regtable_pcie.h 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030
  1. /*
  2. * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. #ifndef _REGTABLE_PCIE_H_
  27. #define _REGTABLE_PCIE_H_
  28. #define MISSING 0
  29. struct targetdef_s {
  30. uint32_t d_RTC_SOC_BASE_ADDRESS;
  31. uint32_t d_RTC_WMAC_BASE_ADDRESS;
  32. uint32_t d_SYSTEM_SLEEP_OFFSET;
  33. uint32_t d_WLAN_SYSTEM_SLEEP_OFFSET;
  34. uint32_t d_WLAN_SYSTEM_SLEEP_DISABLE_LSB;
  35. uint32_t d_WLAN_SYSTEM_SLEEP_DISABLE_MASK;
  36. uint32_t d_CLOCK_CONTROL_OFFSET;
  37. uint32_t d_CLOCK_CONTROL_SI0_CLK_MASK;
  38. uint32_t d_RESET_CONTROL_OFFSET;
  39. uint32_t d_RESET_CONTROL_MBOX_RST_MASK;
  40. uint32_t d_RESET_CONTROL_SI0_RST_MASK;
  41. uint32_t d_WLAN_RESET_CONTROL_OFFSET;
  42. uint32_t d_WLAN_RESET_CONTROL_COLD_RST_MASK;
  43. uint32_t d_WLAN_RESET_CONTROL_WARM_RST_MASK;
  44. uint32_t d_GPIO_BASE_ADDRESS;
  45. uint32_t d_GPIO_PIN0_OFFSET;
  46. uint32_t d_GPIO_PIN1_OFFSET;
  47. uint32_t d_GPIO_PIN0_CONFIG_MASK;
  48. uint32_t d_GPIO_PIN1_CONFIG_MASK;
  49. uint32_t d_SI_CONFIG_BIDIR_OD_DATA_LSB;
  50. uint32_t d_SI_CONFIG_BIDIR_OD_DATA_MASK;
  51. uint32_t d_SI_CONFIG_I2C_LSB;
  52. uint32_t d_SI_CONFIG_I2C_MASK;
  53. uint32_t d_SI_CONFIG_POS_SAMPLE_LSB;
  54. uint32_t d_SI_CONFIG_POS_SAMPLE_MASK;
  55. uint32_t d_SI_CONFIG_INACTIVE_CLK_LSB;
  56. uint32_t d_SI_CONFIG_INACTIVE_CLK_MASK;
  57. uint32_t d_SI_CONFIG_INACTIVE_DATA_LSB;
  58. uint32_t d_SI_CONFIG_INACTIVE_DATA_MASK;
  59. uint32_t d_SI_CONFIG_DIVIDER_LSB;
  60. uint32_t d_SI_CONFIG_DIVIDER_MASK;
  61. uint32_t d_SI_BASE_ADDRESS;
  62. uint32_t d_SI_CONFIG_OFFSET;
  63. uint32_t d_SI_TX_DATA0_OFFSET;
  64. uint32_t d_SI_TX_DATA1_OFFSET;
  65. uint32_t d_SI_RX_DATA0_OFFSET;
  66. uint32_t d_SI_RX_DATA1_OFFSET;
  67. uint32_t d_SI_CS_OFFSET;
  68. uint32_t d_SI_CS_DONE_ERR_MASK;
  69. uint32_t d_SI_CS_DONE_INT_MASK;
  70. uint32_t d_SI_CS_START_LSB;
  71. uint32_t d_SI_CS_START_MASK;
  72. uint32_t d_SI_CS_RX_CNT_LSB;
  73. uint32_t d_SI_CS_RX_CNT_MASK;
  74. uint32_t d_SI_CS_TX_CNT_LSB;
  75. uint32_t d_SI_CS_TX_CNT_MASK;
  76. uint32_t d_BOARD_DATA_SZ;
  77. uint32_t d_BOARD_EXT_DATA_SZ;
  78. uint32_t d_MBOX_BASE_ADDRESS;
  79. uint32_t d_LOCAL_SCRATCH_OFFSET;
  80. uint32_t d_CPU_CLOCK_OFFSET;
  81. uint32_t d_LPO_CAL_OFFSET;
  82. uint32_t d_GPIO_PIN10_OFFSET;
  83. uint32_t d_GPIO_PIN11_OFFSET;
  84. uint32_t d_GPIO_PIN12_OFFSET;
  85. uint32_t d_GPIO_PIN13_OFFSET;
  86. uint32_t d_CLOCK_GPIO_OFFSET;
  87. uint32_t d_CPU_CLOCK_STANDARD_LSB;
  88. uint32_t d_CPU_CLOCK_STANDARD_MASK;
  89. uint32_t d_LPO_CAL_ENABLE_LSB;
  90. uint32_t d_LPO_CAL_ENABLE_MASK;
  91. uint32_t d_CLOCK_GPIO_BT_CLK_OUT_EN_LSB;
  92. uint32_t d_CLOCK_GPIO_BT_CLK_OUT_EN_MASK;
  93. uint32_t d_ANALOG_INTF_BASE_ADDRESS;
  94. uint32_t d_WLAN_MAC_BASE_ADDRESS;
  95. uint32_t d_FW_INDICATOR_ADDRESS;
  96. uint32_t d_DRAM_BASE_ADDRESS;
  97. uint32_t d_SOC_CORE_BASE_ADDRESS;
  98. uint32_t d_CORE_CTRL_ADDRESS;
  99. uint32_t d_CE_COUNT;
  100. uint32_t d_MSI_NUM_REQUEST;
  101. uint32_t d_MSI_ASSIGN_FW;
  102. uint32_t d_MSI_ASSIGN_CE_INITIAL;
  103. uint32_t d_PCIE_INTR_ENABLE_ADDRESS;
  104. uint32_t d_PCIE_INTR_CLR_ADDRESS;
  105. uint32_t d_PCIE_INTR_FIRMWARE_MASK;
  106. uint32_t d_PCIE_INTR_CE_MASK_ALL;
  107. uint32_t d_CORE_CTRL_CPU_INTR_MASK;
  108. uint32_t d_SR_WR_INDEX_ADDRESS;
  109. uint32_t d_DST_WATERMARK_ADDRESS;
  110. /* htt_rx.c */
  111. uint32_t d_RX_MSDU_END_4_FIRST_MSDU_MASK;
  112. uint32_t d_RX_MSDU_END_4_FIRST_MSDU_LSB;
  113. uint32_t d_RX_MPDU_START_0_RETRY_LSB;
  114. uint32_t d_RX_MPDU_START_0_RETRY_MASK;
  115. uint32_t d_RX_MPDU_START_0_SEQ_NUM_MASK;
  116. uint32_t d_RX_MPDU_START_0_SEQ_NUM_LSB;
  117. uint32_t d_RX_MPDU_START_2_PN_47_32_LSB;
  118. uint32_t d_RX_MPDU_START_2_PN_47_32_MASK;
  119. uint32_t d_RX_MPDU_START_2_TID_LSB;
  120. uint32_t d_RX_MPDU_START_2_TID_MASK;
  121. uint32_t d_RX_MSDU_END_1_EXT_WAPI_PN_63_48_MASK;
  122. uint32_t d_RX_MSDU_END_1_EXT_WAPI_PN_63_48_LSB;
  123. uint32_t d_RX_MSDU_END_1_KEY_ID_OCT_MASK;
  124. uint32_t d_RX_MSDU_END_1_KEY_ID_OCT_LSB;
  125. uint32_t d_RX_MSDU_END_4_LAST_MSDU_MASK;
  126. uint32_t d_RX_MSDU_END_4_LAST_MSDU_LSB;
  127. uint32_t d_RX_ATTENTION_0_MCAST_BCAST_MASK;
  128. uint32_t d_RX_ATTENTION_0_MCAST_BCAST_LSB;
  129. uint32_t d_RX_ATTENTION_0_FRAGMENT_MASK;
  130. uint32_t d_RX_ATTENTION_0_FRAGMENT_LSB;
  131. uint32_t d_RX_ATTENTION_0_MPDU_LENGTH_ERR_MASK;
  132. uint32_t d_RX_FRAG_INFO_0_RING2_MORE_COUNT_MASK;
  133. uint32_t d_RX_FRAG_INFO_0_RING2_MORE_COUNT_LSB;
  134. uint32_t d_RX_MSDU_START_0_MSDU_LENGTH_MASK;
  135. uint32_t d_RX_MSDU_START_0_MSDU_LENGTH_LSB;
  136. uint32_t d_RX_MSDU_START_2_DECAP_FORMAT_OFFSET;
  137. uint32_t d_RX_MSDU_START_2_DECAP_FORMAT_MASK;
  138. uint32_t d_RX_MSDU_START_2_DECAP_FORMAT_LSB;
  139. uint32_t d_RX_MPDU_START_0_ENCRYPTED_MASK;
  140. uint32_t d_RX_MPDU_START_0_ENCRYPTED_LSB;
  141. uint32_t d_RX_ATTENTION_0_MORE_DATA_MASK;
  142. uint32_t d_RX_ATTENTION_0_MSDU_DONE_MASK;
  143. uint32_t d_RX_ATTENTION_0_TCP_UDP_CHKSUM_FAIL_MASK;
  144. /* end */
  145. /* PLL start */
  146. uint32_t d_EFUSE_OFFSET;
  147. uint32_t d_EFUSE_XTAL_SEL_MSB;
  148. uint32_t d_EFUSE_XTAL_SEL_LSB;
  149. uint32_t d_EFUSE_XTAL_SEL_MASK;
  150. uint32_t d_BB_PLL_CONFIG_OFFSET;
  151. uint32_t d_BB_PLL_CONFIG_OUTDIV_MSB;
  152. uint32_t d_BB_PLL_CONFIG_OUTDIV_LSB;
  153. uint32_t d_BB_PLL_CONFIG_OUTDIV_MASK;
  154. uint32_t d_BB_PLL_CONFIG_FRAC_MSB;
  155. uint32_t d_BB_PLL_CONFIG_FRAC_LSB;
  156. uint32_t d_BB_PLL_CONFIG_FRAC_MASK;
  157. uint32_t d_WLAN_PLL_SETTLE_TIME_MSB;
  158. uint32_t d_WLAN_PLL_SETTLE_TIME_LSB;
  159. uint32_t d_WLAN_PLL_SETTLE_TIME_MASK;
  160. uint32_t d_WLAN_PLL_SETTLE_OFFSET;
  161. uint32_t d_WLAN_PLL_SETTLE_SW_MASK;
  162. uint32_t d_WLAN_PLL_SETTLE_RSTMASK;
  163. uint32_t d_WLAN_PLL_SETTLE_RESET;
  164. uint32_t d_WLAN_PLL_CONTROL_NOPWD_MSB;
  165. uint32_t d_WLAN_PLL_CONTROL_NOPWD_LSB;
  166. uint32_t d_WLAN_PLL_CONTROL_NOPWD_MASK;
  167. uint32_t d_WLAN_PLL_CONTROL_BYPASS_MSB;
  168. uint32_t d_WLAN_PLL_CONTROL_BYPASS_LSB;
  169. uint32_t d_WLAN_PLL_CONTROL_BYPASS_MASK;
  170. uint32_t d_WLAN_PLL_CONTROL_BYPASS_RESET;
  171. uint32_t d_WLAN_PLL_CONTROL_CLK_SEL_MSB;
  172. uint32_t d_WLAN_PLL_CONTROL_CLK_SEL_LSB;
  173. uint32_t d_WLAN_PLL_CONTROL_CLK_SEL_MASK;
  174. uint32_t d_WLAN_PLL_CONTROL_CLK_SEL_RESET;
  175. uint32_t d_WLAN_PLL_CONTROL_REFDIV_MSB;
  176. uint32_t d_WLAN_PLL_CONTROL_REFDIV_LSB;
  177. uint32_t d_WLAN_PLL_CONTROL_REFDIV_MASK;
  178. uint32_t d_WLAN_PLL_CONTROL_REFDIV_RESET;
  179. uint32_t d_WLAN_PLL_CONTROL_DIV_MSB;
  180. uint32_t d_WLAN_PLL_CONTROL_DIV_LSB;
  181. uint32_t d_WLAN_PLL_CONTROL_DIV_MASK;
  182. uint32_t d_WLAN_PLL_CONTROL_DIV_RESET;
  183. uint32_t d_WLAN_PLL_CONTROL_OFFSET;
  184. uint32_t d_WLAN_PLL_CONTROL_SW_MASK;
  185. uint32_t d_WLAN_PLL_CONTROL_RSTMASK;
  186. uint32_t d_WLAN_PLL_CONTROL_RESET;
  187. uint32_t d_SOC_CORE_CLK_CTRL_OFFSET;
  188. uint32_t d_SOC_CORE_CLK_CTRL_DIV_MSB;
  189. uint32_t d_SOC_CORE_CLK_CTRL_DIV_LSB;
  190. uint32_t d_SOC_CORE_CLK_CTRL_DIV_MASK;
  191. uint32_t d_RTC_SYNC_STATUS_PLL_CHANGING_MSB;
  192. uint32_t d_RTC_SYNC_STATUS_PLL_CHANGING_LSB;
  193. uint32_t d_RTC_SYNC_STATUS_PLL_CHANGING_MASK;
  194. uint32_t d_RTC_SYNC_STATUS_PLL_CHANGING_RESET;
  195. uint32_t d_RTC_SYNC_STATUS_OFFSET;
  196. uint32_t d_SOC_CPU_CLOCK_OFFSET;
  197. uint32_t d_SOC_CPU_CLOCK_STANDARD_MSB;
  198. uint32_t d_SOC_CPU_CLOCK_STANDARD_LSB;
  199. uint32_t d_SOC_CPU_CLOCK_STANDARD_MASK;
  200. /* PLL end */
  201. uint32_t d_SOC_POWER_REG_OFFSET;
  202. uint32_t d_PCIE_INTR_CAUSE_ADDRESS;
  203. uint32_t d_SOC_RESET_CONTROL_ADDRESS;
  204. uint32_t d_SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_MASK;
  205. uint32_t d_SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_LSB;
  206. uint32_t d_SOC_RESET_CONTROL_CE_RST_MASK;
  207. uint32_t d_SOC_RESET_CONTROL_CPU_WARM_RST_MASK;
  208. uint32_t d_CPU_INTR_ADDRESS;
  209. uint32_t d_SOC_LF_TIMER_CONTROL0_ADDRESS;
  210. uint32_t d_SOC_LF_TIMER_CONTROL0_ENABLE_MASK;
  211. /* chip id start */
  212. uint32_t d_SOC_CHIP_ID_ADDRESS;
  213. uint32_t d_SOC_CHIP_ID_VERSION_MASK;
  214. uint32_t d_SOC_CHIP_ID_VERSION_LSB;
  215. uint32_t d_SOC_CHIP_ID_REVISION_MASK;
  216. uint32_t d_SOC_CHIP_ID_REVISION_LSB;
  217. /* chip id end */
  218. uint32_t d_A_SOC_CORE_SCRATCH_0_ADDRESS;
  219. uint32_t d_A_SOC_CORE_SCRATCH_1_ADDRESS;
  220. uint32_t d_A_SOC_CORE_SCRATCH_2_ADDRESS;
  221. uint32_t d_A_SOC_CORE_SCRATCH_3_ADDRESS;
  222. uint32_t d_A_SOC_CORE_SCRATCH_4_ADDRESS;
  223. uint32_t d_A_SOC_CORE_SCRATCH_5_ADDRESS;
  224. uint32_t d_A_SOC_CORE_SCRATCH_6_ADDRESS;
  225. uint32_t d_A_SOC_CORE_SCRATCH_7_ADDRESS;
  226. uint32_t d_A_SOC_CORE_SPARE_0_REGISTER;
  227. uint32_t d_PCIE_INTR_FIRMWARE_ROUTE_MASK;
  228. uint32_t d_A_SOC_CORE_PCIE_INTR_CAUSE_GRP1;
  229. uint32_t d_A_SOC_CORE_SPARE_1_REGISTER;
  230. uint32_t d_A_SOC_CORE_PCIE_INTR_CLR_GRP1;
  231. uint32_t d_A_SOC_CORE_PCIE_INTR_ENABLE_GRP1;
  232. uint32_t d_A_SOC_PCIE_PCIE_SCRATCH_0;
  233. uint32_t d_A_SOC_PCIE_PCIE_SCRATCH_1;
  234. uint32_t d_A_WIFI_APB_1_A_WFSS_CE_TARGET_HOST_DELTA;
  235. uint32_t d_A_SOC_PCIE_PCIE_SCRATCH_2;
  236. uint32_t d_A_SOC_CORE_PCIE_INTR_ENABLE_GRP0_Q6_MASK;
  237. uint32_t d_WLAN_DEBUG_INPUT_SEL_OFFSET;
  238. uint32_t d_WLAN_DEBUG_INPUT_SEL_SRC_MSB;
  239. uint32_t d_WLAN_DEBUG_INPUT_SEL_SRC_LSB;
  240. uint32_t d_WLAN_DEBUG_INPUT_SEL_SRC_MASK;
  241. uint32_t d_WLAN_DEBUG_CONTROL_OFFSET;
  242. uint32_t d_WLAN_DEBUG_CONTROL_ENABLE_MSB;
  243. uint32_t d_WLAN_DEBUG_CONTROL_ENABLE_LSB;
  244. uint32_t d_WLAN_DEBUG_CONTROL_ENABLE_MASK;
  245. uint32_t d_WLAN_DEBUG_OUT_OFFSET;
  246. uint32_t d_WLAN_DEBUG_OUT_DATA_MSB;
  247. uint32_t d_WLAN_DEBUG_OUT_DATA_LSB;
  248. uint32_t d_WLAN_DEBUG_OUT_DATA_MASK;
  249. uint32_t d_AMBA_DEBUG_BUS_OFFSET;
  250. uint32_t d_AMBA_DEBUG_BUS_PCIE_DEBUG_SEL_MSB;
  251. uint32_t d_AMBA_DEBUG_BUS_PCIE_DEBUG_SEL_LSB;
  252. uint32_t d_AMBA_DEBUG_BUS_PCIE_DEBUG_SEL_MASK;
  253. uint32_t d_AMBA_DEBUG_BUS_SEL_MSB;
  254. uint32_t d_AMBA_DEBUG_BUS_SEL_LSB;
  255. uint32_t d_AMBA_DEBUG_BUS_SEL_MASK;
  256. #ifdef QCA_WIFI_3_0_ADRASTEA
  257. uint32_t d_Q6_ENABLE_REGISTER_0;
  258. uint32_t d_Q6_ENABLE_REGISTER_1;
  259. uint32_t d_Q6_CAUSE_REGISTER_0;
  260. uint32_t d_Q6_CAUSE_REGISTER_1;
  261. uint32_t d_Q6_CLEAR_REGISTER_0;
  262. uint32_t d_Q6_CLEAR_REGISTER_1;
  263. #endif
  264. };
  265. #define A_SOC_CORE_PCIE_INTR_ENABLE_GRP0_Q6_MASK \
  266. (scn->targetdef->d_A_SOC_CORE_PCIE_INTR_ENABLE_GRP0_Q6_MASK)
  267. #define A_SOC_CORE_PCIE_INTR_CAUSE_GRP1 \
  268. (scn->targetdef->d_A_SOC_CORE_PCIE_INTR_CAUSE_GRP1)
  269. #define A_SOC_CORE_SPARE_1_REGISTER \
  270. (scn->targetdef->d_A_SOC_CORE_SPARE_1_REGISTER)
  271. #define A_SOC_CORE_PCIE_INTR_CLR_GRP1 \
  272. (scn->targetdef->d_A_SOC_CORE_PCIE_INTR_CLR_GRP1)
  273. #define A_SOC_CORE_PCIE_INTR_ENABLE_GRP1 \
  274. (scn->targetdef->d_A_SOC_CORE_PCIE_INTR_ENABLE_GRP1)
  275. #define A_SOC_PCIE_PCIE_SCRATCH_0 \
  276. (scn->targetdef->d_A_SOC_PCIE_PCIE_SCRATCH_0)
  277. #define A_SOC_PCIE_PCIE_SCRATCH_1 \
  278. (scn->targetdef->d_A_SOC_PCIE_PCIE_SCRATCH_1)
  279. #define A_WIFI_APB_1_A_WFSS_CE_TARGET_HOST_DELTA \
  280. (scn->targetdef->d_A_WIFI_APB_1_A_WFSS_CE_TARGET_HOST_DELTA)
  281. #define A_SOC_PCIE_PCIE_SCRATCH_2 \
  282. (scn->targetdef->d_A_SOC_PCIE_PCIE_SCRATCH_2)
  283. /* end Q6 iHelium emu registers */
  284. #define PCIE_INTR_FIRMWARE_ROUTE_MASK \
  285. (scn->targetdef->d_PCIE_INTR_FIRMWARE_ROUTE_MASK)
  286. #define A_SOC_CORE_SPARE_0_REGISTER \
  287. (scn->targetdef->d_A_SOC_CORE_SPARE_0_REGISTER)
  288. #define A_SOC_CORE_SCRATCH_0_ADDRESS \
  289. (scn->targetdef->d_A_SOC_CORE_SCRATCH_0_ADDRESS)
  290. #define A_SOC_CORE_SCRATCH_1_ADDRESS \
  291. (scn->targetdef->d_A_SOC_CORE_SCRATCH_1_ADDRESS)
  292. #define A_SOC_CORE_SCRATCH_2_ADDRESS \
  293. (scn->targetdef->d_A_SOC_CORE_SCRATCH_2_ADDRESS)
  294. #define A_SOC_CORE_SCRATCH_3_ADDRESS \
  295. (scn->targetdef->d_A_SOC_CORE_SCRATCH_3_ADDRESS)
  296. #define A_SOC_CORE_SCRATCH_4_ADDRESS \
  297. (scn->targetdef->d_A_SOC_CORE_SCRATCH_4_ADDRESS)
  298. #define A_SOC_CORE_SCRATCH_5_ADDRESS \
  299. (scn->targetdef->d_A_SOC_CORE_SCRATCH_5_ADDRESS)
  300. #define A_SOC_CORE_SCRATCH_6_ADDRESS \
  301. (scn->targetdef->d_A_SOC_CORE_SCRATCH_6_ADDRESS)
  302. #define A_SOC_CORE_SCRATCH_7_ADDRESS \
  303. (scn->targetdef->d_A_SOC_CORE_SCRATCH_7_ADDRESS)
  304. #define RTC_SOC_BASE_ADDRESS (scn->targetdef->d_RTC_SOC_BASE_ADDRESS)
  305. #define RTC_WMAC_BASE_ADDRESS (scn->targetdef->d_RTC_WMAC_BASE_ADDRESS)
  306. #define SYSTEM_SLEEP_OFFSET (scn->targetdef->d_SYSTEM_SLEEP_OFFSET)
  307. #define WLAN_SYSTEM_SLEEP_OFFSET \
  308. (scn->targetdef->d_WLAN_SYSTEM_SLEEP_OFFSET)
  309. #define WLAN_SYSTEM_SLEEP_DISABLE_LSB \
  310. (scn->targetdef->d_WLAN_SYSTEM_SLEEP_DISABLE_LSB)
  311. #define WLAN_SYSTEM_SLEEP_DISABLE_MASK \
  312. (scn->targetdef->d_WLAN_SYSTEM_SLEEP_DISABLE_MASK)
  313. #define CLOCK_CONTROL_OFFSET (scn->targetdef->d_CLOCK_CONTROL_OFFSET)
  314. #define CLOCK_CONTROL_SI0_CLK_MASK \
  315. (scn->targetdef->d_CLOCK_CONTROL_SI0_CLK_MASK)
  316. #define RESET_CONTROL_OFFSET (scn->targetdef->d_RESET_CONTROL_OFFSET)
  317. #define RESET_CONTROL_MBOX_RST_MASK \
  318. (scn->targetdef->d_RESET_CONTROL_MBOX_RST_MASK)
  319. #define RESET_CONTROL_SI0_RST_MASK \
  320. (scn->targetdef->d_RESET_CONTROL_SI0_RST_MASK)
  321. #define WLAN_RESET_CONTROL_OFFSET \
  322. (scn->targetdef->d_WLAN_RESET_CONTROL_OFFSET)
  323. #define WLAN_RESET_CONTROL_COLD_RST_MASK \
  324. (scn->targetdef->d_WLAN_RESET_CONTROL_COLD_RST_MASK)
  325. #define WLAN_RESET_CONTROL_WARM_RST_MASK \
  326. (scn->targetdef->d_WLAN_RESET_CONTROL_WARM_RST_MASK)
  327. #define GPIO_BASE_ADDRESS (scn->targetdef->d_GPIO_BASE_ADDRESS)
  328. #define GPIO_PIN0_OFFSET (scn->targetdef->d_GPIO_PIN0_OFFSET)
  329. #define GPIO_PIN1_OFFSET (scn->targetdef->d_GPIO_PIN1_OFFSET)
  330. #define GPIO_PIN0_CONFIG_MASK (scn->targetdef->d_GPIO_PIN0_CONFIG_MASK)
  331. #define GPIO_PIN1_CONFIG_MASK (scn->targetdef->d_GPIO_PIN1_CONFIG_MASK)
  332. #define A_SOC_CORE_SCRATCH_0 (scn->targetdef->d_A_SOC_CORE_SCRATCH_0)
  333. #define SI_CONFIG_BIDIR_OD_DATA_LSB \
  334. (scn->targetdef->d_SI_CONFIG_BIDIR_OD_DATA_LSB)
  335. #define SI_CONFIG_BIDIR_OD_DATA_MASK \
  336. (scn->targetdef->d_SI_CONFIG_BIDIR_OD_DATA_MASK)
  337. #define SI_CONFIG_I2C_LSB (scn->targetdef->d_SI_CONFIG_I2C_LSB)
  338. #define SI_CONFIG_I2C_MASK \
  339. (scn->targetdef->d_SI_CONFIG_I2C_MASK)
  340. #define SI_CONFIG_POS_SAMPLE_LSB \
  341. (scn->targetdef->d_SI_CONFIG_POS_SAMPLE_LSB)
  342. #define SI_CONFIG_POS_SAMPLE_MASK \
  343. (scn->targetdef->d_SI_CONFIG_POS_SAMPLE_MASK)
  344. #define SI_CONFIG_INACTIVE_CLK_LSB \
  345. (scn->targetdef->d_SI_CONFIG_INACTIVE_CLK_LSB)
  346. #define SI_CONFIG_INACTIVE_CLK_MASK \
  347. (scn->targetdef->d_SI_CONFIG_INACTIVE_CLK_MASK)
  348. #define SI_CONFIG_INACTIVE_DATA_LSB \
  349. (scn->targetdef->d_SI_CONFIG_INACTIVE_DATA_LSB)
  350. #define SI_CONFIG_INACTIVE_DATA_MASK \
  351. (scn->targetdef->d_SI_CONFIG_INACTIVE_DATA_MASK)
  352. #define SI_CONFIG_DIVIDER_LSB (scn->targetdef->d_SI_CONFIG_DIVIDER_LSB)
  353. #define SI_CONFIG_DIVIDER_MASK (scn->targetdef->d_SI_CONFIG_DIVIDER_MASK)
  354. #define SI_BASE_ADDRESS (scn->targetdef->d_SI_BASE_ADDRESS)
  355. #define SI_CONFIG_OFFSET (scn->targetdef->d_SI_CONFIG_OFFSET)
  356. #define SI_TX_DATA0_OFFSET (scn->targetdef->d_SI_TX_DATA0_OFFSET)
  357. #define SI_TX_DATA1_OFFSET (scn->targetdef->d_SI_TX_DATA1_OFFSET)
  358. #define SI_RX_DATA0_OFFSET (scn->targetdef->d_SI_RX_DATA0_OFFSET)
  359. #define SI_RX_DATA1_OFFSET (scn->targetdef->d_SI_RX_DATA1_OFFSET)
  360. #define SI_CS_OFFSET (scn->targetdef->d_SI_CS_OFFSET)
  361. #define SI_CS_DONE_ERR_MASK (scn->targetdef->d_SI_CS_DONE_ERR_MASK)
  362. #define SI_CS_DONE_INT_MASK (scn->targetdef->d_SI_CS_DONE_INT_MASK)
  363. #define SI_CS_START_LSB (scn->targetdef->d_SI_CS_START_LSB)
  364. #define SI_CS_START_MASK (scn->targetdef->d_SI_CS_START_MASK)
  365. #define SI_CS_RX_CNT_LSB (scn->targetdef->d_SI_CS_RX_CNT_LSB)
  366. #define SI_CS_RX_CNT_MASK (scn->targetdef->d_SI_CS_RX_CNT_MASK)
  367. #define SI_CS_TX_CNT_LSB (scn->targetdef->d_SI_CS_TX_CNT_LSB)
  368. #define SI_CS_TX_CNT_MASK (scn->targetdef->d_SI_CS_TX_CNT_MASK)
  369. #define EEPROM_SZ (scn->targetdef->d_BOARD_DATA_SZ)
  370. #define EEPROM_EXT_SZ (scn->targetdef->d_BOARD_EXT_DATA_SZ)
  371. #define MBOX_BASE_ADDRESS (scn->targetdef->d_MBOX_BASE_ADDRESS)
  372. #define LOCAL_SCRATCH_OFFSET (scn->targetdef->d_LOCAL_SCRATCH_OFFSET)
  373. #define CPU_CLOCK_OFFSET (scn->targetdef->d_CPU_CLOCK_OFFSET)
  374. #define LPO_CAL_OFFSET (scn->targetdef->d_LPO_CAL_OFFSET)
  375. #define GPIO_PIN10_OFFSET (scn->targetdef->d_GPIO_PIN10_OFFSET)
  376. #define GPIO_PIN11_OFFSET (scn->targetdef->d_GPIO_PIN11_OFFSET)
  377. #define GPIO_PIN12_OFFSET (scn->targetdef->d_GPIO_PIN12_OFFSET)
  378. #define GPIO_PIN13_OFFSET (scn->targetdef->d_GPIO_PIN13_OFFSET)
  379. #define CLOCK_GPIO_OFFSET (scn->targetdef->d_CLOCK_GPIO_OFFSET)
  380. #define CPU_CLOCK_STANDARD_LSB (scn->targetdef->d_CPU_CLOCK_STANDARD_LSB)
  381. #define CPU_CLOCK_STANDARD_MASK (scn->targetdef->d_CPU_CLOCK_STANDARD_MASK)
  382. #define LPO_CAL_ENABLE_LSB (scn->targetdef->d_LPO_CAL_ENABLE_LSB)
  383. #define LPO_CAL_ENABLE_MASK (scn->targetdef->d_LPO_CAL_ENABLE_MASK)
  384. #define CLOCK_GPIO_BT_CLK_OUT_EN_LSB \
  385. (scn->targetdef->d_CLOCK_GPIO_BT_CLK_OUT_EN_LSB)
  386. #define CLOCK_GPIO_BT_CLK_OUT_EN_MASK \
  387. (scn->targetdef->d_CLOCK_GPIO_BT_CLK_OUT_EN_MASK)
  388. #define ANALOG_INTF_BASE_ADDRESS (scn->targetdef->d_ANALOG_INTF_BASE_ADDRESS)
  389. #define WLAN_MAC_BASE_ADDRESS (scn->targetdef->d_WLAN_MAC_BASE_ADDRESS)
  390. #define FW_INDICATOR_ADDRESS (scn->targetdef->d_FW_INDICATOR_ADDRESS)
  391. #define DRAM_BASE_ADDRESS (scn->targetdef->d_DRAM_BASE_ADDRESS)
  392. #define SOC_CORE_BASE_ADDRESS (scn->targetdef->d_SOC_CORE_BASE_ADDRESS)
  393. #define CORE_CTRL_ADDRESS (scn->targetdef->d_CORE_CTRL_ADDRESS)
  394. #define CE_COUNT (scn->targetdef->d_CE_COUNT)
  395. #define PCIE_INTR_ENABLE_ADDRESS (scn->targetdef->d_PCIE_INTR_ENABLE_ADDRESS)
  396. #define PCIE_INTR_CLR_ADDRESS (scn->targetdef->d_PCIE_INTR_CLR_ADDRESS)
  397. #define PCIE_INTR_FIRMWARE_MASK (scn->targetdef->d_PCIE_INTR_FIRMWARE_MASK)
  398. #define PCIE_INTR_CE_MASK_ALL (scn->targetdef->d_PCIE_INTR_CE_MASK_ALL)
  399. #define CORE_CTRL_CPU_INTR_MASK (scn->targetdef->d_CORE_CTRL_CPU_INTR_MASK)
  400. #define PCIE_INTR_CAUSE_ADDRESS (scn->targetdef->d_PCIE_INTR_CAUSE_ADDRESS)
  401. #define SOC_RESET_CONTROL_ADDRESS (scn->targetdef->d_SOC_RESET_CONTROL_ADDRESS)
  402. #define HOST_GROUP0_MASK (PCIE_INTR_FIRMWARE_MASK | PCIE_INTR_CE_MASK_ALL | \
  403. A_SOC_CORE_PCIE_INTR_ENABLE_GRP0_Q6_MASK)
  404. #define SOC_RESET_CONTROL_CE_RST_MASK \
  405. (scn->targetdef->d_SOC_RESET_CONTROL_CE_RST_MASK)
  406. #define SOC_RESET_CONTROL_CPU_WARM_RST_MASK \
  407. (scn->targetdef->d_SOC_RESET_CONTROL_CPU_WARM_RST_MASK)
  408. #define CPU_INTR_ADDRESS (scn->targetdef->d_CPU_INTR_ADDRESS)
  409. #define SOC_LF_TIMER_CONTROL0_ADDRESS \
  410. (scn->targetdef->d_SOC_LF_TIMER_CONTROL0_ADDRESS)
  411. #define SOC_LF_TIMER_CONTROL0_ENABLE_MASK \
  412. (scn->targetdef->d_SOC_LF_TIMER_CONTROL0_ENABLE_MASK)
  413. #define SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_LSB \
  414. (scn->targetdef->d_SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_LSB)
  415. #define SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_MASK \
  416. (scn->targetdef->d_SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_MASK)
  417. #define SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_GET(x) \
  418. (((x) & SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_MASK) >> \
  419. SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_LSB)
  420. #define SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_SET(x) \
  421. (((x) << SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_LSB) & \
  422. SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_MASK)
  423. /* hif_pci.c */
  424. #define CHIP_ID_ADDRESS (scn->targetdef->d_SOC_CHIP_ID_ADDRESS)
  425. #define SOC_CHIP_ID_REVISION_MASK (scn->targetdef->d_SOC_CHIP_ID_REVISION_MASK)
  426. #define SOC_CHIP_ID_REVISION_LSB (scn->targetdef->d_SOC_CHIP_ID_REVISION_LSB)
  427. #define SOC_CHIP_ID_VERSION_MASK (scn->targetdef->d_SOC_CHIP_ID_VERSION_MASK)
  428. #define SOC_CHIP_ID_VERSION_LSB (scn->targetdef->d_SOC_CHIP_ID_VERSION_LSB)
  429. #define CHIP_ID_REVISION_GET(x) \
  430. (((x) & SOC_CHIP_ID_REVISION_MASK) >> SOC_CHIP_ID_REVISION_LSB)
  431. #define CHIP_ID_VERSION_GET(x) \
  432. (((x) & SOC_CHIP_ID_VERSION_MASK) >> SOC_CHIP_ID_VERSION_LSB)
  433. /* hif_pci.c end */
  434. /* misc */
  435. #define SR_WR_INDEX_ADDRESS (scn->targetdef->d_SR_WR_INDEX_ADDRESS)
  436. #define DST_WATERMARK_ADDRESS (scn->targetdef->d_DST_WATERMARK_ADDRESS)
  437. #define SOC_POWER_REG_OFFSET (scn->targetdef->d_SOC_POWER_REG_OFFSET)
  438. /* end */
  439. /* htt_rx.c */
  440. #define RX_MSDU_END_4_FIRST_MSDU_MASK \
  441. (pdev->targetdef->d_RX_MSDU_END_4_FIRST_MSDU_MASK)
  442. #define RX_MSDU_END_4_FIRST_MSDU_LSB \
  443. (pdev->targetdef->d_RX_MSDU_END_4_FIRST_MSDU_LSB)
  444. #define RX_MPDU_START_0_RETRY_LSB \
  445. (pdev->targetdef->d_RX_MPDU_START_0_RETRY_LSB)
  446. #define RX_MPDU_START_0_RETRY_MASK \
  447. (pdev->targetdef->d_RX_MPDU_START_0_RETRY_MASK)
  448. #define RX_MPDU_START_0_SEQ_NUM_MASK \
  449. (pdev->targetdef->d_RX_MPDU_START_0_SEQ_NUM_MASK)
  450. #define RX_MPDU_START_0_SEQ_NUM_LSB \
  451. (pdev->targetdef->d_RX_MPDU_START_0_SEQ_NUM_LSB)
  452. #define RX_MPDU_START_2_PN_47_32_LSB \
  453. (pdev->targetdef->d_RX_MPDU_START_2_PN_47_32_LSB)
  454. #define RX_MPDU_START_2_PN_47_32_MASK \
  455. (pdev->targetdef->d_RX_MPDU_START_2_PN_47_32_MASK)
  456. #define RX_MPDU_START_2_TID_LSB \
  457. (pdev->targetdef->d_RX_MPDU_START_2_TID_LSB)
  458. #define RX_MPDU_START_2_TID_MASK \
  459. (pdev->targetdef->d_RX_MPDU_START_2_TID_MASK)
  460. #define RX_MSDU_END_1_KEY_ID_OCT_MASK \
  461. (pdev->targetdef->d_RX_MSDU_END_1_KEY_ID_OCT_MASK)
  462. #define RX_MSDU_END_1_KEY_ID_OCT_LSB \
  463. (pdev->targetdef->d_RX_MSDU_END_1_KEY_ID_OCT_LSB)
  464. #define RX_MSDU_END_1_EXT_WAPI_PN_63_48_MASK \
  465. (pdev->targetdef->d_RX_MSDU_END_1_EXT_WAPI_PN_63_48_MASK)
  466. #define RX_MSDU_END_1_EXT_WAPI_PN_63_48_LSB \
  467. (pdev->targetdef->d_RX_MSDU_END_1_EXT_WAPI_PN_63_48_LSB)
  468. #define RX_MSDU_END_4_LAST_MSDU_MASK \
  469. (pdev->targetdef->d_RX_MSDU_END_4_LAST_MSDU_MASK)
  470. #define RX_MSDU_END_4_LAST_MSDU_LSB \
  471. (pdev->targetdef->d_RX_MSDU_END_4_LAST_MSDU_LSB)
  472. #define RX_ATTENTION_0_MCAST_BCAST_MASK \
  473. (pdev->targetdef->d_RX_ATTENTION_0_MCAST_BCAST_MASK)
  474. #define RX_ATTENTION_0_MCAST_BCAST_LSB \
  475. (pdev->targetdef->d_RX_ATTENTION_0_MCAST_BCAST_LSB)
  476. #define RX_ATTENTION_0_FRAGMENT_MASK \
  477. (pdev->targetdef->d_RX_ATTENTION_0_FRAGMENT_MASK)
  478. #define RX_ATTENTION_0_FRAGMENT_LSB \
  479. (pdev->targetdef->d_RX_ATTENTION_0_FRAGMENT_LSB)
  480. #define RX_ATTENTION_0_MPDU_LENGTH_ERR_MASK \
  481. (pdev->targetdef->d_RX_ATTENTION_0_MPDU_LENGTH_ERR_MASK)
  482. #define RX_FRAG_INFO_0_RING2_MORE_COUNT_MASK \
  483. (pdev->targetdef->d_RX_FRAG_INFO_0_RING2_MORE_COUNT_MASK)
  484. #define RX_FRAG_INFO_0_RING2_MORE_COUNT_LSB \
  485. (pdev->targetdef->d_RX_FRAG_INFO_0_RING2_MORE_COUNT_LSB)
  486. #define RX_MSDU_START_0_MSDU_LENGTH_MASK \
  487. (pdev->targetdef->d_RX_MSDU_START_0_MSDU_LENGTH_MASK)
  488. #define RX_MSDU_START_0_MSDU_LENGTH_LSB \
  489. (pdev->targetdef->d_RX_MSDU_START_0_MSDU_LENGTH_LSB)
  490. #define RX_MSDU_START_2_DECAP_FORMAT_OFFSET \
  491. (pdev->targetdef->d_RX_MSDU_START_2_DECAP_FORMAT_OFFSET)
  492. #define RX_MSDU_START_2_DECAP_FORMAT_MASK \
  493. (pdev->targetdef->d_RX_MSDU_START_2_DECAP_FORMAT_MASK)
  494. #define RX_MSDU_START_2_DECAP_FORMAT_LSB \
  495. (pdev->targetdef->d_RX_MSDU_START_2_DECAP_FORMAT_LSB)
  496. #define RX_MPDU_START_0_ENCRYPTED_MASK \
  497. (pdev->targetdef->d_RX_MPDU_START_0_ENCRYPTED_MASK)
  498. #define RX_MPDU_START_0_ENCRYPTED_LSB \
  499. (pdev->targetdef->d_RX_MPDU_START_0_ENCRYPTED_LSB)
  500. #define RX_ATTENTION_0_MORE_DATA_MASK \
  501. (pdev->targetdef->d_RX_ATTENTION_0_MORE_DATA_MASK)
  502. #define RX_ATTENTION_0_MSDU_DONE_MASK \
  503. (pdev->targetdef->d_RX_ATTENTION_0_MSDU_DONE_MASK)
  504. #define RX_ATTENTION_0_TCP_UDP_CHKSUM_FAIL_MASK \
  505. (pdev->targetdef->d_RX_ATTENTION_0_TCP_UDP_CHKSUM_FAIL_MASK)
  506. /* end */
  507. /* copy_engine.c */
  508. /* end */
  509. /* PLL start */
  510. #define EFUSE_OFFSET (scn->targetdef->d_EFUSE_OFFSET)
  511. #define EFUSE_XTAL_SEL_MSB (scn->targetdef->d_EFUSE_XTAL_SEL_MSB)
  512. #define EFUSE_XTAL_SEL_LSB (scn->targetdef->d_EFUSE_XTAL_SEL_LSB)
  513. #define EFUSE_XTAL_SEL_MASK (scn->targetdef->d_EFUSE_XTAL_SEL_MASK)
  514. #define BB_PLL_CONFIG_OFFSET (scn->targetdef->d_BB_PLL_CONFIG_OFFSET)
  515. #define BB_PLL_CONFIG_OUTDIV_MSB (scn->targetdef->d_BB_PLL_CONFIG_OUTDIV_MSB)
  516. #define BB_PLL_CONFIG_OUTDIV_LSB (scn->targetdef->d_BB_PLL_CONFIG_OUTDIV_LSB)
  517. #define BB_PLL_CONFIG_OUTDIV_MASK (scn->targetdef->d_BB_PLL_CONFIG_OUTDIV_MASK)
  518. #define BB_PLL_CONFIG_FRAC_MSB (scn->targetdef->d_BB_PLL_CONFIG_FRAC_MSB)
  519. #define BB_PLL_CONFIG_FRAC_LSB (scn->targetdef->d_BB_PLL_CONFIG_FRAC_LSB)
  520. #define BB_PLL_CONFIG_FRAC_MASK (scn->targetdef->d_BB_PLL_CONFIG_FRAC_MASK)
  521. #define WLAN_PLL_SETTLE_TIME_MSB (scn->targetdef->d_WLAN_PLL_SETTLE_TIME_MSB)
  522. #define WLAN_PLL_SETTLE_TIME_LSB (scn->targetdef->d_WLAN_PLL_SETTLE_TIME_LSB)
  523. #define WLAN_PLL_SETTLE_TIME_MASK (scn->targetdef->d_WLAN_PLL_SETTLE_TIME_MASK)
  524. #define WLAN_PLL_SETTLE_OFFSET (scn->targetdef->d_WLAN_PLL_SETTLE_OFFSET)
  525. #define WLAN_PLL_SETTLE_SW_MASK (scn->targetdef->d_WLAN_PLL_SETTLE_SW_MASK)
  526. #define WLAN_PLL_SETTLE_RSTMASK (scn->targetdef->d_WLAN_PLL_SETTLE_RSTMASK)
  527. #define WLAN_PLL_SETTLE_RESET (scn->targetdef->d_WLAN_PLL_SETTLE_RESET)
  528. #define WLAN_PLL_CONTROL_NOPWD_MSB \
  529. (scn->targetdef->d_WLAN_PLL_CONTROL_NOPWD_MSB)
  530. #define WLAN_PLL_CONTROL_NOPWD_LSB \
  531. (scn->targetdef->d_WLAN_PLL_CONTROL_NOPWD_LSB)
  532. #define WLAN_PLL_CONTROL_NOPWD_MASK \
  533. (scn->targetdef->d_WLAN_PLL_CONTROL_NOPWD_MASK)
  534. #define WLAN_PLL_CONTROL_BYPASS_MSB \
  535. (scn->targetdef->d_WLAN_PLL_CONTROL_BYPASS_MSB)
  536. #define WLAN_PLL_CONTROL_BYPASS_LSB \
  537. (scn->targetdef->d_WLAN_PLL_CONTROL_BYPASS_LSB)
  538. #define WLAN_PLL_CONTROL_BYPASS_MASK \
  539. (scn->targetdef->d_WLAN_PLL_CONTROL_BYPASS_MASK)
  540. #define WLAN_PLL_CONTROL_BYPASS_RESET \
  541. (scn->targetdef->d_WLAN_PLL_CONTROL_BYPASS_RESET)
  542. #define WLAN_PLL_CONTROL_CLK_SEL_MSB \
  543. (scn->targetdef->d_WLAN_PLL_CONTROL_CLK_SEL_MSB)
  544. #define WLAN_PLL_CONTROL_CLK_SEL_LSB \
  545. (scn->targetdef->d_WLAN_PLL_CONTROL_CLK_SEL_LSB)
  546. #define WLAN_PLL_CONTROL_CLK_SEL_MASK \
  547. (scn->targetdef->d_WLAN_PLL_CONTROL_CLK_SEL_MASK)
  548. #define WLAN_PLL_CONTROL_CLK_SEL_RESET \
  549. (scn->targetdef->d_WLAN_PLL_CONTROL_CLK_SEL_RESET)
  550. #define WLAN_PLL_CONTROL_REFDIV_MSB \
  551. (scn->targetdef->d_WLAN_PLL_CONTROL_REFDIV_MSB)
  552. #define WLAN_PLL_CONTROL_REFDIV_LSB \
  553. (scn->targetdef->d_WLAN_PLL_CONTROL_REFDIV_LSB)
  554. #define WLAN_PLL_CONTROL_REFDIV_MASK \
  555. (scn->targetdef->d_WLAN_PLL_CONTROL_REFDIV_MASK)
  556. #define WLAN_PLL_CONTROL_REFDIV_RESET \
  557. (scn->targetdef->d_WLAN_PLL_CONTROL_REFDIV_RESET)
  558. #define WLAN_PLL_CONTROL_DIV_MSB (scn->targetdef->d_WLAN_PLL_CONTROL_DIV_MSB)
  559. #define WLAN_PLL_CONTROL_DIV_LSB (scn->targetdef->d_WLAN_PLL_CONTROL_DIV_LSB)
  560. #define WLAN_PLL_CONTROL_DIV_MASK (scn->targetdef->d_WLAN_PLL_CONTROL_DIV_MASK)
  561. #define WLAN_PLL_CONTROL_DIV_RESET \
  562. (scn->targetdef->d_WLAN_PLL_CONTROL_DIV_RESET)
  563. #define WLAN_PLL_CONTROL_OFFSET (scn->targetdef->d_WLAN_PLL_CONTROL_OFFSET)
  564. #define WLAN_PLL_CONTROL_SW_MASK (scn->targetdef->d_WLAN_PLL_CONTROL_SW_MASK)
  565. #define WLAN_PLL_CONTROL_RSTMASK (scn->targetdef->d_WLAN_PLL_CONTROL_RSTMASK)
  566. #define WLAN_PLL_CONTROL_RESET (scn->targetdef->d_WLAN_PLL_CONTROL_RESET)
  567. #define SOC_CORE_CLK_CTRL_OFFSET (scn->targetdef->d_SOC_CORE_CLK_CTRL_OFFSET)
  568. #define SOC_CORE_CLK_CTRL_DIV_MSB (scn->targetdef->d_SOC_CORE_CLK_CTRL_DIV_MSB)
  569. #define SOC_CORE_CLK_CTRL_DIV_LSB (scn->targetdef->d_SOC_CORE_CLK_CTRL_DIV_LSB)
  570. #define SOC_CORE_CLK_CTRL_DIV_MASK \
  571. (scn->targetdef->d_SOC_CORE_CLK_CTRL_DIV_MASK)
  572. #define RTC_SYNC_STATUS_PLL_CHANGING_MSB \
  573. (scn->targetdef->d_RTC_SYNC_STATUS_PLL_CHANGING_MSB)
  574. #define RTC_SYNC_STATUS_PLL_CHANGING_LSB \
  575. (scn->targetdef->d_RTC_SYNC_STATUS_PLL_CHANGING_LSB)
  576. #define RTC_SYNC_STATUS_PLL_CHANGING_MASK \
  577. (scn->targetdef->d_RTC_SYNC_STATUS_PLL_CHANGING_MASK)
  578. #define RTC_SYNC_STATUS_PLL_CHANGING_RESET \
  579. (scn->targetdef->d_RTC_SYNC_STATUS_PLL_CHANGING_RESET)
  580. #define RTC_SYNC_STATUS_OFFSET (scn->targetdef->d_RTC_SYNC_STATUS_OFFSET)
  581. #define SOC_CPU_CLOCK_OFFSET (scn->targetdef->d_SOC_CPU_CLOCK_OFFSET)
  582. #define SOC_CPU_CLOCK_STANDARD_MSB \
  583. (scn->targetdef->d_SOC_CPU_CLOCK_STANDARD_MSB)
  584. #define SOC_CPU_CLOCK_STANDARD_LSB \
  585. (scn->targetdef->d_SOC_CPU_CLOCK_STANDARD_LSB)
  586. #define SOC_CPU_CLOCK_STANDARD_MASK \
  587. (scn->targetdef->d_SOC_CPU_CLOCK_STANDARD_MASK)
  588. /* PLL end */
  589. /* SET macros */
  590. #define WLAN_SYSTEM_SLEEP_DISABLE_SET(x) \
  591. (((x) << WLAN_SYSTEM_SLEEP_DISABLE_LSB) & \
  592. WLAN_SYSTEM_SLEEP_DISABLE_MASK)
  593. #define SI_CONFIG_BIDIR_OD_DATA_SET(x) \
  594. (((x) << SI_CONFIG_BIDIR_OD_DATA_LSB) & SI_CONFIG_BIDIR_OD_DATA_MASK)
  595. #define SI_CONFIG_I2C_SET(x) (((x) << SI_CONFIG_I2C_LSB) & SI_CONFIG_I2C_MASK)
  596. #define SI_CONFIG_POS_SAMPLE_SET(x) \
  597. (((x) << SI_CONFIG_POS_SAMPLE_LSB) & SI_CONFIG_POS_SAMPLE_MASK)
  598. #define SI_CONFIG_INACTIVE_CLK_SET(x) \
  599. (((x) << SI_CONFIG_INACTIVE_CLK_LSB) & SI_CONFIG_INACTIVE_CLK_MASK)
  600. #define SI_CONFIG_INACTIVE_DATA_SET(x) \
  601. (((x) << SI_CONFIG_INACTIVE_DATA_LSB) & SI_CONFIG_INACTIVE_DATA_MASK)
  602. #define SI_CONFIG_DIVIDER_SET(x) \
  603. (((x) << SI_CONFIG_DIVIDER_LSB) & SI_CONFIG_DIVIDER_MASK)
  604. #define SI_CS_START_SET(x) (((x) << SI_CS_START_LSB) & SI_CS_START_MASK)
  605. #define SI_CS_RX_CNT_SET(x) (((x) << SI_CS_RX_CNT_LSB) & SI_CS_RX_CNT_MASK)
  606. #define SI_CS_TX_CNT_SET(x) (((x) << SI_CS_TX_CNT_LSB) & SI_CS_TX_CNT_MASK)
  607. #define LPO_CAL_ENABLE_SET(x) \
  608. (((x) << LPO_CAL_ENABLE_LSB) & LPO_CAL_ENABLE_MASK)
  609. #define CPU_CLOCK_STANDARD_SET(x) \
  610. (((x) << CPU_CLOCK_STANDARD_LSB) & CPU_CLOCK_STANDARD_MASK)
  611. #define CLOCK_GPIO_BT_CLK_OUT_EN_SET(x) \
  612. (((x) << CLOCK_GPIO_BT_CLK_OUT_EN_LSB) & CLOCK_GPIO_BT_CLK_OUT_EN_MASK)
  613. /* copy_engine.c */
  614. /* end */
  615. /* PLL start */
  616. #define EFUSE_XTAL_SEL_GET(x) \
  617. (((x) & EFUSE_XTAL_SEL_MASK) >> EFUSE_XTAL_SEL_LSB)
  618. #define EFUSE_XTAL_SEL_SET(x) \
  619. (((x) << EFUSE_XTAL_SEL_LSB) & EFUSE_XTAL_SEL_MASK)
  620. #define BB_PLL_CONFIG_OUTDIV_GET(x) \
  621. (((x) & BB_PLL_CONFIG_OUTDIV_MASK) >> BB_PLL_CONFIG_OUTDIV_LSB)
  622. #define BB_PLL_CONFIG_OUTDIV_SET(x) \
  623. (((x) << BB_PLL_CONFIG_OUTDIV_LSB) & BB_PLL_CONFIG_OUTDIV_MASK)
  624. #define BB_PLL_CONFIG_FRAC_GET(x) \
  625. (((x) & BB_PLL_CONFIG_FRAC_MASK) >> BB_PLL_CONFIG_FRAC_LSB)
  626. #define BB_PLL_CONFIG_FRAC_SET(x) \
  627. (((x) << BB_PLL_CONFIG_FRAC_LSB) & BB_PLL_CONFIG_FRAC_MASK)
  628. #define WLAN_PLL_SETTLE_TIME_GET(x) \
  629. (((x) & WLAN_PLL_SETTLE_TIME_MASK) >> WLAN_PLL_SETTLE_TIME_LSB)
  630. #define WLAN_PLL_SETTLE_TIME_SET(x) \
  631. (((x) << WLAN_PLL_SETTLE_TIME_LSB) & WLAN_PLL_SETTLE_TIME_MASK)
  632. #define WLAN_PLL_CONTROL_NOPWD_GET(x) \
  633. (((x) & WLAN_PLL_CONTROL_NOPWD_MASK) >> WLAN_PLL_CONTROL_NOPWD_LSB)
  634. #define WLAN_PLL_CONTROL_NOPWD_SET(x) \
  635. (((x) << WLAN_PLL_CONTROL_NOPWD_LSB) & WLAN_PLL_CONTROL_NOPWD_MASK)
  636. #define WLAN_PLL_CONTROL_BYPASS_GET(x) \
  637. (((x) & WLAN_PLL_CONTROL_BYPASS_MASK) >> WLAN_PLL_CONTROL_BYPASS_LSB)
  638. #define WLAN_PLL_CONTROL_BYPASS_SET(x) \
  639. (((x) << WLAN_PLL_CONTROL_BYPASS_LSB) & WLAN_PLL_CONTROL_BYPASS_MASK)
  640. #define WLAN_PLL_CONTROL_CLK_SEL_GET(x) \
  641. (((x) & WLAN_PLL_CONTROL_CLK_SEL_MASK) >> WLAN_PLL_CONTROL_CLK_SEL_LSB)
  642. #define WLAN_PLL_CONTROL_CLK_SEL_SET(x) \
  643. (((x) << WLAN_PLL_CONTROL_CLK_SEL_LSB) & WLAN_PLL_CONTROL_CLK_SEL_MASK)
  644. #define WLAN_PLL_CONTROL_REFDIV_GET(x) \
  645. (((x) & WLAN_PLL_CONTROL_REFDIV_MASK) >> WLAN_PLL_CONTROL_REFDIV_LSB)
  646. #define WLAN_PLL_CONTROL_REFDIV_SET(x) \
  647. (((x) << WLAN_PLL_CONTROL_REFDIV_LSB) & WLAN_PLL_CONTROL_REFDIV_MASK)
  648. #define WLAN_PLL_CONTROL_DIV_GET(x) \
  649. (((x) & WLAN_PLL_CONTROL_DIV_MASK) >> WLAN_PLL_CONTROL_DIV_LSB)
  650. #define WLAN_PLL_CONTROL_DIV_SET(x) \
  651. (((x) << WLAN_PLL_CONTROL_DIV_LSB) & WLAN_PLL_CONTROL_DIV_MASK)
  652. #define SOC_CORE_CLK_CTRL_DIV_GET(x) \
  653. (((x) & SOC_CORE_CLK_CTRL_DIV_MASK) >> SOC_CORE_CLK_CTRL_DIV_LSB)
  654. #define SOC_CORE_CLK_CTRL_DIV_SET(x) \
  655. (((x) << SOC_CORE_CLK_CTRL_DIV_LSB) & SOC_CORE_CLK_CTRL_DIV_MASK)
  656. #define RTC_SYNC_STATUS_PLL_CHANGING_GET(x) \
  657. (((x) & RTC_SYNC_STATUS_PLL_CHANGING_MASK) >> \
  658. RTC_SYNC_STATUS_PLL_CHANGING_LSB)
  659. #define RTC_SYNC_STATUS_PLL_CHANGING_SET(x) \
  660. (((x) << RTC_SYNC_STATUS_PLL_CHANGING_LSB) & \
  661. RTC_SYNC_STATUS_PLL_CHANGING_MASK)
  662. #define SOC_CPU_CLOCK_STANDARD_GET(x) \
  663. (((x) & SOC_CPU_CLOCK_STANDARD_MASK) >> SOC_CPU_CLOCK_STANDARD_LSB)
  664. #define SOC_CPU_CLOCK_STANDARD_SET(x) \
  665. (((x) << SOC_CPU_CLOCK_STANDARD_LSB) & SOC_CPU_CLOCK_STANDARD_MASK)
  666. /* PLL end */
  667. #ifdef QCA_WIFI_3_0_ADRASTEA
  668. #define Q6_ENABLE_REGISTER_0 \
  669. (scn->targetdef->d_Q6_ENABLE_REGISTER_0)
  670. #define Q6_ENABLE_REGISTER_1 \
  671. (scn->targetdef->d_Q6_ENABLE_REGISTER_1)
  672. #define Q6_CAUSE_REGISTER_0 \
  673. (scn->targetdef->d_Q6_CAUSE_REGISTER_0)
  674. #define Q6_CAUSE_REGISTER_1 \
  675. (scn->targetdef->d_Q6_CAUSE_REGISTER_1)
  676. #define Q6_CLEAR_REGISTER_0 \
  677. (scn->targetdef->d_Q6_CLEAR_REGISTER_0)
  678. #define Q6_CLEAR_REGISTER_1 \
  679. (scn->targetdef->d_Q6_CLEAR_REGISTER_1)
  680. #endif
  681. struct hostdef_s {
  682. A_UINT32 d_INT_STATUS_ENABLE_ERROR_LSB;
  683. A_UINT32 d_INT_STATUS_ENABLE_ERROR_MASK;
  684. A_UINT32 d_INT_STATUS_ENABLE_CPU_LSB;
  685. A_UINT32 d_INT_STATUS_ENABLE_CPU_MASK;
  686. A_UINT32 d_INT_STATUS_ENABLE_COUNTER_LSB;
  687. A_UINT32 d_INT_STATUS_ENABLE_COUNTER_MASK;
  688. A_UINT32 d_INT_STATUS_ENABLE_MBOX_DATA_LSB;
  689. A_UINT32 d_INT_STATUS_ENABLE_MBOX_DATA_MASK;
  690. A_UINT32 d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB;
  691. A_UINT32 d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK;
  692. A_UINT32 d_ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB;
  693. A_UINT32 d_ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK;
  694. A_UINT32 d_COUNTER_INT_STATUS_ENABLE_BIT_LSB;
  695. A_UINT32 d_COUNTER_INT_STATUS_ENABLE_BIT_MASK;
  696. A_UINT32 d_INT_STATUS_ENABLE_ADDRESS;
  697. A_UINT32 d_CPU_INT_STATUS_ENABLE_BIT_LSB;
  698. A_UINT32 d_CPU_INT_STATUS_ENABLE_BIT_MASK;
  699. A_UINT32 d_HOST_INT_STATUS_ADDRESS;
  700. A_UINT32 d_CPU_INT_STATUS_ADDRESS;
  701. A_UINT32 d_ERROR_INT_STATUS_ADDRESS;
  702. A_UINT32 d_ERROR_INT_STATUS_WAKEUP_MASK;
  703. A_UINT32 d_ERROR_INT_STATUS_WAKEUP_LSB;
  704. A_UINT32 d_ERROR_INT_STATUS_RX_UNDERFLOW_MASK;
  705. A_UINT32 d_ERROR_INT_STATUS_RX_UNDERFLOW_LSB;
  706. A_UINT32 d_ERROR_INT_STATUS_TX_OVERFLOW_MASK;
  707. A_UINT32 d_ERROR_INT_STATUS_TX_OVERFLOW_LSB;
  708. A_UINT32 d_COUNT_DEC_ADDRESS;
  709. A_UINT32 d_HOST_INT_STATUS_CPU_MASK;
  710. A_UINT32 d_HOST_INT_STATUS_CPU_LSB;
  711. A_UINT32 d_HOST_INT_STATUS_ERROR_MASK;
  712. A_UINT32 d_HOST_INT_STATUS_ERROR_LSB;
  713. A_UINT32 d_HOST_INT_STATUS_COUNTER_MASK;
  714. A_UINT32 d_HOST_INT_STATUS_COUNTER_LSB;
  715. A_UINT32 d_RX_LOOKAHEAD_VALID_ADDRESS;
  716. A_UINT32 d_WINDOW_DATA_ADDRESS;
  717. A_UINT32 d_WINDOW_READ_ADDR_ADDRESS;
  718. A_UINT32 d_WINDOW_WRITE_ADDR_ADDRESS;
  719. A_UINT32 d_SOC_GLOBAL_RESET_ADDRESS;
  720. A_UINT32 d_RTC_STATE_ADDRESS;
  721. A_UINT32 d_RTC_STATE_COLD_RESET_MASK;
  722. A_UINT32 d_PCIE_LOCAL_BASE_ADDRESS;
  723. A_UINT32 d_PCIE_SOC_WAKE_RESET;
  724. A_UINT32 d_PCIE_SOC_WAKE_ADDRESS;
  725. A_UINT32 d_PCIE_SOC_WAKE_V_MASK;
  726. A_UINT32 d_RTC_STATE_V_MASK;
  727. A_UINT32 d_RTC_STATE_V_LSB;
  728. A_UINT32 d_FW_IND_EVENT_PENDING;
  729. A_UINT32 d_FW_IND_INITIALIZED;
  730. A_UINT32 d_FW_IND_HELPER;
  731. A_UINT32 d_RTC_STATE_V_ON;
  732. #if defined(SDIO_3_0)
  733. A_UINT32 d_HOST_INT_STATUS_MBOX_DATA_MASK;
  734. A_UINT32 d_HOST_INT_STATUS_MBOX_DATA_LSB;
  735. #endif
  736. A_UINT32 d_PCIE_SOC_RDY_STATUS_ADDRESS;
  737. A_UINT32 d_PCIE_SOC_RDY_STATUS_BAR_MASK;
  738. A_UINT32 d_SOC_PCIE_BASE_ADDRESS;
  739. A_UINT32 d_MSI_MAGIC_ADR_ADDRESS;
  740. A_UINT32 d_MSI_MAGIC_ADDRESS;
  741. uint32_t d_HOST_CE_COUNT;
  742. uint32_t d_ENABLE_MSI;
  743. uint32_t d_MUX_ID_MASK;
  744. uint32_t d_TRANSACTION_ID_MASK;
  745. uint32_t d_DESC_DATA_FLAG_MASK;
  746. uint32_t d_A_SOC_PCIE_PCIE_BAR0_START;
  747. };
  748. #define A_SOC_PCIE_PCIE_BAR0_START (scn->hostdef->d_A_SOC_PCIE_PCIE_BAR0_START)
  749. #define DESC_DATA_FLAG_MASK (scn->hostdef->d_DESC_DATA_FLAG_MASK)
  750. #define MUX_ID_MASK (scn->hostdef->d_MUX_ID_MASK)
  751. #define TRANSACTION_ID_MASK (scn->hostdef->d_TRANSACTION_ID_MASK)
  752. #define HOST_CE_COUNT (scn->hostdef->d_HOST_CE_COUNT)
  753. #define ENABLE_MSI (scn->hostdef->d_ENABLE_MSI)
  754. #define INT_STATUS_ENABLE_ERROR_LSB \
  755. (scn->hostdef->d_INT_STATUS_ENABLE_ERROR_LSB)
  756. #define INT_STATUS_ENABLE_ERROR_MASK \
  757. (scn->hostdef->d_INT_STATUS_ENABLE_ERROR_MASK)
  758. #define INT_STATUS_ENABLE_CPU_LSB (scn->hostdef->d_INT_STATUS_ENABLE_CPU_LSB)
  759. #define INT_STATUS_ENABLE_CPU_MASK (scn->hostdef->d_INT_STATUS_ENABLE_CPU_MASK)
  760. #define INT_STATUS_ENABLE_COUNTER_LSB \
  761. (scn->hostdef->d_INT_STATUS_ENABLE_COUNTER_LSB)
  762. #define INT_STATUS_ENABLE_COUNTER_MASK \
  763. (scn->hostdef->d_INT_STATUS_ENABLE_COUNTER_MASK)
  764. #define INT_STATUS_ENABLE_MBOX_DATA_LSB \
  765. (scn->hostdef->d_INT_STATUS_ENABLE_MBOX_DATA_LSB)
  766. #define INT_STATUS_ENABLE_MBOX_DATA_MASK \
  767. (scn->hostdef->d_INT_STATUS_ENABLE_MBOX_DATA_MASK)
  768. #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB \
  769. (scn->hostdef->d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB)
  770. #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK \
  771. (scn->hostdef->d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK)
  772. #define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB \
  773. (scn->hostdef->d_ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB)
  774. #define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK \
  775. (scn->hostdef->d_ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK)
  776. #define COUNTER_INT_STATUS_ENABLE_BIT_LSB \
  777. (scn->hostdef->d_COUNTER_INT_STATUS_ENABLE_BIT_LSB)
  778. #define COUNTER_INT_STATUS_ENABLE_BIT_MASK \
  779. (scn->hostdef->d_COUNTER_INT_STATUS_ENABLE_BIT_MASK)
  780. #define INT_STATUS_ENABLE_ADDRESS \
  781. (scn->hostdef->d_INT_STATUS_ENABLE_ADDRESS)
  782. #define CPU_INT_STATUS_ENABLE_BIT_LSB \
  783. (scn->hostdef->d_CPU_INT_STATUS_ENABLE_BIT_LSB)
  784. #define CPU_INT_STATUS_ENABLE_BIT_MASK \
  785. (scn->hostdef->d_CPU_INT_STATUS_ENABLE_BIT_MASK)
  786. #define HOST_INT_STATUS_ADDRESS (scn->hostdef->d_HOST_INT_STATUS_ADDRESS)
  787. #define CPU_INT_STATUS_ADDRESS (scn->hostdef->d_CPU_INT_STATUS_ADDRESS)
  788. #define ERROR_INT_STATUS_ADDRESS (scn->hostdef->d_ERROR_INT_STATUS_ADDRESS)
  789. #define ERROR_INT_STATUS_WAKEUP_MASK \
  790. (scn->hostdef->d_ERROR_INT_STATUS_WAKEUP_MASK)
  791. #define ERROR_INT_STATUS_WAKEUP_LSB \
  792. (scn->hostdef->d_ERROR_INT_STATUS_WAKEUP_LSB)
  793. #define ERROR_INT_STATUS_RX_UNDERFLOW_MASK \
  794. (scn->hostdef->d_ERROR_INT_STATUS_RX_UNDERFLOW_MASK)
  795. #define ERROR_INT_STATUS_RX_UNDERFLOW_LSB \
  796. (scn->hostdef->d_ERROR_INT_STATUS_RX_UNDERFLOW_LSB)
  797. #define ERROR_INT_STATUS_TX_OVERFLOW_MASK \
  798. (scn->hostdef->d_ERROR_INT_STATUS_TX_OVERFLOW_MASK)
  799. #define ERROR_INT_STATUS_TX_OVERFLOW_LSB \
  800. (scn->hostdef->d_ERROR_INT_STATUS_TX_OVERFLOW_LSB)
  801. #define COUNT_DEC_ADDRESS (scn->hostdef->d_COUNT_DEC_ADDRESS)
  802. #define HOST_INT_STATUS_CPU_MASK (scn->hostdef->d_HOST_INT_STATUS_CPU_MASK)
  803. #define HOST_INT_STATUS_CPU_LSB (scn->hostdef->d_HOST_INT_STATUS_CPU_LSB)
  804. #define HOST_INT_STATUS_ERROR_MASK (scn->hostdef->d_HOST_INT_STATUS_ERROR_MASK)
  805. #define HOST_INT_STATUS_ERROR_LSB (scn->hostdef->d_HOST_INT_STATUS_ERROR_LSB)
  806. #define HOST_INT_STATUS_COUNTER_MASK \
  807. (scn->hostdef->d_HOST_INT_STATUS_COUNTER_MASK)
  808. #define HOST_INT_STATUS_COUNTER_LSB \
  809. (scn->hostdef->d_HOST_INT_STATUS_COUNTER_LSB)
  810. #define RX_LOOKAHEAD_VALID_ADDRESS (scn->hostdef->d_RX_LOOKAHEAD_VALID_ADDRESS)
  811. #define WINDOW_DATA_ADDRESS (scn->hostdef->d_WINDOW_DATA_ADDRESS)
  812. #define WINDOW_READ_ADDR_ADDRESS (scn->hostdef->d_WINDOW_READ_ADDR_ADDRESS)
  813. #define WINDOW_WRITE_ADDR_ADDRESS (scn->hostdef->d_WINDOW_WRITE_ADDR_ADDRESS)
  814. #define SOC_GLOBAL_RESET_ADDRESS (scn->hostdef->d_SOC_GLOBAL_RESET_ADDRESS)
  815. #define RTC_STATE_ADDRESS (scn->hostdef->d_RTC_STATE_ADDRESS)
  816. #define RTC_STATE_COLD_RESET_MASK (scn->hostdef->d_RTC_STATE_COLD_RESET_MASK)
  817. #define PCIE_LOCAL_BASE_ADDRESS (scn->hostdef->d_PCIE_LOCAL_BASE_ADDRESS)
  818. #define PCIE_SOC_WAKE_RESET (scn->hostdef->d_PCIE_SOC_WAKE_RESET)
  819. #define PCIE_SOC_WAKE_ADDRESS (scn->hostdef->d_PCIE_SOC_WAKE_ADDRESS)
  820. #define PCIE_SOC_WAKE_V_MASK (scn->hostdef->d_PCIE_SOC_WAKE_V_MASK)
  821. #define RTC_STATE_V_MASK (scn->hostdef->d_RTC_STATE_V_MASK)
  822. #define RTC_STATE_V_LSB (scn->hostdef->d_RTC_STATE_V_LSB)
  823. #define FW_IND_EVENT_PENDING (scn->hostdef->d_FW_IND_EVENT_PENDING)
  824. #define FW_IND_INITIALIZED (scn->hostdef->d_FW_IND_INITIALIZED)
  825. #define FW_IND_HELPER (scn->hostdef->d_FW_IND_HELPER)
  826. #define RTC_STATE_V_ON (scn->hostdef->d_RTC_STATE_V_ON)
  827. #if defined(SDIO_3_0)
  828. #define HOST_INT_STATUS_MBOX_DATA_MASK \
  829. (scn->hostdef->d_HOST_INT_STATUS_MBOX_DATA_MASK)
  830. #define HOST_INT_STATUS_MBOX_DATA_LSB \
  831. (scn->hostdef->d_HOST_INT_STATUS_MBOX_DATA_LSB)
  832. #endif
  833. #if !defined(SOC_PCIE_BASE_ADDRESS)
  834. #define SOC_PCIE_BASE_ADDRESS 0
  835. #endif
  836. #if !defined(PCIE_SOC_RDY_STATUS_ADDRESS)
  837. #define PCIE_SOC_RDY_STATUS_ADDRESS 0
  838. #define PCIE_SOC_RDY_STATUS_BAR_MASK 0
  839. #endif
  840. #if !defined(MSI_MAGIC_ADR_ADDRESS)
  841. #define MSI_MAGIC_ADR_ADDRESS 0
  842. #define MSI_MAGIC_ADDRESS 0
  843. #endif
  844. /* SET/GET macros */
  845. #define INT_STATUS_ENABLE_ERROR_SET(x) \
  846. (((x) << INT_STATUS_ENABLE_ERROR_LSB) & INT_STATUS_ENABLE_ERROR_MASK)
  847. #define INT_STATUS_ENABLE_CPU_SET(x) \
  848. (((x) << INT_STATUS_ENABLE_CPU_LSB) & INT_STATUS_ENABLE_CPU_MASK)
  849. #define INT_STATUS_ENABLE_COUNTER_SET(x) \
  850. (((x) << INT_STATUS_ENABLE_COUNTER_LSB) & \
  851. INT_STATUS_ENABLE_COUNTER_MASK)
  852. #define INT_STATUS_ENABLE_MBOX_DATA_SET(x) \
  853. (((x) << INT_STATUS_ENABLE_MBOX_DATA_LSB) & \
  854. INT_STATUS_ENABLE_MBOX_DATA_MASK)
  855. #define CPU_INT_STATUS_ENABLE_BIT_SET(x) \
  856. (((x) << CPU_INT_STATUS_ENABLE_BIT_LSB) & \
  857. CPU_INT_STATUS_ENABLE_BIT_MASK)
  858. #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(x) \
  859. (((x) << ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) & \
  860. ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK)
  861. #define ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(x) \
  862. (((x) << ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) & \
  863. ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK)
  864. #define COUNTER_INT_STATUS_ENABLE_BIT_SET(x) \
  865. (((x) << COUNTER_INT_STATUS_ENABLE_BIT_LSB) & \
  866. COUNTER_INT_STATUS_ENABLE_BIT_MASK)
  867. #define ERROR_INT_STATUS_WAKEUP_GET(x) \
  868. (((x) & ERROR_INT_STATUS_WAKEUP_MASK) >> \
  869. ERROR_INT_STATUS_WAKEUP_LSB)
  870. #define ERROR_INT_STATUS_RX_UNDERFLOW_GET(x) \
  871. (((x) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) >> \
  872. ERROR_INT_STATUS_RX_UNDERFLOW_LSB)
  873. #define ERROR_INT_STATUS_TX_OVERFLOW_GET(x) \
  874. (((x) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) >> \
  875. ERROR_INT_STATUS_TX_OVERFLOW_LSB)
  876. #define HOST_INT_STATUS_CPU_GET(x) \
  877. (((x) & HOST_INT_STATUS_CPU_MASK) >> HOST_INT_STATUS_CPU_LSB)
  878. #define HOST_INT_STATUS_ERROR_GET(x) \
  879. (((x) & HOST_INT_STATUS_ERROR_MASK) >> HOST_INT_STATUS_ERROR_LSB)
  880. #define HOST_INT_STATUS_COUNTER_GET(x) \
  881. (((x) & HOST_INT_STATUS_COUNTER_MASK) >> HOST_INT_STATUS_COUNTER_LSB)
  882. #define RTC_STATE_V_GET(x) \
  883. (((x) & RTC_STATE_V_MASK) >> RTC_STATE_V_LSB)
  884. #if defined(SDIO_3_0)
  885. #define HOST_INT_STATUS_MBOX_DATA_GET(x) \
  886. (((x) & HOST_INT_STATUS_MBOX_DATA_MASK) >> \
  887. HOST_INT_STATUS_MBOX_DATA_LSB)
  888. #endif
  889. #define INVALID_REG_LOC_DUMMY_DATA 0xAA
  890. #define AR6320_CORE_CLK_DIV_ADDR 0x403fa8
  891. #define AR6320_CPU_PLL_INIT_DONE_ADDR 0x403fd0
  892. #define AR6320_CPU_SPEED_ADDR 0x403fa4
  893. #define AR6320V2_CORE_CLK_DIV_ADDR 0x403fd8
  894. #define AR6320V2_CPU_PLL_INIT_DONE_ADDR 0x403fd0
  895. #define AR6320V2_CPU_SPEED_ADDR 0x403fd4
  896. #define AR6320V3_CORE_CLK_DIV_ADDR 0x404028
  897. #define AR6320V3_CPU_PLL_INIT_DONE_ADDR 0x404020
  898. #define AR6320V3_CPU_SPEED_ADDR 0x404024
  899. typedef enum {
  900. SOC_REFCLK_UNKNOWN = -1, /* Unsupported ref clock -- use PLL Bypass */
  901. SOC_REFCLK_48_MHZ = 0,
  902. SOC_REFCLK_19_2_MHZ = 1,
  903. SOC_REFCLK_24_MHZ = 2,
  904. SOC_REFCLK_26_MHZ = 3,
  905. SOC_REFCLK_37_4_MHZ = 4,
  906. SOC_REFCLK_38_4_MHZ = 5,
  907. SOC_REFCLK_40_MHZ = 6,
  908. SOC_REFCLK_52_MHZ = 7,
  909. } A_refclk_speed_t;
  910. #define A_REFCLK_UNKNOWN SOC_REFCLK_UNKNOWN
  911. #define A_REFCLK_48_MHZ SOC_REFCLK_48_MHZ
  912. #define A_REFCLK_19_2_MHZ SOC_REFCLK_19_2_MHZ
  913. #define A_REFCLK_24_MHZ SOC_REFCLK_24_MHZ
  914. #define A_REFCLK_26_MHZ SOC_REFCLK_26_MHZ
  915. #define A_REFCLK_37_4_MHZ SOC_REFCLK_37_4_MHZ
  916. #define A_REFCLK_38_4_MHZ SOC_REFCLK_38_4_MHZ
  917. #define A_REFCLK_40_MHZ SOC_REFCLK_40_MHZ
  918. #define A_REFCLK_52_MHZ SOC_REFCLK_52_MHZ
  919. #define TARGET_CPU_FREQ 176000000
  920. struct wlan_pll_s {
  921. uint32_t refdiv;
  922. uint32_t div;
  923. uint32_t rnfrac;
  924. uint32_t outdiv;
  925. };
  926. struct cmnos_clock_s {
  927. A_refclk_speed_t refclk_speed;
  928. uint32_t refclk_hz;
  929. uint32_t pll_settling_time; /* 50us */
  930. struct wlan_pll_s wlan_pll;
  931. };
  932. typedef struct TGT_REG_SECTION {
  933. uint32_t start_addr;
  934. uint32_t end_addr;
  935. } tgt_reg_section;
  936. typedef struct TGT_REG_TABLE {
  937. tgt_reg_section *section;
  938. uint32_t section_size;
  939. } tgt_reg_table;
  940. struct hif_softc;
  941. void target_register_tbl_attach(struct hif_softc *scn, u32 target_type);
  942. void hif_register_tbl_attach(struct hif_softc *scn, u32 hif_type);
  943. struct host_shadow_regs_s {
  944. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_0;
  945. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_1;
  946. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_2;
  947. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_3;
  948. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_4;
  949. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_5;
  950. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_6;
  951. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_7;
  952. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_8;
  953. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_9;
  954. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_10;
  955. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_11;
  956. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_12;
  957. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_13;
  958. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_14;
  959. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_15;
  960. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_16;
  961. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_17;
  962. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_18;
  963. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_19;
  964. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_20;
  965. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_21;
  966. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_22;
  967. uint32_t d_A_LOCAL_SHADOW_REG_VALUE_23;
  968. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_0;
  969. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_1;
  970. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_2;
  971. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_3;
  972. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_4;
  973. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_5;
  974. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_6;
  975. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_7;
  976. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_8;
  977. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_9;
  978. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_10;
  979. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_11;
  980. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_12;
  981. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_13;
  982. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_14;
  983. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_15;
  984. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_16;
  985. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_17;
  986. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_18;
  987. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_19;
  988. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_20;
  989. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_21;
  990. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_22;
  991. uint32_t d_A_LOCAL_SHADOW_REG_ADDRESS_23;
  992. };
  993. #endif /* _REGTABLE_PCIE_H_ */