hw.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  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 QCA9377_1_0_DEVICE_ID (0x0042)
  26. /* QCA988X 1.0 definitions (unsupported) */
  27. #define QCA988X_HW_1_0_CHIP_ID_REV 0x0
  28. /* QCA988X 2.0 definitions */
  29. #define QCA988X_HW_2_0_VERSION 0x4100016c
  30. #define QCA988X_HW_2_0_CHIP_ID_REV 0x2
  31. #define QCA988X_HW_2_0_FW_DIR ATH10K_FW_DIR "/QCA988X/hw2.0"
  32. #define QCA988X_HW_2_0_FW_FILE "firmware.bin"
  33. #define QCA988X_HW_2_0_OTP_FILE "otp.bin"
  34. #define QCA988X_HW_2_0_BOARD_DATA_FILE "board.bin"
  35. #define QCA988X_HW_2_0_PATCH_LOAD_ADDR 0x1234
  36. /* QCA6174 target BMI version signatures */
  37. #define QCA6174_HW_1_0_VERSION 0x05000000
  38. #define QCA6174_HW_1_1_VERSION 0x05000001
  39. #define QCA6174_HW_1_3_VERSION 0x05000003
  40. #define QCA6174_HW_2_1_VERSION 0x05010000
  41. #define QCA6174_HW_3_0_VERSION 0x05020000
  42. #define QCA6174_HW_3_2_VERSION 0x05030000
  43. /* QCA9377 target BMI version signatures */
  44. #define QCA9377_HW_1_0_DEV_VERSION 0x05020000
  45. #define QCA9377_HW_1_1_DEV_VERSION 0x05020001
  46. enum qca6174_pci_rev {
  47. QCA6174_PCI_REV_1_1 = 0x11,
  48. QCA6174_PCI_REV_1_3 = 0x13,
  49. QCA6174_PCI_REV_2_0 = 0x20,
  50. QCA6174_PCI_REV_3_0 = 0x30,
  51. };
  52. enum qca6174_chip_id_rev {
  53. QCA6174_HW_1_0_CHIP_ID_REV = 0,
  54. QCA6174_HW_1_1_CHIP_ID_REV = 1,
  55. QCA6174_HW_1_3_CHIP_ID_REV = 2,
  56. QCA6174_HW_2_1_CHIP_ID_REV = 4,
  57. QCA6174_HW_2_2_CHIP_ID_REV = 5,
  58. QCA6174_HW_3_0_CHIP_ID_REV = 8,
  59. QCA6174_HW_3_1_CHIP_ID_REV = 9,
  60. QCA6174_HW_3_2_CHIP_ID_REV = 10,
  61. };
  62. enum qca9377_chip_id_rev {
  63. QCA9377_HW_1_0_CHIP_ID_REV = 0x0,
  64. QCA9377_HW_1_1_CHIP_ID_REV = 0x1,
  65. };
  66. #define QCA6174_HW_2_1_FW_DIR "ath10k/QCA6174/hw2.1"
  67. #define QCA6174_HW_2_1_FW_FILE "firmware.bin"
  68. #define QCA6174_HW_2_1_OTP_FILE "otp.bin"
  69. #define QCA6174_HW_2_1_BOARD_DATA_FILE "board.bin"
  70. #define QCA6174_HW_2_1_PATCH_LOAD_ADDR 0x1234
  71. #define QCA6174_HW_3_0_FW_DIR "ath10k/QCA6174/hw3.0"
  72. #define QCA6174_HW_3_0_FW_FILE "firmware.bin"
  73. #define QCA6174_HW_3_0_OTP_FILE "otp.bin"
  74. #define QCA6174_HW_3_0_BOARD_DATA_FILE "board.bin"
  75. #define QCA6174_HW_3_0_PATCH_LOAD_ADDR 0x1234
  76. /* QCA99X0 1.0 definitions (unsupported) */
  77. #define QCA99X0_HW_1_0_CHIP_ID_REV 0x0
  78. /* QCA99X0 2.0 definitions */
  79. #define QCA99X0_HW_2_0_DEV_VERSION 0x01000000
  80. #define QCA99X0_HW_2_0_CHIP_ID_REV 0x1
  81. #define QCA99X0_HW_2_0_FW_DIR ATH10K_FW_DIR "/QCA99X0/hw2.0"
  82. #define QCA99X0_HW_2_0_FW_FILE "firmware.bin"
  83. #define QCA99X0_HW_2_0_OTP_FILE "otp.bin"
  84. #define QCA99X0_HW_2_0_BOARD_DATA_FILE "board.bin"
  85. #define QCA99X0_HW_2_0_PATCH_LOAD_ADDR 0x1234
  86. /* QCA9377 1.0 definitions */
  87. #define QCA9377_HW_1_0_FW_DIR ATH10K_FW_DIR "/QCA9377/hw1.0"
  88. #define QCA9377_HW_1_0_FW_FILE "firmware.bin"
  89. #define QCA9377_HW_1_0_OTP_FILE "otp.bin"
  90. #define QCA9377_HW_1_0_BOARD_DATA_FILE "board.bin"
  91. #define QCA9377_HW_1_0_PATCH_LOAD_ADDR 0x1234
  92. #define ATH10K_FW_API2_FILE "firmware-2.bin"
  93. #define ATH10K_FW_API3_FILE "firmware-3.bin"
  94. /* added support for ATH10K_FW_IE_WMI_OP_VERSION */
  95. #define ATH10K_FW_API4_FILE "firmware-4.bin"
  96. /* HTT id conflict fix for management frames over HTT */
  97. #define ATH10K_FW_API5_FILE "firmware-5.bin"
  98. #define ATH10K_FW_UTF_FILE "utf.bin"
  99. #define ATH10K_FW_UTF_API2_FILE "utf-2.bin"
  100. /* includes also the null byte */
  101. #define ATH10K_FIRMWARE_MAGIC "QCA-ATH10K"
  102. #define ATH10K_BOARD_MAGIC "QCA-ATH10K-BOARD"
  103. #define ATH10K_BOARD_API2_FILE "board-2.bin"
  104. #define REG_DUMP_COUNT_QCA988X 60
  105. #define QCA988X_CAL_DATA_LEN 2116
  106. struct ath10k_fw_ie {
  107. __le32 id;
  108. __le32 len;
  109. u8 data[0];
  110. };
  111. enum ath10k_fw_ie_type {
  112. ATH10K_FW_IE_FW_VERSION = 0,
  113. ATH10K_FW_IE_TIMESTAMP = 1,
  114. ATH10K_FW_IE_FEATURES = 2,
  115. ATH10K_FW_IE_FW_IMAGE = 3,
  116. ATH10K_FW_IE_OTP_IMAGE = 4,
  117. /* WMI "operations" interface version, 32 bit value. Supported from
  118. * FW API 4 and above.
  119. */
  120. ATH10K_FW_IE_WMI_OP_VERSION = 5,
  121. /* HTT "operations" interface version, 32 bit value. Supported from
  122. * FW API 5 and above.
  123. */
  124. ATH10K_FW_IE_HTT_OP_VERSION = 6,
  125. /* Code swap image for firmware binary */
  126. ATH10K_FW_IE_FW_CODE_SWAP_IMAGE = 7,
  127. };
  128. enum ath10k_fw_wmi_op_version {
  129. ATH10K_FW_WMI_OP_VERSION_UNSET = 0,
  130. ATH10K_FW_WMI_OP_VERSION_MAIN = 1,
  131. ATH10K_FW_WMI_OP_VERSION_10_1 = 2,
  132. ATH10K_FW_WMI_OP_VERSION_10_2 = 3,
  133. ATH10K_FW_WMI_OP_VERSION_TLV = 4,
  134. ATH10K_FW_WMI_OP_VERSION_10_2_4 = 5,
  135. ATH10K_FW_WMI_OP_VERSION_10_4 = 6,
  136. /* keep last */
  137. ATH10K_FW_WMI_OP_VERSION_MAX,
  138. };
  139. enum ath10k_fw_htt_op_version {
  140. ATH10K_FW_HTT_OP_VERSION_UNSET = 0,
  141. ATH10K_FW_HTT_OP_VERSION_MAIN = 1,
  142. /* also used in 10.2 and 10.2.4 branches */
  143. ATH10K_FW_HTT_OP_VERSION_10_1 = 2,
  144. ATH10K_FW_HTT_OP_VERSION_TLV = 3,
  145. ATH10K_FW_HTT_OP_VERSION_10_4 = 4,
  146. /* keep last */
  147. ATH10K_FW_HTT_OP_VERSION_MAX,
  148. };
  149. enum ath10k_bd_ie_type {
  150. /* contains sub IEs of enum ath10k_bd_ie_board_type */
  151. ATH10K_BD_IE_BOARD = 0,
  152. };
  153. enum ath10k_bd_ie_board_type {
  154. ATH10K_BD_IE_BOARD_NAME = 0,
  155. ATH10K_BD_IE_BOARD_DATA = 1,
  156. };
  157. enum ath10k_hw_rev {
  158. ATH10K_HW_QCA988X,
  159. ATH10K_HW_QCA6174,
  160. ATH10K_HW_QCA99X0,
  161. ATH10K_HW_QCA9377,
  162. };
  163. struct ath10k_hw_regs {
  164. u32 rtc_state_cold_reset_mask;
  165. u32 rtc_soc_base_address;
  166. u32 rtc_wmac_base_address;
  167. u32 soc_core_base_address;
  168. u32 ce_wrapper_base_address;
  169. u32 ce0_base_address;
  170. u32 ce1_base_address;
  171. u32 ce2_base_address;
  172. u32 ce3_base_address;
  173. u32 ce4_base_address;
  174. u32 ce5_base_address;
  175. u32 ce6_base_address;
  176. u32 ce7_base_address;
  177. u32 soc_reset_control_si0_rst_mask;
  178. u32 soc_reset_control_ce_rst_mask;
  179. u32 soc_chip_id_address;
  180. u32 scratch_3_address;
  181. u32 fw_indicator_address;
  182. u32 pcie_local_base_address;
  183. u32 ce_wrap_intr_sum_host_msi_lsb;
  184. u32 ce_wrap_intr_sum_host_msi_mask;
  185. u32 pcie_intr_fw_mask;
  186. u32 pcie_intr_ce_mask_all;
  187. u32 pcie_intr_clr_address;
  188. };
  189. extern const struct ath10k_hw_regs qca988x_regs;
  190. extern const struct ath10k_hw_regs qca6174_regs;
  191. extern const struct ath10k_hw_regs qca99x0_regs;
  192. struct ath10k_hw_values {
  193. u32 rtc_state_val_on;
  194. u8 ce_count;
  195. u8 msi_assign_ce_max;
  196. u8 num_target_ce_config_wlan;
  197. u16 ce_desc_meta_data_mask;
  198. u8 ce_desc_meta_data_lsb;
  199. };
  200. extern const struct ath10k_hw_values qca988x_values;
  201. extern const struct ath10k_hw_values qca6174_values;
  202. extern const struct ath10k_hw_values qca99x0_values;
  203. void ath10k_hw_fill_survey_time(struct ath10k *ar, struct survey_info *survey,
  204. u32 cc, u32 rcc, u32 cc_prev, u32 rcc_prev);
  205. #define QCA_REV_988X(ar) ((ar)->hw_rev == ATH10K_HW_QCA988X)
  206. #define QCA_REV_6174(ar) ((ar)->hw_rev == ATH10K_HW_QCA6174)
  207. #define QCA_REV_99X0(ar) ((ar)->hw_rev == ATH10K_HW_QCA99X0)
  208. #define QCA_REV_9377(ar) ((ar)->hw_rev == ATH10K_HW_QCA9377)
  209. /* Known pecularities:
  210. * - raw appears in nwifi decap, raw and nwifi appear in ethernet decap
  211. * - raw have FCS, nwifi doesn't
  212. * - ethernet frames have 802.11 header decapped and parts (base hdr, cipher
  213. * param, llc/snap) are aligned to 4byte boundaries each */
  214. enum ath10k_hw_txrx_mode {
  215. ATH10K_HW_TXRX_RAW = 0,
  216. /* Native Wifi decap mode is used to align IP frames to 4-byte
  217. * boundaries and avoid a very expensive re-alignment in mac80211.
  218. */
  219. ATH10K_HW_TXRX_NATIVE_WIFI = 1,
  220. ATH10K_HW_TXRX_ETHERNET = 2,
  221. /* Valid for HTT >= 3.0. Used for management frames in TX_FRM. */
  222. ATH10K_HW_TXRX_MGMT = 3,
  223. };
  224. enum ath10k_mcast2ucast_mode {
  225. ATH10K_MCAST2UCAST_DISABLED = 0,
  226. ATH10K_MCAST2UCAST_ENABLED = 1,
  227. };
  228. struct ath10k_pktlog_hdr {
  229. __le16 flags;
  230. __le16 missed_cnt;
  231. __le16 log_type;
  232. __le16 size;
  233. __le32 timestamp;
  234. u8 payload[0];
  235. } __packed;
  236. enum ath10k_hw_rate_ofdm {
  237. ATH10K_HW_RATE_OFDM_48M = 0,
  238. ATH10K_HW_RATE_OFDM_24M,
  239. ATH10K_HW_RATE_OFDM_12M,
  240. ATH10K_HW_RATE_OFDM_6M,
  241. ATH10K_HW_RATE_OFDM_54M,
  242. ATH10K_HW_RATE_OFDM_36M,
  243. ATH10K_HW_RATE_OFDM_18M,
  244. ATH10K_HW_RATE_OFDM_9M,
  245. };
  246. enum ath10k_hw_rate_cck {
  247. ATH10K_HW_RATE_CCK_LP_11M = 0,
  248. ATH10K_HW_RATE_CCK_LP_5_5M,
  249. ATH10K_HW_RATE_CCK_LP_2M,
  250. ATH10K_HW_RATE_CCK_LP_1M,
  251. ATH10K_HW_RATE_CCK_SP_11M,
  252. ATH10K_HW_RATE_CCK_SP_5_5M,
  253. ATH10K_HW_RATE_CCK_SP_2M,
  254. };
  255. /* Target specific defines for MAIN firmware */
  256. #define TARGET_NUM_VDEVS 8
  257. #define TARGET_NUM_PEER_AST 2
  258. #define TARGET_NUM_WDS_ENTRIES 32
  259. #define TARGET_DMA_BURST_SIZE 0
  260. #define TARGET_MAC_AGGR_DELIM 0
  261. #define TARGET_AST_SKID_LIMIT 16
  262. #define TARGET_NUM_STATIONS 16
  263. #define TARGET_NUM_PEERS ((TARGET_NUM_STATIONS) + \
  264. (TARGET_NUM_VDEVS))
  265. #define TARGET_NUM_OFFLOAD_PEERS 0
  266. #define TARGET_NUM_OFFLOAD_REORDER_BUFS 0
  267. #define TARGET_NUM_PEER_KEYS 2
  268. #define TARGET_NUM_TIDS ((TARGET_NUM_PEERS) * 2)
  269. #define TARGET_TX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
  270. #define TARGET_RX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
  271. #define TARGET_RX_TIMEOUT_LO_PRI 100
  272. #define TARGET_RX_TIMEOUT_HI_PRI 40
  273. #define TARGET_SCAN_MAX_PENDING_REQS 4
  274. #define TARGET_BMISS_OFFLOAD_MAX_VDEV 3
  275. #define TARGET_ROAM_OFFLOAD_MAX_VDEV 3
  276. #define TARGET_ROAM_OFFLOAD_MAX_AP_PROFILES 8
  277. #define TARGET_GTK_OFFLOAD_MAX_VDEV 3
  278. #define TARGET_NUM_MCAST_GROUPS 0
  279. #define TARGET_NUM_MCAST_TABLE_ELEMS 0
  280. #define TARGET_MCAST2UCAST_MODE ATH10K_MCAST2UCAST_DISABLED
  281. #define TARGET_TX_DBG_LOG_SIZE 1024
  282. #define TARGET_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 0
  283. #define TARGET_VOW_CONFIG 0
  284. #define TARGET_NUM_MSDU_DESC (1024 + 400)
  285. #define TARGET_MAX_FRAG_ENTRIES 0
  286. /* Target specific defines for 10.X firmware */
  287. #define TARGET_10X_NUM_VDEVS 16
  288. #define TARGET_10X_NUM_PEER_AST 2
  289. #define TARGET_10X_NUM_WDS_ENTRIES 32
  290. #define TARGET_10X_DMA_BURST_SIZE 0
  291. #define TARGET_10X_MAC_AGGR_DELIM 0
  292. #define TARGET_10X_AST_SKID_LIMIT 128
  293. #define TARGET_10X_NUM_STATIONS 128
  294. #define TARGET_10X_NUM_PEERS ((TARGET_10X_NUM_STATIONS) + \
  295. (TARGET_10X_NUM_VDEVS))
  296. #define TARGET_10X_NUM_OFFLOAD_PEERS 0
  297. #define TARGET_10X_NUM_OFFLOAD_REORDER_BUFS 0
  298. #define TARGET_10X_NUM_PEER_KEYS 2
  299. #define TARGET_10X_NUM_TIDS_MAX 256
  300. #define TARGET_10X_NUM_TIDS min((TARGET_10X_NUM_TIDS_MAX), \
  301. (TARGET_10X_NUM_PEERS) * 2)
  302. #define TARGET_10X_TX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
  303. #define TARGET_10X_RX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
  304. #define TARGET_10X_RX_TIMEOUT_LO_PRI 100
  305. #define TARGET_10X_RX_TIMEOUT_HI_PRI 40
  306. #define TARGET_10X_SCAN_MAX_PENDING_REQS 4
  307. #define TARGET_10X_BMISS_OFFLOAD_MAX_VDEV 2
  308. #define TARGET_10X_ROAM_OFFLOAD_MAX_VDEV 2
  309. #define TARGET_10X_ROAM_OFFLOAD_MAX_AP_PROFILES 8
  310. #define TARGET_10X_GTK_OFFLOAD_MAX_VDEV 3
  311. #define TARGET_10X_NUM_MCAST_GROUPS 0
  312. #define TARGET_10X_NUM_MCAST_TABLE_ELEMS 0
  313. #define TARGET_10X_MCAST2UCAST_MODE ATH10K_MCAST2UCAST_DISABLED
  314. #define TARGET_10X_TX_DBG_LOG_SIZE 1024
  315. #define TARGET_10X_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 1
  316. #define TARGET_10X_VOW_CONFIG 0
  317. #define TARGET_10X_NUM_MSDU_DESC (1024 + 400)
  318. #define TARGET_10X_MAX_FRAG_ENTRIES 0
  319. /* 10.2 parameters */
  320. #define TARGET_10_2_DMA_BURST_SIZE 0
  321. /* Target specific defines for WMI-TLV firmware */
  322. #define TARGET_TLV_NUM_VDEVS 4
  323. #define TARGET_TLV_NUM_STATIONS 32
  324. #define TARGET_TLV_NUM_PEERS 35
  325. #define TARGET_TLV_NUM_TDLS_VDEVS 1
  326. #define TARGET_TLV_NUM_TIDS ((TARGET_TLV_NUM_PEERS) * 2)
  327. #define TARGET_TLV_NUM_MSDU_DESC (1024 + 32)
  328. #define TARGET_TLV_NUM_WOW_PATTERNS 22
  329. /* Diagnostic Window */
  330. #define CE_DIAG_PIPE 7
  331. #define NUM_TARGET_CE_CONFIG_WLAN ar->hw_values->num_target_ce_config_wlan
  332. /* Target specific defines for 10.4 firmware */
  333. #define TARGET_10_4_NUM_VDEVS 16
  334. #define TARGET_10_4_NUM_STATIONS 32
  335. #define TARGET_10_4_NUM_PEERS ((TARGET_10_4_NUM_STATIONS) + \
  336. (TARGET_10_4_NUM_VDEVS))
  337. #define TARGET_10_4_ACTIVE_PEERS 0
  338. #define TARGET_10_4_NUM_QCACHE_PEERS_MAX 512
  339. #define TARGET_10_4_QCACHE_ACTIVE_PEERS 50
  340. #define TARGET_10_4_NUM_OFFLOAD_PEERS 0
  341. #define TARGET_10_4_NUM_OFFLOAD_REORDER_BUFFS 0
  342. #define TARGET_10_4_NUM_PEER_KEYS 2
  343. #define TARGET_10_4_TGT_NUM_TIDS ((TARGET_10_4_NUM_PEERS) * 2)
  344. #define TARGET_10_4_AST_SKID_LIMIT 32
  345. #define TARGET_10_4_TX_CHAIN_MASK (BIT(0) | BIT(1) | \
  346. BIT(2) | BIT(3))
  347. #define TARGET_10_4_RX_CHAIN_MASK (BIT(0) | BIT(1) | \
  348. BIT(2) | BIT(3))
  349. /* 100 ms for video, best-effort, and background */
  350. #define TARGET_10_4_RX_TIMEOUT_LO_PRI 100
  351. /* 40 ms for voice */
  352. #define TARGET_10_4_RX_TIMEOUT_HI_PRI 40
  353. #define TARGET_10_4_RX_DECAP_MODE ATH10K_HW_TXRX_NATIVE_WIFI
  354. #define TARGET_10_4_SCAN_MAX_REQS 4
  355. #define TARGET_10_4_BMISS_OFFLOAD_MAX_VDEV 3
  356. #define TARGET_10_4_ROAM_OFFLOAD_MAX_VDEV 3
  357. #define TARGET_10_4_ROAM_OFFLOAD_MAX_PROFILES 8
  358. /* Note: mcast to ucast is disabled by default */
  359. #define TARGET_10_4_NUM_MCAST_GROUPS 0
  360. #define TARGET_10_4_NUM_MCAST_TABLE_ELEMS 0
  361. #define TARGET_10_4_MCAST2UCAST_MODE 0
  362. #define TARGET_10_4_TX_DBG_LOG_SIZE 1024
  363. #define TARGET_10_4_NUM_WDS_ENTRIES 32
  364. #define TARGET_10_4_DMA_BURST_SIZE 0
  365. #define TARGET_10_4_MAC_AGGR_DELIM 0
  366. #define TARGET_10_4_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 1
  367. #define TARGET_10_4_VOW_CONFIG 0
  368. #define TARGET_10_4_GTK_OFFLOAD_MAX_VDEV 3
  369. #define TARGET_10_4_NUM_MSDU_DESC (1024 + 400)
  370. #define TARGET_10_4_11AC_TX_MAX_FRAGS 2
  371. #define TARGET_10_4_MAX_PEER_EXT_STATS 16
  372. #define TARGET_10_4_SMART_ANT_CAP 0
  373. #define TARGET_10_4_BK_MIN_FREE 0
  374. #define TARGET_10_4_BE_MIN_FREE 0
  375. #define TARGET_10_4_VI_MIN_FREE 0
  376. #define TARGET_10_4_VO_MIN_FREE 0
  377. #define TARGET_10_4_RX_BATCH_MODE 1
  378. #define TARGET_10_4_THERMAL_THROTTLING_CONFIG 0
  379. #define TARGET_10_4_ATF_CONFIG 0
  380. #define TARGET_10_4_IPHDR_PAD_CONFIG 1
  381. #define TARGET_10_4_QWRAP_CONFIG 0
  382. /* Number of Copy Engines supported */
  383. #define CE_COUNT ar->hw_values->ce_count
  384. /*
  385. * Granted MSIs are assigned as follows:
  386. * Firmware uses the first
  387. * Remaining MSIs, if any, are used by Copy Engines
  388. * This mapping is known to both Target firmware and Host software.
  389. * It may be changed as long as Host and Target are kept in sync.
  390. */
  391. /* MSI for firmware (errors, etc.) */
  392. #define MSI_ASSIGN_FW 0
  393. /* MSIs for Copy Engines */
  394. #define MSI_ASSIGN_CE_INITIAL 1
  395. #define MSI_ASSIGN_CE_MAX ar->hw_values->msi_assign_ce_max
  396. /* as of IP3.7.1 */
  397. #define RTC_STATE_V_ON ar->hw_values->rtc_state_val_on
  398. #define RTC_STATE_COLD_RESET_MASK ar->regs->rtc_state_cold_reset_mask
  399. #define RTC_STATE_V_LSB 0
  400. #define RTC_STATE_V_MASK 0x00000007
  401. #define RTC_STATE_ADDRESS 0x0000
  402. #define PCIE_SOC_WAKE_V_MASK 0x00000001
  403. #define PCIE_SOC_WAKE_ADDRESS 0x0004
  404. #define PCIE_SOC_WAKE_RESET 0x00000000
  405. #define SOC_GLOBAL_RESET_ADDRESS 0x0008
  406. #define RTC_SOC_BASE_ADDRESS ar->regs->rtc_soc_base_address
  407. #define RTC_WMAC_BASE_ADDRESS ar->regs->rtc_wmac_base_address
  408. #define MAC_COEX_BASE_ADDRESS 0x00006000
  409. #define BT_COEX_BASE_ADDRESS 0x00007000
  410. #define SOC_PCIE_BASE_ADDRESS 0x00008000
  411. #define SOC_CORE_BASE_ADDRESS ar->regs->soc_core_base_address
  412. #define WLAN_UART_BASE_ADDRESS 0x0000c000
  413. #define WLAN_SI_BASE_ADDRESS 0x00010000
  414. #define WLAN_GPIO_BASE_ADDRESS 0x00014000
  415. #define WLAN_ANALOG_INTF_BASE_ADDRESS 0x0001c000
  416. #define WLAN_MAC_BASE_ADDRESS 0x00020000
  417. #define EFUSE_BASE_ADDRESS 0x00030000
  418. #define FPGA_REG_BASE_ADDRESS 0x00039000
  419. #define WLAN_UART2_BASE_ADDRESS 0x00054c00
  420. #define CE_WRAPPER_BASE_ADDRESS ar->regs->ce_wrapper_base_address
  421. #define CE0_BASE_ADDRESS ar->regs->ce0_base_address
  422. #define CE1_BASE_ADDRESS ar->regs->ce1_base_address
  423. #define CE2_BASE_ADDRESS ar->regs->ce2_base_address
  424. #define CE3_BASE_ADDRESS ar->regs->ce3_base_address
  425. #define CE4_BASE_ADDRESS ar->regs->ce4_base_address
  426. #define CE5_BASE_ADDRESS ar->regs->ce5_base_address
  427. #define CE6_BASE_ADDRESS ar->regs->ce6_base_address
  428. #define CE7_BASE_ADDRESS ar->regs->ce7_base_address
  429. #define DBI_BASE_ADDRESS 0x00060000
  430. #define WLAN_ANALOG_INTF_PCIE_BASE_ADDRESS 0x0006c000
  431. #define PCIE_LOCAL_BASE_ADDRESS ar->regs->pcie_local_base_address
  432. #define SOC_RESET_CONTROL_ADDRESS 0x00000000
  433. #define SOC_RESET_CONTROL_OFFSET 0x00000000
  434. #define SOC_RESET_CONTROL_SI0_RST_MASK ar->regs->soc_reset_control_si0_rst_mask
  435. #define SOC_RESET_CONTROL_CE_RST_MASK ar->regs->soc_reset_control_ce_rst_mask
  436. #define SOC_RESET_CONTROL_CPU_WARM_RST_MASK 0x00000040
  437. #define SOC_CPU_CLOCK_OFFSET 0x00000020
  438. #define SOC_CPU_CLOCK_STANDARD_LSB 0
  439. #define SOC_CPU_CLOCK_STANDARD_MASK 0x00000003
  440. #define SOC_CLOCK_CONTROL_OFFSET 0x00000028
  441. #define SOC_CLOCK_CONTROL_SI0_CLK_MASK 0x00000001
  442. #define SOC_SYSTEM_SLEEP_OFFSET 0x000000c4
  443. #define SOC_LPO_CAL_OFFSET 0x000000e0
  444. #define SOC_LPO_CAL_ENABLE_LSB 20
  445. #define SOC_LPO_CAL_ENABLE_MASK 0x00100000
  446. #define SOC_LF_TIMER_CONTROL0_ADDRESS 0x00000050
  447. #define SOC_LF_TIMER_CONTROL0_ENABLE_MASK 0x00000004
  448. #define SOC_CHIP_ID_ADDRESS ar->regs->soc_chip_id_address
  449. #define SOC_CHIP_ID_REV_LSB 8
  450. #define SOC_CHIP_ID_REV_MASK 0x00000f00
  451. #define WLAN_RESET_CONTROL_COLD_RST_MASK 0x00000008
  452. #define WLAN_RESET_CONTROL_WARM_RST_MASK 0x00000004
  453. #define WLAN_SYSTEM_SLEEP_DISABLE_LSB 0
  454. #define WLAN_SYSTEM_SLEEP_DISABLE_MASK 0x00000001
  455. #define WLAN_GPIO_PIN0_ADDRESS 0x00000028
  456. #define WLAN_GPIO_PIN0_CONFIG_MASK 0x00007800
  457. #define WLAN_GPIO_PIN1_ADDRESS 0x0000002c
  458. #define WLAN_GPIO_PIN1_CONFIG_MASK 0x00007800
  459. #define WLAN_GPIO_PIN10_ADDRESS 0x00000050
  460. #define WLAN_GPIO_PIN11_ADDRESS 0x00000054
  461. #define WLAN_GPIO_PIN12_ADDRESS 0x00000058
  462. #define WLAN_GPIO_PIN13_ADDRESS 0x0000005c
  463. #define CLOCK_GPIO_OFFSET 0xffffffff
  464. #define CLOCK_GPIO_BT_CLK_OUT_EN_LSB 0
  465. #define CLOCK_GPIO_BT_CLK_OUT_EN_MASK 0
  466. #define SI_CONFIG_OFFSET 0x00000000
  467. #define SI_CONFIG_BIDIR_OD_DATA_LSB 18
  468. #define SI_CONFIG_BIDIR_OD_DATA_MASK 0x00040000
  469. #define SI_CONFIG_I2C_LSB 16
  470. #define SI_CONFIG_I2C_MASK 0x00010000
  471. #define SI_CONFIG_POS_SAMPLE_LSB 7
  472. #define SI_CONFIG_POS_SAMPLE_MASK 0x00000080
  473. #define SI_CONFIG_INACTIVE_DATA_LSB 5
  474. #define SI_CONFIG_INACTIVE_DATA_MASK 0x00000020
  475. #define SI_CONFIG_INACTIVE_CLK_LSB 4
  476. #define SI_CONFIG_INACTIVE_CLK_MASK 0x00000010
  477. #define SI_CONFIG_DIVIDER_LSB 0
  478. #define SI_CONFIG_DIVIDER_MASK 0x0000000f
  479. #define SI_CS_OFFSET 0x00000004
  480. #define SI_CS_DONE_ERR_MASK 0x00000400
  481. #define SI_CS_DONE_INT_MASK 0x00000200
  482. #define SI_CS_START_LSB 8
  483. #define SI_CS_START_MASK 0x00000100
  484. #define SI_CS_RX_CNT_LSB 4
  485. #define SI_CS_RX_CNT_MASK 0x000000f0
  486. #define SI_CS_TX_CNT_LSB 0
  487. #define SI_CS_TX_CNT_MASK 0x0000000f
  488. #define SI_TX_DATA0_OFFSET 0x00000008
  489. #define SI_TX_DATA1_OFFSET 0x0000000c
  490. #define SI_RX_DATA0_OFFSET 0x00000010
  491. #define SI_RX_DATA1_OFFSET 0x00000014
  492. #define CORE_CTRL_CPU_INTR_MASK 0x00002000
  493. #define CORE_CTRL_PCIE_REG_31_MASK 0x00000800
  494. #define CORE_CTRL_ADDRESS 0x0000
  495. #define PCIE_INTR_ENABLE_ADDRESS 0x0008
  496. #define PCIE_INTR_CAUSE_ADDRESS 0x000c
  497. #define PCIE_INTR_CLR_ADDRESS ar->regs->pcie_intr_clr_address
  498. #define SCRATCH_3_ADDRESS ar->regs->scratch_3_address
  499. #define CPU_INTR_ADDRESS 0x0010
  500. #define CCNT_TO_MSEC(ar, x) ((x) / ar->hw_params.channel_counters_freq_hz)
  501. /* Firmware indications to the Host via SCRATCH_3 register. */
  502. #define FW_INDICATOR_ADDRESS ar->regs->fw_indicator_address
  503. #define FW_IND_EVENT_PENDING 1
  504. #define FW_IND_INITIALIZED 2
  505. /* HOST_REG interrupt from firmware */
  506. #define PCIE_INTR_FIRMWARE_MASK ar->regs->pcie_intr_fw_mask
  507. #define PCIE_INTR_CE_MASK_ALL ar->regs->pcie_intr_ce_mask_all
  508. #define DRAM_BASE_ADDRESS 0x00400000
  509. #define PCIE_BAR_REG_ADDRESS 0x40030
  510. #define MISSING 0
  511. #define SYSTEM_SLEEP_OFFSET SOC_SYSTEM_SLEEP_OFFSET
  512. #define WLAN_SYSTEM_SLEEP_OFFSET SOC_SYSTEM_SLEEP_OFFSET
  513. #define WLAN_RESET_CONTROL_OFFSET SOC_RESET_CONTROL_OFFSET
  514. #define CLOCK_CONTROL_OFFSET SOC_CLOCK_CONTROL_OFFSET
  515. #define CLOCK_CONTROL_SI0_CLK_MASK SOC_CLOCK_CONTROL_SI0_CLK_MASK
  516. #define RESET_CONTROL_MBOX_RST_MASK MISSING
  517. #define RESET_CONTROL_SI0_RST_MASK SOC_RESET_CONTROL_SI0_RST_MASK
  518. #define GPIO_BASE_ADDRESS WLAN_GPIO_BASE_ADDRESS
  519. #define GPIO_PIN0_OFFSET WLAN_GPIO_PIN0_ADDRESS
  520. #define GPIO_PIN1_OFFSET WLAN_GPIO_PIN1_ADDRESS
  521. #define GPIO_PIN0_CONFIG_MASK WLAN_GPIO_PIN0_CONFIG_MASK
  522. #define GPIO_PIN1_CONFIG_MASK WLAN_GPIO_PIN1_CONFIG_MASK
  523. #define SI_BASE_ADDRESS WLAN_SI_BASE_ADDRESS
  524. #define SCRATCH_BASE_ADDRESS SOC_CORE_BASE_ADDRESS
  525. #define LOCAL_SCRATCH_OFFSET 0x18
  526. #define CPU_CLOCK_OFFSET SOC_CPU_CLOCK_OFFSET
  527. #define LPO_CAL_OFFSET SOC_LPO_CAL_OFFSET
  528. #define GPIO_PIN10_OFFSET WLAN_GPIO_PIN10_ADDRESS
  529. #define GPIO_PIN11_OFFSET WLAN_GPIO_PIN11_ADDRESS
  530. #define GPIO_PIN12_OFFSET WLAN_GPIO_PIN12_ADDRESS
  531. #define GPIO_PIN13_OFFSET WLAN_GPIO_PIN13_ADDRESS
  532. #define CPU_CLOCK_STANDARD_LSB SOC_CPU_CLOCK_STANDARD_LSB
  533. #define CPU_CLOCK_STANDARD_MASK SOC_CPU_CLOCK_STANDARD_MASK
  534. #define LPO_CAL_ENABLE_LSB SOC_LPO_CAL_ENABLE_LSB
  535. #define LPO_CAL_ENABLE_MASK SOC_LPO_CAL_ENABLE_MASK
  536. #define ANALOG_INTF_BASE_ADDRESS WLAN_ANALOG_INTF_BASE_ADDRESS
  537. #define MBOX_BASE_ADDRESS MISSING
  538. #define INT_STATUS_ENABLE_ERROR_LSB MISSING
  539. #define INT_STATUS_ENABLE_ERROR_MASK MISSING
  540. #define INT_STATUS_ENABLE_CPU_LSB MISSING
  541. #define INT_STATUS_ENABLE_CPU_MASK MISSING
  542. #define INT_STATUS_ENABLE_COUNTER_LSB MISSING
  543. #define INT_STATUS_ENABLE_COUNTER_MASK MISSING
  544. #define INT_STATUS_ENABLE_MBOX_DATA_LSB MISSING
  545. #define INT_STATUS_ENABLE_MBOX_DATA_MASK MISSING
  546. #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB MISSING
  547. #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK MISSING
  548. #define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB MISSING
  549. #define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK MISSING
  550. #define COUNTER_INT_STATUS_ENABLE_BIT_LSB MISSING
  551. #define COUNTER_INT_STATUS_ENABLE_BIT_MASK MISSING
  552. #define INT_STATUS_ENABLE_ADDRESS MISSING
  553. #define CPU_INT_STATUS_ENABLE_BIT_LSB MISSING
  554. #define CPU_INT_STATUS_ENABLE_BIT_MASK MISSING
  555. #define HOST_INT_STATUS_ADDRESS MISSING
  556. #define CPU_INT_STATUS_ADDRESS MISSING
  557. #define ERROR_INT_STATUS_ADDRESS MISSING
  558. #define ERROR_INT_STATUS_WAKEUP_MASK MISSING
  559. #define ERROR_INT_STATUS_WAKEUP_LSB MISSING
  560. #define ERROR_INT_STATUS_RX_UNDERFLOW_MASK MISSING
  561. #define ERROR_INT_STATUS_RX_UNDERFLOW_LSB MISSING
  562. #define ERROR_INT_STATUS_TX_OVERFLOW_MASK MISSING
  563. #define ERROR_INT_STATUS_TX_OVERFLOW_LSB MISSING
  564. #define COUNT_DEC_ADDRESS MISSING
  565. #define HOST_INT_STATUS_CPU_MASK MISSING
  566. #define HOST_INT_STATUS_CPU_LSB MISSING
  567. #define HOST_INT_STATUS_ERROR_MASK MISSING
  568. #define HOST_INT_STATUS_ERROR_LSB MISSING
  569. #define HOST_INT_STATUS_COUNTER_MASK MISSING
  570. #define HOST_INT_STATUS_COUNTER_LSB MISSING
  571. #define RX_LOOKAHEAD_VALID_ADDRESS MISSING
  572. #define WINDOW_DATA_ADDRESS MISSING
  573. #define WINDOW_READ_ADDR_ADDRESS MISSING
  574. #define WINDOW_WRITE_ADDR_ADDRESS MISSING
  575. #define RTC_STATE_V_GET(x) (((x) & RTC_STATE_V_MASK) >> RTC_STATE_V_LSB)
  576. #endif /* _HW_H_ */