bfi_cbreg.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. /*
  2. * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
  3. * All rights reserved
  4. * www.brocade.com
  5. *
  6. * Linux driver for Brocade Fibre Channel Host Bus Adapter.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License (GPL) Version 2 as
  10. * published by the Free Software Foundation
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. */
  17. /*
  18. * bfi_cbreg.h crossbow host block register definitions
  19. *
  20. * !!! Do not edit. Auto generated. !!!
  21. */
  22. #ifndef __BFI_CBREG_H__
  23. #define __BFI_CBREG_H__
  24. #define HOSTFN0_INT_STATUS 0x00014000
  25. #define __HOSTFN0_INT_STATUS_LVL_MK 0x00f00000
  26. #define __HOSTFN0_INT_STATUS_LVL_SH 20
  27. #define __HOSTFN0_INT_STATUS_LVL(_v) ((_v) << __HOSTFN0_INT_STATUS_LVL_SH)
  28. #define __HOSTFN0_INT_STATUS_P 0x000fffff
  29. #define HOSTFN0_INT_MSK 0x00014004
  30. #define HOST_PAGE_NUM_FN0 0x00014008
  31. #define __HOST_PAGE_NUM_FN 0x000001ff
  32. #define HOSTFN1_INT_STATUS 0x00014100
  33. #define __HOSTFN1_INT_STAT_LVL_MK 0x00f00000
  34. #define __HOSTFN1_INT_STAT_LVL_SH 20
  35. #define __HOSTFN1_INT_STAT_LVL(_v) ((_v) << __HOSTFN1_INT_STAT_LVL_SH)
  36. #define __HOSTFN1_INT_STAT_P 0x000fffff
  37. #define HOSTFN1_INT_MSK 0x00014104
  38. #define HOST_PAGE_NUM_FN1 0x00014108
  39. #define APP_PLL_400_CTL_REG 0x00014204
  40. #define __P_400_PLL_LOCK 0x80000000
  41. #define __APP_PLL_400_SRAM_USE_100MHZ 0x00100000
  42. #define __APP_PLL_400_RESET_TIMER_MK 0x000e0000
  43. #define __APP_PLL_400_RESET_TIMER_SH 17
  44. #define __APP_PLL_400_RESET_TIMER(_v) ((_v) << __APP_PLL_400_RESET_TIMER_SH)
  45. #define __APP_PLL_400_LOGIC_SOFT_RESET 0x00010000
  46. #define __APP_PLL_400_CNTLMT0_1_MK 0x0000c000
  47. #define __APP_PLL_400_CNTLMT0_1_SH 14
  48. #define __APP_PLL_400_CNTLMT0_1(_v) ((_v) << __APP_PLL_400_CNTLMT0_1_SH)
  49. #define __APP_PLL_400_JITLMT0_1_MK 0x00003000
  50. #define __APP_PLL_400_JITLMT0_1_SH 12
  51. #define __APP_PLL_400_JITLMT0_1(_v) ((_v) << __APP_PLL_400_JITLMT0_1_SH)
  52. #define __APP_PLL_400_HREF 0x00000800
  53. #define __APP_PLL_400_HDIV 0x00000400
  54. #define __APP_PLL_400_P0_1_MK 0x00000300
  55. #define __APP_PLL_400_P0_1_SH 8
  56. #define __APP_PLL_400_P0_1(_v) ((_v) << __APP_PLL_400_P0_1_SH)
  57. #define __APP_PLL_400_Z0_2_MK 0x000000e0
  58. #define __APP_PLL_400_Z0_2_SH 5
  59. #define __APP_PLL_400_Z0_2(_v) ((_v) << __APP_PLL_400_Z0_2_SH)
  60. #define __APP_PLL_400_RSEL200500 0x00000010
  61. #define __APP_PLL_400_ENARST 0x00000008
  62. #define __APP_PLL_400_BYPASS 0x00000004
  63. #define __APP_PLL_400_LRESETN 0x00000002
  64. #define __APP_PLL_400_ENABLE 0x00000001
  65. #define APP_PLL_212_CTL_REG 0x00014208
  66. #define __P_212_PLL_LOCK 0x80000000
  67. #define __APP_PLL_212_RESET_TIMER_MK 0x000e0000
  68. #define __APP_PLL_212_RESET_TIMER_SH 17
  69. #define __APP_PLL_212_RESET_TIMER(_v) ((_v) << __APP_PLL_212_RESET_TIMER_SH)
  70. #define __APP_PLL_212_LOGIC_SOFT_RESET 0x00010000
  71. #define __APP_PLL_212_CNTLMT0_1_MK 0x0000c000
  72. #define __APP_PLL_212_CNTLMT0_1_SH 14
  73. #define __APP_PLL_212_CNTLMT0_1(_v) ((_v) << __APP_PLL_212_CNTLMT0_1_SH)
  74. #define __APP_PLL_212_JITLMT0_1_MK 0x00003000
  75. #define __APP_PLL_212_JITLMT0_1_SH 12
  76. #define __APP_PLL_212_JITLMT0_1(_v) ((_v) << __APP_PLL_212_JITLMT0_1_SH)
  77. #define __APP_PLL_212_HREF 0x00000800
  78. #define __APP_PLL_212_HDIV 0x00000400
  79. #define __APP_PLL_212_P0_1_MK 0x00000300
  80. #define __APP_PLL_212_P0_1_SH 8
  81. #define __APP_PLL_212_P0_1(_v) ((_v) << __APP_PLL_212_P0_1_SH)
  82. #define __APP_PLL_212_Z0_2_MK 0x000000e0
  83. #define __APP_PLL_212_Z0_2_SH 5
  84. #define __APP_PLL_212_Z0_2(_v) ((_v) << __APP_PLL_212_Z0_2_SH)
  85. #define __APP_PLL_212_RSEL200500 0x00000010
  86. #define __APP_PLL_212_ENARST 0x00000008
  87. #define __APP_PLL_212_BYPASS 0x00000004
  88. #define __APP_PLL_212_LRESETN 0x00000002
  89. #define __APP_PLL_212_ENABLE 0x00000001
  90. #define HOST_SEM0_REG 0x00014230
  91. #define __HOST_SEMAPHORE 0x00000001
  92. #define HOST_SEM1_REG 0x00014234
  93. #define HOST_SEM2_REG 0x00014238
  94. #define HOST_SEM3_REG 0x0001423c
  95. #define HOST_SEM0_INFO_REG 0x00014240
  96. #define HOST_SEM1_INFO_REG 0x00014244
  97. #define HOST_SEM2_INFO_REG 0x00014248
  98. #define HOST_SEM3_INFO_REG 0x0001424c
  99. #define HOSTFN0_LPU0_CMD_STAT 0x00019000
  100. #define __HOSTFN0_LPU0_MBOX_INFO_MK 0xfffffffe
  101. #define __HOSTFN0_LPU0_MBOX_INFO_SH 1
  102. #define __HOSTFN0_LPU0_MBOX_INFO(_v) ((_v) << __HOSTFN0_LPU0_MBOX_INFO_SH)
  103. #define __HOSTFN0_LPU0_MBOX_CMD_STATUS 0x00000001
  104. #define LPU0_HOSTFN0_CMD_STAT 0x00019008
  105. #define __LPU0_HOSTFN0_MBOX_INFO_MK 0xfffffffe
  106. #define __LPU0_HOSTFN0_MBOX_INFO_SH 1
  107. #define __LPU0_HOSTFN0_MBOX_INFO(_v) ((_v) << __LPU0_HOSTFN0_MBOX_INFO_SH)
  108. #define __LPU0_HOSTFN0_MBOX_CMD_STATUS 0x00000001
  109. #define HOSTFN1_LPU1_CMD_STAT 0x00019014
  110. #define __HOSTFN1_LPU1_MBOX_INFO_MK 0xfffffffe
  111. #define __HOSTFN1_LPU1_MBOX_INFO_SH 1
  112. #define __HOSTFN1_LPU1_MBOX_INFO(_v) ((_v) << __HOSTFN1_LPU1_MBOX_INFO_SH)
  113. #define __HOSTFN1_LPU1_MBOX_CMD_STATUS 0x00000001
  114. #define LPU1_HOSTFN1_CMD_STAT 0x0001901c
  115. #define __LPU1_HOSTFN1_MBOX_INFO_MK 0xfffffffe
  116. #define __LPU1_HOSTFN1_MBOX_INFO_SH 1
  117. #define __LPU1_HOSTFN1_MBOX_INFO(_v) ((_v) << __LPU1_HOSTFN1_MBOX_INFO_SH)
  118. #define __LPU1_HOSTFN1_MBOX_CMD_STATUS 0x00000001
  119. #define CPE_Q0_DEPTH 0x00010014
  120. #define CPE_Q0_PI 0x0001001c
  121. #define CPE_Q0_CI 0x00010020
  122. #define CPE_Q1_DEPTH 0x00010034
  123. #define CPE_Q1_PI 0x0001003c
  124. #define CPE_Q1_CI 0x00010040
  125. #define CPE_Q2_DEPTH 0x00010054
  126. #define CPE_Q2_PI 0x0001005c
  127. #define CPE_Q2_CI 0x00010060
  128. #define CPE_Q3_DEPTH 0x00010074
  129. #define CPE_Q3_PI 0x0001007c
  130. #define CPE_Q3_CI 0x00010080
  131. #define CPE_Q4_DEPTH 0x00010094
  132. #define CPE_Q4_PI 0x0001009c
  133. #define CPE_Q4_CI 0x000100a0
  134. #define CPE_Q5_DEPTH 0x000100b4
  135. #define CPE_Q5_PI 0x000100bc
  136. #define CPE_Q5_CI 0x000100c0
  137. #define CPE_Q6_DEPTH 0x000100d4
  138. #define CPE_Q6_PI 0x000100dc
  139. #define CPE_Q6_CI 0x000100e0
  140. #define CPE_Q7_DEPTH 0x000100f4
  141. #define CPE_Q7_PI 0x000100fc
  142. #define CPE_Q7_CI 0x00010100
  143. #define RME_Q0_DEPTH 0x00011014
  144. #define RME_Q0_PI 0x0001101c
  145. #define RME_Q0_CI 0x00011020
  146. #define RME_Q1_DEPTH 0x00011034
  147. #define RME_Q1_PI 0x0001103c
  148. #define RME_Q1_CI 0x00011040
  149. #define RME_Q2_DEPTH 0x00011054
  150. #define RME_Q2_PI 0x0001105c
  151. #define RME_Q2_CI 0x00011060
  152. #define RME_Q3_DEPTH 0x00011074
  153. #define RME_Q3_PI 0x0001107c
  154. #define RME_Q3_CI 0x00011080
  155. #define RME_Q4_DEPTH 0x00011094
  156. #define RME_Q4_PI 0x0001109c
  157. #define RME_Q4_CI 0x000110a0
  158. #define RME_Q5_DEPTH 0x000110b4
  159. #define RME_Q5_PI 0x000110bc
  160. #define RME_Q5_CI 0x000110c0
  161. #define RME_Q6_DEPTH 0x000110d4
  162. #define RME_Q6_PI 0x000110dc
  163. #define RME_Q6_CI 0x000110e0
  164. #define RME_Q7_DEPTH 0x000110f4
  165. #define RME_Q7_PI 0x000110fc
  166. #define RME_Q7_CI 0x00011100
  167. #define PSS_CTL_REG 0x00018800
  168. #define __PSS_I2C_CLK_DIV_MK 0x00030000
  169. #define __PSS_I2C_CLK_DIV_SH 16
  170. #define __PSS_I2C_CLK_DIV(_v) ((_v) << __PSS_I2C_CLK_DIV_SH)
  171. #define __PSS_LMEM_INIT_DONE 0x00001000
  172. #define __PSS_LMEM_RESET 0x00000200
  173. #define __PSS_LMEM_INIT_EN 0x00000100
  174. #define __PSS_LPU1_RESET 0x00000002
  175. #define __PSS_LPU0_RESET 0x00000001
  176. /*
  177. * These definitions are either in error/missing in spec. Its auto-generated
  178. * from hard coded values in regparse.pl.
  179. */
  180. #define __EMPHPOST_AT_4G_MK_FIX 0x0000001c
  181. #define __EMPHPOST_AT_4G_SH_FIX 0x00000002
  182. #define __EMPHPRE_AT_4G_FIX 0x00000003
  183. #define __SFP_TXRATE_EN_FIX 0x00000100
  184. #define __SFP_RXRATE_EN_FIX 0x00000080
  185. /*
  186. * These register definitions are auto-generated from hard coded values
  187. * in regparse.pl.
  188. */
  189. #define HOSTFN0_LPU_MBOX0_0 0x00019200
  190. #define HOSTFN1_LPU_MBOX0_8 0x00019260
  191. #define LPU_HOSTFN0_MBOX0_0 0x00019280
  192. #define LPU_HOSTFN1_MBOX0_8 0x000192e0
  193. /*
  194. * These register mapping definitions are auto-generated from mapping tables
  195. * in regparse.pl.
  196. */
  197. #define BFA_IOC0_HBEAT_REG HOST_SEM0_INFO_REG
  198. #define BFA_IOC0_STATE_REG HOST_SEM1_INFO_REG
  199. #define BFA_IOC1_HBEAT_REG HOST_SEM2_INFO_REG
  200. #define BFA_IOC1_STATE_REG HOST_SEM3_INFO_REG
  201. #define BFA_FW_USE_COUNT HOST_SEM4_INFO_REG
  202. #define CPE_Q_DEPTH(__n) \
  203. (CPE_Q0_DEPTH + (__n) * (CPE_Q1_DEPTH - CPE_Q0_DEPTH))
  204. #define CPE_Q_PI(__n) \
  205. (CPE_Q0_PI + (__n) * (CPE_Q1_PI - CPE_Q0_PI))
  206. #define CPE_Q_CI(__n) \
  207. (CPE_Q0_CI + (__n) * (CPE_Q1_CI - CPE_Q0_CI))
  208. #define RME_Q_DEPTH(__n) \
  209. (RME_Q0_DEPTH + (__n) * (RME_Q1_DEPTH - RME_Q0_DEPTH))
  210. #define RME_Q_PI(__n) \
  211. (RME_Q0_PI + (__n) * (RME_Q1_PI - RME_Q0_PI))
  212. #define RME_Q_CI(__n) \
  213. (RME_Q0_CI + (__n) * (RME_Q1_CI - RME_Q0_CI))
  214. #define CPE_Q_NUM(__fn, __q) (((__fn) << 2) + (__q))
  215. #define RME_Q_NUM(__fn, __q) (((__fn) << 2) + (__q))
  216. #define CPE_Q_MASK(__q) ((__q) & 0x3)
  217. #define RME_Q_MASK(__q) ((__q) & 0x3)
  218. /*
  219. * PCI MSI-X vector defines
  220. */
  221. enum {
  222. BFA_MSIX_CPE_Q0 = 0,
  223. BFA_MSIX_CPE_Q1 = 1,
  224. BFA_MSIX_CPE_Q2 = 2,
  225. BFA_MSIX_CPE_Q3 = 3,
  226. BFA_MSIX_CPE_Q4 = 4,
  227. BFA_MSIX_CPE_Q5 = 5,
  228. BFA_MSIX_CPE_Q6 = 6,
  229. BFA_MSIX_CPE_Q7 = 7,
  230. BFA_MSIX_RME_Q0 = 8,
  231. BFA_MSIX_RME_Q1 = 9,
  232. BFA_MSIX_RME_Q2 = 10,
  233. BFA_MSIX_RME_Q3 = 11,
  234. BFA_MSIX_RME_Q4 = 12,
  235. BFA_MSIX_RME_Q5 = 13,
  236. BFA_MSIX_RME_Q6 = 14,
  237. BFA_MSIX_RME_Q7 = 15,
  238. BFA_MSIX_ERR_EMC = 16,
  239. BFA_MSIX_ERR_LPU0 = 17,
  240. BFA_MSIX_ERR_LPU1 = 18,
  241. BFA_MSIX_ERR_PSS = 19,
  242. BFA_MSIX_MBOX_LPU0 = 20,
  243. BFA_MSIX_MBOX_LPU1 = 21,
  244. BFA_MSIX_CB_MAX = 22,
  245. };
  246. /*
  247. * And corresponding host interrupt status bit field defines
  248. */
  249. #define __HFN_INT_CPE_Q0 0x00000001U
  250. #define __HFN_INT_CPE_Q1 0x00000002U
  251. #define __HFN_INT_CPE_Q2 0x00000004U
  252. #define __HFN_INT_CPE_Q3 0x00000008U
  253. #define __HFN_INT_CPE_Q4 0x00000010U
  254. #define __HFN_INT_CPE_Q5 0x00000020U
  255. #define __HFN_INT_CPE_Q6 0x00000040U
  256. #define __HFN_INT_CPE_Q7 0x00000080U
  257. #define __HFN_INT_RME_Q0 0x00000100U
  258. #define __HFN_INT_RME_Q1 0x00000200U
  259. #define __HFN_INT_RME_Q2 0x00000400U
  260. #define __HFN_INT_RME_Q3 0x00000800U
  261. #define __HFN_INT_RME_Q4 0x00001000U
  262. #define __HFN_INT_RME_Q5 0x00002000U
  263. #define __HFN_INT_RME_Q6 0x00004000U
  264. #define __HFN_INT_RME_Q7 0x00008000U
  265. #define __HFN_INT_ERR_EMC 0x00010000U
  266. #define __HFN_INT_ERR_LPU0 0x00020000U
  267. #define __HFN_INT_ERR_LPU1 0x00040000U
  268. #define __HFN_INT_ERR_PSS 0x00080000U
  269. #define __HFN_INT_MBOX_LPU0 0x00100000U
  270. #define __HFN_INT_MBOX_LPU1 0x00200000U
  271. #define __HFN_INT_MBOX1_LPU0 0x00400000U
  272. #define __HFN_INT_MBOX1_LPU1 0x00800000U
  273. #define __HFN_INT_CPE_MASK 0x000000ffU
  274. #define __HFN_INT_RME_MASK 0x0000ff00U
  275. /*
  276. * crossbow memory map.
  277. */
  278. #define PSS_SMEM_PAGE_START 0x8000
  279. #define PSS_SMEM_PGNUM(_pg0, _ma) ((_pg0) + ((_ma) >> 15))
  280. #define PSS_SMEM_PGOFF(_ma) ((_ma) & 0x7fff)
  281. /*
  282. * End of crossbow memory map
  283. */
  284. #endif /* __BFI_CBREG_H__ */