regtable_pcie.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749
  1. /*
  2. * Copyright (c) 2011-2016 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. #define A_SOC_CORE_PCIE_INTR_ENABLE_GRP0_Q6_MASK \
  30. (scn->targetdef->d_A_SOC_CORE_PCIE_INTR_ENABLE_GRP0_Q6_MASK)
  31. #define A_SOC_CORE_PCIE_INTR_CAUSE_GRP1 \
  32. (scn->targetdef->d_A_SOC_CORE_PCIE_INTR_CAUSE_GRP1)
  33. #define A_SOC_CORE_SPARE_1_REGISTER \
  34. (scn->targetdef->d_A_SOC_CORE_SPARE_1_REGISTER)
  35. #define A_SOC_CORE_PCIE_INTR_CLR_GRP1 \
  36. (scn->targetdef->d_A_SOC_CORE_PCIE_INTR_CLR_GRP1)
  37. #define A_SOC_CORE_PCIE_INTR_ENABLE_GRP1 \
  38. (scn->targetdef->d_A_SOC_CORE_PCIE_INTR_ENABLE_GRP1)
  39. #define A_SOC_PCIE_PCIE_SCRATCH_0 \
  40. (scn->targetdef->d_A_SOC_PCIE_PCIE_SCRATCH_0)
  41. #define A_SOC_PCIE_PCIE_SCRATCH_1 \
  42. (scn->targetdef->d_A_SOC_PCIE_PCIE_SCRATCH_1)
  43. #define A_WIFI_APB_1_A_WFSS_CE_TARGET_HOST_DELTA \
  44. (scn->targetdef->d_A_WIFI_APB_1_A_WFSS_CE_TARGET_HOST_DELTA)
  45. #define A_SOC_PCIE_PCIE_SCRATCH_2 \
  46. (scn->targetdef->d_A_SOC_PCIE_PCIE_SCRATCH_2)
  47. /* end Q6 iHelium emu registers */
  48. #define PCIE_INTR_FIRMWARE_ROUTE_MASK \
  49. (scn->targetdef->d_PCIE_INTR_FIRMWARE_ROUTE_MASK)
  50. #define A_SOC_CORE_SPARE_0_REGISTER \
  51. (scn->targetdef->d_A_SOC_CORE_SPARE_0_REGISTER)
  52. #define A_SOC_CORE_SCRATCH_0_ADDRESS \
  53. (scn->targetdef->d_A_SOC_CORE_SCRATCH_0_ADDRESS)
  54. #define A_SOC_CORE_SCRATCH_1_ADDRESS \
  55. (scn->targetdef->d_A_SOC_CORE_SCRATCH_1_ADDRESS)
  56. #define A_SOC_CORE_SCRATCH_2_ADDRESS \
  57. (scn->targetdef->d_A_SOC_CORE_SCRATCH_2_ADDRESS)
  58. #define A_SOC_CORE_SCRATCH_3_ADDRESS \
  59. (scn->targetdef->d_A_SOC_CORE_SCRATCH_3_ADDRESS)
  60. #define A_SOC_CORE_SCRATCH_4_ADDRESS \
  61. (scn->targetdef->d_A_SOC_CORE_SCRATCH_4_ADDRESS)
  62. #define A_SOC_CORE_SCRATCH_5_ADDRESS \
  63. (scn->targetdef->d_A_SOC_CORE_SCRATCH_5_ADDRESS)
  64. #define A_SOC_CORE_SCRATCH_6_ADDRESS \
  65. (scn->targetdef->d_A_SOC_CORE_SCRATCH_6_ADDRESS)
  66. #define A_SOC_CORE_SCRATCH_7_ADDRESS \
  67. (scn->targetdef->d_A_SOC_CORE_SCRATCH_7_ADDRESS)
  68. #define RTC_SOC_BASE_ADDRESS (scn->targetdef->d_RTC_SOC_BASE_ADDRESS)
  69. #define RTC_WMAC_BASE_ADDRESS (scn->targetdef->d_RTC_WMAC_BASE_ADDRESS)
  70. #define SYSTEM_SLEEP_OFFSET (scn->targetdef->d_SYSTEM_SLEEP_OFFSET)
  71. #define WLAN_SYSTEM_SLEEP_OFFSET \
  72. (scn->targetdef->d_WLAN_SYSTEM_SLEEP_OFFSET)
  73. #define WLAN_SYSTEM_SLEEP_DISABLE_LSB \
  74. (scn->targetdef->d_WLAN_SYSTEM_SLEEP_DISABLE_LSB)
  75. #define WLAN_SYSTEM_SLEEP_DISABLE_MASK \
  76. (scn->targetdef->d_WLAN_SYSTEM_SLEEP_DISABLE_MASK)
  77. #define CLOCK_CONTROL_OFFSET (scn->targetdef->d_CLOCK_CONTROL_OFFSET)
  78. #define CLOCK_CONTROL_SI0_CLK_MASK \
  79. (scn->targetdef->d_CLOCK_CONTROL_SI0_CLK_MASK)
  80. #define RESET_CONTROL_OFFSET (scn->targetdef->d_RESET_CONTROL_OFFSET)
  81. #define RESET_CONTROL_MBOX_RST_MASK \
  82. (scn->targetdef->d_RESET_CONTROL_MBOX_RST_MASK)
  83. #define RESET_CONTROL_SI0_RST_MASK \
  84. (scn->targetdef->d_RESET_CONTROL_SI0_RST_MASK)
  85. #define WLAN_RESET_CONTROL_OFFSET \
  86. (scn->targetdef->d_WLAN_RESET_CONTROL_OFFSET)
  87. #define WLAN_RESET_CONTROL_COLD_RST_MASK \
  88. (scn->targetdef->d_WLAN_RESET_CONTROL_COLD_RST_MASK)
  89. #define WLAN_RESET_CONTROL_WARM_RST_MASK \
  90. (scn->targetdef->d_WLAN_RESET_CONTROL_WARM_RST_MASK)
  91. #define GPIO_BASE_ADDRESS (scn->targetdef->d_GPIO_BASE_ADDRESS)
  92. #define GPIO_PIN0_OFFSET (scn->targetdef->d_GPIO_PIN0_OFFSET)
  93. #define GPIO_PIN1_OFFSET (scn->targetdef->d_GPIO_PIN1_OFFSET)
  94. #define GPIO_PIN0_CONFIG_MASK (scn->targetdef->d_GPIO_PIN0_CONFIG_MASK)
  95. #define GPIO_PIN1_CONFIG_MASK (scn->targetdef->d_GPIO_PIN1_CONFIG_MASK)
  96. #define A_SOC_CORE_SCRATCH_0 (scn->targetdef->d_A_SOC_CORE_SCRATCH_0)
  97. #define SI_CONFIG_BIDIR_OD_DATA_LSB \
  98. (scn->targetdef->d_SI_CONFIG_BIDIR_OD_DATA_LSB)
  99. #define SI_CONFIG_BIDIR_OD_DATA_MASK \
  100. (scn->targetdef->d_SI_CONFIG_BIDIR_OD_DATA_MASK)
  101. #define SI_CONFIG_I2C_LSB (scn->targetdef->d_SI_CONFIG_I2C_LSB)
  102. #define SI_CONFIG_I2C_MASK \
  103. (scn->targetdef->d_SI_CONFIG_I2C_MASK)
  104. #define SI_CONFIG_POS_SAMPLE_LSB \
  105. (scn->targetdef->d_SI_CONFIG_POS_SAMPLE_LSB)
  106. #define SI_CONFIG_POS_SAMPLE_MASK \
  107. (scn->targetdef->d_SI_CONFIG_POS_SAMPLE_MASK)
  108. #define SI_CONFIG_INACTIVE_CLK_LSB \
  109. (scn->targetdef->d_SI_CONFIG_INACTIVE_CLK_LSB)
  110. #define SI_CONFIG_INACTIVE_CLK_MASK \
  111. (scn->targetdef->d_SI_CONFIG_INACTIVE_CLK_MASK)
  112. #define SI_CONFIG_INACTIVE_DATA_LSB \
  113. (scn->targetdef->d_SI_CONFIG_INACTIVE_DATA_LSB)
  114. #define SI_CONFIG_INACTIVE_DATA_MASK \
  115. (scn->targetdef->d_SI_CONFIG_INACTIVE_DATA_MASK)
  116. #define SI_CONFIG_DIVIDER_LSB (scn->targetdef->d_SI_CONFIG_DIVIDER_LSB)
  117. #define SI_CONFIG_DIVIDER_MASK (scn->targetdef->d_SI_CONFIG_DIVIDER_MASK)
  118. #define SI_BASE_ADDRESS (scn->targetdef->d_SI_BASE_ADDRESS)
  119. #define SI_CONFIG_OFFSET (scn->targetdef->d_SI_CONFIG_OFFSET)
  120. #define SI_TX_DATA0_OFFSET (scn->targetdef->d_SI_TX_DATA0_OFFSET)
  121. #define SI_TX_DATA1_OFFSET (scn->targetdef->d_SI_TX_DATA1_OFFSET)
  122. #define SI_RX_DATA0_OFFSET (scn->targetdef->d_SI_RX_DATA0_OFFSET)
  123. #define SI_RX_DATA1_OFFSET (scn->targetdef->d_SI_RX_DATA1_OFFSET)
  124. #define SI_CS_OFFSET (scn->targetdef->d_SI_CS_OFFSET)
  125. #define SI_CS_DONE_ERR_MASK (scn->targetdef->d_SI_CS_DONE_ERR_MASK)
  126. #define SI_CS_DONE_INT_MASK (scn->targetdef->d_SI_CS_DONE_INT_MASK)
  127. #define SI_CS_START_LSB (scn->targetdef->d_SI_CS_START_LSB)
  128. #define SI_CS_START_MASK (scn->targetdef->d_SI_CS_START_MASK)
  129. #define SI_CS_RX_CNT_LSB (scn->targetdef->d_SI_CS_RX_CNT_LSB)
  130. #define SI_CS_RX_CNT_MASK (scn->targetdef->d_SI_CS_RX_CNT_MASK)
  131. #define SI_CS_TX_CNT_LSB (scn->targetdef->d_SI_CS_TX_CNT_LSB)
  132. #define SI_CS_TX_CNT_MASK (scn->targetdef->d_SI_CS_TX_CNT_MASK)
  133. #define EEPROM_SZ (scn->targetdef->d_BOARD_DATA_SZ)
  134. #define EEPROM_EXT_SZ (scn->targetdef->d_BOARD_EXT_DATA_SZ)
  135. #define MBOX_BASE_ADDRESS (scn->targetdef->d_MBOX_BASE_ADDRESS)
  136. #define LOCAL_SCRATCH_OFFSET (scn->targetdef->d_LOCAL_SCRATCH_OFFSET)
  137. #define CPU_CLOCK_OFFSET (scn->targetdef->d_CPU_CLOCK_OFFSET)
  138. #define LPO_CAL_OFFSET (scn->targetdef->d_LPO_CAL_OFFSET)
  139. #define GPIO_PIN10_OFFSET (scn->targetdef->d_GPIO_PIN10_OFFSET)
  140. #define GPIO_PIN11_OFFSET (scn->targetdef->d_GPIO_PIN11_OFFSET)
  141. #define GPIO_PIN12_OFFSET (scn->targetdef->d_GPIO_PIN12_OFFSET)
  142. #define GPIO_PIN13_OFFSET (scn->targetdef->d_GPIO_PIN13_OFFSET)
  143. #define CLOCK_GPIO_OFFSET (scn->targetdef->d_CLOCK_GPIO_OFFSET)
  144. #define CPU_CLOCK_STANDARD_LSB (scn->targetdef->d_CPU_CLOCK_STANDARD_LSB)
  145. #define CPU_CLOCK_STANDARD_MASK (scn->targetdef->d_CPU_CLOCK_STANDARD_MASK)
  146. #define LPO_CAL_ENABLE_LSB (scn->targetdef->d_LPO_CAL_ENABLE_LSB)
  147. #define LPO_CAL_ENABLE_MASK (scn->targetdef->d_LPO_CAL_ENABLE_MASK)
  148. #define CLOCK_GPIO_BT_CLK_OUT_EN_LSB \
  149. (scn->targetdef->d_CLOCK_GPIO_BT_CLK_OUT_EN_LSB)
  150. #define CLOCK_GPIO_BT_CLK_OUT_EN_MASK \
  151. (scn->targetdef->d_CLOCK_GPIO_BT_CLK_OUT_EN_MASK)
  152. #define ANALOG_INTF_BASE_ADDRESS (scn->targetdef->d_ANALOG_INTF_BASE_ADDRESS)
  153. #define WLAN_MAC_BASE_ADDRESS (scn->targetdef->d_WLAN_MAC_BASE_ADDRESS)
  154. #define FW_INDICATOR_ADDRESS (scn->targetdef->d_FW_INDICATOR_ADDRESS)
  155. #define DRAM_BASE_ADDRESS (scn->targetdef->d_DRAM_BASE_ADDRESS)
  156. #define SOC_CORE_BASE_ADDRESS (scn->targetdef->d_SOC_CORE_BASE_ADDRESS)
  157. #define CORE_CTRL_ADDRESS (scn->targetdef->d_CORE_CTRL_ADDRESS)
  158. #define CE_COUNT (scn->targetdef->d_CE_COUNT)
  159. #define PCIE_INTR_ENABLE_ADDRESS (scn->targetdef->d_PCIE_INTR_ENABLE_ADDRESS)
  160. #define PCIE_INTR_CLR_ADDRESS (scn->targetdef->d_PCIE_INTR_CLR_ADDRESS)
  161. #define PCIE_INTR_FIRMWARE_MASK (scn->targetdef->d_PCIE_INTR_FIRMWARE_MASK)
  162. #define PCIE_INTR_CE_MASK_ALL (scn->targetdef->d_PCIE_INTR_CE_MASK_ALL)
  163. #define CORE_CTRL_CPU_INTR_MASK (scn->targetdef->d_CORE_CTRL_CPU_INTR_MASK)
  164. #define PCIE_INTR_CAUSE_ADDRESS (scn->targetdef->d_PCIE_INTR_CAUSE_ADDRESS)
  165. #define SOC_RESET_CONTROL_ADDRESS (scn->targetdef->d_SOC_RESET_CONTROL_ADDRESS)
  166. #define HOST_GROUP0_MASK (PCIE_INTR_FIRMWARE_MASK | PCIE_INTR_CE_MASK_ALL | \
  167. A_SOC_CORE_PCIE_INTR_ENABLE_GRP0_Q6_MASK)
  168. #define SOC_RESET_CONTROL_CE_RST_MASK \
  169. (scn->targetdef->d_SOC_RESET_CONTROL_CE_RST_MASK)
  170. #define SOC_RESET_CONTROL_CPU_WARM_RST_MASK \
  171. (scn->targetdef->d_SOC_RESET_CONTROL_CPU_WARM_RST_MASK)
  172. #define CPU_INTR_ADDRESS (scn->targetdef->d_CPU_INTR_ADDRESS)
  173. #define SOC_LF_TIMER_CONTROL0_ADDRESS \
  174. (scn->targetdef->d_SOC_LF_TIMER_CONTROL0_ADDRESS)
  175. #define SOC_LF_TIMER_CONTROL0_ENABLE_MASK \
  176. (scn->targetdef->d_SOC_LF_TIMER_CONTROL0_ENABLE_MASK)
  177. #define SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_LSB \
  178. (scn->targetdef->d_SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_LSB)
  179. #define SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_MASK \
  180. (scn->targetdef->d_SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_MASK)
  181. #define SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_GET(x) \
  182. (((x) & SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_MASK) >> \
  183. SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_LSB)
  184. #define SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_SET(x) \
  185. (((x) << SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_LSB) & \
  186. SOC_RESET_CONTROL_PCIE_RST_SHORT_OVRD_MASK)
  187. /* hif_pci.c */
  188. #define CHIP_ID_ADDRESS (scn->targetdef->d_SOC_CHIP_ID_ADDRESS)
  189. #define SOC_CHIP_ID_REVISION_MASK (scn->targetdef->d_SOC_CHIP_ID_REVISION_MASK)
  190. #define SOC_CHIP_ID_REVISION_LSB (scn->targetdef->d_SOC_CHIP_ID_REVISION_LSB)
  191. #define SOC_CHIP_ID_VERSION_MASK (scn->targetdef->d_SOC_CHIP_ID_VERSION_MASK)
  192. #define SOC_CHIP_ID_VERSION_LSB (scn->targetdef->d_SOC_CHIP_ID_VERSION_LSB)
  193. #define CHIP_ID_REVISION_GET(x) \
  194. (((x) & SOC_CHIP_ID_REVISION_MASK) >> SOC_CHIP_ID_REVISION_LSB)
  195. #define CHIP_ID_VERSION_GET(x) \
  196. (((x) & SOC_CHIP_ID_VERSION_MASK) >> SOC_CHIP_ID_VERSION_LSB)
  197. /* hif_pci.c end */
  198. /* misc */
  199. #define SR_WR_INDEX_ADDRESS (scn->targetdef->d_SR_WR_INDEX_ADDRESS)
  200. #define DST_WATERMARK_ADDRESS (scn->targetdef->d_DST_WATERMARK_ADDRESS)
  201. #define SOC_POWER_REG_OFFSET (scn->targetdef->d_SOC_POWER_REG_OFFSET)
  202. /* end */
  203. #ifndef CONFIG_WIN
  204. /* htt_rx.c */
  205. #define RX_MSDU_END_4_FIRST_MSDU_MASK \
  206. (pdev->targetdef->d_RX_MSDU_END_4_FIRST_MSDU_MASK)
  207. #define RX_MSDU_END_4_FIRST_MSDU_LSB \
  208. (pdev->targetdef->d_RX_MSDU_END_4_FIRST_MSDU_LSB)
  209. #define RX_MPDU_START_0_RETRY_LSB \
  210. (pdev->targetdef->d_RX_MPDU_START_0_RETRY_LSB)
  211. #define RX_MPDU_START_0_RETRY_MASK \
  212. (pdev->targetdef->d_RX_MPDU_START_0_RETRY_MASK)
  213. #define RX_MPDU_START_0_SEQ_NUM_MASK \
  214. (pdev->targetdef->d_RX_MPDU_START_0_SEQ_NUM_MASK)
  215. #define RX_MPDU_START_0_SEQ_NUM_LSB \
  216. (pdev->targetdef->d_RX_MPDU_START_0_SEQ_NUM_LSB)
  217. #define RX_MPDU_START_2_PN_47_32_LSB \
  218. (pdev->targetdef->d_RX_MPDU_START_2_PN_47_32_LSB)
  219. #define RX_MPDU_START_2_PN_47_32_MASK \
  220. (pdev->targetdef->d_RX_MPDU_START_2_PN_47_32_MASK)
  221. #define RX_MPDU_START_2_TID_LSB \
  222. (pdev->targetdef->d_RX_MPDU_START_2_TID_LSB)
  223. #define RX_MPDU_START_2_TID_MASK \
  224. (pdev->targetdef->d_RX_MPDU_START_2_TID_MASK)
  225. #define RX_MSDU_END_1_KEY_ID_OCT_MASK \
  226. (pdev->targetdef->d_RX_MSDU_END_1_KEY_ID_OCT_MASK)
  227. #define RX_MSDU_END_1_KEY_ID_OCT_LSB \
  228. (pdev->targetdef->d_RX_MSDU_END_1_KEY_ID_OCT_LSB)
  229. #define RX_MSDU_END_1_EXT_WAPI_PN_63_48_MASK \
  230. (pdev->targetdef->d_RX_MSDU_END_1_EXT_WAPI_PN_63_48_MASK)
  231. #define RX_MSDU_END_1_EXT_WAPI_PN_63_48_LSB \
  232. (pdev->targetdef->d_RX_MSDU_END_1_EXT_WAPI_PN_63_48_LSB)
  233. #define RX_MSDU_END_4_LAST_MSDU_MASK \
  234. (pdev->targetdef->d_RX_MSDU_END_4_LAST_MSDU_MASK)
  235. #define RX_MSDU_END_4_LAST_MSDU_LSB \
  236. (pdev->targetdef->d_RX_MSDU_END_4_LAST_MSDU_LSB)
  237. #define RX_ATTENTION_0_MCAST_BCAST_MASK \
  238. (pdev->targetdef->d_RX_ATTENTION_0_MCAST_BCAST_MASK)
  239. #define RX_ATTENTION_0_MCAST_BCAST_LSB \
  240. (pdev->targetdef->d_RX_ATTENTION_0_MCAST_BCAST_LSB)
  241. #define RX_ATTENTION_0_FRAGMENT_MASK \
  242. (pdev->targetdef->d_RX_ATTENTION_0_FRAGMENT_MASK)
  243. #define RX_ATTENTION_0_FRAGMENT_LSB \
  244. (pdev->targetdef->d_RX_ATTENTION_0_FRAGMENT_LSB)
  245. #define RX_ATTENTION_0_MPDU_LENGTH_ERR_MASK \
  246. (pdev->targetdef->d_RX_ATTENTION_0_MPDU_LENGTH_ERR_MASK)
  247. #define RX_FRAG_INFO_0_RING2_MORE_COUNT_MASK \
  248. (pdev->targetdef->d_RX_FRAG_INFO_0_RING2_MORE_COUNT_MASK)
  249. #define RX_FRAG_INFO_0_RING2_MORE_COUNT_LSB \
  250. (pdev->targetdef->d_RX_FRAG_INFO_0_RING2_MORE_COUNT_LSB)
  251. #define RX_MSDU_START_0_MSDU_LENGTH_MASK \
  252. (pdev->targetdef->d_RX_MSDU_START_0_MSDU_LENGTH_MASK)
  253. #define RX_MSDU_START_0_MSDU_LENGTH_LSB \
  254. (pdev->targetdef->d_RX_MSDU_START_0_MSDU_LENGTH_LSB)
  255. #ifndef RX_MSDU_START_2_DECAP_FORMAT_OFFSET
  256. #define RX_MSDU_START_2_DECAP_FORMAT_OFFSET \
  257. (pdev->targetdef->d_RX_MSDU_START_2_DECAP_FORMAT_OFFSET)
  258. #endif
  259. #ifndef RX_MSDU_START_2_DECAP_FORMAT_MASK
  260. #define RX_MSDU_START_2_DECAP_FORMAT_MASK \
  261. (pdev->targetdef->d_RX_MSDU_START_2_DECAP_FORMAT_MASK)
  262. #endif
  263. #ifndef RX_MSDU_START_2_DECAP_FORMAT_LSB
  264. #define RX_MSDU_START_2_DECAP_FORMAT_LSB \
  265. (pdev->targetdef->d_RX_MSDU_START_2_DECAP_FORMAT_LSB)
  266. #endif
  267. #define RX_MPDU_START_0_ENCRYPTED_MASK \
  268. (pdev->targetdef->d_RX_MPDU_START_0_ENCRYPTED_MASK)
  269. #define RX_MPDU_START_0_ENCRYPTED_LSB \
  270. (pdev->targetdef->d_RX_MPDU_START_0_ENCRYPTED_LSB)
  271. #define RX_ATTENTION_0_MORE_DATA_MASK \
  272. (pdev->targetdef->d_RX_ATTENTION_0_MORE_DATA_MASK)
  273. #define RX_ATTENTION_0_MSDU_DONE_MASK \
  274. (pdev->targetdef->d_RX_ATTENTION_0_MSDU_DONE_MASK)
  275. #define RX_ATTENTION_0_TCP_UDP_CHKSUM_FAIL_MASK \
  276. (pdev->targetdef->d_RX_ATTENTION_0_TCP_UDP_CHKSUM_FAIL_MASK)
  277. /* end */
  278. #endif
  279. /* copy_engine.c */
  280. /* end */
  281. /* PLL start */
  282. #define EFUSE_OFFSET (scn->targetdef->d_EFUSE_OFFSET)
  283. #define EFUSE_XTAL_SEL_MSB (scn->targetdef->d_EFUSE_XTAL_SEL_MSB)
  284. #define EFUSE_XTAL_SEL_LSB (scn->targetdef->d_EFUSE_XTAL_SEL_LSB)
  285. #define EFUSE_XTAL_SEL_MASK (scn->targetdef->d_EFUSE_XTAL_SEL_MASK)
  286. #define BB_PLL_CONFIG_OFFSET (scn->targetdef->d_BB_PLL_CONFIG_OFFSET)
  287. #define BB_PLL_CONFIG_OUTDIV_MSB (scn->targetdef->d_BB_PLL_CONFIG_OUTDIV_MSB)
  288. #define BB_PLL_CONFIG_OUTDIV_LSB (scn->targetdef->d_BB_PLL_CONFIG_OUTDIV_LSB)
  289. #define BB_PLL_CONFIG_OUTDIV_MASK (scn->targetdef->d_BB_PLL_CONFIG_OUTDIV_MASK)
  290. #define BB_PLL_CONFIG_FRAC_MSB (scn->targetdef->d_BB_PLL_CONFIG_FRAC_MSB)
  291. #define BB_PLL_CONFIG_FRAC_LSB (scn->targetdef->d_BB_PLL_CONFIG_FRAC_LSB)
  292. #define BB_PLL_CONFIG_FRAC_MASK (scn->targetdef->d_BB_PLL_CONFIG_FRAC_MASK)
  293. #define WLAN_PLL_SETTLE_TIME_MSB (scn->targetdef->d_WLAN_PLL_SETTLE_TIME_MSB)
  294. #define WLAN_PLL_SETTLE_TIME_LSB (scn->targetdef->d_WLAN_PLL_SETTLE_TIME_LSB)
  295. #define WLAN_PLL_SETTLE_TIME_MASK (scn->targetdef->d_WLAN_PLL_SETTLE_TIME_MASK)
  296. #define WLAN_PLL_SETTLE_OFFSET (scn->targetdef->d_WLAN_PLL_SETTLE_OFFSET)
  297. #define WLAN_PLL_SETTLE_SW_MASK (scn->targetdef->d_WLAN_PLL_SETTLE_SW_MASK)
  298. #define WLAN_PLL_SETTLE_RSTMASK (scn->targetdef->d_WLAN_PLL_SETTLE_RSTMASK)
  299. #define WLAN_PLL_SETTLE_RESET (scn->targetdef->d_WLAN_PLL_SETTLE_RESET)
  300. #define WLAN_PLL_CONTROL_NOPWD_MSB \
  301. (scn->targetdef->d_WLAN_PLL_CONTROL_NOPWD_MSB)
  302. #define WLAN_PLL_CONTROL_NOPWD_LSB \
  303. (scn->targetdef->d_WLAN_PLL_CONTROL_NOPWD_LSB)
  304. #define WLAN_PLL_CONTROL_NOPWD_MASK \
  305. (scn->targetdef->d_WLAN_PLL_CONTROL_NOPWD_MASK)
  306. #define WLAN_PLL_CONTROL_BYPASS_MSB \
  307. (scn->targetdef->d_WLAN_PLL_CONTROL_BYPASS_MSB)
  308. #define WLAN_PLL_CONTROL_BYPASS_LSB \
  309. (scn->targetdef->d_WLAN_PLL_CONTROL_BYPASS_LSB)
  310. #define WLAN_PLL_CONTROL_BYPASS_MASK \
  311. (scn->targetdef->d_WLAN_PLL_CONTROL_BYPASS_MASK)
  312. #define WLAN_PLL_CONTROL_BYPASS_RESET \
  313. (scn->targetdef->d_WLAN_PLL_CONTROL_BYPASS_RESET)
  314. #define WLAN_PLL_CONTROL_CLK_SEL_MSB \
  315. (scn->targetdef->d_WLAN_PLL_CONTROL_CLK_SEL_MSB)
  316. #define WLAN_PLL_CONTROL_CLK_SEL_LSB \
  317. (scn->targetdef->d_WLAN_PLL_CONTROL_CLK_SEL_LSB)
  318. #define WLAN_PLL_CONTROL_CLK_SEL_MASK \
  319. (scn->targetdef->d_WLAN_PLL_CONTROL_CLK_SEL_MASK)
  320. #define WLAN_PLL_CONTROL_CLK_SEL_RESET \
  321. (scn->targetdef->d_WLAN_PLL_CONTROL_CLK_SEL_RESET)
  322. #define WLAN_PLL_CONTROL_REFDIV_MSB \
  323. (scn->targetdef->d_WLAN_PLL_CONTROL_REFDIV_MSB)
  324. #define WLAN_PLL_CONTROL_REFDIV_LSB \
  325. (scn->targetdef->d_WLAN_PLL_CONTROL_REFDIV_LSB)
  326. #define WLAN_PLL_CONTROL_REFDIV_MASK \
  327. (scn->targetdef->d_WLAN_PLL_CONTROL_REFDIV_MASK)
  328. #define WLAN_PLL_CONTROL_REFDIV_RESET \
  329. (scn->targetdef->d_WLAN_PLL_CONTROL_REFDIV_RESET)
  330. #define WLAN_PLL_CONTROL_DIV_MSB (scn->targetdef->d_WLAN_PLL_CONTROL_DIV_MSB)
  331. #define WLAN_PLL_CONTROL_DIV_LSB (scn->targetdef->d_WLAN_PLL_CONTROL_DIV_LSB)
  332. #define WLAN_PLL_CONTROL_DIV_MASK (scn->targetdef->d_WLAN_PLL_CONTROL_DIV_MASK)
  333. #define WLAN_PLL_CONTROL_DIV_RESET \
  334. (scn->targetdef->d_WLAN_PLL_CONTROL_DIV_RESET)
  335. #define WLAN_PLL_CONTROL_OFFSET (scn->targetdef->d_WLAN_PLL_CONTROL_OFFSET)
  336. #define WLAN_PLL_CONTROL_SW_MASK (scn->targetdef->d_WLAN_PLL_CONTROL_SW_MASK)
  337. #define WLAN_PLL_CONTROL_RSTMASK (scn->targetdef->d_WLAN_PLL_CONTROL_RSTMASK)
  338. #define WLAN_PLL_CONTROL_RESET (scn->targetdef->d_WLAN_PLL_CONTROL_RESET)
  339. #define SOC_CORE_CLK_CTRL_OFFSET (scn->targetdef->d_SOC_CORE_CLK_CTRL_OFFSET)
  340. #define SOC_CORE_CLK_CTRL_DIV_MSB (scn->targetdef->d_SOC_CORE_CLK_CTRL_DIV_MSB)
  341. #define SOC_CORE_CLK_CTRL_DIV_LSB (scn->targetdef->d_SOC_CORE_CLK_CTRL_DIV_LSB)
  342. #define SOC_CORE_CLK_CTRL_DIV_MASK \
  343. (scn->targetdef->d_SOC_CORE_CLK_CTRL_DIV_MASK)
  344. #define RTC_SYNC_STATUS_PLL_CHANGING_MSB \
  345. (scn->targetdef->d_RTC_SYNC_STATUS_PLL_CHANGING_MSB)
  346. #define RTC_SYNC_STATUS_PLL_CHANGING_LSB \
  347. (scn->targetdef->d_RTC_SYNC_STATUS_PLL_CHANGING_LSB)
  348. #define RTC_SYNC_STATUS_PLL_CHANGING_MASK \
  349. (scn->targetdef->d_RTC_SYNC_STATUS_PLL_CHANGING_MASK)
  350. #define RTC_SYNC_STATUS_PLL_CHANGING_RESET \
  351. (scn->targetdef->d_RTC_SYNC_STATUS_PLL_CHANGING_RESET)
  352. #define RTC_SYNC_STATUS_OFFSET (scn->targetdef->d_RTC_SYNC_STATUS_OFFSET)
  353. #define SOC_CPU_CLOCK_OFFSET (scn->targetdef->d_SOC_CPU_CLOCK_OFFSET)
  354. #define SOC_CPU_CLOCK_STANDARD_MSB \
  355. (scn->targetdef->d_SOC_CPU_CLOCK_STANDARD_MSB)
  356. #define SOC_CPU_CLOCK_STANDARD_LSB \
  357. (scn->targetdef->d_SOC_CPU_CLOCK_STANDARD_LSB)
  358. #define SOC_CPU_CLOCK_STANDARD_MASK \
  359. (scn->targetdef->d_SOC_CPU_CLOCK_STANDARD_MASK)
  360. /* PLL end */
  361. #define FW_CPU_PLL_CONFIG \
  362. (scn->targetdef->d_FW_CPU_PLL_CONFIG)
  363. #define WIFICMN_PCIE_BAR_REG_ADDRESS \
  364. (sc->targetdef->d_WIFICMN_PCIE_BAR_REG_ADDRESS)
  365. /* htt tx */
  366. #define MSDU_LINK_EXT_3_TCP_OVER_IPV4_CHECKSUM_EN_MASK \
  367. (pdev->targetdef->d_MSDU_LINK_EXT_3_TCP_OVER_IPV4_CHECKSUM_EN_MASK)
  368. #define MSDU_LINK_EXT_3_TCP_OVER_IPV6_CHECKSUM_EN_MASK \
  369. (pdev->targetdef->d_MSDU_LINK_EXT_3_TCP_OVER_IPV6_CHECKSUM_EN_MASK)
  370. #define MSDU_LINK_EXT_3_UDP_OVER_IPV4_CHECKSUM_EN_MASK \
  371. (pdev->targetdef->d_MSDU_LINK_EXT_3_UDP_OVER_IPV4_CHECKSUM_EN_MASK)
  372. #define MSDU_LINK_EXT_3_UDP_OVER_IPV6_CHECKSUM_EN_MASK \
  373. (pdev->targetdef->d_MSDU_LINK_EXT_3_UDP_OVER_IPV6_CHECKSUM_EN_MASK)
  374. #define MSDU_LINK_EXT_3_TCP_OVER_IPV4_CHECKSUM_EN_LSB \
  375. (pdev->targetdef->d_MSDU_LINK_EXT_3_TCP_OVER_IPV4_CHECKSUM_EN_LSB)
  376. #define MSDU_LINK_EXT_3_TCP_OVER_IPV6_CHECKSUM_EN_LSB \
  377. (pdev->targetdef->d_MSDU_LINK_EXT_3_TCP_OVER_IPV6_CHECKSUM_EN_LSB)
  378. #define MSDU_LINK_EXT_3_UDP_OVER_IPV4_CHECKSUM_EN_LSB \
  379. (pdev->targetdef->d_MSDU_LINK_EXT_3_UDP_OVER_IPV4_CHECKSUM_EN_LSB)
  380. #define MSDU_LINK_EXT_3_UDP_OVER_IPV6_CHECKSUM_EN_LSB \
  381. (pdev->targetdef->d_MSDU_LINK_EXT_3_UDP_OVER_IPV6_CHECKSUM_EN_LSB)
  382. #define CE_CMD_ADDRESS \
  383. (scn->targetdef->d_CE_CMD_ADDRESS)
  384. #define CE_CMD_HALT_MASK \
  385. (scn->targetdef->d_CE_CMD_HALT_MASK)
  386. #define CE_CMD_HALT_STATUS_MASK \
  387. (scn->targetdef->d_CE_CMD_HALT_STATUS_MASK)
  388. #define CE_CMD_HALT_STATUS_LSB \
  389. (scn->targetdef->d_CE_CMD_HALT_STATUS_LSB)
  390. #define SI_CONFIG_ERR_INT_MASK \
  391. (scn->targetdef->d_SI_CONFIG_ERR_INT_MASK)
  392. #define SI_CONFIG_ERR_INT_LSB \
  393. (scn->targetdef->d_SI_CONFIG_ERR_INT_LSB)
  394. #define GPIO_ENABLE_W1TS_LOW_ADDRESS \
  395. (scn->targetdef->d_GPIO_ENABLE_W1TS_LOW_ADDRESS)
  396. #define GPIO_PIN0_CONFIG_LSB \
  397. (scn->targetdef->d_GPIO_PIN0_CONFIG_LSB)
  398. #define GPIO_PIN0_PAD_PULL_LSB \
  399. (scn->targetdef->d_GPIO_PIN0_PAD_PULL_LSB)
  400. #define GPIO_PIN0_PAD_PULL_MASK \
  401. (scn->targetdef->d_GPIO_PIN0_PAD_PULL_MASK)
  402. #define SOC_CHIP_ID_REVISION_MSB \
  403. (scn->targetdef->d_SOC_CHIP_ID_REVISION_MSB)
  404. #define FW_AXI_MSI_ADDR \
  405. (scn->targetdef->d_FW_AXI_MSI_ADDR)
  406. #define FW_AXI_MSI_DATA \
  407. (scn->targetdef->d_FW_AXI_MSI_DATA)
  408. #define WLAN_SUBSYSTEM_CORE_ID_ADDRESS \
  409. (scn->targetdef->d_WLAN_SUBSYSTEM_CORE_ID_ADDRESS)
  410. #define FPGA_VERSION_ADDRESS \
  411. (scn->targetdef->d_FPGA_VERSION_ADDRESS)
  412. /* SET macros */
  413. #define WLAN_SYSTEM_SLEEP_DISABLE_SET(x) \
  414. (((x) << WLAN_SYSTEM_SLEEP_DISABLE_LSB) & \
  415. WLAN_SYSTEM_SLEEP_DISABLE_MASK)
  416. #define SI_CONFIG_BIDIR_OD_DATA_SET(x) \
  417. (((x) << SI_CONFIG_BIDIR_OD_DATA_LSB) & SI_CONFIG_BIDIR_OD_DATA_MASK)
  418. #define SI_CONFIG_I2C_SET(x) (((x) << SI_CONFIG_I2C_LSB) & SI_CONFIG_I2C_MASK)
  419. #define SI_CONFIG_POS_SAMPLE_SET(x) \
  420. (((x) << SI_CONFIG_POS_SAMPLE_LSB) & SI_CONFIG_POS_SAMPLE_MASK)
  421. #define SI_CONFIG_INACTIVE_CLK_SET(x) \
  422. (((x) << SI_CONFIG_INACTIVE_CLK_LSB) & SI_CONFIG_INACTIVE_CLK_MASK)
  423. #define SI_CONFIG_INACTIVE_DATA_SET(x) \
  424. (((x) << SI_CONFIG_INACTIVE_DATA_LSB) & SI_CONFIG_INACTIVE_DATA_MASK)
  425. #define SI_CONFIG_DIVIDER_SET(x) \
  426. (((x) << SI_CONFIG_DIVIDER_LSB) & SI_CONFIG_DIVIDER_MASK)
  427. #define SI_CS_START_SET(x) (((x) << SI_CS_START_LSB) & SI_CS_START_MASK)
  428. #define SI_CS_RX_CNT_SET(x) (((x) << SI_CS_RX_CNT_LSB) & SI_CS_RX_CNT_MASK)
  429. #define SI_CS_TX_CNT_SET(x) (((x) << SI_CS_TX_CNT_LSB) & SI_CS_TX_CNT_MASK)
  430. #define LPO_CAL_ENABLE_SET(x) \
  431. (((x) << LPO_CAL_ENABLE_LSB) & LPO_CAL_ENABLE_MASK)
  432. #define CPU_CLOCK_STANDARD_SET(x) \
  433. (((x) << CPU_CLOCK_STANDARD_LSB) & CPU_CLOCK_STANDARD_MASK)
  434. #define CLOCK_GPIO_BT_CLK_OUT_EN_SET(x) \
  435. (((x) << CLOCK_GPIO_BT_CLK_OUT_EN_LSB) & CLOCK_GPIO_BT_CLK_OUT_EN_MASK)
  436. /* copy_engine.c */
  437. /* end */
  438. /* PLL start */
  439. #define EFUSE_XTAL_SEL_GET(x) \
  440. (((x) & EFUSE_XTAL_SEL_MASK) >> EFUSE_XTAL_SEL_LSB)
  441. #define EFUSE_XTAL_SEL_SET(x) \
  442. (((x) << EFUSE_XTAL_SEL_LSB) & EFUSE_XTAL_SEL_MASK)
  443. #define BB_PLL_CONFIG_OUTDIV_GET(x) \
  444. (((x) & BB_PLL_CONFIG_OUTDIV_MASK) >> BB_PLL_CONFIG_OUTDIV_LSB)
  445. #define BB_PLL_CONFIG_OUTDIV_SET(x) \
  446. (((x) << BB_PLL_CONFIG_OUTDIV_LSB) & BB_PLL_CONFIG_OUTDIV_MASK)
  447. #define BB_PLL_CONFIG_FRAC_GET(x) \
  448. (((x) & BB_PLL_CONFIG_FRAC_MASK) >> BB_PLL_CONFIG_FRAC_LSB)
  449. #define BB_PLL_CONFIG_FRAC_SET(x) \
  450. (((x) << BB_PLL_CONFIG_FRAC_LSB) & BB_PLL_CONFIG_FRAC_MASK)
  451. #define WLAN_PLL_SETTLE_TIME_GET(x) \
  452. (((x) & WLAN_PLL_SETTLE_TIME_MASK) >> WLAN_PLL_SETTLE_TIME_LSB)
  453. #define WLAN_PLL_SETTLE_TIME_SET(x) \
  454. (((x) << WLAN_PLL_SETTLE_TIME_LSB) & WLAN_PLL_SETTLE_TIME_MASK)
  455. #define WLAN_PLL_CONTROL_NOPWD_GET(x) \
  456. (((x) & WLAN_PLL_CONTROL_NOPWD_MASK) >> WLAN_PLL_CONTROL_NOPWD_LSB)
  457. #define WLAN_PLL_CONTROL_NOPWD_SET(x) \
  458. (((x) << WLAN_PLL_CONTROL_NOPWD_LSB) & WLAN_PLL_CONTROL_NOPWD_MASK)
  459. #define WLAN_PLL_CONTROL_BYPASS_GET(x) \
  460. (((x) & WLAN_PLL_CONTROL_BYPASS_MASK) >> WLAN_PLL_CONTROL_BYPASS_LSB)
  461. #define WLAN_PLL_CONTROL_BYPASS_SET(x) \
  462. (((x) << WLAN_PLL_CONTROL_BYPASS_LSB) & WLAN_PLL_CONTROL_BYPASS_MASK)
  463. #define WLAN_PLL_CONTROL_CLK_SEL_GET(x) \
  464. (((x) & WLAN_PLL_CONTROL_CLK_SEL_MASK) >> WLAN_PLL_CONTROL_CLK_SEL_LSB)
  465. #define WLAN_PLL_CONTROL_CLK_SEL_SET(x) \
  466. (((x) << WLAN_PLL_CONTROL_CLK_SEL_LSB) & WLAN_PLL_CONTROL_CLK_SEL_MASK)
  467. #define WLAN_PLL_CONTROL_REFDIV_GET(x) \
  468. (((x) & WLAN_PLL_CONTROL_REFDIV_MASK) >> WLAN_PLL_CONTROL_REFDIV_LSB)
  469. #define WLAN_PLL_CONTROL_REFDIV_SET(x) \
  470. (((x) << WLAN_PLL_CONTROL_REFDIV_LSB) & WLAN_PLL_CONTROL_REFDIV_MASK)
  471. #define WLAN_PLL_CONTROL_DIV_GET(x) \
  472. (((x) & WLAN_PLL_CONTROL_DIV_MASK) >> WLAN_PLL_CONTROL_DIV_LSB)
  473. #define WLAN_PLL_CONTROL_DIV_SET(x) \
  474. (((x) << WLAN_PLL_CONTROL_DIV_LSB) & WLAN_PLL_CONTROL_DIV_MASK)
  475. #define SOC_CORE_CLK_CTRL_DIV_GET(x) \
  476. (((x) & SOC_CORE_CLK_CTRL_DIV_MASK) >> SOC_CORE_CLK_CTRL_DIV_LSB)
  477. #define SOC_CORE_CLK_CTRL_DIV_SET(x) \
  478. (((x) << SOC_CORE_CLK_CTRL_DIV_LSB) & SOC_CORE_CLK_CTRL_DIV_MASK)
  479. #define RTC_SYNC_STATUS_PLL_CHANGING_GET(x) \
  480. (((x) & RTC_SYNC_STATUS_PLL_CHANGING_MASK) >> \
  481. RTC_SYNC_STATUS_PLL_CHANGING_LSB)
  482. #define RTC_SYNC_STATUS_PLL_CHANGING_SET(x) \
  483. (((x) << RTC_SYNC_STATUS_PLL_CHANGING_LSB) & \
  484. RTC_SYNC_STATUS_PLL_CHANGING_MASK)
  485. #define SOC_CPU_CLOCK_STANDARD_GET(x) \
  486. (((x) & SOC_CPU_CLOCK_STANDARD_MASK) >> SOC_CPU_CLOCK_STANDARD_LSB)
  487. #define SOC_CPU_CLOCK_STANDARD_SET(x) \
  488. (((x) << SOC_CPU_CLOCK_STANDARD_LSB) & SOC_CPU_CLOCK_STANDARD_MASK)
  489. /* PLL end */
  490. #define WLAN_GPIO_PIN0_CONFIG_SET(x) \
  491. (((x) << GPIO_PIN0_CONFIG_LSB) & GPIO_PIN0_CONFIG_MASK)
  492. #define WLAN_GPIO_PIN0_PAD_PULL_SET(x) \
  493. (((x) << GPIO_PIN0_PAD_PULL_LSB) & GPIO_PIN0_PAD_PULL_MASK)
  494. #define SI_CONFIG_ERR_INT_SET(x) \
  495. (((x) << SI_CONFIG_ERR_INT_LSB) & SI_CONFIG_ERR_INT_MASK)
  496. #ifdef QCA_WIFI_3_0_ADRASTEA
  497. #define Q6_ENABLE_REGISTER_0 \
  498. (scn->targetdef->d_Q6_ENABLE_REGISTER_0)
  499. #define Q6_ENABLE_REGISTER_1 \
  500. (scn->targetdef->d_Q6_ENABLE_REGISTER_1)
  501. #define Q6_CAUSE_REGISTER_0 \
  502. (scn->targetdef->d_Q6_CAUSE_REGISTER_0)
  503. #define Q6_CAUSE_REGISTER_1 \
  504. (scn->targetdef->d_Q6_CAUSE_REGISTER_1)
  505. #define Q6_CLEAR_REGISTER_0 \
  506. (scn->targetdef->d_Q6_CLEAR_REGISTER_0)
  507. #define Q6_CLEAR_REGISTER_1 \
  508. (scn->targetdef->d_Q6_CLEAR_REGISTER_1)
  509. #endif
  510. #ifdef CONFIG_BYPASS_QMI
  511. #define BYPASS_QMI_TEMP_REGISTER \
  512. (scn->targetdef->d_BYPASS_QMI_TEMP_REGISTER)
  513. #endif
  514. #define A_SOC_PCIE_PCIE_BAR0_START (scn->hostdef->d_A_SOC_PCIE_PCIE_BAR0_START)
  515. #define DESC_DATA_FLAG_MASK (scn->hostdef->d_DESC_DATA_FLAG_MASK)
  516. #define MUX_ID_MASK (scn->hostdef->d_MUX_ID_MASK)
  517. #define TRANSACTION_ID_MASK (scn->hostdef->d_TRANSACTION_ID_MASK)
  518. #define HOST_CE_COUNT (scn->hostdef->d_HOST_CE_COUNT)
  519. #define ENABLE_MSI (scn->hostdef->d_ENABLE_MSI)
  520. #define INT_STATUS_ENABLE_ERROR_LSB \
  521. (scn->hostdef->d_INT_STATUS_ENABLE_ERROR_LSB)
  522. #define INT_STATUS_ENABLE_ERROR_MASK \
  523. (scn->hostdef->d_INT_STATUS_ENABLE_ERROR_MASK)
  524. #define INT_STATUS_ENABLE_CPU_LSB (scn->hostdef->d_INT_STATUS_ENABLE_CPU_LSB)
  525. #define INT_STATUS_ENABLE_CPU_MASK (scn->hostdef->d_INT_STATUS_ENABLE_CPU_MASK)
  526. #define INT_STATUS_ENABLE_COUNTER_LSB \
  527. (scn->hostdef->d_INT_STATUS_ENABLE_COUNTER_LSB)
  528. #define INT_STATUS_ENABLE_COUNTER_MASK \
  529. (scn->hostdef->d_INT_STATUS_ENABLE_COUNTER_MASK)
  530. #define INT_STATUS_ENABLE_MBOX_DATA_LSB \
  531. (scn->hostdef->d_INT_STATUS_ENABLE_MBOX_DATA_LSB)
  532. #define INT_STATUS_ENABLE_MBOX_DATA_MASK \
  533. (scn->hostdef->d_INT_STATUS_ENABLE_MBOX_DATA_MASK)
  534. #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB \
  535. (scn->hostdef->d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB)
  536. #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK \
  537. (scn->hostdef->d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK)
  538. #define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB \
  539. (scn->hostdef->d_ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB)
  540. #define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK \
  541. (scn->hostdef->d_ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK)
  542. #define COUNTER_INT_STATUS_ENABLE_BIT_LSB \
  543. (scn->hostdef->d_COUNTER_INT_STATUS_ENABLE_BIT_LSB)
  544. #define COUNTER_INT_STATUS_ENABLE_BIT_MASK \
  545. (scn->hostdef->d_COUNTER_INT_STATUS_ENABLE_BIT_MASK)
  546. #define INT_STATUS_ENABLE_ADDRESS \
  547. (scn->hostdef->d_INT_STATUS_ENABLE_ADDRESS)
  548. #define CPU_INT_STATUS_ENABLE_BIT_LSB \
  549. (scn->hostdef->d_CPU_INT_STATUS_ENABLE_BIT_LSB)
  550. #define CPU_INT_STATUS_ENABLE_BIT_MASK \
  551. (scn->hostdef->d_CPU_INT_STATUS_ENABLE_BIT_MASK)
  552. #define HOST_INT_STATUS_ADDRESS (scn->hostdef->d_HOST_INT_STATUS_ADDRESS)
  553. #define CPU_INT_STATUS_ADDRESS (scn->hostdef->d_CPU_INT_STATUS_ADDRESS)
  554. #define ERROR_INT_STATUS_ADDRESS (scn->hostdef->d_ERROR_INT_STATUS_ADDRESS)
  555. #define ERROR_INT_STATUS_WAKEUP_MASK \
  556. (scn->hostdef->d_ERROR_INT_STATUS_WAKEUP_MASK)
  557. #define ERROR_INT_STATUS_WAKEUP_LSB \
  558. (scn->hostdef->d_ERROR_INT_STATUS_WAKEUP_LSB)
  559. #define ERROR_INT_STATUS_RX_UNDERFLOW_MASK \
  560. (scn->hostdef->d_ERROR_INT_STATUS_RX_UNDERFLOW_MASK)
  561. #define ERROR_INT_STATUS_RX_UNDERFLOW_LSB \
  562. (scn->hostdef->d_ERROR_INT_STATUS_RX_UNDERFLOW_LSB)
  563. #define ERROR_INT_STATUS_TX_OVERFLOW_MASK \
  564. (scn->hostdef->d_ERROR_INT_STATUS_TX_OVERFLOW_MASK)
  565. #define ERROR_INT_STATUS_TX_OVERFLOW_LSB \
  566. (scn->hostdef->d_ERROR_INT_STATUS_TX_OVERFLOW_LSB)
  567. #define COUNT_DEC_ADDRESS (scn->hostdef->d_COUNT_DEC_ADDRESS)
  568. #define HOST_INT_STATUS_CPU_MASK (scn->hostdef->d_HOST_INT_STATUS_CPU_MASK)
  569. #define HOST_INT_STATUS_CPU_LSB (scn->hostdef->d_HOST_INT_STATUS_CPU_LSB)
  570. #define HOST_INT_STATUS_ERROR_MASK (scn->hostdef->d_HOST_INT_STATUS_ERROR_MASK)
  571. #define HOST_INT_STATUS_ERROR_LSB (scn->hostdef->d_HOST_INT_STATUS_ERROR_LSB)
  572. #define HOST_INT_STATUS_COUNTER_MASK \
  573. (scn->hostdef->d_HOST_INT_STATUS_COUNTER_MASK)
  574. #define HOST_INT_STATUS_COUNTER_LSB \
  575. (scn->hostdef->d_HOST_INT_STATUS_COUNTER_LSB)
  576. #define RX_LOOKAHEAD_VALID_ADDRESS (scn->hostdef->d_RX_LOOKAHEAD_VALID_ADDRESS)
  577. #define WINDOW_DATA_ADDRESS (scn->hostdef->d_WINDOW_DATA_ADDRESS)
  578. #define WINDOW_READ_ADDR_ADDRESS (scn->hostdef->d_WINDOW_READ_ADDR_ADDRESS)
  579. #define WINDOW_WRITE_ADDR_ADDRESS (scn->hostdef->d_WINDOW_WRITE_ADDR_ADDRESS)
  580. #define SOC_GLOBAL_RESET_ADDRESS (scn->hostdef->d_SOC_GLOBAL_RESET_ADDRESS)
  581. #define RTC_STATE_ADDRESS (scn->hostdef->d_RTC_STATE_ADDRESS)
  582. #define RTC_STATE_COLD_RESET_MASK (scn->hostdef->d_RTC_STATE_COLD_RESET_MASK)
  583. #define PCIE_LOCAL_BASE_ADDRESS (scn->hostdef->d_PCIE_LOCAL_BASE_ADDRESS)
  584. #define PCIE_SOC_WAKE_RESET (scn->hostdef->d_PCIE_SOC_WAKE_RESET)
  585. #define PCIE_SOC_WAKE_ADDRESS (scn->hostdef->d_PCIE_SOC_WAKE_ADDRESS)
  586. #define PCIE_SOC_WAKE_V_MASK (scn->hostdef->d_PCIE_SOC_WAKE_V_MASK)
  587. #define RTC_STATE_V_MASK (scn->hostdef->d_RTC_STATE_V_MASK)
  588. #define RTC_STATE_V_LSB (scn->hostdef->d_RTC_STATE_V_LSB)
  589. #define FW_IND_EVENT_PENDING (scn->hostdef->d_FW_IND_EVENT_PENDING)
  590. #define FW_IND_INITIALIZED (scn->hostdef->d_FW_IND_INITIALIZED)
  591. #define FW_IND_HELPER (scn->hostdef->d_FW_IND_HELPER)
  592. #define RTC_STATE_V_ON (scn->hostdef->d_RTC_STATE_V_ON)
  593. #define FW_IND_HOST_READY (scn->hostdef->d_FW_IND_HOST_READY)
  594. #if defined(SDIO_3_0)
  595. #define HOST_INT_STATUS_MBOX_DATA_MASK \
  596. (scn->hostdef->d_HOST_INT_STATUS_MBOX_DATA_MASK)
  597. #define HOST_INT_STATUS_MBOX_DATA_LSB \
  598. (scn->hostdef->d_HOST_INT_STATUS_MBOX_DATA_LSB)
  599. #endif
  600. #if !defined(SOC_PCIE_BASE_ADDRESS)
  601. #define SOC_PCIE_BASE_ADDRESS 0
  602. #endif
  603. #if !defined(PCIE_SOC_RDY_STATUS_ADDRESS)
  604. #define PCIE_SOC_RDY_STATUS_ADDRESS 0
  605. #define PCIE_SOC_RDY_STATUS_BAR_MASK 0
  606. #endif
  607. #if !defined(MSI_MAGIC_ADR_ADDRESS)
  608. #define MSI_MAGIC_ADR_ADDRESS 0
  609. #define MSI_MAGIC_ADDRESS 0
  610. #endif
  611. /* SET/GET macros */
  612. #define INT_STATUS_ENABLE_ERROR_SET(x) \
  613. (((x) << INT_STATUS_ENABLE_ERROR_LSB) & INT_STATUS_ENABLE_ERROR_MASK)
  614. #define INT_STATUS_ENABLE_CPU_SET(x) \
  615. (((x) << INT_STATUS_ENABLE_CPU_LSB) & INT_STATUS_ENABLE_CPU_MASK)
  616. #define INT_STATUS_ENABLE_COUNTER_SET(x) \
  617. (((x) << INT_STATUS_ENABLE_COUNTER_LSB) & \
  618. INT_STATUS_ENABLE_COUNTER_MASK)
  619. #define INT_STATUS_ENABLE_MBOX_DATA_SET(x) \
  620. (((x) << INT_STATUS_ENABLE_MBOX_DATA_LSB) & \
  621. INT_STATUS_ENABLE_MBOX_DATA_MASK)
  622. #define CPU_INT_STATUS_ENABLE_BIT_SET(x) \
  623. (((x) << CPU_INT_STATUS_ENABLE_BIT_LSB) & \
  624. CPU_INT_STATUS_ENABLE_BIT_MASK)
  625. #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(x) \
  626. (((x) << ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) & \
  627. ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK)
  628. #define ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(x) \
  629. (((x) << ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) & \
  630. ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK)
  631. #define COUNTER_INT_STATUS_ENABLE_BIT_SET(x) \
  632. (((x) << COUNTER_INT_STATUS_ENABLE_BIT_LSB) & \
  633. COUNTER_INT_STATUS_ENABLE_BIT_MASK)
  634. #define ERROR_INT_STATUS_WAKEUP_GET(x) \
  635. (((x) & ERROR_INT_STATUS_WAKEUP_MASK) >> \
  636. ERROR_INT_STATUS_WAKEUP_LSB)
  637. #define ERROR_INT_STATUS_RX_UNDERFLOW_GET(x) \
  638. (((x) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) >> \
  639. ERROR_INT_STATUS_RX_UNDERFLOW_LSB)
  640. #define ERROR_INT_STATUS_TX_OVERFLOW_GET(x) \
  641. (((x) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) >> \
  642. ERROR_INT_STATUS_TX_OVERFLOW_LSB)
  643. #define HOST_INT_STATUS_CPU_GET(x) \
  644. (((x) & HOST_INT_STATUS_CPU_MASK) >> HOST_INT_STATUS_CPU_LSB)
  645. #define HOST_INT_STATUS_ERROR_GET(x) \
  646. (((x) & HOST_INT_STATUS_ERROR_MASK) >> HOST_INT_STATUS_ERROR_LSB)
  647. #define HOST_INT_STATUS_COUNTER_GET(x) \
  648. (((x) & HOST_INT_STATUS_COUNTER_MASK) >> HOST_INT_STATUS_COUNTER_LSB)
  649. #define RTC_STATE_V_GET(x) \
  650. (((x) & RTC_STATE_V_MASK) >> RTC_STATE_V_LSB)
  651. #if defined(SDIO_3_0)
  652. #define HOST_INT_STATUS_MBOX_DATA_GET(x) \
  653. (((x) & HOST_INT_STATUS_MBOX_DATA_MASK) >> \
  654. HOST_INT_STATUS_MBOX_DATA_LSB)
  655. #endif
  656. #define INVALID_REG_LOC_DUMMY_DATA 0xAA
  657. #define AR6320_CORE_CLK_DIV_ADDR 0x403fa8
  658. #define AR6320_CPU_PLL_INIT_DONE_ADDR 0x403fd0
  659. #define AR6320_CPU_SPEED_ADDR 0x403fa4
  660. #define AR6320V2_CORE_CLK_DIV_ADDR 0x403fd8
  661. #define AR6320V2_CPU_PLL_INIT_DONE_ADDR 0x403fd0
  662. #define AR6320V2_CPU_SPEED_ADDR 0x403fd4
  663. #define AR6320V3_CORE_CLK_DIV_ADDR 0x404028
  664. #define AR6320V3_CPU_PLL_INIT_DONE_ADDR 0x404020
  665. #define AR6320V3_CPU_SPEED_ADDR 0x404024
  666. typedef enum {
  667. SOC_REFCLK_UNKNOWN = -1, /* Unsupported ref clock -- use PLL Bypass */
  668. SOC_REFCLK_48_MHZ = 0,
  669. SOC_REFCLK_19_2_MHZ = 1,
  670. SOC_REFCLK_24_MHZ = 2,
  671. SOC_REFCLK_26_MHZ = 3,
  672. SOC_REFCLK_37_4_MHZ = 4,
  673. SOC_REFCLK_38_4_MHZ = 5,
  674. SOC_REFCLK_40_MHZ = 6,
  675. SOC_REFCLK_52_MHZ = 7,
  676. } A_refclk_speed_t;
  677. #define A_REFCLK_UNKNOWN SOC_REFCLK_UNKNOWN
  678. #define A_REFCLK_48_MHZ SOC_REFCLK_48_MHZ
  679. #define A_REFCLK_19_2_MHZ SOC_REFCLK_19_2_MHZ
  680. #define A_REFCLK_24_MHZ SOC_REFCLK_24_MHZ
  681. #define A_REFCLK_26_MHZ SOC_REFCLK_26_MHZ
  682. #define A_REFCLK_37_4_MHZ SOC_REFCLK_37_4_MHZ
  683. #define A_REFCLK_38_4_MHZ SOC_REFCLK_38_4_MHZ
  684. #define A_REFCLK_40_MHZ SOC_REFCLK_40_MHZ
  685. #define A_REFCLK_52_MHZ SOC_REFCLK_52_MHZ
  686. #define TARGET_CPU_FREQ 176000000
  687. struct wlan_pll_s {
  688. uint32_t refdiv;
  689. uint32_t div;
  690. uint32_t rnfrac;
  691. uint32_t outdiv;
  692. };
  693. struct cmnos_clock_s {
  694. A_refclk_speed_t refclk_speed;
  695. uint32_t refclk_hz;
  696. uint32_t pll_settling_time; /* 50us */
  697. struct wlan_pll_s wlan_pll;
  698. };
  699. typedef struct TGT_REG_SECTION {
  700. uint32_t start_addr;
  701. uint32_t end_addr;
  702. } tgt_reg_section;
  703. typedef struct TGT_REG_TABLE {
  704. tgt_reg_section *section;
  705. uint32_t section_size;
  706. } tgt_reg_table;
  707. struct hif_softc;
  708. void hif_target_register_tbl_attach(struct hif_softc *scn, u32 target_type);
  709. void hif_register_tbl_attach(struct hif_softc *scn, u32 hif_type);
  710. #endif /* _REGTABLE_PCIE_H_ */