cvmx-gpio-defs.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. /***********************license start***************
  2. * Author: Cavium Networks
  3. *
  4. * Contact: [email protected]
  5. * This file is part of the OCTEON SDK
  6. *
  7. * Copyright (c) 2003-2012 Cavium Networks
  8. *
  9. * This file is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License, Version 2, as
  11. * published by the Free Software Foundation.
  12. *
  13. * This file is distributed in the hope that it will be useful, but
  14. * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
  15. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
  16. * NONINFRINGEMENT. See the GNU General Public License for more
  17. * details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this file; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  22. * or visit http://www.gnu.org/licenses/.
  23. *
  24. * This file may also be available under a different license from Cavium.
  25. * Contact Cavium Networks for more information
  26. ***********************license end**************************************/
  27. #ifndef __CVMX_GPIO_DEFS_H__
  28. #define __CVMX_GPIO_DEFS_H__
  29. #define CVMX_GPIO_BIT_CFGX(offset) (CVMX_ADD_IO_SEG(0x0001070000000800ull) + ((offset) & 15) * 8)
  30. #define CVMX_GPIO_BOOT_ENA (CVMX_ADD_IO_SEG(0x00010700000008A8ull))
  31. #define CVMX_GPIO_CLK_GENX(offset) (CVMX_ADD_IO_SEG(0x00010700000008C0ull) + ((offset) & 3) * 8)
  32. #define CVMX_GPIO_CLK_QLMX(offset) (CVMX_ADD_IO_SEG(0x00010700000008E0ull) + ((offset) & 1) * 8)
  33. #define CVMX_GPIO_DBG_ENA (CVMX_ADD_IO_SEG(0x00010700000008A0ull))
  34. #define CVMX_GPIO_INT_CLR (CVMX_ADD_IO_SEG(0x0001070000000898ull))
  35. #define CVMX_GPIO_MULTI_CAST (CVMX_ADD_IO_SEG(0x00010700000008B0ull))
  36. #define CVMX_GPIO_PIN_ENA (CVMX_ADD_IO_SEG(0x00010700000008B8ull))
  37. #define CVMX_GPIO_RX_DAT (CVMX_ADD_IO_SEG(0x0001070000000880ull))
  38. #define CVMX_GPIO_TIM_CTL (CVMX_ADD_IO_SEG(0x00010700000008A0ull))
  39. #define CVMX_GPIO_TX_CLR (CVMX_ADD_IO_SEG(0x0001070000000890ull))
  40. #define CVMX_GPIO_TX_SET (CVMX_ADD_IO_SEG(0x0001070000000888ull))
  41. #define CVMX_GPIO_XBIT_CFGX(offset) (CVMX_ADD_IO_SEG(0x0001070000000900ull) + ((offset) & 31) * 8 - 8*16)
  42. union cvmx_gpio_bit_cfgx {
  43. uint64_t u64;
  44. struct cvmx_gpio_bit_cfgx_s {
  45. #ifdef __BIG_ENDIAN_BITFIELD
  46. uint64_t reserved_21_63:42;
  47. uint64_t output_sel:5;
  48. uint64_t synce_sel:2;
  49. uint64_t clk_gen:1;
  50. uint64_t clk_sel:2;
  51. uint64_t fil_sel:4;
  52. uint64_t fil_cnt:4;
  53. uint64_t int_type:1;
  54. uint64_t int_en:1;
  55. uint64_t rx_xor:1;
  56. uint64_t tx_oe:1;
  57. #else
  58. uint64_t tx_oe:1;
  59. uint64_t rx_xor:1;
  60. uint64_t int_en:1;
  61. uint64_t int_type:1;
  62. uint64_t fil_cnt:4;
  63. uint64_t fil_sel:4;
  64. uint64_t clk_sel:2;
  65. uint64_t clk_gen:1;
  66. uint64_t synce_sel:2;
  67. uint64_t output_sel:5;
  68. uint64_t reserved_21_63:42;
  69. #endif
  70. } s;
  71. struct cvmx_gpio_bit_cfgx_cn30xx {
  72. #ifdef __BIG_ENDIAN_BITFIELD
  73. uint64_t reserved_12_63:52;
  74. uint64_t fil_sel:4;
  75. uint64_t fil_cnt:4;
  76. uint64_t int_type:1;
  77. uint64_t int_en:1;
  78. uint64_t rx_xor:1;
  79. uint64_t tx_oe:1;
  80. #else
  81. uint64_t tx_oe:1;
  82. uint64_t rx_xor:1;
  83. uint64_t int_en:1;
  84. uint64_t int_type:1;
  85. uint64_t fil_cnt:4;
  86. uint64_t fil_sel:4;
  87. uint64_t reserved_12_63:52;
  88. #endif
  89. } cn30xx;
  90. struct cvmx_gpio_bit_cfgx_cn52xx {
  91. #ifdef __BIG_ENDIAN_BITFIELD
  92. uint64_t reserved_15_63:49;
  93. uint64_t clk_gen:1;
  94. uint64_t clk_sel:2;
  95. uint64_t fil_sel:4;
  96. uint64_t fil_cnt:4;
  97. uint64_t int_type:1;
  98. uint64_t int_en:1;
  99. uint64_t rx_xor:1;
  100. uint64_t tx_oe:1;
  101. #else
  102. uint64_t tx_oe:1;
  103. uint64_t rx_xor:1;
  104. uint64_t int_en:1;
  105. uint64_t int_type:1;
  106. uint64_t fil_cnt:4;
  107. uint64_t fil_sel:4;
  108. uint64_t clk_sel:2;
  109. uint64_t clk_gen:1;
  110. uint64_t reserved_15_63:49;
  111. #endif
  112. } cn52xx;
  113. };
  114. union cvmx_gpio_boot_ena {
  115. uint64_t u64;
  116. struct cvmx_gpio_boot_ena_s {
  117. #ifdef __BIG_ENDIAN_BITFIELD
  118. uint64_t reserved_12_63:52;
  119. uint64_t boot_ena:4;
  120. uint64_t reserved_0_7:8;
  121. #else
  122. uint64_t reserved_0_7:8;
  123. uint64_t boot_ena:4;
  124. uint64_t reserved_12_63:52;
  125. #endif
  126. } s;
  127. };
  128. union cvmx_gpio_clk_genx {
  129. uint64_t u64;
  130. struct cvmx_gpio_clk_genx_s {
  131. #ifdef __BIG_ENDIAN_BITFIELD
  132. uint64_t reserved_32_63:32;
  133. uint64_t n:32;
  134. #else
  135. uint64_t n:32;
  136. uint64_t reserved_32_63:32;
  137. #endif
  138. } s;
  139. };
  140. union cvmx_gpio_clk_qlmx {
  141. uint64_t u64;
  142. struct cvmx_gpio_clk_qlmx_s {
  143. #ifdef __BIG_ENDIAN_BITFIELD
  144. uint64_t reserved_11_63:53;
  145. uint64_t qlm_sel:3;
  146. uint64_t reserved_3_7:5;
  147. uint64_t div:1;
  148. uint64_t lane_sel:2;
  149. #else
  150. uint64_t lane_sel:2;
  151. uint64_t div:1;
  152. uint64_t reserved_3_7:5;
  153. uint64_t qlm_sel:3;
  154. uint64_t reserved_11_63:53;
  155. #endif
  156. } s;
  157. struct cvmx_gpio_clk_qlmx_cn61xx {
  158. #ifdef __BIG_ENDIAN_BITFIELD
  159. uint64_t reserved_10_63:54;
  160. uint64_t qlm_sel:2;
  161. uint64_t reserved_3_7:5;
  162. uint64_t div:1;
  163. uint64_t lane_sel:2;
  164. #else
  165. uint64_t lane_sel:2;
  166. uint64_t div:1;
  167. uint64_t reserved_3_7:5;
  168. uint64_t qlm_sel:2;
  169. uint64_t reserved_10_63:54;
  170. #endif
  171. } cn61xx;
  172. struct cvmx_gpio_clk_qlmx_cn63xx {
  173. #ifdef __BIG_ENDIAN_BITFIELD
  174. uint64_t reserved_3_63:61;
  175. uint64_t div:1;
  176. uint64_t lane_sel:2;
  177. #else
  178. uint64_t lane_sel:2;
  179. uint64_t div:1;
  180. uint64_t reserved_3_63:61;
  181. #endif
  182. } cn63xx;
  183. };
  184. union cvmx_gpio_dbg_ena {
  185. uint64_t u64;
  186. struct cvmx_gpio_dbg_ena_s {
  187. #ifdef __BIG_ENDIAN_BITFIELD
  188. uint64_t reserved_21_63:43;
  189. uint64_t dbg_ena:21;
  190. #else
  191. uint64_t dbg_ena:21;
  192. uint64_t reserved_21_63:43;
  193. #endif
  194. } s;
  195. };
  196. union cvmx_gpio_int_clr {
  197. uint64_t u64;
  198. struct cvmx_gpio_int_clr_s {
  199. #ifdef __BIG_ENDIAN_BITFIELD
  200. uint64_t reserved_16_63:48;
  201. uint64_t type:16;
  202. #else
  203. uint64_t type:16;
  204. uint64_t reserved_16_63:48;
  205. #endif
  206. } s;
  207. };
  208. union cvmx_gpio_multi_cast {
  209. uint64_t u64;
  210. struct cvmx_gpio_multi_cast_s {
  211. #ifdef __BIG_ENDIAN_BITFIELD
  212. uint64_t reserved_1_63:63;
  213. uint64_t en:1;
  214. #else
  215. uint64_t en:1;
  216. uint64_t reserved_1_63:63;
  217. #endif
  218. } s;
  219. };
  220. union cvmx_gpio_pin_ena {
  221. uint64_t u64;
  222. struct cvmx_gpio_pin_ena_s {
  223. #ifdef __BIG_ENDIAN_BITFIELD
  224. uint64_t reserved_20_63:44;
  225. uint64_t ena19:1;
  226. uint64_t ena18:1;
  227. uint64_t reserved_0_17:18;
  228. #else
  229. uint64_t reserved_0_17:18;
  230. uint64_t ena18:1;
  231. uint64_t ena19:1;
  232. uint64_t reserved_20_63:44;
  233. #endif
  234. } s;
  235. };
  236. union cvmx_gpio_rx_dat {
  237. uint64_t u64;
  238. struct cvmx_gpio_rx_dat_s {
  239. #ifdef __BIG_ENDIAN_BITFIELD
  240. uint64_t reserved_24_63:40;
  241. uint64_t dat:24;
  242. #else
  243. uint64_t dat:24;
  244. uint64_t reserved_24_63:40;
  245. #endif
  246. } s;
  247. struct cvmx_gpio_rx_dat_cn38xx {
  248. #ifdef __BIG_ENDIAN_BITFIELD
  249. uint64_t reserved_16_63:48;
  250. uint64_t dat:16;
  251. #else
  252. uint64_t dat:16;
  253. uint64_t reserved_16_63:48;
  254. #endif
  255. } cn38xx;
  256. struct cvmx_gpio_rx_dat_cn61xx {
  257. #ifdef __BIG_ENDIAN_BITFIELD
  258. uint64_t reserved_20_63:44;
  259. uint64_t dat:20;
  260. #else
  261. uint64_t dat:20;
  262. uint64_t reserved_20_63:44;
  263. #endif
  264. } cn61xx;
  265. };
  266. union cvmx_gpio_tim_ctl {
  267. uint64_t u64;
  268. struct cvmx_gpio_tim_ctl_s {
  269. #ifdef __BIG_ENDIAN_BITFIELD
  270. uint64_t reserved_4_63:60;
  271. uint64_t sel:4;
  272. #else
  273. uint64_t sel:4;
  274. uint64_t reserved_4_63:60;
  275. #endif
  276. } s;
  277. };
  278. union cvmx_gpio_tx_clr {
  279. uint64_t u64;
  280. struct cvmx_gpio_tx_clr_s {
  281. #ifdef __BIG_ENDIAN_BITFIELD
  282. uint64_t reserved_24_63:40;
  283. uint64_t clr:24;
  284. #else
  285. uint64_t clr:24;
  286. uint64_t reserved_24_63:40;
  287. #endif
  288. } s;
  289. struct cvmx_gpio_tx_clr_cn38xx {
  290. #ifdef __BIG_ENDIAN_BITFIELD
  291. uint64_t reserved_16_63:48;
  292. uint64_t clr:16;
  293. #else
  294. uint64_t clr:16;
  295. uint64_t reserved_16_63:48;
  296. #endif
  297. } cn38xx;
  298. struct cvmx_gpio_tx_clr_cn61xx {
  299. #ifdef __BIG_ENDIAN_BITFIELD
  300. uint64_t reserved_20_63:44;
  301. uint64_t clr:20;
  302. #else
  303. uint64_t clr:20;
  304. uint64_t reserved_20_63:44;
  305. #endif
  306. } cn61xx;
  307. };
  308. union cvmx_gpio_tx_set {
  309. uint64_t u64;
  310. struct cvmx_gpio_tx_set_s {
  311. #ifdef __BIG_ENDIAN_BITFIELD
  312. uint64_t reserved_24_63:40;
  313. uint64_t set:24;
  314. #else
  315. uint64_t set:24;
  316. uint64_t reserved_24_63:40;
  317. #endif
  318. } s;
  319. struct cvmx_gpio_tx_set_cn38xx {
  320. #ifdef __BIG_ENDIAN_BITFIELD
  321. uint64_t reserved_16_63:48;
  322. uint64_t set:16;
  323. #else
  324. uint64_t set:16;
  325. uint64_t reserved_16_63:48;
  326. #endif
  327. } cn38xx;
  328. struct cvmx_gpio_tx_set_cn61xx {
  329. #ifdef __BIG_ENDIAN_BITFIELD
  330. uint64_t reserved_20_63:44;
  331. uint64_t set:20;
  332. #else
  333. uint64_t set:20;
  334. uint64_t reserved_20_63:44;
  335. #endif
  336. } cn61xx;
  337. };
  338. union cvmx_gpio_xbit_cfgx {
  339. uint64_t u64;
  340. struct cvmx_gpio_xbit_cfgx_s {
  341. #ifdef __BIG_ENDIAN_BITFIELD
  342. uint64_t reserved_17_63:47;
  343. uint64_t synce_sel:2;
  344. uint64_t clk_gen:1;
  345. uint64_t clk_sel:2;
  346. uint64_t fil_sel:4;
  347. uint64_t fil_cnt:4;
  348. uint64_t int_type:1;
  349. uint64_t int_en:1;
  350. uint64_t rx_xor:1;
  351. uint64_t tx_oe:1;
  352. #else
  353. uint64_t tx_oe:1;
  354. uint64_t rx_xor:1;
  355. uint64_t int_en:1;
  356. uint64_t int_type:1;
  357. uint64_t fil_cnt:4;
  358. uint64_t fil_sel:4;
  359. uint64_t clk_sel:2;
  360. uint64_t clk_gen:1;
  361. uint64_t synce_sel:2;
  362. uint64_t reserved_17_63:47;
  363. #endif
  364. } s;
  365. struct cvmx_gpio_xbit_cfgx_cn30xx {
  366. #ifdef __BIG_ENDIAN_BITFIELD
  367. uint64_t reserved_12_63:52;
  368. uint64_t fil_sel:4;
  369. uint64_t fil_cnt:4;
  370. uint64_t reserved_2_3:2;
  371. uint64_t rx_xor:1;
  372. uint64_t tx_oe:1;
  373. #else
  374. uint64_t tx_oe:1;
  375. uint64_t rx_xor:1;
  376. uint64_t reserved_2_3:2;
  377. uint64_t fil_cnt:4;
  378. uint64_t fil_sel:4;
  379. uint64_t reserved_12_63:52;
  380. #endif
  381. } cn30xx;
  382. };
  383. #endif