hw.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926
  1. /*
  2. * Copyright (c) 2005-2011 Atheros Communications Inc.
  3. * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. #ifndef _HW_H_
  18. #define _HW_H_
  19. #include "targaddrs.h"
  20. #define ATH10K_FW_DIR "ath10k"
  21. #define QCA988X_2_0_DEVICE_ID (0x003c)
  22. #define QCA6164_2_1_DEVICE_ID (0x0041)
  23. #define QCA6174_2_1_DEVICE_ID (0x003e)
  24. #define QCA99X0_2_0_DEVICE_ID (0x0040)
  25. #define QCA9888_2_0_DEVICE_ID (0x0056)
  26. #define QCA9984_1_0_DEVICE_ID (0x0046)
  27. #define QCA9377_1_0_DEVICE_ID (0x0042)
  28. #define QCA9887_1_0_DEVICE_ID (0x0050)
  29. /* QCA988X 1.0 definitions (unsupported) */
  30. #define QCA988X_HW_1_0_CHIP_ID_REV 0x0
  31. /* QCA988X 2.0 definitions */
  32. #define QCA988X_HW_2_0_VERSION 0x4100016c
  33. #define QCA988X_HW_2_0_CHIP_ID_REV 0x2
  34. #define QCA988X_HW_2_0_FW_DIR ATH10K_FW_DIR "/QCA988X/hw2.0"
  35. #define QCA988X_HW_2_0_BOARD_DATA_FILE "board.bin"
  36. #define QCA988X_HW_2_0_PATCH_LOAD_ADDR 0x1234
  37. /* QCA9887 1.0 definitions */
  38. #define QCA9887_HW_1_0_VERSION 0x4100016d
  39. #define QCA9887_HW_1_0_CHIP_ID_REV 0
  40. #define QCA9887_HW_1_0_FW_DIR ATH10K_FW_DIR "/QCA9887/hw1.0"
  41. #define QCA9887_HW_1_0_BOARD_DATA_FILE "board.bin"
  42. #define QCA9887_HW_1_0_PATCH_LOAD_ADDR 0x1234
  43. /* QCA6174 target BMI version signatures */
  44. #define QCA6174_HW_1_0_VERSION 0x05000000
  45. #define QCA6174_HW_1_1_VERSION 0x05000001
  46. #define QCA6174_HW_1_3_VERSION 0x05000003
  47. #define QCA6174_HW_2_1_VERSION 0x05010000
  48. #define QCA6174_HW_3_0_VERSION 0x05020000
  49. #define QCA6174_HW_3_2_VERSION 0x05030000
  50. /* QCA9377 target BMI version signatures */
  51. #define QCA9377_HW_1_0_DEV_VERSION 0x05020000
  52. #define QCA9377_HW_1_1_DEV_VERSION 0x05020001
  53. enum qca6174_pci_rev {
  54. QCA6174_PCI_REV_1_1 = 0x11,
  55. QCA6174_PCI_REV_1_3 = 0x13,
  56. QCA6174_PCI_REV_2_0 = 0x20,
  57. QCA6174_PCI_REV_3_0 = 0x30,
  58. };
  59. enum qca6174_chip_id_rev {
  60. QCA6174_HW_1_0_CHIP_ID_REV = 0,
  61. QCA6174_HW_1_1_CHIP_ID_REV = 1,
  62. QCA6174_HW_1_3_CHIP_ID_REV = 2,
  63. QCA6174_HW_2_1_CHIP_ID_REV = 4,
  64. QCA6174_HW_2_2_CHIP_ID_REV = 5,
  65. QCA6174_HW_3_0_CHIP_ID_REV = 8,
  66. QCA6174_HW_3_1_CHIP_ID_REV = 9,
  67. QCA6174_HW_3_2_CHIP_ID_REV = 10,
  68. };
  69. enum qca9377_chip_id_rev {
  70. QCA9377_HW_1_0_CHIP_ID_REV = 0x0,
  71. QCA9377_HW_1_1_CHIP_ID_REV = 0x1,
  72. };
  73. #define QCA6174_HW_2_1_FW_DIR "ath10k/QCA6174/hw2.1"
  74. #define QCA6174_HW_2_1_BOARD_DATA_FILE "board.bin"
  75. #define QCA6174_HW_2_1_PATCH_LOAD_ADDR 0x1234
  76. #define QCA6174_HW_3_0_FW_DIR "ath10k/QCA6174/hw3.0"
  77. #define QCA6174_HW_3_0_BOARD_DATA_FILE "board.bin"
  78. #define QCA6174_HW_3_0_PATCH_LOAD_ADDR 0x1234
  79. /* QCA99X0 1.0 definitions (unsupported) */
  80. #define QCA99X0_HW_1_0_CHIP_ID_REV 0x0
  81. /* QCA99X0 2.0 definitions */
  82. #define QCA99X0_HW_2_0_DEV_VERSION 0x01000000
  83. #define QCA99X0_HW_2_0_CHIP_ID_REV 0x1
  84. #define QCA99X0_HW_2_0_FW_DIR ATH10K_FW_DIR "/QCA99X0/hw2.0"
  85. #define QCA99X0_HW_2_0_BOARD_DATA_FILE "board.bin"
  86. #define QCA99X0_HW_2_0_PATCH_LOAD_ADDR 0x1234
  87. /* QCA9984 1.0 defines */
  88. #define QCA9984_HW_1_0_DEV_VERSION 0x1000000
  89. #define QCA9984_HW_DEV_TYPE 0xa
  90. #define QCA9984_HW_1_0_CHIP_ID_REV 0x0
  91. #define QCA9984_HW_1_0_FW_DIR ATH10K_FW_DIR "/QCA9984/hw1.0"
  92. #define QCA9984_HW_1_0_BOARD_DATA_FILE "board.bin"
  93. #define QCA9984_HW_1_0_PATCH_LOAD_ADDR 0x1234
  94. /* QCA9888 2.0 defines */
  95. #define QCA9888_HW_2_0_DEV_VERSION 0x1000000
  96. #define QCA9888_HW_DEV_TYPE 0xc
  97. #define QCA9888_HW_2_0_CHIP_ID_REV 0x0
  98. #define QCA9888_HW_2_0_FW_DIR ATH10K_FW_DIR "/QCA9888/hw2.0"
  99. #define QCA9888_HW_2_0_BOARD_DATA_FILE "board.bin"
  100. #define QCA9888_HW_2_0_PATCH_LOAD_ADDR 0x1234
  101. /* QCA9377 1.0 definitions */
  102. #define QCA9377_HW_1_0_FW_DIR ATH10K_FW_DIR "/QCA9377/hw1.0"
  103. #define QCA9377_HW_1_0_BOARD_DATA_FILE "board.bin"
  104. #define QCA9377_HW_1_0_PATCH_LOAD_ADDR 0x1234
  105. /* QCA4019 1.0 definitions */
  106. #define QCA4019_HW_1_0_DEV_VERSION 0x01000000
  107. #define QCA4019_HW_1_0_FW_DIR ATH10K_FW_DIR "/QCA4019/hw1.0"
  108. #define QCA4019_HW_1_0_BOARD_DATA_FILE "board.bin"
  109. #define QCA4019_HW_1_0_PATCH_LOAD_ADDR 0x1234
  110. #define ATH10K_FW_FILE_BASE "firmware"
  111. #define ATH10K_FW_API_MAX 6
  112. #define ATH10K_FW_API_MIN 2
  113. #define ATH10K_FW_API2_FILE "firmware-2.bin"
  114. #define ATH10K_FW_API3_FILE "firmware-3.bin"
  115. /* added support for ATH10K_FW_IE_WMI_OP_VERSION */
  116. #define ATH10K_FW_API4_FILE "firmware-4.bin"
  117. /* HTT id conflict fix for management frames over HTT */
  118. #define ATH10K_FW_API5_FILE "firmware-5.bin"
  119. /* the firmware-6.bin blob */
  120. #define ATH10K_FW_API6_FILE "firmware-6.bin"
  121. #define ATH10K_FW_UTF_FILE "utf.bin"
  122. #define ATH10K_FW_UTF_API2_FILE "utf-2.bin"
  123. /* includes also the null byte */
  124. #define ATH10K_FIRMWARE_MAGIC "QCA-ATH10K"
  125. #define ATH10K_BOARD_MAGIC "QCA-ATH10K-BOARD"
  126. #define ATH10K_BOARD_API2_FILE "board-2.bin"
  127. #define REG_DUMP_COUNT_QCA988X 60
  128. struct ath10k_fw_ie {
  129. __le32 id;
  130. __le32 len;
  131. u8 data[0];
  132. };
  133. enum ath10k_fw_ie_type {
  134. ATH10K_FW_IE_FW_VERSION = 0,
  135. ATH10K_FW_IE_TIMESTAMP = 1,
  136. ATH10K_FW_IE_FEATURES = 2,
  137. ATH10K_FW_IE_FW_IMAGE = 3,
  138. ATH10K_FW_IE_OTP_IMAGE = 4,
  139. /* WMI "operations" interface version, 32 bit value. Supported from
  140. * FW API 4 and above.
  141. */
  142. ATH10K_FW_IE_WMI_OP_VERSION = 5,
  143. /* HTT "operations" interface version, 32 bit value. Supported from
  144. * FW API 5 and above.
  145. */
  146. ATH10K_FW_IE_HTT_OP_VERSION = 6,
  147. /* Code swap image for firmware binary */
  148. ATH10K_FW_IE_FW_CODE_SWAP_IMAGE = 7,
  149. };
  150. enum ath10k_fw_wmi_op_version {
  151. ATH10K_FW_WMI_OP_VERSION_UNSET = 0,
  152. ATH10K_FW_WMI_OP_VERSION_MAIN = 1,
  153. ATH10K_FW_WMI_OP_VERSION_10_1 = 2,
  154. ATH10K_FW_WMI_OP_VERSION_10_2 = 3,
  155. ATH10K_FW_WMI_OP_VERSION_TLV = 4,
  156. ATH10K_FW_WMI_OP_VERSION_10_2_4 = 5,
  157. ATH10K_FW_WMI_OP_VERSION_10_4 = 6,
  158. /* keep last */
  159. ATH10K_FW_WMI_OP_VERSION_MAX,
  160. };
  161. enum ath10k_fw_htt_op_version {
  162. ATH10K_FW_HTT_OP_VERSION_UNSET = 0,
  163. ATH10K_FW_HTT_OP_VERSION_MAIN = 1,
  164. /* also used in 10.2 and 10.2.4 branches */
  165. ATH10K_FW_HTT_OP_VERSION_10_1 = 2,
  166. ATH10K_FW_HTT_OP_VERSION_TLV = 3,
  167. ATH10K_FW_HTT_OP_VERSION_10_4 = 4,
  168. /* keep last */
  169. ATH10K_FW_HTT_OP_VERSION_MAX,
  170. };
  171. enum ath10k_bd_ie_type {
  172. /* contains sub IEs of enum ath10k_bd_ie_board_type */
  173. ATH10K_BD_IE_BOARD = 0,
  174. };
  175. enum ath10k_bd_ie_board_type {
  176. ATH10K_BD_IE_BOARD_NAME = 0,
  177. ATH10K_BD_IE_BOARD_DATA = 1,
  178. };
  179. enum ath10k_hw_rev {
  180. ATH10K_HW_QCA988X,
  181. ATH10K_HW_QCA6174,
  182. ATH10K_HW_QCA99X0,
  183. ATH10K_HW_QCA9888,
  184. ATH10K_HW_QCA9984,
  185. ATH10K_HW_QCA9377,
  186. ATH10K_HW_QCA4019,
  187. ATH10K_HW_QCA9887,
  188. };
  189. struct ath10k_hw_regs {
  190. u32 rtc_soc_base_address;
  191. u32 rtc_wmac_base_address;
  192. u32 soc_core_base_address;
  193. u32 wlan_mac_base_address;
  194. u32 ce_wrapper_base_address;
  195. u32 ce0_base_address;
  196. u32 ce1_base_address;
  197. u32 ce2_base_address;
  198. u32 ce3_base_address;
  199. u32 ce4_base_address;
  200. u32 ce5_base_address;
  201. u32 ce6_base_address;
  202. u32 ce7_base_address;
  203. u32 soc_reset_control_si0_rst_mask;
  204. u32 soc_reset_control_ce_rst_mask;
  205. u32 soc_chip_id_address;
  206. u32 scratch_3_address;
  207. u32 fw_indicator_address;
  208. u32 pcie_local_base_address;
  209. u32 ce_wrap_intr_sum_host_msi_lsb;
  210. u32 ce_wrap_intr_sum_host_msi_mask;
  211. u32 pcie_intr_fw_mask;
  212. u32 pcie_intr_ce_mask_all;
  213. u32 pcie_intr_clr_address;
  214. u32 cpu_pll_init_address;
  215. u32 cpu_speed_address;
  216. u32 core_clk_div_address;
  217. };
  218. extern const struct ath10k_hw_regs qca988x_regs;
  219. extern const struct ath10k_hw_regs qca6174_regs;
  220. extern const struct ath10k_hw_regs qca99x0_regs;
  221. extern const struct ath10k_hw_regs qca4019_regs;
  222. struct ath10k_hw_values {
  223. u32 rtc_state_val_on;
  224. u8 ce_count;
  225. u8 msi_assign_ce_max;
  226. u8 num_target_ce_config_wlan;
  227. u16 ce_desc_meta_data_mask;
  228. u8 ce_desc_meta_data_lsb;
  229. };
  230. extern const struct ath10k_hw_values qca988x_values;
  231. extern const struct ath10k_hw_values qca6174_values;
  232. extern const struct ath10k_hw_values qca99x0_values;
  233. extern const struct ath10k_hw_values qca9888_values;
  234. extern const struct ath10k_hw_values qca4019_values;
  235. void ath10k_hw_fill_survey_time(struct ath10k *ar, struct survey_info *survey,
  236. u32 cc, u32 rcc, u32 cc_prev, u32 rcc_prev);
  237. #define QCA_REV_988X(ar) ((ar)->hw_rev == ATH10K_HW_QCA988X)
  238. #define QCA_REV_9887(ar) ((ar)->hw_rev == ATH10K_HW_QCA9887)
  239. #define QCA_REV_6174(ar) ((ar)->hw_rev == ATH10K_HW_QCA6174)
  240. #define QCA_REV_99X0(ar) ((ar)->hw_rev == ATH10K_HW_QCA99X0)
  241. #define QCA_REV_9888(ar) ((ar)->hw_rev == ATH10K_HW_QCA9888)
  242. #define QCA_REV_9984(ar) ((ar)->hw_rev == ATH10K_HW_QCA9984)
  243. #define QCA_REV_9377(ar) ((ar)->hw_rev == ATH10K_HW_QCA9377)
  244. #define QCA_REV_40XX(ar) ((ar)->hw_rev == ATH10K_HW_QCA4019)
  245. /* Known peculiarities:
  246. * - raw appears in nwifi decap, raw and nwifi appear in ethernet decap
  247. * - raw have FCS, nwifi doesn't
  248. * - ethernet frames have 802.11 header decapped and parts (base hdr, cipher
  249. * param, llc/snap) are aligned to 4byte boundaries each
  250. */
  251. enum ath10k_hw_txrx_mode {
  252. ATH10K_HW_TXRX_RAW = 0,
  253. /* Native Wifi decap mode is used to align IP frames to 4-byte
  254. * boundaries and avoid a very expensive re-alignment in mac80211.
  255. */
  256. ATH10K_HW_TXRX_NATIVE_WIFI = 1,
  257. ATH10K_HW_TXRX_ETHERNET = 2,
  258. /* Valid for HTT >= 3.0. Used for management frames in TX_FRM. */
  259. ATH10K_HW_TXRX_MGMT = 3,
  260. };
  261. enum ath10k_mcast2ucast_mode {
  262. ATH10K_MCAST2UCAST_DISABLED = 0,
  263. ATH10K_MCAST2UCAST_ENABLED = 1,
  264. };
  265. enum ath10k_hw_rate_ofdm {
  266. ATH10K_HW_RATE_OFDM_48M = 0,
  267. ATH10K_HW_RATE_OFDM_24M,
  268. ATH10K_HW_RATE_OFDM_12M,
  269. ATH10K_HW_RATE_OFDM_6M,
  270. ATH10K_HW_RATE_OFDM_54M,
  271. ATH10K_HW_RATE_OFDM_36M,
  272. ATH10K_HW_RATE_OFDM_18M,
  273. ATH10K_HW_RATE_OFDM_9M,
  274. };
  275. enum ath10k_hw_rate_cck {
  276. ATH10K_HW_RATE_CCK_LP_11M = 0,
  277. ATH10K_HW_RATE_CCK_LP_5_5M,
  278. ATH10K_HW_RATE_CCK_LP_2M,
  279. ATH10K_HW_RATE_CCK_LP_1M,
  280. ATH10K_HW_RATE_CCK_SP_11M,
  281. ATH10K_HW_RATE_CCK_SP_5_5M,
  282. ATH10K_HW_RATE_CCK_SP_2M,
  283. };
  284. enum ath10k_hw_rate_rev2_cck {
  285. ATH10K_HW_RATE_REV2_CCK_LP_1M = 1,
  286. ATH10K_HW_RATE_REV2_CCK_LP_2M,
  287. ATH10K_HW_RATE_REV2_CCK_LP_5_5M,
  288. ATH10K_HW_RATE_REV2_CCK_LP_11M,
  289. ATH10K_HW_RATE_REV2_CCK_SP_2M,
  290. ATH10K_HW_RATE_REV2_CCK_SP_5_5M,
  291. ATH10K_HW_RATE_REV2_CCK_SP_11M,
  292. };
  293. enum ath10k_hw_cc_wraparound_type {
  294. ATH10K_HW_CC_WRAP_DISABLED = 0,
  295. /* This type is when the HW chip has a quirky Cycle Counter
  296. * wraparound which resets to 0x7fffffff instead of 0. All
  297. * other CC related counters (e.g. Rx Clear Count) are divided
  298. * by 2 so they never wraparound themselves.
  299. */
  300. ATH10K_HW_CC_WRAP_SHIFTED_ALL = 1,
  301. /* Each hw counter wrapsaround independently. When the
  302. * counter overflows the repestive counter is right shifted
  303. * by 1, i.e reset to 0x7fffffff, and other counters will be
  304. * running unaffected. In this type of wraparound, it should
  305. * be possible to report accurate Rx busy time unlike the
  306. * first type.
  307. */
  308. ATH10K_HW_CC_WRAP_SHIFTED_EACH = 2,
  309. };
  310. enum ath10k_hw_refclk_speed {
  311. ATH10K_HW_REFCLK_UNKNOWN = -1,
  312. ATH10K_HW_REFCLK_48_MHZ = 0,
  313. ATH10K_HW_REFCLK_19_2_MHZ = 1,
  314. ATH10K_HW_REFCLK_24_MHZ = 2,
  315. ATH10K_HW_REFCLK_26_MHZ = 3,
  316. ATH10K_HW_REFCLK_37_4_MHZ = 4,
  317. ATH10K_HW_REFCLK_38_4_MHZ = 5,
  318. ATH10K_HW_REFCLK_40_MHZ = 6,
  319. ATH10K_HW_REFCLK_52_MHZ = 7,
  320. /* must be the last one */
  321. ATH10K_HW_REFCLK_COUNT,
  322. };
  323. struct ath10k_hw_clk_params {
  324. u32 refclk;
  325. u32 div;
  326. u32 rnfrac;
  327. u32 settle_time;
  328. u32 refdiv;
  329. u32 outdiv;
  330. };
  331. struct ath10k_hw_params {
  332. u32 id;
  333. u16 dev_id;
  334. const char *name;
  335. u32 patch_load_addr;
  336. int uart_pin;
  337. u32 otp_exe_param;
  338. /* Type of hw cycle counter wraparound logic, for more info
  339. * refer enum ath10k_hw_cc_wraparound_type.
  340. */
  341. enum ath10k_hw_cc_wraparound_type cc_wraparound_type;
  342. /* Some of chip expects fragment descriptor to be continuous
  343. * memory for any TX operation. Set continuous_frag_desc flag
  344. * for the hardware which have such requirement.
  345. */
  346. bool continuous_frag_desc;
  347. /* CCK hardware rate table mapping for the newer chipsets
  348. * like QCA99X0, QCA4019 got revised. The CCK h/w rate values
  349. * are in a proper order with respect to the rate/preamble
  350. */
  351. bool cck_rate_map_rev2;
  352. u32 channel_counters_freq_hz;
  353. /* Mgmt tx descriptors threshold for limiting probe response
  354. * frames.
  355. */
  356. u32 max_probe_resp_desc_thres;
  357. u32 tx_chain_mask;
  358. u32 rx_chain_mask;
  359. u32 max_spatial_stream;
  360. u32 cal_data_len;
  361. struct ath10k_hw_params_fw {
  362. const char *dir;
  363. const char *board;
  364. size_t board_size;
  365. size_t board_ext_size;
  366. } fw;
  367. /* qca99x0 family chips deliver broadcast/multicast management
  368. * frames encrypted and expect software do decryption.
  369. */
  370. bool sw_decrypt_mcast_mgmt;
  371. const struct ath10k_hw_ops *hw_ops;
  372. /* Number of bytes used for alignment in rx_hdr_status of rx desc. */
  373. int decap_align_bytes;
  374. /* hw specific clock control parameters */
  375. const struct ath10k_hw_clk_params *hw_clk;
  376. int target_cpu_freq;
  377. /* Number of bytes to be discarded for each FFT sample */
  378. int spectral_bin_discard;
  379. };
  380. struct htt_rx_desc;
  381. /* Defines needed for Rx descriptor abstraction */
  382. struct ath10k_hw_ops {
  383. int (*rx_desc_get_l3_pad_bytes)(struct htt_rx_desc *rxd);
  384. void (*set_coverage_class)(struct ath10k *ar, s16 value);
  385. int (*enable_pll_clk)(struct ath10k *ar);
  386. };
  387. extern const struct ath10k_hw_ops qca988x_ops;
  388. extern const struct ath10k_hw_ops qca99x0_ops;
  389. extern const struct ath10k_hw_ops qca6174_ops;
  390. extern const struct ath10k_hw_clk_params qca6174_clk[];
  391. static inline int
  392. ath10k_rx_desc_get_l3_pad_bytes(struct ath10k_hw_params *hw,
  393. struct htt_rx_desc *rxd)
  394. {
  395. if (hw->hw_ops->rx_desc_get_l3_pad_bytes)
  396. return hw->hw_ops->rx_desc_get_l3_pad_bytes(rxd);
  397. return 0;
  398. }
  399. /* Target specific defines for MAIN firmware */
  400. #define TARGET_NUM_VDEVS 8
  401. #define TARGET_NUM_PEER_AST 2
  402. #define TARGET_NUM_WDS_ENTRIES 32
  403. #define TARGET_DMA_BURST_SIZE 0
  404. #define TARGET_MAC_AGGR_DELIM 0
  405. #define TARGET_AST_SKID_LIMIT 16
  406. #define TARGET_NUM_STATIONS 16
  407. #define TARGET_NUM_PEERS ((TARGET_NUM_STATIONS) + \
  408. (TARGET_NUM_VDEVS))
  409. #define TARGET_NUM_OFFLOAD_PEERS 0
  410. #define TARGET_NUM_OFFLOAD_REORDER_BUFS 0
  411. #define TARGET_NUM_PEER_KEYS 2
  412. #define TARGET_NUM_TIDS ((TARGET_NUM_PEERS) * 2)
  413. #define TARGET_TX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
  414. #define TARGET_RX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
  415. #define TARGET_RX_TIMEOUT_LO_PRI 100
  416. #define TARGET_RX_TIMEOUT_HI_PRI 40
  417. #define TARGET_SCAN_MAX_PENDING_REQS 4
  418. #define TARGET_BMISS_OFFLOAD_MAX_VDEV 3
  419. #define TARGET_ROAM_OFFLOAD_MAX_VDEV 3
  420. #define TARGET_ROAM_OFFLOAD_MAX_AP_PROFILES 8
  421. #define TARGET_GTK_OFFLOAD_MAX_VDEV 3
  422. #define TARGET_NUM_MCAST_GROUPS 0
  423. #define TARGET_NUM_MCAST_TABLE_ELEMS 0
  424. #define TARGET_MCAST2UCAST_MODE ATH10K_MCAST2UCAST_DISABLED
  425. #define TARGET_TX_DBG_LOG_SIZE 1024
  426. #define TARGET_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 0
  427. #define TARGET_VOW_CONFIG 0
  428. #define TARGET_NUM_MSDU_DESC (1024 + 400)
  429. #define TARGET_MAX_FRAG_ENTRIES 0
  430. /* Target specific defines for 10.X firmware */
  431. #define TARGET_10X_NUM_VDEVS 16
  432. #define TARGET_10X_NUM_PEER_AST 2
  433. #define TARGET_10X_NUM_WDS_ENTRIES 32
  434. #define TARGET_10X_DMA_BURST_SIZE 0
  435. #define TARGET_10X_MAC_AGGR_DELIM 0
  436. #define TARGET_10X_AST_SKID_LIMIT 128
  437. #define TARGET_10X_NUM_STATIONS 128
  438. #define TARGET_10X_TX_STATS_NUM_STATIONS 118
  439. #define TARGET_10X_NUM_PEERS ((TARGET_10X_NUM_STATIONS) + \
  440. (TARGET_10X_NUM_VDEVS))
  441. #define TARGET_10X_TX_STATS_NUM_PEERS ((TARGET_10X_TX_STATS_NUM_STATIONS) + \
  442. (TARGET_10X_NUM_VDEVS))
  443. #define TARGET_10X_NUM_OFFLOAD_PEERS 0
  444. #define TARGET_10X_NUM_OFFLOAD_REORDER_BUFS 0
  445. #define TARGET_10X_NUM_PEER_KEYS 2
  446. #define TARGET_10X_NUM_TIDS_MAX 256
  447. #define TARGET_10X_NUM_TIDS min((TARGET_10X_NUM_TIDS_MAX), \
  448. (TARGET_10X_NUM_PEERS) * 2)
  449. #define TARGET_10X_TX_STATS_NUM_TIDS min((TARGET_10X_NUM_TIDS_MAX), \
  450. (TARGET_10X_TX_STATS_NUM_PEERS) * 2)
  451. #define TARGET_10X_TX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
  452. #define TARGET_10X_RX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
  453. #define TARGET_10X_RX_TIMEOUT_LO_PRI 100
  454. #define TARGET_10X_RX_TIMEOUT_HI_PRI 40
  455. #define TARGET_10X_SCAN_MAX_PENDING_REQS 4
  456. #define TARGET_10X_BMISS_OFFLOAD_MAX_VDEV 2
  457. #define TARGET_10X_ROAM_OFFLOAD_MAX_VDEV 2
  458. #define TARGET_10X_ROAM_OFFLOAD_MAX_AP_PROFILES 8
  459. #define TARGET_10X_GTK_OFFLOAD_MAX_VDEV 3
  460. #define TARGET_10X_NUM_MCAST_GROUPS 0
  461. #define TARGET_10X_NUM_MCAST_TABLE_ELEMS 0
  462. #define TARGET_10X_MCAST2UCAST_MODE ATH10K_MCAST2UCAST_DISABLED
  463. #define TARGET_10X_TX_DBG_LOG_SIZE 1024
  464. #define TARGET_10X_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 1
  465. #define TARGET_10X_VOW_CONFIG 0
  466. #define TARGET_10X_NUM_MSDU_DESC (1024 + 400)
  467. #define TARGET_10X_MAX_FRAG_ENTRIES 0
  468. /* 10.2 parameters */
  469. #define TARGET_10_2_DMA_BURST_SIZE 0
  470. /* Target specific defines for WMI-TLV firmware */
  471. #define TARGET_TLV_NUM_VDEVS 4
  472. #define TARGET_TLV_NUM_STATIONS 32
  473. #define TARGET_TLV_NUM_PEERS 33
  474. #define TARGET_TLV_NUM_TDLS_VDEVS 1
  475. #define TARGET_TLV_NUM_TIDS ((TARGET_TLV_NUM_PEERS) * 2)
  476. #define TARGET_TLV_NUM_MSDU_DESC (1024 + 32)
  477. #define TARGET_TLV_NUM_WOW_PATTERNS 22
  478. /* Diagnostic Window */
  479. #define CE_DIAG_PIPE 7
  480. #define NUM_TARGET_CE_CONFIG_WLAN ar->hw_values->num_target_ce_config_wlan
  481. /* Target specific defines for 10.4 firmware */
  482. #define TARGET_10_4_NUM_VDEVS 16
  483. #define TARGET_10_4_NUM_STATIONS 32
  484. #define TARGET_10_4_NUM_PEERS ((TARGET_10_4_NUM_STATIONS) + \
  485. (TARGET_10_4_NUM_VDEVS))
  486. #define TARGET_10_4_ACTIVE_PEERS 0
  487. #define TARGET_10_4_NUM_QCACHE_PEERS_MAX 512
  488. #define TARGET_10_4_QCACHE_ACTIVE_PEERS 50
  489. #define TARGET_10_4_QCACHE_ACTIVE_PEERS_PFC 35
  490. #define TARGET_10_4_NUM_OFFLOAD_PEERS 0
  491. #define TARGET_10_4_NUM_OFFLOAD_REORDER_BUFFS 0
  492. #define TARGET_10_4_NUM_PEER_KEYS 2
  493. #define TARGET_10_4_TGT_NUM_TIDS ((TARGET_10_4_NUM_PEERS) * 2)
  494. #define TARGET_10_4_NUM_MSDU_DESC (1024 + 400)
  495. #define TARGET_10_4_NUM_MSDU_DESC_PFC 2500
  496. #define TARGET_10_4_AST_SKID_LIMIT 32
  497. /* 100 ms for video, best-effort, and background */
  498. #define TARGET_10_4_RX_TIMEOUT_LO_PRI 100
  499. /* 40 ms for voice */
  500. #define TARGET_10_4_RX_TIMEOUT_HI_PRI 40
  501. #define TARGET_10_4_RX_DECAP_MODE ATH10K_HW_TXRX_NATIVE_WIFI
  502. #define TARGET_10_4_SCAN_MAX_REQS 4
  503. #define TARGET_10_4_BMISS_OFFLOAD_MAX_VDEV 3
  504. #define TARGET_10_4_ROAM_OFFLOAD_MAX_VDEV 3
  505. #define TARGET_10_4_ROAM_OFFLOAD_MAX_PROFILES 8
  506. /* Note: mcast to ucast is disabled by default */
  507. #define TARGET_10_4_NUM_MCAST_GROUPS 0
  508. #define TARGET_10_4_NUM_MCAST_TABLE_ELEMS 0
  509. #define TARGET_10_4_MCAST2UCAST_MODE 0
  510. #define TARGET_10_4_TX_DBG_LOG_SIZE 1024
  511. #define TARGET_10_4_NUM_WDS_ENTRIES 32
  512. #define TARGET_10_4_DMA_BURST_SIZE 0
  513. #define TARGET_10_4_MAC_AGGR_DELIM 0
  514. #define TARGET_10_4_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 1
  515. #define TARGET_10_4_VOW_CONFIG 0
  516. #define TARGET_10_4_GTK_OFFLOAD_MAX_VDEV 3
  517. #define TARGET_10_4_11AC_TX_MAX_FRAGS 2
  518. #define TARGET_10_4_MAX_PEER_EXT_STATS 16
  519. #define TARGET_10_4_SMART_ANT_CAP 0
  520. #define TARGET_10_4_BK_MIN_FREE 0
  521. #define TARGET_10_4_BE_MIN_FREE 0
  522. #define TARGET_10_4_VI_MIN_FREE 0
  523. #define TARGET_10_4_VO_MIN_FREE 0
  524. #define TARGET_10_4_RX_BATCH_MODE 1
  525. #define TARGET_10_4_THERMAL_THROTTLING_CONFIG 0
  526. #define TARGET_10_4_ATF_CONFIG 0
  527. #define TARGET_10_4_IPHDR_PAD_CONFIG 1
  528. #define TARGET_10_4_QWRAP_CONFIG 0
  529. /* Maximum number of Copy Engine's supported */
  530. #define CE_COUNT_MAX 12
  531. /* Number of Copy Engines supported */
  532. #define CE_COUNT ar->hw_values->ce_count
  533. /*
  534. * Granted MSIs are assigned as follows:
  535. * Firmware uses the first
  536. * Remaining MSIs, if any, are used by Copy Engines
  537. * This mapping is known to both Target firmware and Host software.
  538. * It may be changed as long as Host and Target are kept in sync.
  539. */
  540. /* MSI for firmware (errors, etc.) */
  541. #define MSI_ASSIGN_FW 0
  542. /* MSIs for Copy Engines */
  543. #define MSI_ASSIGN_CE_INITIAL 1
  544. #define MSI_ASSIGN_CE_MAX ar->hw_values->msi_assign_ce_max
  545. /* as of IP3.7.1 */
  546. #define RTC_STATE_V_ON ar->hw_values->rtc_state_val_on
  547. #define RTC_STATE_V_LSB 0
  548. #define RTC_STATE_V_MASK 0x00000007
  549. #define RTC_STATE_ADDRESS 0x0000
  550. #define PCIE_SOC_WAKE_V_MASK 0x00000001
  551. #define PCIE_SOC_WAKE_ADDRESS 0x0004
  552. #define PCIE_SOC_WAKE_RESET 0x00000000
  553. #define SOC_GLOBAL_RESET_ADDRESS 0x0008
  554. #define RTC_SOC_BASE_ADDRESS ar->regs->rtc_soc_base_address
  555. #define RTC_WMAC_BASE_ADDRESS ar->regs->rtc_wmac_base_address
  556. #define MAC_COEX_BASE_ADDRESS 0x00006000
  557. #define BT_COEX_BASE_ADDRESS 0x00007000
  558. #define SOC_PCIE_BASE_ADDRESS 0x00008000
  559. #define SOC_CORE_BASE_ADDRESS ar->regs->soc_core_base_address
  560. #define WLAN_UART_BASE_ADDRESS 0x0000c000
  561. #define WLAN_SI_BASE_ADDRESS 0x00010000
  562. #define WLAN_GPIO_BASE_ADDRESS 0x00014000
  563. #define WLAN_ANALOG_INTF_BASE_ADDRESS 0x0001c000
  564. #define WLAN_MAC_BASE_ADDRESS ar->regs->wlan_mac_base_address
  565. #define EFUSE_BASE_ADDRESS 0x00030000
  566. #define FPGA_REG_BASE_ADDRESS 0x00039000
  567. #define WLAN_UART2_BASE_ADDRESS 0x00054c00
  568. #define CE_WRAPPER_BASE_ADDRESS ar->regs->ce_wrapper_base_address
  569. #define CE0_BASE_ADDRESS ar->regs->ce0_base_address
  570. #define CE1_BASE_ADDRESS ar->regs->ce1_base_address
  571. #define CE2_BASE_ADDRESS ar->regs->ce2_base_address
  572. #define CE3_BASE_ADDRESS ar->regs->ce3_base_address
  573. #define CE4_BASE_ADDRESS ar->regs->ce4_base_address
  574. #define CE5_BASE_ADDRESS ar->regs->ce5_base_address
  575. #define CE6_BASE_ADDRESS ar->regs->ce6_base_address
  576. #define CE7_BASE_ADDRESS ar->regs->ce7_base_address
  577. #define DBI_BASE_ADDRESS 0x00060000
  578. #define WLAN_ANALOG_INTF_PCIE_BASE_ADDRESS 0x0006c000
  579. #define PCIE_LOCAL_BASE_ADDRESS ar->regs->pcie_local_base_address
  580. #define SOC_RESET_CONTROL_ADDRESS 0x00000000
  581. #define SOC_RESET_CONTROL_OFFSET 0x00000000
  582. #define SOC_RESET_CONTROL_SI0_RST_MASK ar->regs->soc_reset_control_si0_rst_mask
  583. #define SOC_RESET_CONTROL_CE_RST_MASK ar->regs->soc_reset_control_ce_rst_mask
  584. #define SOC_RESET_CONTROL_CPU_WARM_RST_MASK 0x00000040
  585. #define SOC_CPU_CLOCK_OFFSET 0x00000020
  586. #define SOC_CPU_CLOCK_STANDARD_LSB 0
  587. #define SOC_CPU_CLOCK_STANDARD_MASK 0x00000003
  588. #define SOC_CLOCK_CONTROL_OFFSET 0x00000028
  589. #define SOC_CLOCK_CONTROL_SI0_CLK_MASK 0x00000001
  590. #define SOC_SYSTEM_SLEEP_OFFSET 0x000000c4
  591. #define SOC_LPO_CAL_OFFSET 0x000000e0
  592. #define SOC_LPO_CAL_ENABLE_LSB 20
  593. #define SOC_LPO_CAL_ENABLE_MASK 0x00100000
  594. #define SOC_LF_TIMER_CONTROL0_ADDRESS 0x00000050
  595. #define SOC_LF_TIMER_CONTROL0_ENABLE_MASK 0x00000004
  596. #define SOC_CHIP_ID_ADDRESS ar->regs->soc_chip_id_address
  597. #define SOC_CHIP_ID_REV_LSB 8
  598. #define SOC_CHIP_ID_REV_MASK 0x00000f00
  599. #define WLAN_RESET_CONTROL_COLD_RST_MASK 0x00000008
  600. #define WLAN_RESET_CONTROL_WARM_RST_MASK 0x00000004
  601. #define WLAN_SYSTEM_SLEEP_DISABLE_LSB 0
  602. #define WLAN_SYSTEM_SLEEP_DISABLE_MASK 0x00000001
  603. #define WLAN_GPIO_PIN0_ADDRESS 0x00000028
  604. #define WLAN_GPIO_PIN0_CONFIG_LSB 11
  605. #define WLAN_GPIO_PIN0_CONFIG_MASK 0x00007800
  606. #define WLAN_GPIO_PIN0_PAD_PULL_LSB 5
  607. #define WLAN_GPIO_PIN0_PAD_PULL_MASK 0x00000060
  608. #define WLAN_GPIO_PIN1_ADDRESS 0x0000002c
  609. #define WLAN_GPIO_PIN1_CONFIG_MASK 0x00007800
  610. #define WLAN_GPIO_PIN10_ADDRESS 0x00000050
  611. #define WLAN_GPIO_PIN11_ADDRESS 0x00000054
  612. #define WLAN_GPIO_PIN12_ADDRESS 0x00000058
  613. #define WLAN_GPIO_PIN13_ADDRESS 0x0000005c
  614. #define CLOCK_GPIO_OFFSET 0xffffffff
  615. #define CLOCK_GPIO_BT_CLK_OUT_EN_LSB 0
  616. #define CLOCK_GPIO_BT_CLK_OUT_EN_MASK 0
  617. #define SI_CONFIG_OFFSET 0x00000000
  618. #define SI_CONFIG_ERR_INT_LSB 19
  619. #define SI_CONFIG_ERR_INT_MASK 0x00080000
  620. #define SI_CONFIG_BIDIR_OD_DATA_LSB 18
  621. #define SI_CONFIG_BIDIR_OD_DATA_MASK 0x00040000
  622. #define SI_CONFIG_I2C_LSB 16
  623. #define SI_CONFIG_I2C_MASK 0x00010000
  624. #define SI_CONFIG_POS_SAMPLE_LSB 7
  625. #define SI_CONFIG_POS_SAMPLE_MASK 0x00000080
  626. #define SI_CONFIG_INACTIVE_DATA_LSB 5
  627. #define SI_CONFIG_INACTIVE_DATA_MASK 0x00000020
  628. #define SI_CONFIG_INACTIVE_CLK_LSB 4
  629. #define SI_CONFIG_INACTIVE_CLK_MASK 0x00000010
  630. #define SI_CONFIG_DIVIDER_LSB 0
  631. #define SI_CONFIG_DIVIDER_MASK 0x0000000f
  632. #define SI_CS_OFFSET 0x00000004
  633. #define SI_CS_DONE_ERR_LSB 10
  634. #define SI_CS_DONE_ERR_MASK 0x00000400
  635. #define SI_CS_DONE_INT_LSB 9
  636. #define SI_CS_DONE_INT_MASK 0x00000200
  637. #define SI_CS_START_LSB 8
  638. #define SI_CS_START_MASK 0x00000100
  639. #define SI_CS_RX_CNT_LSB 4
  640. #define SI_CS_RX_CNT_MASK 0x000000f0
  641. #define SI_CS_TX_CNT_LSB 0
  642. #define SI_CS_TX_CNT_MASK 0x0000000f
  643. #define SI_TX_DATA0_OFFSET 0x00000008
  644. #define SI_TX_DATA1_OFFSET 0x0000000c
  645. #define SI_RX_DATA0_OFFSET 0x00000010
  646. #define SI_RX_DATA1_OFFSET 0x00000014
  647. #define CORE_CTRL_CPU_INTR_MASK 0x00002000
  648. #define CORE_CTRL_PCIE_REG_31_MASK 0x00000800
  649. #define CORE_CTRL_ADDRESS 0x0000
  650. #define PCIE_INTR_ENABLE_ADDRESS 0x0008
  651. #define PCIE_INTR_CAUSE_ADDRESS 0x000c
  652. #define PCIE_INTR_CLR_ADDRESS ar->regs->pcie_intr_clr_address
  653. #define SCRATCH_3_ADDRESS ar->regs->scratch_3_address
  654. #define CPU_INTR_ADDRESS 0x0010
  655. #define CCNT_TO_MSEC(ar, x) ((x) / ar->hw_params.channel_counters_freq_hz)
  656. /* Firmware indications to the Host via SCRATCH_3 register. */
  657. #define FW_INDICATOR_ADDRESS ar->regs->fw_indicator_address
  658. #define FW_IND_EVENT_PENDING 1
  659. #define FW_IND_INITIALIZED 2
  660. #define FW_IND_HOST_READY 0x80000000
  661. /* HOST_REG interrupt from firmware */
  662. #define PCIE_INTR_FIRMWARE_MASK ar->regs->pcie_intr_fw_mask
  663. #define PCIE_INTR_CE_MASK_ALL ar->regs->pcie_intr_ce_mask_all
  664. #define DRAM_BASE_ADDRESS 0x00400000
  665. #define PCIE_BAR_REG_ADDRESS 0x40030
  666. #define MISSING 0
  667. #define SYSTEM_SLEEP_OFFSET SOC_SYSTEM_SLEEP_OFFSET
  668. #define WLAN_SYSTEM_SLEEP_OFFSET SOC_SYSTEM_SLEEP_OFFSET
  669. #define WLAN_RESET_CONTROL_OFFSET SOC_RESET_CONTROL_OFFSET
  670. #define CLOCK_CONTROL_OFFSET SOC_CLOCK_CONTROL_OFFSET
  671. #define CLOCK_CONTROL_SI0_CLK_MASK SOC_CLOCK_CONTROL_SI0_CLK_MASK
  672. #define RESET_CONTROL_MBOX_RST_MASK MISSING
  673. #define RESET_CONTROL_SI0_RST_MASK SOC_RESET_CONTROL_SI0_RST_MASK
  674. #define GPIO_BASE_ADDRESS WLAN_GPIO_BASE_ADDRESS
  675. #define GPIO_PIN0_OFFSET WLAN_GPIO_PIN0_ADDRESS
  676. #define GPIO_PIN1_OFFSET WLAN_GPIO_PIN1_ADDRESS
  677. #define GPIO_PIN0_CONFIG_LSB WLAN_GPIO_PIN0_CONFIG_LSB
  678. #define GPIO_PIN0_CONFIG_MASK WLAN_GPIO_PIN0_CONFIG_MASK
  679. #define GPIO_PIN0_PAD_PULL_LSB WLAN_GPIO_PIN0_PAD_PULL_LSB
  680. #define GPIO_PIN0_PAD_PULL_MASK WLAN_GPIO_PIN0_PAD_PULL_MASK
  681. #define GPIO_PIN1_CONFIG_MASK WLAN_GPIO_PIN1_CONFIG_MASK
  682. #define SI_BASE_ADDRESS WLAN_SI_BASE_ADDRESS
  683. #define SCRATCH_BASE_ADDRESS SOC_CORE_BASE_ADDRESS
  684. #define LOCAL_SCRATCH_OFFSET 0x18
  685. #define CPU_CLOCK_OFFSET SOC_CPU_CLOCK_OFFSET
  686. #define LPO_CAL_OFFSET SOC_LPO_CAL_OFFSET
  687. #define GPIO_PIN10_OFFSET WLAN_GPIO_PIN10_ADDRESS
  688. #define GPIO_PIN11_OFFSET WLAN_GPIO_PIN11_ADDRESS
  689. #define GPIO_PIN12_OFFSET WLAN_GPIO_PIN12_ADDRESS
  690. #define GPIO_PIN13_OFFSET WLAN_GPIO_PIN13_ADDRESS
  691. #define CPU_CLOCK_STANDARD_LSB SOC_CPU_CLOCK_STANDARD_LSB
  692. #define CPU_CLOCK_STANDARD_MASK SOC_CPU_CLOCK_STANDARD_MASK
  693. #define LPO_CAL_ENABLE_LSB SOC_LPO_CAL_ENABLE_LSB
  694. #define LPO_CAL_ENABLE_MASK SOC_LPO_CAL_ENABLE_MASK
  695. #define ANALOG_INTF_BASE_ADDRESS WLAN_ANALOG_INTF_BASE_ADDRESS
  696. #define MBOX_BASE_ADDRESS MISSING
  697. #define INT_STATUS_ENABLE_ERROR_LSB MISSING
  698. #define INT_STATUS_ENABLE_ERROR_MASK MISSING
  699. #define INT_STATUS_ENABLE_CPU_LSB MISSING
  700. #define INT_STATUS_ENABLE_CPU_MASK MISSING
  701. #define INT_STATUS_ENABLE_COUNTER_LSB MISSING
  702. #define INT_STATUS_ENABLE_COUNTER_MASK MISSING
  703. #define INT_STATUS_ENABLE_MBOX_DATA_LSB MISSING
  704. #define INT_STATUS_ENABLE_MBOX_DATA_MASK MISSING
  705. #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB MISSING
  706. #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK MISSING
  707. #define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB MISSING
  708. #define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK MISSING
  709. #define COUNTER_INT_STATUS_ENABLE_BIT_LSB MISSING
  710. #define COUNTER_INT_STATUS_ENABLE_BIT_MASK MISSING
  711. #define INT_STATUS_ENABLE_ADDRESS MISSING
  712. #define CPU_INT_STATUS_ENABLE_BIT_LSB MISSING
  713. #define CPU_INT_STATUS_ENABLE_BIT_MASK MISSING
  714. #define HOST_INT_STATUS_ADDRESS MISSING
  715. #define CPU_INT_STATUS_ADDRESS MISSING
  716. #define ERROR_INT_STATUS_ADDRESS MISSING
  717. #define ERROR_INT_STATUS_WAKEUP_MASK MISSING
  718. #define ERROR_INT_STATUS_WAKEUP_LSB MISSING
  719. #define ERROR_INT_STATUS_RX_UNDERFLOW_MASK MISSING
  720. #define ERROR_INT_STATUS_RX_UNDERFLOW_LSB MISSING
  721. #define ERROR_INT_STATUS_TX_OVERFLOW_MASK MISSING
  722. #define ERROR_INT_STATUS_TX_OVERFLOW_LSB MISSING
  723. #define COUNT_DEC_ADDRESS MISSING
  724. #define HOST_INT_STATUS_CPU_MASK MISSING
  725. #define HOST_INT_STATUS_CPU_LSB MISSING
  726. #define HOST_INT_STATUS_ERROR_MASK MISSING
  727. #define HOST_INT_STATUS_ERROR_LSB MISSING
  728. #define HOST_INT_STATUS_COUNTER_MASK MISSING
  729. #define HOST_INT_STATUS_COUNTER_LSB MISSING
  730. #define RX_LOOKAHEAD_VALID_ADDRESS MISSING
  731. #define WINDOW_DATA_ADDRESS MISSING
  732. #define WINDOW_READ_ADDR_ADDRESS MISSING
  733. #define WINDOW_WRITE_ADDR_ADDRESS MISSING
  734. #define QCA9887_1_0_I2C_SDA_GPIO_PIN 5
  735. #define QCA9887_1_0_I2C_SDA_PIN_CONFIG 3
  736. #define QCA9887_1_0_SI_CLK_GPIO_PIN 17
  737. #define QCA9887_1_0_SI_CLK_PIN_CONFIG 3
  738. #define QCA9887_1_0_GPIO_ENABLE_W1TS_LOW_ADDRESS 0x00000010
  739. #define QCA9887_EEPROM_SELECT_READ 0xa10000a0
  740. #define QCA9887_EEPROM_ADDR_HI_MASK 0x0000ff00
  741. #define QCA9887_EEPROM_ADDR_HI_LSB 8
  742. #define QCA9887_EEPROM_ADDR_LO_MASK 0x00ff0000
  743. #define QCA9887_EEPROM_ADDR_LO_LSB 16
  744. #define RTC_STATE_V_GET(x) (((x) & RTC_STATE_V_MASK) >> RTC_STATE_V_LSB)
  745. /* Register definitions for first generation ath10k cards. These cards include
  746. * a mac thich has a register allocation similar to ath9k and at least some
  747. * registers including the ones relevant for modifying the coverage class are
  748. * identical to the ath9k definitions.
  749. * These registers are usually managed by the ath10k firmware. However by
  750. * overriding them it is possible to support coverage class modifications.
  751. */
  752. #define WAVE1_PCU_ACK_CTS_TIMEOUT 0x8014
  753. #define WAVE1_PCU_ACK_CTS_TIMEOUT_MAX 0x00003FFF
  754. #define WAVE1_PCU_ACK_CTS_TIMEOUT_ACK_MASK 0x00003FFF
  755. #define WAVE1_PCU_ACK_CTS_TIMEOUT_ACK_LSB 0
  756. #define WAVE1_PCU_ACK_CTS_TIMEOUT_CTS_MASK 0x3FFF0000
  757. #define WAVE1_PCU_ACK_CTS_TIMEOUT_CTS_LSB 16
  758. #define WAVE1_PCU_GBL_IFS_SLOT 0x1070
  759. #define WAVE1_PCU_GBL_IFS_SLOT_MASK 0x0000FFFF
  760. #define WAVE1_PCU_GBL_IFS_SLOT_MAX 0x0000FFFF
  761. #define WAVE1_PCU_GBL_IFS_SLOT_LSB 0
  762. #define WAVE1_PCU_GBL_IFS_SLOT_RESV0 0xFFFF0000
  763. #define WAVE1_PHYCLK 0x801C
  764. #define WAVE1_PHYCLK_USEC_MASK 0x0000007F
  765. #define WAVE1_PHYCLK_USEC_LSB 0
  766. /* qca6174 PLL offset/mask */
  767. #define SOC_CORE_CLK_CTRL_OFFSET 0x00000114
  768. #define SOC_CORE_CLK_CTRL_DIV_LSB 0
  769. #define SOC_CORE_CLK_CTRL_DIV_MASK 0x00000007
  770. #define EFUSE_OFFSET 0x0000032c
  771. #define EFUSE_XTAL_SEL_LSB 8
  772. #define EFUSE_XTAL_SEL_MASK 0x00000700
  773. #define BB_PLL_CONFIG_OFFSET 0x000002f4
  774. #define BB_PLL_CONFIG_FRAC_LSB 0
  775. #define BB_PLL_CONFIG_FRAC_MASK 0x0003ffff
  776. #define BB_PLL_CONFIG_OUTDIV_LSB 18
  777. #define BB_PLL_CONFIG_OUTDIV_MASK 0x001c0000
  778. #define WLAN_PLL_SETTLE_OFFSET 0x0018
  779. #define WLAN_PLL_SETTLE_TIME_LSB 0
  780. #define WLAN_PLL_SETTLE_TIME_MASK 0x000007ff
  781. #define WLAN_PLL_CONTROL_OFFSET 0x0014
  782. #define WLAN_PLL_CONTROL_DIV_LSB 0
  783. #define WLAN_PLL_CONTROL_DIV_MASK 0x000003ff
  784. #define WLAN_PLL_CONTROL_REFDIV_LSB 10
  785. #define WLAN_PLL_CONTROL_REFDIV_MASK 0x00003c00
  786. #define WLAN_PLL_CONTROL_BYPASS_LSB 16
  787. #define WLAN_PLL_CONTROL_BYPASS_MASK 0x00010000
  788. #define WLAN_PLL_CONTROL_NOPWD_LSB 18
  789. #define WLAN_PLL_CONTROL_NOPWD_MASK 0x00040000
  790. #define RTC_SYNC_STATUS_OFFSET 0x0244
  791. #define RTC_SYNC_STATUS_PLL_CHANGING_LSB 5
  792. #define RTC_SYNC_STATUS_PLL_CHANGING_MASK 0x00000020
  793. /* qca6174 PLL offset/mask end */
  794. #endif /* _HW_H_ */