cvmx-gpio-defs.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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-2008 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) \
  30. CVMX_ADD_IO_SEG(0x0001070000000800ull + (((offset) & 15) * 8))
  31. #define CVMX_GPIO_BOOT_ENA \
  32. CVMX_ADD_IO_SEG(0x00010700000008A8ull)
  33. #define CVMX_GPIO_CLK_GENX(offset) \
  34. CVMX_ADD_IO_SEG(0x00010700000008C0ull + (((offset) & 3) * 8))
  35. #define CVMX_GPIO_DBG_ENA \
  36. CVMX_ADD_IO_SEG(0x00010700000008A0ull)
  37. #define CVMX_GPIO_INT_CLR \
  38. CVMX_ADD_IO_SEG(0x0001070000000898ull)
  39. #define CVMX_GPIO_RX_DAT \
  40. CVMX_ADD_IO_SEG(0x0001070000000880ull)
  41. #define CVMX_GPIO_TX_CLR \
  42. CVMX_ADD_IO_SEG(0x0001070000000890ull)
  43. #define CVMX_GPIO_TX_SET \
  44. CVMX_ADD_IO_SEG(0x0001070000000888ull)
  45. #define CVMX_GPIO_XBIT_CFGX(offset) \
  46. CVMX_ADD_IO_SEG(0x0001070000000900ull + (((offset) & 31) * 8) - 8 * 16)
  47. union cvmx_gpio_bit_cfgx {
  48. uint64_t u64;
  49. struct cvmx_gpio_bit_cfgx_s {
  50. uint64_t reserved_15_63:49;
  51. uint64_t clk_gen:1;
  52. uint64_t clk_sel:2;
  53. uint64_t fil_sel:4;
  54. uint64_t fil_cnt:4;
  55. uint64_t int_type:1;
  56. uint64_t int_en:1;
  57. uint64_t rx_xor:1;
  58. uint64_t tx_oe:1;
  59. } s;
  60. struct cvmx_gpio_bit_cfgx_cn30xx {
  61. uint64_t reserved_12_63:52;
  62. uint64_t fil_sel:4;
  63. uint64_t fil_cnt:4;
  64. uint64_t int_type:1;
  65. uint64_t int_en:1;
  66. uint64_t rx_xor:1;
  67. uint64_t tx_oe:1;
  68. } cn30xx;
  69. struct cvmx_gpio_bit_cfgx_cn30xx cn31xx;
  70. struct cvmx_gpio_bit_cfgx_cn30xx cn38xx;
  71. struct cvmx_gpio_bit_cfgx_cn30xx cn38xxp2;
  72. struct cvmx_gpio_bit_cfgx_cn30xx cn50xx;
  73. struct cvmx_gpio_bit_cfgx_s cn52xx;
  74. struct cvmx_gpio_bit_cfgx_s cn52xxp1;
  75. struct cvmx_gpio_bit_cfgx_s cn56xx;
  76. struct cvmx_gpio_bit_cfgx_s cn56xxp1;
  77. struct cvmx_gpio_bit_cfgx_cn30xx cn58xx;
  78. struct cvmx_gpio_bit_cfgx_cn30xx cn58xxp1;
  79. };
  80. union cvmx_gpio_boot_ena {
  81. uint64_t u64;
  82. struct cvmx_gpio_boot_ena_s {
  83. uint64_t reserved_12_63:52;
  84. uint64_t boot_ena:4;
  85. uint64_t reserved_0_7:8;
  86. } s;
  87. struct cvmx_gpio_boot_ena_s cn30xx;
  88. struct cvmx_gpio_boot_ena_s cn31xx;
  89. struct cvmx_gpio_boot_ena_s cn50xx;
  90. };
  91. union cvmx_gpio_clk_genx {
  92. uint64_t u64;
  93. struct cvmx_gpio_clk_genx_s {
  94. uint64_t reserved_32_63:32;
  95. uint64_t n:32;
  96. } s;
  97. struct cvmx_gpio_clk_genx_s cn52xx;
  98. struct cvmx_gpio_clk_genx_s cn52xxp1;
  99. struct cvmx_gpio_clk_genx_s cn56xx;
  100. struct cvmx_gpio_clk_genx_s cn56xxp1;
  101. };
  102. union cvmx_gpio_dbg_ena {
  103. uint64_t u64;
  104. struct cvmx_gpio_dbg_ena_s {
  105. uint64_t reserved_21_63:43;
  106. uint64_t dbg_ena:21;
  107. } s;
  108. struct cvmx_gpio_dbg_ena_s cn30xx;
  109. struct cvmx_gpio_dbg_ena_s cn31xx;
  110. struct cvmx_gpio_dbg_ena_s cn50xx;
  111. };
  112. union cvmx_gpio_int_clr {
  113. uint64_t u64;
  114. struct cvmx_gpio_int_clr_s {
  115. uint64_t reserved_16_63:48;
  116. uint64_t type:16;
  117. } s;
  118. struct cvmx_gpio_int_clr_s cn30xx;
  119. struct cvmx_gpio_int_clr_s cn31xx;
  120. struct cvmx_gpio_int_clr_s cn38xx;
  121. struct cvmx_gpio_int_clr_s cn38xxp2;
  122. struct cvmx_gpio_int_clr_s cn50xx;
  123. struct cvmx_gpio_int_clr_s cn52xx;
  124. struct cvmx_gpio_int_clr_s cn52xxp1;
  125. struct cvmx_gpio_int_clr_s cn56xx;
  126. struct cvmx_gpio_int_clr_s cn56xxp1;
  127. struct cvmx_gpio_int_clr_s cn58xx;
  128. struct cvmx_gpio_int_clr_s cn58xxp1;
  129. };
  130. union cvmx_gpio_rx_dat {
  131. uint64_t u64;
  132. struct cvmx_gpio_rx_dat_s {
  133. uint64_t reserved_24_63:40;
  134. uint64_t dat:24;
  135. } s;
  136. struct cvmx_gpio_rx_dat_s cn30xx;
  137. struct cvmx_gpio_rx_dat_s cn31xx;
  138. struct cvmx_gpio_rx_dat_cn38xx {
  139. uint64_t reserved_16_63:48;
  140. uint64_t dat:16;
  141. } cn38xx;
  142. struct cvmx_gpio_rx_dat_cn38xx cn38xxp2;
  143. struct cvmx_gpio_rx_dat_s cn50xx;
  144. struct cvmx_gpio_rx_dat_cn38xx cn52xx;
  145. struct cvmx_gpio_rx_dat_cn38xx cn52xxp1;
  146. struct cvmx_gpio_rx_dat_cn38xx cn56xx;
  147. struct cvmx_gpio_rx_dat_cn38xx cn56xxp1;
  148. struct cvmx_gpio_rx_dat_cn38xx cn58xx;
  149. struct cvmx_gpio_rx_dat_cn38xx cn58xxp1;
  150. };
  151. union cvmx_gpio_tx_clr {
  152. uint64_t u64;
  153. struct cvmx_gpio_tx_clr_s {
  154. uint64_t reserved_24_63:40;
  155. uint64_t clr:24;
  156. } s;
  157. struct cvmx_gpio_tx_clr_s cn30xx;
  158. struct cvmx_gpio_tx_clr_s cn31xx;
  159. struct cvmx_gpio_tx_clr_cn38xx {
  160. uint64_t reserved_16_63:48;
  161. uint64_t clr:16;
  162. } cn38xx;
  163. struct cvmx_gpio_tx_clr_cn38xx cn38xxp2;
  164. struct cvmx_gpio_tx_clr_s cn50xx;
  165. struct cvmx_gpio_tx_clr_cn38xx cn52xx;
  166. struct cvmx_gpio_tx_clr_cn38xx cn52xxp1;
  167. struct cvmx_gpio_tx_clr_cn38xx cn56xx;
  168. struct cvmx_gpio_tx_clr_cn38xx cn56xxp1;
  169. struct cvmx_gpio_tx_clr_cn38xx cn58xx;
  170. struct cvmx_gpio_tx_clr_cn38xx cn58xxp1;
  171. };
  172. union cvmx_gpio_tx_set {
  173. uint64_t u64;
  174. struct cvmx_gpio_tx_set_s {
  175. uint64_t reserved_24_63:40;
  176. uint64_t set:24;
  177. } s;
  178. struct cvmx_gpio_tx_set_s cn30xx;
  179. struct cvmx_gpio_tx_set_s cn31xx;
  180. struct cvmx_gpio_tx_set_cn38xx {
  181. uint64_t reserved_16_63:48;
  182. uint64_t set:16;
  183. } cn38xx;
  184. struct cvmx_gpio_tx_set_cn38xx cn38xxp2;
  185. struct cvmx_gpio_tx_set_s cn50xx;
  186. struct cvmx_gpio_tx_set_cn38xx cn52xx;
  187. struct cvmx_gpio_tx_set_cn38xx cn52xxp1;
  188. struct cvmx_gpio_tx_set_cn38xx cn56xx;
  189. struct cvmx_gpio_tx_set_cn38xx cn56xxp1;
  190. struct cvmx_gpio_tx_set_cn38xx cn58xx;
  191. struct cvmx_gpio_tx_set_cn38xx cn58xxp1;
  192. };
  193. union cvmx_gpio_xbit_cfgx {
  194. uint64_t u64;
  195. struct cvmx_gpio_xbit_cfgx_s {
  196. uint64_t reserved_12_63:52;
  197. uint64_t fil_sel:4;
  198. uint64_t fil_cnt:4;
  199. uint64_t reserved_2_3:2;
  200. uint64_t rx_xor:1;
  201. uint64_t tx_oe:1;
  202. } s;
  203. struct cvmx_gpio_xbit_cfgx_s cn30xx;
  204. struct cvmx_gpio_xbit_cfgx_s cn31xx;
  205. struct cvmx_gpio_xbit_cfgx_s cn50xx;
  206. };
  207. #endif