cvmx-gpio-defs.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. /***********************license start***************
  2. * Author: Cavium Networks
  3. *
  4. * Contact: support@caviumnetworks.com
  5. * This file is part of the OCTEON SDK
  6. *
  7. * Copyright (c) 2003-2010 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_RX_DAT (CVMX_ADD_IO_SEG(0x0001070000000880ull))
  36. #define CVMX_GPIO_TX_CLR (CVMX_ADD_IO_SEG(0x0001070000000890ull))
  37. #define CVMX_GPIO_TX_SET (CVMX_ADD_IO_SEG(0x0001070000000888ull))
  38. #define CVMX_GPIO_XBIT_CFGX(offset) (CVMX_ADD_IO_SEG(0x0001070000000900ull) + ((offset) & 31) * 8 - 8*16)
  39. union cvmx_gpio_bit_cfgx {
  40. uint64_t u64;
  41. struct cvmx_gpio_bit_cfgx_s {
  42. uint64_t reserved_17_63:47;
  43. uint64_t synce_sel:2;
  44. uint64_t clk_gen:1;
  45. uint64_t clk_sel:2;
  46. uint64_t fil_sel:4;
  47. uint64_t fil_cnt:4;
  48. uint64_t int_type:1;
  49. uint64_t int_en:1;
  50. uint64_t rx_xor:1;
  51. uint64_t tx_oe:1;
  52. } s;
  53. struct cvmx_gpio_bit_cfgx_cn30xx {
  54. uint64_t reserved_12_63:52;
  55. uint64_t fil_sel:4;
  56. uint64_t fil_cnt:4;
  57. uint64_t int_type:1;
  58. uint64_t int_en:1;
  59. uint64_t rx_xor:1;
  60. uint64_t tx_oe:1;
  61. } cn30xx;
  62. struct cvmx_gpio_bit_cfgx_cn30xx cn31xx;
  63. struct cvmx_gpio_bit_cfgx_cn30xx cn38xx;
  64. struct cvmx_gpio_bit_cfgx_cn30xx cn38xxp2;
  65. struct cvmx_gpio_bit_cfgx_cn30xx cn50xx;
  66. struct cvmx_gpio_bit_cfgx_cn52xx {
  67. uint64_t reserved_15_63:49;
  68. uint64_t clk_gen:1;
  69. uint64_t clk_sel:2;
  70. uint64_t fil_sel:4;
  71. uint64_t fil_cnt:4;
  72. uint64_t int_type:1;
  73. uint64_t int_en:1;
  74. uint64_t rx_xor:1;
  75. uint64_t tx_oe:1;
  76. } cn52xx;
  77. struct cvmx_gpio_bit_cfgx_cn52xx cn52xxp1;
  78. struct cvmx_gpio_bit_cfgx_cn52xx cn56xx;
  79. struct cvmx_gpio_bit_cfgx_cn52xx cn56xxp1;
  80. struct cvmx_gpio_bit_cfgx_cn30xx cn58xx;
  81. struct cvmx_gpio_bit_cfgx_cn30xx cn58xxp1;
  82. struct cvmx_gpio_bit_cfgx_s cn63xx;
  83. struct cvmx_gpio_bit_cfgx_s cn63xxp1;
  84. };
  85. union cvmx_gpio_boot_ena {
  86. uint64_t u64;
  87. struct cvmx_gpio_boot_ena_s {
  88. uint64_t reserved_12_63:52;
  89. uint64_t boot_ena:4;
  90. uint64_t reserved_0_7:8;
  91. } s;
  92. struct cvmx_gpio_boot_ena_s cn30xx;
  93. struct cvmx_gpio_boot_ena_s cn31xx;
  94. struct cvmx_gpio_boot_ena_s cn50xx;
  95. };
  96. union cvmx_gpio_clk_genx {
  97. uint64_t u64;
  98. struct cvmx_gpio_clk_genx_s {
  99. uint64_t reserved_32_63:32;
  100. uint64_t n:32;
  101. } s;
  102. struct cvmx_gpio_clk_genx_s cn52xx;
  103. struct cvmx_gpio_clk_genx_s cn52xxp1;
  104. struct cvmx_gpio_clk_genx_s cn56xx;
  105. struct cvmx_gpio_clk_genx_s cn56xxp1;
  106. struct cvmx_gpio_clk_genx_s cn63xx;
  107. struct cvmx_gpio_clk_genx_s cn63xxp1;
  108. };
  109. union cvmx_gpio_clk_qlmx {
  110. uint64_t u64;
  111. struct cvmx_gpio_clk_qlmx_s {
  112. uint64_t reserved_3_63:61;
  113. uint64_t div:1;
  114. uint64_t lane_sel:2;
  115. } s;
  116. struct cvmx_gpio_clk_qlmx_s cn63xx;
  117. struct cvmx_gpio_clk_qlmx_s cn63xxp1;
  118. };
  119. union cvmx_gpio_dbg_ena {
  120. uint64_t u64;
  121. struct cvmx_gpio_dbg_ena_s {
  122. uint64_t reserved_21_63:43;
  123. uint64_t dbg_ena:21;
  124. } s;
  125. struct cvmx_gpio_dbg_ena_s cn30xx;
  126. struct cvmx_gpio_dbg_ena_s cn31xx;
  127. struct cvmx_gpio_dbg_ena_s cn50xx;
  128. };
  129. union cvmx_gpio_int_clr {
  130. uint64_t u64;
  131. struct cvmx_gpio_int_clr_s {
  132. uint64_t reserved_16_63:48;
  133. uint64_t type:16;
  134. } s;
  135. struct cvmx_gpio_int_clr_s cn30xx;
  136. struct cvmx_gpio_int_clr_s cn31xx;
  137. struct cvmx_gpio_int_clr_s cn38xx;
  138. struct cvmx_gpio_int_clr_s cn38xxp2;
  139. struct cvmx_gpio_int_clr_s cn50xx;
  140. struct cvmx_gpio_int_clr_s cn52xx;
  141. struct cvmx_gpio_int_clr_s cn52xxp1;
  142. struct cvmx_gpio_int_clr_s cn56xx;
  143. struct cvmx_gpio_int_clr_s cn56xxp1;
  144. struct cvmx_gpio_int_clr_s cn58xx;
  145. struct cvmx_gpio_int_clr_s cn58xxp1;
  146. struct cvmx_gpio_int_clr_s cn63xx;
  147. struct cvmx_gpio_int_clr_s cn63xxp1;
  148. };
  149. union cvmx_gpio_rx_dat {
  150. uint64_t u64;
  151. struct cvmx_gpio_rx_dat_s {
  152. uint64_t reserved_24_63:40;
  153. uint64_t dat:24;
  154. } s;
  155. struct cvmx_gpio_rx_dat_s cn30xx;
  156. struct cvmx_gpio_rx_dat_s cn31xx;
  157. struct cvmx_gpio_rx_dat_cn38xx {
  158. uint64_t reserved_16_63:48;
  159. uint64_t dat:16;
  160. } cn38xx;
  161. struct cvmx_gpio_rx_dat_cn38xx cn38xxp2;
  162. struct cvmx_gpio_rx_dat_s cn50xx;
  163. struct cvmx_gpio_rx_dat_cn38xx cn52xx;
  164. struct cvmx_gpio_rx_dat_cn38xx cn52xxp1;
  165. struct cvmx_gpio_rx_dat_cn38xx cn56xx;
  166. struct cvmx_gpio_rx_dat_cn38xx cn56xxp1;
  167. struct cvmx_gpio_rx_dat_cn38xx cn58xx;
  168. struct cvmx_gpio_rx_dat_cn38xx cn58xxp1;
  169. struct cvmx_gpio_rx_dat_cn38xx cn63xx;
  170. struct cvmx_gpio_rx_dat_cn38xx cn63xxp1;
  171. };
  172. union cvmx_gpio_tx_clr {
  173. uint64_t u64;
  174. struct cvmx_gpio_tx_clr_s {
  175. uint64_t reserved_24_63:40;
  176. uint64_t clr:24;
  177. } s;
  178. struct cvmx_gpio_tx_clr_s cn30xx;
  179. struct cvmx_gpio_tx_clr_s cn31xx;
  180. struct cvmx_gpio_tx_clr_cn38xx {
  181. uint64_t reserved_16_63:48;
  182. uint64_t clr:16;
  183. } cn38xx;
  184. struct cvmx_gpio_tx_clr_cn38xx cn38xxp2;
  185. struct cvmx_gpio_tx_clr_s cn50xx;
  186. struct cvmx_gpio_tx_clr_cn38xx cn52xx;
  187. struct cvmx_gpio_tx_clr_cn38xx cn52xxp1;
  188. struct cvmx_gpio_tx_clr_cn38xx cn56xx;
  189. struct cvmx_gpio_tx_clr_cn38xx cn56xxp1;
  190. struct cvmx_gpio_tx_clr_cn38xx cn58xx;
  191. struct cvmx_gpio_tx_clr_cn38xx cn58xxp1;
  192. struct cvmx_gpio_tx_clr_cn38xx cn63xx;
  193. struct cvmx_gpio_tx_clr_cn38xx cn63xxp1;
  194. };
  195. union cvmx_gpio_tx_set {
  196. uint64_t u64;
  197. struct cvmx_gpio_tx_set_s {
  198. uint64_t reserved_24_63:40;
  199. uint64_t set:24;
  200. } s;
  201. struct cvmx_gpio_tx_set_s cn30xx;
  202. struct cvmx_gpio_tx_set_s cn31xx;
  203. struct cvmx_gpio_tx_set_cn38xx {
  204. uint64_t reserved_16_63:48;
  205. uint64_t set:16;
  206. } cn38xx;
  207. struct cvmx_gpio_tx_set_cn38xx cn38xxp2;
  208. struct cvmx_gpio_tx_set_s cn50xx;
  209. struct cvmx_gpio_tx_set_cn38xx cn52xx;
  210. struct cvmx_gpio_tx_set_cn38xx cn52xxp1;
  211. struct cvmx_gpio_tx_set_cn38xx cn56xx;
  212. struct cvmx_gpio_tx_set_cn38xx cn56xxp1;
  213. struct cvmx_gpio_tx_set_cn38xx cn58xx;
  214. struct cvmx_gpio_tx_set_cn38xx cn58xxp1;
  215. struct cvmx_gpio_tx_set_cn38xx cn63xx;
  216. struct cvmx_gpio_tx_set_cn38xx cn63xxp1;
  217. };
  218. union cvmx_gpio_xbit_cfgx {
  219. uint64_t u64;
  220. struct cvmx_gpio_xbit_cfgx_s {
  221. uint64_t reserved_12_63:52;
  222. uint64_t fil_sel:4;
  223. uint64_t fil_cnt:4;
  224. uint64_t reserved_2_3:2;
  225. uint64_t rx_xor:1;
  226. uint64_t tx_oe:1;
  227. } s;
  228. struct cvmx_gpio_xbit_cfgx_s cn30xx;
  229. struct cvmx_gpio_xbit_cfgx_s cn31xx;
  230. struct cvmx_gpio_xbit_cfgx_s cn50xx;
  231. };
  232. #endif