bfi_reg.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. /*
  2. * Copyright (c) 2005-2010 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_reg.h ASIC register defines for all Brocade adapter ASICs
  19. */
  20. #ifndef __BFI_REG_H__
  21. #define __BFI_REG_H__
  22. #define HOSTFN0_INT_STATUS 0x00014000 /* cb/ct */
  23. #define HOSTFN1_INT_STATUS 0x00014100 /* cb/ct */
  24. #define HOSTFN2_INT_STATUS 0x00014300 /* ct */
  25. #define HOSTFN3_INT_STATUS 0x00014400 /* ct */
  26. #define HOSTFN0_INT_MSK 0x00014004 /* cb/ct */
  27. #define HOSTFN1_INT_MSK 0x00014104 /* cb/ct */
  28. #define HOSTFN2_INT_MSK 0x00014304 /* ct */
  29. #define HOSTFN3_INT_MSK 0x00014404 /* ct */
  30. #define HOST_PAGE_NUM_FN0 0x00014008 /* cb/ct */
  31. #define HOST_PAGE_NUM_FN1 0x00014108 /* cb/ct */
  32. #define HOST_PAGE_NUM_FN2 0x00014308 /* ct */
  33. #define HOST_PAGE_NUM_FN3 0x00014408 /* ct */
  34. #define APP_PLL_LCLK_CTL_REG 0x00014204 /* cb/ct */
  35. #define __P_LCLK_PLL_LOCK 0x80000000
  36. #define __APP_PLL_LCLK_SRAM_USE_100MHZ 0x00100000
  37. #define __APP_PLL_LCLK_RESET_TIMER_MK 0x000e0000
  38. #define __APP_PLL_LCLK_RESET_TIMER_SH 17
  39. #define __APP_PLL_LCLK_RESET_TIMER(_v) ((_v) << __APP_PLL_LCLK_RESET_TIMER_SH)
  40. #define __APP_PLL_LCLK_LOGIC_SOFT_RESET 0x00010000
  41. #define __APP_PLL_LCLK_CNTLMT0_1_MK 0x0000c000
  42. #define __APP_PLL_LCLK_CNTLMT0_1_SH 14
  43. #define __APP_PLL_LCLK_CNTLMT0_1(_v) ((_v) << __APP_PLL_LCLK_CNTLMT0_1_SH)
  44. #define __APP_PLL_LCLK_JITLMT0_1_MK 0x00003000
  45. #define __APP_PLL_LCLK_JITLMT0_1_SH 12
  46. #define __APP_PLL_LCLK_JITLMT0_1(_v) ((_v) << __APP_PLL_LCLK_JITLMT0_1_SH)
  47. #define __APP_PLL_LCLK_HREF 0x00000800
  48. #define __APP_PLL_LCLK_HDIV 0x00000400
  49. #define __APP_PLL_LCLK_P0_1_MK 0x00000300
  50. #define __APP_PLL_LCLK_P0_1_SH 8
  51. #define __APP_PLL_LCLK_P0_1(_v) ((_v) << __APP_PLL_LCLK_P0_1_SH)
  52. #define __APP_PLL_LCLK_Z0_2_MK 0x000000e0
  53. #define __APP_PLL_LCLK_Z0_2_SH 5
  54. #define __APP_PLL_LCLK_Z0_2(_v) ((_v) << __APP_PLL_LCLK_Z0_2_SH)
  55. #define __APP_PLL_LCLK_RSEL200500 0x00000010
  56. #define __APP_PLL_LCLK_ENARST 0x00000008
  57. #define __APP_PLL_LCLK_BYPASS 0x00000004
  58. #define __APP_PLL_LCLK_LRESETN 0x00000002
  59. #define __APP_PLL_LCLK_ENABLE 0x00000001
  60. #define APP_PLL_SCLK_CTL_REG 0x00014208 /* cb/ct */
  61. #define __P_SCLK_PLL_LOCK 0x80000000
  62. #define __APP_PLL_SCLK_RESET_TIMER_MK 0x000e0000
  63. #define __APP_PLL_SCLK_RESET_TIMER_SH 17
  64. #define __APP_PLL_SCLK_RESET_TIMER(_v) ((_v) << __APP_PLL_SCLK_RESET_TIMER_SH)
  65. #define __APP_PLL_SCLK_LOGIC_SOFT_RESET 0x00010000
  66. #define __APP_PLL_SCLK_CNTLMT0_1_MK 0x0000c000
  67. #define __APP_PLL_SCLK_CNTLMT0_1_SH 14
  68. #define __APP_PLL_SCLK_CNTLMT0_1(_v) ((_v) << __APP_PLL_SCLK_CNTLMT0_1_SH)
  69. #define __APP_PLL_SCLK_JITLMT0_1_MK 0x00003000
  70. #define __APP_PLL_SCLK_JITLMT0_1_SH 12
  71. #define __APP_PLL_SCLK_JITLMT0_1(_v) ((_v) << __APP_PLL_SCLK_JITLMT0_1_SH)
  72. #define __APP_PLL_SCLK_HREF 0x00000800
  73. #define __APP_PLL_SCLK_HDIV 0x00000400
  74. #define __APP_PLL_SCLK_P0_1_MK 0x00000300
  75. #define __APP_PLL_SCLK_P0_1_SH 8
  76. #define __APP_PLL_SCLK_P0_1(_v) ((_v) << __APP_PLL_SCLK_P0_1_SH)
  77. #define __APP_PLL_SCLK_Z0_2_MK 0x000000e0
  78. #define __APP_PLL_SCLK_Z0_2_SH 5
  79. #define __APP_PLL_SCLK_Z0_2(_v) ((_v) << __APP_PLL_SCLK_Z0_2_SH)
  80. #define __APP_PLL_SCLK_RSEL200500 0x00000010
  81. #define __APP_PLL_SCLK_ENARST 0x00000008
  82. #define __APP_PLL_SCLK_BYPASS 0x00000004
  83. #define __APP_PLL_SCLK_LRESETN 0x00000002
  84. #define __APP_PLL_SCLK_ENABLE 0x00000001
  85. #define __ENABLE_MAC_AHB_1 0x00800000 /* ct */
  86. #define __ENABLE_MAC_AHB_0 0x00400000 /* ct */
  87. #define __ENABLE_MAC_1 0x00200000 /* ct */
  88. #define __ENABLE_MAC_0 0x00100000 /* ct */
  89. #define HOST_SEM0_REG 0x00014230 /* cb/ct */
  90. #define HOST_SEM1_REG 0x00014234 /* cb/ct */
  91. #define HOST_SEM2_REG 0x00014238 /* cb/ct */
  92. #define HOST_SEM3_REG 0x0001423c /* cb/ct */
  93. #define HOST_SEM4_REG 0x00014610 /* cb/ct */
  94. #define HOST_SEM5_REG 0x00014614 /* cb/ct */
  95. #define HOST_SEM6_REG 0x00014618 /* cb/ct */
  96. #define HOST_SEM7_REG 0x0001461c /* cb/ct */
  97. #define HOST_SEM0_INFO_REG 0x00014240 /* cb/ct */
  98. #define HOST_SEM1_INFO_REG 0x00014244 /* cb/ct */
  99. #define HOST_SEM2_INFO_REG 0x00014248 /* cb/ct */
  100. #define HOST_SEM3_INFO_REG 0x0001424c /* cb/ct */
  101. #define HOST_SEM4_INFO_REG 0x00014620 /* cb/ct */
  102. #define HOST_SEM5_INFO_REG 0x00014624 /* cb/ct */
  103. #define HOST_SEM6_INFO_REG 0x00014628 /* cb/ct */
  104. #define HOST_SEM7_INFO_REG 0x0001462c /* cb/ct */
  105. #define HOSTFN0_LPU0_CMD_STAT 0x00019000 /* cb/ct */
  106. #define HOSTFN0_LPU1_CMD_STAT 0x00019004 /* cb/ct */
  107. #define HOSTFN1_LPU0_CMD_STAT 0x00019010 /* cb/ct */
  108. #define HOSTFN1_LPU1_CMD_STAT 0x00019014 /* cb/ct */
  109. #define HOSTFN2_LPU0_CMD_STAT 0x00019150 /* ct */
  110. #define HOSTFN2_LPU1_CMD_STAT 0x00019154 /* ct */
  111. #define HOSTFN3_LPU0_CMD_STAT 0x00019160 /* ct */
  112. #define HOSTFN3_LPU1_CMD_STAT 0x00019164 /* ct */
  113. #define LPU0_HOSTFN0_CMD_STAT 0x00019008 /* cb/ct */
  114. #define LPU1_HOSTFN0_CMD_STAT 0x0001900c /* cb/ct */
  115. #define LPU0_HOSTFN1_CMD_STAT 0x00019018 /* cb/ct */
  116. #define LPU1_HOSTFN1_CMD_STAT 0x0001901c /* cb/ct */
  117. #define LPU0_HOSTFN2_CMD_STAT 0x00019158 /* ct */
  118. #define LPU1_HOSTFN2_CMD_STAT 0x0001915c /* ct */
  119. #define LPU0_HOSTFN3_CMD_STAT 0x00019168 /* ct */
  120. #define LPU1_HOSTFN3_CMD_STAT 0x0001916c /* ct */
  121. #define PSS_CTL_REG 0x00018800 /* cb/ct */
  122. #define __PSS_I2C_CLK_DIV_MK 0x007f0000
  123. #define __PSS_I2C_CLK_DIV_SH 16
  124. #define __PSS_I2C_CLK_DIV(_v) ((_v) << __PSS_I2C_CLK_DIV_SH)
  125. #define __PSS_LMEM_INIT_DONE 0x00001000
  126. #define __PSS_LMEM_RESET 0x00000200
  127. #define __PSS_LMEM_INIT_EN 0x00000100
  128. #define __PSS_LPU1_RESET 0x00000002
  129. #define __PSS_LPU0_RESET 0x00000001
  130. #define PSS_ERR_STATUS_REG 0x00018810 /* cb/ct */
  131. #define ERR_SET_REG 0x00018818 /* cb/ct */
  132. #define PSS_GPIO_OUT_REG 0x000188c0 /* cb/ct */
  133. #define __PSS_GPIO_OUT_REG 0x00000fff
  134. #define PSS_GPIO_OE_REG 0x000188c8 /* cb/ct */
  135. #define __PSS_GPIO_OE_REG 0x000000ff
  136. #define HOSTFN0_LPU_MBOX0_0 0x00019200 /* cb/ct */
  137. #define HOSTFN1_LPU_MBOX0_8 0x00019260 /* cb/ct */
  138. #define LPU_HOSTFN0_MBOX0_0 0x00019280 /* cb/ct */
  139. #define LPU_HOSTFN1_MBOX0_8 0x000192e0 /* cb/ct */
  140. #define HOSTFN2_LPU_MBOX0_0 0x00019400 /* ct */
  141. #define HOSTFN3_LPU_MBOX0_8 0x00019460 /* ct */
  142. #define LPU_HOSTFN2_MBOX0_0 0x00019480 /* ct */
  143. #define LPU_HOSTFN3_MBOX0_8 0x000194e0 /* ct */
  144. #define HOST_MSIX_ERR_INDEX_FN0 0x0001400c /* ct */
  145. #define HOST_MSIX_ERR_INDEX_FN1 0x0001410c /* ct */
  146. #define HOST_MSIX_ERR_INDEX_FN2 0x0001430c /* ct */
  147. #define HOST_MSIX_ERR_INDEX_FN3 0x0001440c /* ct */
  148. #define MBIST_CTL_REG 0x00014220 /* ct */
  149. #define __EDRAM_BISTR_START 0x00000004
  150. #define MBIST_STAT_REG 0x00014224 /* ct */
  151. #define ETH_MAC_SER_REG 0x00014288 /* ct */
  152. #define __APP_EMS_CKBUFAMPIN 0x00000020
  153. #define __APP_EMS_REFCLKSEL 0x00000010
  154. #define __APP_EMS_CMLCKSEL 0x00000008
  155. #define __APP_EMS_REFCKBUFEN2 0x00000004
  156. #define __APP_EMS_REFCKBUFEN1 0x00000002
  157. #define __APP_EMS_CHANNEL_SEL 0x00000001
  158. #define FNC_PERS_REG 0x00014604 /* ct */
  159. #define __F3_FUNCTION_ACTIVE 0x80000000
  160. #define __F3_FUNCTION_MODE 0x40000000
  161. #define __F3_PORT_MAP_MK 0x30000000
  162. #define __F3_PORT_MAP_SH 28
  163. #define __F3_PORT_MAP(_v) ((_v) << __F3_PORT_MAP_SH)
  164. #define __F3_VM_MODE 0x08000000
  165. #define __F3_INTX_STATUS_MK 0x07000000
  166. #define __F3_INTX_STATUS_SH 24
  167. #define __F3_INTX_STATUS(_v) ((_v) << __F3_INTX_STATUS_SH)
  168. #define __F2_FUNCTION_ACTIVE 0x00800000
  169. #define __F2_FUNCTION_MODE 0x00400000
  170. #define __F2_PORT_MAP_MK 0x00300000
  171. #define __F2_PORT_MAP_SH 20
  172. #define __F2_PORT_MAP(_v) ((_v) << __F2_PORT_MAP_SH)
  173. #define __F2_VM_MODE 0x00080000
  174. #define __F2_INTX_STATUS_MK 0x00070000
  175. #define __F2_INTX_STATUS_SH 16
  176. #define __F2_INTX_STATUS(_v) ((_v) << __F2_INTX_STATUS_SH)
  177. #define __F1_FUNCTION_ACTIVE 0x00008000
  178. #define __F1_FUNCTION_MODE 0x00004000
  179. #define __F1_PORT_MAP_MK 0x00003000
  180. #define __F1_PORT_MAP_SH 12
  181. #define __F1_PORT_MAP(_v) ((_v) << __F1_PORT_MAP_SH)
  182. #define __F1_VM_MODE 0x00000800
  183. #define __F1_INTX_STATUS_MK 0x00000700
  184. #define __F1_INTX_STATUS_SH 8
  185. #define __F1_INTX_STATUS(_v) ((_v) << __F1_INTX_STATUS_SH)
  186. #define __F0_FUNCTION_ACTIVE 0x00000080
  187. #define __F0_FUNCTION_MODE 0x00000040
  188. #define __F0_PORT_MAP_MK 0x00000030
  189. #define __F0_PORT_MAP_SH 4
  190. #define __F0_PORT_MAP(_v) ((_v) << __F0_PORT_MAP_SH)
  191. #define __F0_VM_MODE 0x00000008
  192. #define __F0_INTX_STATUS 0x00000007
  193. enum {
  194. __F0_INTX_STATUS_MSIX = 0x0,
  195. __F0_INTX_STATUS_INTA = 0x1,
  196. __F0_INTX_STATUS_INTB = 0x2,
  197. __F0_INTX_STATUS_INTC = 0x3,
  198. __F0_INTX_STATUS_INTD = 0x4,
  199. };
  200. #define OP_MODE 0x0001460c /* ct */
  201. #define __APP_ETH_CLK_LOWSPEED 0x00000004
  202. #define __GLOBAL_CORECLK_HALFSPEED 0x00000002
  203. #define __GLOBAL_FCOE_MODE 0x00000001
  204. #define FW_INIT_HALT_P0 0x000191ac /* ct */
  205. #define __FW_INIT_HALT_P 0x00000001
  206. #define FW_INIT_HALT_P1 0x000191bc /* ct */
  207. #define PMM_1T_RESET_REG_P0 0x0002381c /* ct */
  208. #define __PMM_1T_RESET_P 0x00000001
  209. #define PMM_1T_RESET_REG_P1 0x00023c1c /* ct */
  210. /**
  211. * Catapult-2 specific defines
  212. */
  213. #define CT2_PCI_CPQ_BASE 0x00030000
  214. #define CT2_PCI_APP_BASE 0x00030100
  215. #define CT2_PCI_ETH_BASE 0x00030400
  216. /*
  217. * APP block registers
  218. */
  219. #define CT2_HOSTFN_INT_STATUS (CT2_PCI_APP_BASE + 0x00)
  220. #define CT2_HOSTFN_INTR_MASK (CT2_PCI_APP_BASE + 0x04)
  221. #define CT2_HOSTFN_PERSONALITY0 (CT2_PCI_APP_BASE + 0x08)
  222. #define __PME_STATUS_ 0x00200000
  223. #define __PF_VF_BAR_SIZE_MODE__MK 0x00180000
  224. #define __PF_VF_BAR_SIZE_MODE__SH 19
  225. #define __PF_VF_BAR_SIZE_MODE_(_v) ((_v) << __PF_VF_BAR_SIZE_MODE__SH)
  226. #define __FC_LL_PORT_MAP__MK 0x00060000
  227. #define __FC_LL_PORT_MAP__SH 17
  228. #define __FC_LL_PORT_MAP_(_v) ((_v) << __FC_LL_PORT_MAP__SH)
  229. #define __PF_VF_ACTIVE_ 0x00010000
  230. #define __PF_VF_CFG_RDY_ 0x00008000
  231. #define __PF_VF_ENABLE_ 0x00004000
  232. #define __PF_DRIVER_ACTIVE_ 0x00002000
  233. #define __PF_PME_SEND_ENABLE_ 0x00001000
  234. #define __PF_EXROM_OFFSET__MK 0x00000ff0
  235. #define __PF_EXROM_OFFSET__SH 4
  236. #define __PF_EXROM_OFFSET_(_v) ((_v) << __PF_EXROM_OFFSET__SH)
  237. #define __FC_LL_MODE_ 0x00000008
  238. #define __PF_INTX_PIN_ 0x00000007
  239. #define CT2_HOSTFN_PERSONALITY1 (CT2_PCI_APP_BASE + 0x0C)
  240. #define __PF_NUM_QUEUES1__MK 0xff000000
  241. #define __PF_NUM_QUEUES1__SH 24
  242. #define __PF_NUM_QUEUES1_(_v) ((_v) << __PF_NUM_QUEUES1__SH)
  243. #define __PF_VF_QUE_OFFSET1__MK 0x00ff0000
  244. #define __PF_VF_QUE_OFFSET1__SH 16
  245. #define __PF_VF_QUE_OFFSET1_(_v) ((_v) << __PF_VF_QUE_OFFSET1__SH)
  246. #define __PF_VF_NUM_QUEUES__MK 0x0000ff00
  247. #define __PF_VF_NUM_QUEUES__SH 8
  248. #define __PF_VF_NUM_QUEUES_(_v) ((_v) << __PF_VF_NUM_QUEUES__SH)
  249. #define __PF_VF_QUE_OFFSET_ 0x000000ff
  250. #define CT2_HOSTFN_PAGE_NUM (CT2_PCI_APP_BASE + 0x18)
  251. #define CT2_HOSTFN_MSIX_VT_INDEX_MBOX_ERR (CT2_PCI_APP_BASE + 0x38)
  252. /*
  253. * Catapult-2 CPQ block registers
  254. */
  255. #define CT2_HOSTFN_LPU0_MBOX0 (CT2_PCI_CPQ_BASE + 0x00)
  256. #define CT2_HOSTFN_LPU1_MBOX0 (CT2_PCI_CPQ_BASE + 0x20)
  257. #define CT2_LPU0_HOSTFN_MBOX0 (CT2_PCI_CPQ_BASE + 0x40)
  258. #define CT2_LPU1_HOSTFN_MBOX0 (CT2_PCI_CPQ_BASE + 0x60)
  259. #define CT2_HOSTFN_LPU0_CMD_STAT (CT2_PCI_CPQ_BASE + 0x80)
  260. #define CT2_HOSTFN_LPU1_CMD_STAT (CT2_PCI_CPQ_BASE + 0x84)
  261. #define CT2_LPU0_HOSTFN_CMD_STAT (CT2_PCI_CPQ_BASE + 0x88)
  262. #define CT2_LPU1_HOSTFN_CMD_STAT (CT2_PCI_CPQ_BASE + 0x8c)
  263. #define CT2_HOSTFN_LPU0_READ_STAT (CT2_PCI_CPQ_BASE + 0x90)
  264. #define CT2_HOSTFN_LPU1_READ_STAT (CT2_PCI_CPQ_BASE + 0x94)
  265. #define CT2_LPU0_HOSTFN_MBOX0_MSK (CT2_PCI_CPQ_BASE + 0x98)
  266. #define CT2_LPU1_HOSTFN_MBOX0_MSK (CT2_PCI_CPQ_BASE + 0x9C)
  267. #define CT2_HOST_SEM0_REG 0x000148f0
  268. #define CT2_HOST_SEM1_REG 0x000148f4
  269. #define CT2_HOST_SEM2_REG 0x000148f8
  270. #define CT2_HOST_SEM3_REG 0x000148fc
  271. #define CT2_HOST_SEM4_REG 0x00014900
  272. #define CT2_HOST_SEM5_REG 0x00014904
  273. #define CT2_HOST_SEM6_REG 0x00014908
  274. #define CT2_HOST_SEM7_REG 0x0001490c
  275. #define CT2_HOST_SEM0_INFO_REG 0x000148b0
  276. #define CT2_HOST_SEM1_INFO_REG 0x000148b4
  277. #define CT2_HOST_SEM2_INFO_REG 0x000148b8
  278. #define CT2_HOST_SEM3_INFO_REG 0x000148bc
  279. #define CT2_HOST_SEM4_INFO_REG 0x000148c0
  280. #define CT2_HOST_SEM5_INFO_REG 0x000148c4
  281. #define CT2_HOST_SEM6_INFO_REG 0x000148c8
  282. #define CT2_HOST_SEM7_INFO_REG 0x000148cc
  283. #define CT2_APP_PLL_LCLK_CTL_REG 0x00014808
  284. #define __APP_LPUCLK_HALFSPEED 0x40000000
  285. #define __APP_PLL_LCLK_LOAD 0x20000000
  286. #define __APP_PLL_LCLK_FBCNT_MK 0x1fe00000
  287. #define __APP_PLL_LCLK_FBCNT_SH 21
  288. #define __APP_PLL_LCLK_FBCNT(_v) ((_v) << __APP_PLL_SCLK_FBCNT_SH)
  289. enum {
  290. __APP_PLL_LCLK_FBCNT_425_MHZ = 6,
  291. __APP_PLL_LCLK_FBCNT_468_MHZ = 4,
  292. };
  293. #define __APP_PLL_LCLK_EXTFB 0x00000800
  294. #define __APP_PLL_LCLK_ENOUTS 0x00000400
  295. #define __APP_PLL_LCLK_RATE 0x00000010
  296. #define CT2_APP_PLL_SCLK_CTL_REG 0x0001480c
  297. #define __P_SCLK_PLL_LOCK 0x80000000
  298. #define __APP_PLL_SCLK_REFCLK_SEL 0x40000000
  299. #define __APP_PLL_SCLK_CLK_DIV2 0x20000000
  300. #define __APP_PLL_SCLK_LOAD 0x10000000
  301. #define __APP_PLL_SCLK_FBCNT_MK 0x0ff00000
  302. #define __APP_PLL_SCLK_FBCNT_SH 20
  303. #define __APP_PLL_SCLK_FBCNT(_v) ((_v) << __APP_PLL_SCLK_FBCNT_SH)
  304. enum {
  305. __APP_PLL_SCLK_FBCNT_NORM = 6,
  306. __APP_PLL_SCLK_FBCNT_10G_FC = 10,
  307. };
  308. #define __APP_PLL_SCLK_EXTFB 0x00000800
  309. #define __APP_PLL_SCLK_ENOUTS 0x00000400
  310. #define __APP_PLL_SCLK_RATE 0x00000010
  311. #define CT2_PCIE_MISC_REG 0x00014804
  312. #define __ETH_CLK_ENABLE_PORT1 0x00000010
  313. #define CT2_CHIP_MISC_PRG 0x000148a4
  314. #define __ETH_CLK_ENABLE_PORT0 0x00004000
  315. #define __APP_LPU_SPEED 0x00000002
  316. #define CT2_MBIST_STAT_REG 0x00014818
  317. #define CT2_MBIST_CTL_REG 0x0001481c
  318. #define CT2_PMM_1T_CONTROL_REG_P0 0x0002381c
  319. #define __PMM_1T_PNDB_P 0x00000002
  320. #define CT2_PMM_1T_CONTROL_REG_P1 0x00023c1c
  321. #define CT2_WGN_STATUS 0x00014990
  322. #define __A2T_AHB_LOAD 0x00000800
  323. #define __WGN_READY 0x00000400
  324. #define __GLBL_PF_VF_CFG_RDY 0x00000200
  325. #define CT2_NFC_STS_REG 0x00027410
  326. #define CT2_NFC_CSR_CLR_REG 0x00027420
  327. #define CT2_NFC_CSR_SET_REG 0x00027424
  328. #define __HALT_NFC_CONTROLLER 0x00000002
  329. #define __NFC_CONTROLLER_HALTED 0x00001000
  330. #define CT2_RSC_GPR15_REG 0x0002765c
  331. #define CT2_CSI_FW_CTL_REG 0x00027080
  332. #define CT2_CSI_FW_CTL_SET_REG 0x00027088
  333. #define __RESET_AND_START_SCLK_LCLK_PLLS 0x00010000
  334. #define CT2_CSI_MAC0_CONTROL_REG 0x000270d0
  335. #define __CSI_MAC_RESET 0x00000010
  336. #define __CSI_MAC_AHB_RESET 0x00000008
  337. #define CT2_CSI_MAC1_CONTROL_REG 0x000270d4
  338. #define CT2_CSI_MAC_CONTROL_REG(__n) \
  339. (CT2_CSI_MAC0_CONTROL_REG + \
  340. (__n) * (CT2_CSI_MAC1_CONTROL_REG - CT2_CSI_MAC0_CONTROL_REG))
  341. #define CT2_NFC_FLASH_STS_REG 0x00014834
  342. #define __FLASH_PLL_INIT_AND_RESET_IN_PROGRESS 0x00000020
  343. /*
  344. * Name semaphore registers based on usage
  345. */
  346. #define BFA_IOC0_HBEAT_REG HOST_SEM0_INFO_REG
  347. #define BFA_IOC0_STATE_REG HOST_SEM1_INFO_REG
  348. #define BFA_IOC1_HBEAT_REG HOST_SEM2_INFO_REG
  349. #define BFA_IOC1_STATE_REG HOST_SEM3_INFO_REG
  350. #define BFA_FW_USE_COUNT HOST_SEM4_INFO_REG
  351. #define BFA_IOC_FAIL_SYNC HOST_SEM5_INFO_REG
  352. /*
  353. * CT2 semaphore register locations changed
  354. */
  355. #define CT2_BFA_IOC0_HBEAT_REG CT2_HOST_SEM0_INFO_REG
  356. #define CT2_BFA_IOC0_STATE_REG CT2_HOST_SEM1_INFO_REG
  357. #define CT2_BFA_IOC1_HBEAT_REG CT2_HOST_SEM2_INFO_REG
  358. #define CT2_BFA_IOC1_STATE_REG CT2_HOST_SEM3_INFO_REG
  359. #define CT2_BFA_FW_USE_COUNT CT2_HOST_SEM4_INFO_REG
  360. #define CT2_BFA_IOC_FAIL_SYNC CT2_HOST_SEM5_INFO_REG
  361. #define CPE_Q_NUM(__fn, __q) (((__fn) << 2) + (__q))
  362. #define RME_Q_NUM(__fn, __q) (((__fn) << 2) + (__q))
  363. /*
  364. * And corresponding host interrupt status bit field defines
  365. */
  366. #define __HFN_INT_CPE_Q0 0x00000001U
  367. #define __HFN_INT_CPE_Q1 0x00000002U
  368. #define __HFN_INT_CPE_Q2 0x00000004U
  369. #define __HFN_INT_CPE_Q3 0x00000008U
  370. #define __HFN_INT_CPE_Q4 0x00000010U
  371. #define __HFN_INT_CPE_Q5 0x00000020U
  372. #define __HFN_INT_CPE_Q6 0x00000040U
  373. #define __HFN_INT_CPE_Q7 0x00000080U
  374. #define __HFN_INT_RME_Q0 0x00000100U
  375. #define __HFN_INT_RME_Q1 0x00000200U
  376. #define __HFN_INT_RME_Q2 0x00000400U
  377. #define __HFN_INT_RME_Q3 0x00000800U
  378. #define __HFN_INT_RME_Q4 0x00001000U
  379. #define __HFN_INT_RME_Q5 0x00002000U
  380. #define __HFN_INT_RME_Q6 0x00004000U
  381. #define __HFN_INT_RME_Q7 0x00008000U
  382. #define __HFN_INT_ERR_EMC 0x00010000U
  383. #define __HFN_INT_ERR_LPU0 0x00020000U
  384. #define __HFN_INT_ERR_LPU1 0x00040000U
  385. #define __HFN_INT_ERR_PSS 0x00080000U
  386. #define __HFN_INT_MBOX_LPU0 0x00100000U
  387. #define __HFN_INT_MBOX_LPU1 0x00200000U
  388. #define __HFN_INT_MBOX1_LPU0 0x00400000U
  389. #define __HFN_INT_MBOX1_LPU1 0x00800000U
  390. #define __HFN_INT_LL_HALT 0x01000000U
  391. #define __HFN_INT_CPE_MASK 0x000000ffU
  392. #define __HFN_INT_RME_MASK 0x0000ff00U
  393. #define __HFN_INT_ERR_MASK \
  394. (__HFN_INT_ERR_EMC | __HFN_INT_ERR_LPU0 | __HFN_INT_ERR_LPU1 | \
  395. __HFN_INT_ERR_PSS | __HFN_INT_LL_HALT)
  396. #define __HFN_INT_FN0_MASK \
  397. (__HFN_INT_CPE_Q0 | __HFN_INT_CPE_Q1 | __HFN_INT_CPE_Q2 | \
  398. __HFN_INT_CPE_Q3 | __HFN_INT_RME_Q0 | __HFN_INT_RME_Q1 | \
  399. __HFN_INT_RME_Q2 | __HFN_INT_RME_Q3 | __HFN_INT_MBOX_LPU0)
  400. #define __HFN_INT_FN1_MASK \
  401. (__HFN_INT_CPE_Q4 | __HFN_INT_CPE_Q5 | __HFN_INT_CPE_Q6 | \
  402. __HFN_INT_CPE_Q7 | __HFN_INT_RME_Q4 | __HFN_INT_RME_Q5 | \
  403. __HFN_INT_RME_Q6 | __HFN_INT_RME_Q7 | __HFN_INT_MBOX_LPU1)
  404. /*
  405. * Host interrupt status defines for catapult-2
  406. */
  407. #define __HFN_INT_MBOX_LPU0_CT2 0x00010000U
  408. #define __HFN_INT_MBOX_LPU1_CT2 0x00020000U
  409. #define __HFN_INT_ERR_PSS_CT2 0x00040000U
  410. #define __HFN_INT_ERR_LPU0_CT2 0x00080000U
  411. #define __HFN_INT_ERR_LPU1_CT2 0x00100000U
  412. #define __HFN_INT_CPQ_HALT_CT2 0x00200000U
  413. #define __HFN_INT_ERR_WGN_CT2 0x00400000U
  414. #define __HFN_INT_ERR_LEHRX_CT2 0x00800000U
  415. #define __HFN_INT_ERR_LEHTX_CT2 0x01000000U
  416. #define __HFN_INT_ERR_MASK_CT2 \
  417. (__HFN_INT_ERR_PSS_CT2 | __HFN_INT_ERR_LPU0_CT2 | \
  418. __HFN_INT_ERR_LPU1_CT2 | __HFN_INT_CPQ_HALT_CT2 | \
  419. __HFN_INT_ERR_WGN_CT2 | __HFN_INT_ERR_LEHRX_CT2 | \
  420. __HFN_INT_ERR_LEHTX_CT2)
  421. #define __HFN_INT_FN0_MASK_CT2 \
  422. (__HFN_INT_CPE_Q0 | __HFN_INT_CPE_Q1 | __HFN_INT_CPE_Q2 | \
  423. __HFN_INT_CPE_Q3 | __HFN_INT_RME_Q0 | __HFN_INT_RME_Q1 | \
  424. __HFN_INT_RME_Q2 | __HFN_INT_RME_Q3 | __HFN_INT_MBOX_LPU0_CT2)
  425. #define __HFN_INT_FN1_MASK_CT2 \
  426. (__HFN_INT_CPE_Q4 | __HFN_INT_CPE_Q5 | __HFN_INT_CPE_Q6 | \
  427. __HFN_INT_CPE_Q7 | __HFN_INT_RME_Q4 | __HFN_INT_RME_Q5 | \
  428. __HFN_INT_RME_Q6 | __HFN_INT_RME_Q7 | __HFN_INT_MBOX_LPU1_CT2)
  429. /*
  430. * asic memory map.
  431. */
  432. #define PSS_SMEM_PAGE_START 0x8000
  433. #define PSS_SMEM_PGNUM(_pg0, _ma) ((_pg0) + ((_ma) >> 15))
  434. #define PSS_SMEM_PGOFF(_ma) ((_ma) & 0x7fff)
  435. #endif /* __BFI_REG_H__ */