Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 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 | |
| 18 | #ifndef _HW_H_ |
| 19 | #define _HW_H_ |
| 20 | |
| 21 | #include "targaddrs.h" |
| 22 | |
Kalle Valo | a58227e | 2014-10-13 09:40:59 +0300 | [diff] [blame] | 23 | #define ATH10K_FW_DIR "ath10k" |
| 24 | |
Kalle Valo | e01ae68 | 2013-09-01 11:22:14 +0300 | [diff] [blame] | 25 | /* QCA988X 1.0 definitions (unsupported) */ |
| 26 | #define QCA988X_HW_1_0_CHIP_ID_REV 0x0 |
| 27 | |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 28 | /* QCA988X 2.0 definitions */ |
| 29 | #define QCA988X_HW_2_0_VERSION 0x4100016c |
Kalle Valo | e01ae68 | 2013-09-01 11:22:14 +0300 | [diff] [blame] | 30 | #define QCA988X_HW_2_0_CHIP_ID_REV 0x2 |
Kalle Valo | a58227e | 2014-10-13 09:40:59 +0300 | [diff] [blame] | 31 | #define QCA988X_HW_2_0_FW_DIR ATH10K_FW_DIR "/QCA988X/hw2.0" |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 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 | |
Kalle Valo | 1a22243 | 2013-09-27 19:55:07 +0300 | [diff] [blame] | 37 | #define ATH10K_FW_API2_FILE "firmware-2.bin" |
Michal Kazior | 24c88f7 | 2014-07-25 13:32:17 +0200 | [diff] [blame] | 38 | #define ATH10K_FW_API3_FILE "firmware-3.bin" |
Kalle Valo | 1a22243 | 2013-09-27 19:55:07 +0300 | [diff] [blame] | 39 | |
Rajkumar Manoharan | 4a16fbe | 2014-12-17 12:21:12 +0200 | [diff] [blame] | 40 | /* added support for ATH10K_FW_IE_WMI_OP_VERSION */ |
| 41 | #define ATH10K_FW_API4_FILE "firmware-4.bin" |
| 42 | |
Kalle Valo | 43d2a30 | 2014-09-10 18:23:30 +0300 | [diff] [blame] | 43 | #define ATH10K_FW_UTF_FILE "utf.bin" |
| 44 | |
Kalle Valo | 1a22243 | 2013-09-27 19:55:07 +0300 | [diff] [blame] | 45 | /* includes also the null byte */ |
| 46 | #define ATH10K_FIRMWARE_MAGIC "QCA-ATH10K" |
| 47 | |
Ben Greear | 384914b | 2014-08-25 08:37:32 +0300 | [diff] [blame] | 48 | #define REG_DUMP_COUNT_QCA988X 60 |
| 49 | |
Kalle Valo | 7869b4f | 2014-09-24 14:16:58 +0300 | [diff] [blame] | 50 | #define QCA988X_CAL_DATA_LEN 2116 |
| 51 | |
Kalle Valo | 1a22243 | 2013-09-27 19:55:07 +0300 | [diff] [blame] | 52 | struct ath10k_fw_ie { |
| 53 | __le32 id; |
| 54 | __le32 len; |
| 55 | u8 data[0]; |
| 56 | }; |
| 57 | |
| 58 | enum ath10k_fw_ie_type { |
| 59 | ATH10K_FW_IE_FW_VERSION = 0, |
| 60 | ATH10K_FW_IE_TIMESTAMP = 1, |
| 61 | ATH10K_FW_IE_FEATURES = 2, |
| 62 | ATH10K_FW_IE_FW_IMAGE = 3, |
| 63 | ATH10K_FW_IE_OTP_IMAGE = 4, |
Kalle Valo | 202e86e | 2014-12-03 10:10:08 +0200 | [diff] [blame] | 64 | |
| 65 | /* WMI "operations" interface version, 32 bit value. Supported from |
| 66 | * FW API 4 and above. |
| 67 | */ |
| 68 | ATH10K_FW_IE_WMI_OP_VERSION = 5, |
| 69 | }; |
| 70 | |
| 71 | enum ath10k_fw_wmi_op_version { |
| 72 | ATH10K_FW_WMI_OP_VERSION_UNSET = 0, |
| 73 | |
| 74 | ATH10K_FW_WMI_OP_VERSION_MAIN = 1, |
| 75 | ATH10K_FW_WMI_OP_VERSION_10_1 = 2, |
| 76 | ATH10K_FW_WMI_OP_VERSION_10_2 = 3, |
Michal Kazior | ca996ec | 2014-12-03 10:11:32 +0200 | [diff] [blame] | 77 | ATH10K_FW_WMI_OP_VERSION_TLV = 4, |
Rajkumar Manoharan | 4a16fbe | 2014-12-17 12:21:12 +0200 | [diff] [blame] | 78 | ATH10K_FW_WMI_OP_VERSION_10_2_4 = 5, |
Kalle Valo | 202e86e | 2014-12-03 10:10:08 +0200 | [diff] [blame] | 79 | |
| 80 | /* keep last */ |
| 81 | ATH10K_FW_WMI_OP_VERSION_MAX, |
Kalle Valo | 1a22243 | 2013-09-27 19:55:07 +0300 | [diff] [blame] | 82 | }; |
| 83 | |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 84 | /* Known pecularities: |
| 85 | * - current FW doesn't support raw rx mode (last tested v599) |
| 86 | * - current FW dumps upon raw tx mode (last tested v599) |
| 87 | * - raw appears in nwifi decap, raw and nwifi appear in ethernet decap |
| 88 | * - raw have FCS, nwifi doesn't |
| 89 | * - ethernet frames have 802.11 header decapped and parts (base hdr, cipher |
| 90 | * param, llc/snap) are aligned to 4byte boundaries each */ |
| 91 | enum ath10k_hw_txrx_mode { |
| 92 | ATH10K_HW_TXRX_RAW = 0, |
| 93 | ATH10K_HW_TXRX_NATIVE_WIFI = 1, |
| 94 | ATH10K_HW_TXRX_ETHERNET = 2, |
Michal Kazior | 961d4c3 | 2013-08-09 10:13:34 +0200 | [diff] [blame] | 95 | |
| 96 | /* Valid for HTT >= 3.0. Used for management frames in TX_FRM. */ |
| 97 | ATH10K_HW_TXRX_MGMT = 3, |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 98 | }; |
| 99 | |
| 100 | enum ath10k_mcast2ucast_mode { |
| 101 | ATH10K_MCAST2UCAST_DISABLED = 0, |
| 102 | ATH10K_MCAST2UCAST_ENABLED = 1, |
| 103 | }; |
| 104 | |
Rajkumar Manoharan | bfdd793 | 2014-10-03 08:02:40 +0300 | [diff] [blame] | 105 | struct ath10k_pktlog_hdr { |
| 106 | __le16 flags; |
| 107 | __le16 missed_cnt; |
| 108 | __le16 log_type; |
| 109 | __le16 size; |
| 110 | __le32 timestamp; |
| 111 | u8 payload[0]; |
| 112 | } __packed; |
| 113 | |
Bartosz Markowski | ec6a73f | 2013-09-26 17:47:14 +0200 | [diff] [blame] | 114 | /* Target specific defines for MAIN firmware */ |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 115 | #define TARGET_NUM_VDEVS 8 |
| 116 | #define TARGET_NUM_PEER_AST 2 |
| 117 | #define TARGET_NUM_WDS_ENTRIES 32 |
| 118 | #define TARGET_DMA_BURST_SIZE 0 |
| 119 | #define TARGET_MAC_AGGR_DELIM 0 |
| 120 | #define TARGET_AST_SKID_LIMIT 16 |
Michal Kazior | cfd1061 | 2014-11-25 15:16:05 +0100 | [diff] [blame] | 121 | #define TARGET_NUM_STATIONS 16 |
| 122 | #define TARGET_NUM_PEERS ((TARGET_NUM_STATIONS) + \ |
| 123 | (TARGET_NUM_VDEVS)) |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 124 | #define TARGET_NUM_OFFLOAD_PEERS 0 |
| 125 | #define TARGET_NUM_OFFLOAD_REORDER_BUFS 0 |
| 126 | #define TARGET_NUM_PEER_KEYS 2 |
Michal Kazior | cfd1061 | 2014-11-25 15:16:05 +0100 | [diff] [blame] | 127 | #define TARGET_NUM_TIDS ((TARGET_NUM_PEERS) * 2) |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 128 | #define TARGET_TX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2)) |
| 129 | #define TARGET_RX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2)) |
| 130 | #define TARGET_RX_TIMEOUT_LO_PRI 100 |
| 131 | #define TARGET_RX_TIMEOUT_HI_PRI 40 |
Michal Kazior | 4d316c7 | 2013-09-26 10:12:24 +0300 | [diff] [blame] | 132 | |
| 133 | /* Native Wifi decap mode is used to align IP frames to 4-byte boundaries and |
| 134 | * avoid a very expensive re-alignment in mac80211. */ |
| 135 | #define TARGET_RX_DECAP_MODE ATH10K_HW_TXRX_NATIVE_WIFI |
| 136 | |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 137 | #define TARGET_SCAN_MAX_PENDING_REQS 4 |
| 138 | #define TARGET_BMISS_OFFLOAD_MAX_VDEV 3 |
| 139 | #define TARGET_ROAM_OFFLOAD_MAX_VDEV 3 |
| 140 | #define TARGET_ROAM_OFFLOAD_MAX_AP_PROFILES 8 |
| 141 | #define TARGET_GTK_OFFLOAD_MAX_VDEV 3 |
| 142 | #define TARGET_NUM_MCAST_GROUPS 0 |
| 143 | #define TARGET_NUM_MCAST_TABLE_ELEMS 0 |
| 144 | #define TARGET_MCAST2UCAST_MODE ATH10K_MCAST2UCAST_DISABLED |
| 145 | #define TARGET_TX_DBG_LOG_SIZE 1024 |
| 146 | #define TARGET_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 0 |
| 147 | #define TARGET_VOW_CONFIG 0 |
| 148 | #define TARGET_NUM_MSDU_DESC (1024 + 400) |
| 149 | #define TARGET_MAX_FRAG_ENTRIES 0 |
| 150 | |
Bartosz Markowski | ec6a73f | 2013-09-26 17:47:14 +0200 | [diff] [blame] | 151 | /* Target specific defines for 10.X firmware */ |
| 152 | #define TARGET_10X_NUM_VDEVS 16 |
| 153 | #define TARGET_10X_NUM_PEER_AST 2 |
| 154 | #define TARGET_10X_NUM_WDS_ENTRIES 32 |
| 155 | #define TARGET_10X_DMA_BURST_SIZE 0 |
| 156 | #define TARGET_10X_MAC_AGGR_DELIM 0 |
| 157 | #define TARGET_10X_AST_SKID_LIMIT 16 |
Michal Kazior | cfd1061 | 2014-11-25 15:16:05 +0100 | [diff] [blame] | 158 | #define TARGET_10X_NUM_STATIONS 128 |
| 159 | #define TARGET_10X_NUM_PEERS ((TARGET_10X_NUM_STATIONS) + \ |
| 160 | (TARGET_10X_NUM_VDEVS)) |
Bartosz Markowski | ec6a73f | 2013-09-26 17:47:14 +0200 | [diff] [blame] | 161 | #define TARGET_10X_NUM_OFFLOAD_PEERS 0 |
| 162 | #define TARGET_10X_NUM_OFFLOAD_REORDER_BUFS 0 |
| 163 | #define TARGET_10X_NUM_PEER_KEYS 2 |
Michal Kazior | cfd1061 | 2014-11-25 15:16:05 +0100 | [diff] [blame] | 164 | #define TARGET_10X_NUM_TIDS_MAX 256 |
| 165 | #define TARGET_10X_NUM_TIDS min((TARGET_10X_NUM_TIDS_MAX), \ |
| 166 | (TARGET_10X_NUM_PEERS) * 2) |
Bartosz Markowski | ec6a73f | 2013-09-26 17:47:14 +0200 | [diff] [blame] | 167 | #define TARGET_10X_TX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2)) |
| 168 | #define TARGET_10X_RX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2)) |
| 169 | #define TARGET_10X_RX_TIMEOUT_LO_PRI 100 |
| 170 | #define TARGET_10X_RX_TIMEOUT_HI_PRI 40 |
Michal Kazior | 0d1a28f | 2013-10-07 20:00:36 -0700 | [diff] [blame] | 171 | #define TARGET_10X_RX_DECAP_MODE ATH10K_HW_TXRX_NATIVE_WIFI |
Bartosz Markowski | ec6a73f | 2013-09-26 17:47:14 +0200 | [diff] [blame] | 172 | #define TARGET_10X_SCAN_MAX_PENDING_REQS 4 |
| 173 | #define TARGET_10X_BMISS_OFFLOAD_MAX_VDEV 2 |
| 174 | #define TARGET_10X_ROAM_OFFLOAD_MAX_VDEV 2 |
| 175 | #define TARGET_10X_ROAM_OFFLOAD_MAX_AP_PROFILES 8 |
| 176 | #define TARGET_10X_GTK_OFFLOAD_MAX_VDEV 3 |
| 177 | #define TARGET_10X_NUM_MCAST_GROUPS 0 |
| 178 | #define TARGET_10X_NUM_MCAST_TABLE_ELEMS 0 |
| 179 | #define TARGET_10X_MCAST2UCAST_MODE ATH10K_MCAST2UCAST_DISABLED |
| 180 | #define TARGET_10X_TX_DBG_LOG_SIZE 1024 |
| 181 | #define TARGET_10X_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 1 |
| 182 | #define TARGET_10X_VOW_CONFIG 0 |
| 183 | #define TARGET_10X_NUM_MSDU_DESC (1024 + 400) |
| 184 | #define TARGET_10X_MAX_FRAG_ENTRIES 0 |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 185 | |
Sujith Manoharan | f6603ff | 2015-01-12 12:30:02 +0200 | [diff] [blame^] | 186 | /* 10.2 parameters */ |
| 187 | #define TARGET_10_2_DMA_BURST_SIZE 1 |
| 188 | |
Michal Kazior | ca996ec | 2014-12-03 10:11:32 +0200 | [diff] [blame] | 189 | /* Target specific defines for WMI-TLV firmware */ |
| 190 | #define TARGET_TLV_NUM_VDEVS 3 |
| 191 | #define TARGET_TLV_NUM_STATIONS 32 |
| 192 | #define TARGET_TLV_NUM_PEERS ((TARGET_TLV_NUM_STATIONS) + \ |
| 193 | (TARGET_TLV_NUM_VDEVS) + \ |
| 194 | 2) |
| 195 | #define TARGET_TLV_NUM_TIDS ((TARGET_TLV_NUM_PEERS) * 2) |
| 196 | #define TARGET_TLV_NUM_MSDU_DESC (1024 + 32) |
| 197 | |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 198 | /* Number of Copy Engines supported */ |
| 199 | #define CE_COUNT 8 |
| 200 | |
| 201 | /* |
| 202 | * Total number of PCIe MSI interrupts requested for all interrupt sources. |
| 203 | * PCIe standard forces this to be a power of 2. |
| 204 | * Some Host OS's limit MSI requests that can be granted to 8 |
| 205 | * so for now we abide by this limit and avoid requesting more |
| 206 | * than that. |
| 207 | */ |
| 208 | #define MSI_NUM_REQUEST_LOG2 3 |
| 209 | #define MSI_NUM_REQUEST (1<<MSI_NUM_REQUEST_LOG2) |
| 210 | |
| 211 | /* |
| 212 | * Granted MSIs are assigned as follows: |
| 213 | * Firmware uses the first |
| 214 | * Remaining MSIs, if any, are used by Copy Engines |
| 215 | * This mapping is known to both Target firmware and Host software. |
| 216 | * It may be changed as long as Host and Target are kept in sync. |
| 217 | */ |
| 218 | /* MSI for firmware (errors, etc.) */ |
| 219 | #define MSI_ASSIGN_FW 0 |
| 220 | |
| 221 | /* MSIs for Copy Engines */ |
| 222 | #define MSI_ASSIGN_CE_INITIAL 1 |
| 223 | #define MSI_ASSIGN_CE_MAX 7 |
| 224 | |
| 225 | /* as of IP3.7.1 */ |
| 226 | #define RTC_STATE_V_ON 3 |
| 227 | |
| 228 | #define RTC_STATE_COLD_RESET_MASK 0x00000400 |
| 229 | #define RTC_STATE_V_LSB 0 |
| 230 | #define RTC_STATE_V_MASK 0x00000007 |
| 231 | #define RTC_STATE_ADDRESS 0x0000 |
| 232 | #define PCIE_SOC_WAKE_V_MASK 0x00000001 |
| 233 | #define PCIE_SOC_WAKE_ADDRESS 0x0004 |
| 234 | #define PCIE_SOC_WAKE_RESET 0x00000000 |
| 235 | #define SOC_GLOBAL_RESET_ADDRESS 0x0008 |
| 236 | |
| 237 | #define RTC_SOC_BASE_ADDRESS 0x00004000 |
| 238 | #define RTC_WMAC_BASE_ADDRESS 0x00005000 |
| 239 | #define MAC_COEX_BASE_ADDRESS 0x00006000 |
| 240 | #define BT_COEX_BASE_ADDRESS 0x00007000 |
| 241 | #define SOC_PCIE_BASE_ADDRESS 0x00008000 |
| 242 | #define SOC_CORE_BASE_ADDRESS 0x00009000 |
| 243 | #define WLAN_UART_BASE_ADDRESS 0x0000c000 |
| 244 | #define WLAN_SI_BASE_ADDRESS 0x00010000 |
| 245 | #define WLAN_GPIO_BASE_ADDRESS 0x00014000 |
| 246 | #define WLAN_ANALOG_INTF_BASE_ADDRESS 0x0001c000 |
| 247 | #define WLAN_MAC_BASE_ADDRESS 0x00020000 |
| 248 | #define EFUSE_BASE_ADDRESS 0x00030000 |
| 249 | #define FPGA_REG_BASE_ADDRESS 0x00039000 |
| 250 | #define WLAN_UART2_BASE_ADDRESS 0x00054c00 |
| 251 | #define CE_WRAPPER_BASE_ADDRESS 0x00057000 |
| 252 | #define CE0_BASE_ADDRESS 0x00057400 |
| 253 | #define CE1_BASE_ADDRESS 0x00057800 |
| 254 | #define CE2_BASE_ADDRESS 0x00057c00 |
| 255 | #define CE3_BASE_ADDRESS 0x00058000 |
| 256 | #define CE4_BASE_ADDRESS 0x00058400 |
| 257 | #define CE5_BASE_ADDRESS 0x00058800 |
| 258 | #define CE6_BASE_ADDRESS 0x00058c00 |
| 259 | #define CE7_BASE_ADDRESS 0x00059000 |
| 260 | #define DBI_BASE_ADDRESS 0x00060000 |
| 261 | #define WLAN_ANALOG_INTF_PCIE_BASE_ADDRESS 0x0006c000 |
| 262 | #define PCIE_LOCAL_BASE_ADDRESS 0x00080000 |
| 263 | |
Michal Kazior | fc36e3f | 2014-02-10 17:14:22 +0100 | [diff] [blame] | 264 | #define SOC_RESET_CONTROL_ADDRESS 0x00000000 |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 265 | #define SOC_RESET_CONTROL_OFFSET 0x00000000 |
| 266 | #define SOC_RESET_CONTROL_SI0_RST_MASK 0x00000001 |
Michal Kazior | fc36e3f | 2014-02-10 17:14:22 +0100 | [diff] [blame] | 267 | #define SOC_RESET_CONTROL_CE_RST_MASK 0x00040000 |
| 268 | #define SOC_RESET_CONTROL_CPU_WARM_RST_MASK 0x00000040 |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 269 | #define SOC_CPU_CLOCK_OFFSET 0x00000020 |
| 270 | #define SOC_CPU_CLOCK_STANDARD_LSB 0 |
| 271 | #define SOC_CPU_CLOCK_STANDARD_MASK 0x00000003 |
| 272 | #define SOC_CLOCK_CONTROL_OFFSET 0x00000028 |
| 273 | #define SOC_CLOCK_CONTROL_SI0_CLK_MASK 0x00000001 |
| 274 | #define SOC_SYSTEM_SLEEP_OFFSET 0x000000c4 |
| 275 | #define SOC_LPO_CAL_OFFSET 0x000000e0 |
| 276 | #define SOC_LPO_CAL_ENABLE_LSB 20 |
| 277 | #define SOC_LPO_CAL_ENABLE_MASK 0x00100000 |
Michal Kazior | fc36e3f | 2014-02-10 17:14:22 +0100 | [diff] [blame] | 278 | #define SOC_LF_TIMER_CONTROL0_ADDRESS 0x00000050 |
| 279 | #define SOC_LF_TIMER_CONTROL0_ENABLE_MASK 0x00000004 |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 280 | |
Kalle Valo | e01ae68 | 2013-09-01 11:22:14 +0300 | [diff] [blame] | 281 | #define SOC_CHIP_ID_ADDRESS 0x000000ec |
| 282 | #define SOC_CHIP_ID_REV_LSB 8 |
| 283 | #define SOC_CHIP_ID_REV_MASK 0x00000f00 |
| 284 | |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 285 | #define WLAN_RESET_CONTROL_COLD_RST_MASK 0x00000008 |
| 286 | #define WLAN_RESET_CONTROL_WARM_RST_MASK 0x00000004 |
| 287 | #define WLAN_SYSTEM_SLEEP_DISABLE_LSB 0 |
| 288 | #define WLAN_SYSTEM_SLEEP_DISABLE_MASK 0x00000001 |
| 289 | |
| 290 | #define WLAN_GPIO_PIN0_ADDRESS 0x00000028 |
| 291 | #define WLAN_GPIO_PIN0_CONFIG_MASK 0x00007800 |
| 292 | #define WLAN_GPIO_PIN1_ADDRESS 0x0000002c |
| 293 | #define WLAN_GPIO_PIN1_CONFIG_MASK 0x00007800 |
| 294 | #define WLAN_GPIO_PIN10_ADDRESS 0x00000050 |
| 295 | #define WLAN_GPIO_PIN11_ADDRESS 0x00000054 |
| 296 | #define WLAN_GPIO_PIN12_ADDRESS 0x00000058 |
| 297 | #define WLAN_GPIO_PIN13_ADDRESS 0x0000005c |
| 298 | |
| 299 | #define CLOCK_GPIO_OFFSET 0xffffffff |
| 300 | #define CLOCK_GPIO_BT_CLK_OUT_EN_LSB 0 |
| 301 | #define CLOCK_GPIO_BT_CLK_OUT_EN_MASK 0 |
| 302 | |
| 303 | #define SI_CONFIG_OFFSET 0x00000000 |
| 304 | #define SI_CONFIG_BIDIR_OD_DATA_LSB 18 |
| 305 | #define SI_CONFIG_BIDIR_OD_DATA_MASK 0x00040000 |
| 306 | #define SI_CONFIG_I2C_LSB 16 |
| 307 | #define SI_CONFIG_I2C_MASK 0x00010000 |
| 308 | #define SI_CONFIG_POS_SAMPLE_LSB 7 |
| 309 | #define SI_CONFIG_POS_SAMPLE_MASK 0x00000080 |
| 310 | #define SI_CONFIG_INACTIVE_DATA_LSB 5 |
| 311 | #define SI_CONFIG_INACTIVE_DATA_MASK 0x00000020 |
| 312 | #define SI_CONFIG_INACTIVE_CLK_LSB 4 |
| 313 | #define SI_CONFIG_INACTIVE_CLK_MASK 0x00000010 |
| 314 | #define SI_CONFIG_DIVIDER_LSB 0 |
| 315 | #define SI_CONFIG_DIVIDER_MASK 0x0000000f |
| 316 | #define SI_CS_OFFSET 0x00000004 |
| 317 | #define SI_CS_DONE_ERR_MASK 0x00000400 |
| 318 | #define SI_CS_DONE_INT_MASK 0x00000200 |
| 319 | #define SI_CS_START_LSB 8 |
| 320 | #define SI_CS_START_MASK 0x00000100 |
| 321 | #define SI_CS_RX_CNT_LSB 4 |
| 322 | #define SI_CS_RX_CNT_MASK 0x000000f0 |
| 323 | #define SI_CS_TX_CNT_LSB 0 |
| 324 | #define SI_CS_TX_CNT_MASK 0x0000000f |
| 325 | |
| 326 | #define SI_TX_DATA0_OFFSET 0x00000008 |
| 327 | #define SI_TX_DATA1_OFFSET 0x0000000c |
| 328 | #define SI_RX_DATA0_OFFSET 0x00000010 |
| 329 | #define SI_RX_DATA1_OFFSET 0x00000014 |
| 330 | |
| 331 | #define CORE_CTRL_CPU_INTR_MASK 0x00002000 |
Michal Kazior | 7c0f0e3 | 2014-10-20 14:14:38 +0200 | [diff] [blame] | 332 | #define CORE_CTRL_PCIE_REG_31_MASK 0x00000800 |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 333 | #define CORE_CTRL_ADDRESS 0x0000 |
| 334 | #define PCIE_INTR_ENABLE_ADDRESS 0x0008 |
Michal Kazior | e539887 | 2013-11-25 14:06:20 +0100 | [diff] [blame] | 335 | #define PCIE_INTR_CAUSE_ADDRESS 0x000c |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 336 | #define PCIE_INTR_CLR_ADDRESS 0x0014 |
| 337 | #define SCRATCH_3_ADDRESS 0x0030 |
Michal Kazior | fc36e3f | 2014-02-10 17:14:22 +0100 | [diff] [blame] | 338 | #define CPU_INTR_ADDRESS 0x0010 |
Kalle Valo | 5e3dd15 | 2013-06-12 20:52:10 +0300 | [diff] [blame] | 339 | |
| 340 | /* Firmware indications to the Host via SCRATCH_3 register. */ |
| 341 | #define FW_INDICATOR_ADDRESS (SOC_CORE_BASE_ADDRESS + SCRATCH_3_ADDRESS) |
| 342 | #define FW_IND_EVENT_PENDING 1 |
| 343 | #define FW_IND_INITIALIZED 2 |
| 344 | |
| 345 | /* HOST_REG interrupt from firmware */ |
| 346 | #define PCIE_INTR_FIRMWARE_MASK 0x00000400 |
| 347 | #define PCIE_INTR_CE_MASK_ALL 0x0007f800 |
| 348 | |
| 349 | #define DRAM_BASE_ADDRESS 0x00400000 |
| 350 | |
| 351 | #define MISSING 0 |
| 352 | |
| 353 | #define SYSTEM_SLEEP_OFFSET SOC_SYSTEM_SLEEP_OFFSET |
| 354 | #define WLAN_SYSTEM_SLEEP_OFFSET SOC_SYSTEM_SLEEP_OFFSET |
| 355 | #define WLAN_RESET_CONTROL_OFFSET SOC_RESET_CONTROL_OFFSET |
| 356 | #define CLOCK_CONTROL_OFFSET SOC_CLOCK_CONTROL_OFFSET |
| 357 | #define CLOCK_CONTROL_SI0_CLK_MASK SOC_CLOCK_CONTROL_SI0_CLK_MASK |
| 358 | #define RESET_CONTROL_MBOX_RST_MASK MISSING |
| 359 | #define RESET_CONTROL_SI0_RST_MASK SOC_RESET_CONTROL_SI0_RST_MASK |
| 360 | #define GPIO_BASE_ADDRESS WLAN_GPIO_BASE_ADDRESS |
| 361 | #define GPIO_PIN0_OFFSET WLAN_GPIO_PIN0_ADDRESS |
| 362 | #define GPIO_PIN1_OFFSET WLAN_GPIO_PIN1_ADDRESS |
| 363 | #define GPIO_PIN0_CONFIG_MASK WLAN_GPIO_PIN0_CONFIG_MASK |
| 364 | #define GPIO_PIN1_CONFIG_MASK WLAN_GPIO_PIN1_CONFIG_MASK |
| 365 | #define SI_BASE_ADDRESS WLAN_SI_BASE_ADDRESS |
| 366 | #define SCRATCH_BASE_ADDRESS SOC_CORE_BASE_ADDRESS |
| 367 | #define LOCAL_SCRATCH_OFFSET 0x18 |
| 368 | #define CPU_CLOCK_OFFSET SOC_CPU_CLOCK_OFFSET |
| 369 | #define LPO_CAL_OFFSET SOC_LPO_CAL_OFFSET |
| 370 | #define GPIO_PIN10_OFFSET WLAN_GPIO_PIN10_ADDRESS |
| 371 | #define GPIO_PIN11_OFFSET WLAN_GPIO_PIN11_ADDRESS |
| 372 | #define GPIO_PIN12_OFFSET WLAN_GPIO_PIN12_ADDRESS |
| 373 | #define GPIO_PIN13_OFFSET WLAN_GPIO_PIN13_ADDRESS |
| 374 | #define CPU_CLOCK_STANDARD_LSB SOC_CPU_CLOCK_STANDARD_LSB |
| 375 | #define CPU_CLOCK_STANDARD_MASK SOC_CPU_CLOCK_STANDARD_MASK |
| 376 | #define LPO_CAL_ENABLE_LSB SOC_LPO_CAL_ENABLE_LSB |
| 377 | #define LPO_CAL_ENABLE_MASK SOC_LPO_CAL_ENABLE_MASK |
| 378 | #define ANALOG_INTF_BASE_ADDRESS WLAN_ANALOG_INTF_BASE_ADDRESS |
| 379 | #define MBOX_BASE_ADDRESS MISSING |
| 380 | #define INT_STATUS_ENABLE_ERROR_LSB MISSING |
| 381 | #define INT_STATUS_ENABLE_ERROR_MASK MISSING |
| 382 | #define INT_STATUS_ENABLE_CPU_LSB MISSING |
| 383 | #define INT_STATUS_ENABLE_CPU_MASK MISSING |
| 384 | #define INT_STATUS_ENABLE_COUNTER_LSB MISSING |
| 385 | #define INT_STATUS_ENABLE_COUNTER_MASK MISSING |
| 386 | #define INT_STATUS_ENABLE_MBOX_DATA_LSB MISSING |
| 387 | #define INT_STATUS_ENABLE_MBOX_DATA_MASK MISSING |
| 388 | #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB MISSING |
| 389 | #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK MISSING |
| 390 | #define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB MISSING |
| 391 | #define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK MISSING |
| 392 | #define COUNTER_INT_STATUS_ENABLE_BIT_LSB MISSING |
| 393 | #define COUNTER_INT_STATUS_ENABLE_BIT_MASK MISSING |
| 394 | #define INT_STATUS_ENABLE_ADDRESS MISSING |
| 395 | #define CPU_INT_STATUS_ENABLE_BIT_LSB MISSING |
| 396 | #define CPU_INT_STATUS_ENABLE_BIT_MASK MISSING |
| 397 | #define HOST_INT_STATUS_ADDRESS MISSING |
| 398 | #define CPU_INT_STATUS_ADDRESS MISSING |
| 399 | #define ERROR_INT_STATUS_ADDRESS MISSING |
| 400 | #define ERROR_INT_STATUS_WAKEUP_MASK MISSING |
| 401 | #define ERROR_INT_STATUS_WAKEUP_LSB MISSING |
| 402 | #define ERROR_INT_STATUS_RX_UNDERFLOW_MASK MISSING |
| 403 | #define ERROR_INT_STATUS_RX_UNDERFLOW_LSB MISSING |
| 404 | #define ERROR_INT_STATUS_TX_OVERFLOW_MASK MISSING |
| 405 | #define ERROR_INT_STATUS_TX_OVERFLOW_LSB MISSING |
| 406 | #define COUNT_DEC_ADDRESS MISSING |
| 407 | #define HOST_INT_STATUS_CPU_MASK MISSING |
| 408 | #define HOST_INT_STATUS_CPU_LSB MISSING |
| 409 | #define HOST_INT_STATUS_ERROR_MASK MISSING |
| 410 | #define HOST_INT_STATUS_ERROR_LSB MISSING |
| 411 | #define HOST_INT_STATUS_COUNTER_MASK MISSING |
| 412 | #define HOST_INT_STATUS_COUNTER_LSB MISSING |
| 413 | #define RX_LOOKAHEAD_VALID_ADDRESS MISSING |
| 414 | #define WINDOW_DATA_ADDRESS MISSING |
| 415 | #define WINDOW_READ_ADDR_ADDRESS MISSING |
| 416 | #define WINDOW_WRITE_ADDR_ADDRESS MISSING |
| 417 | |
| 418 | #define RTC_STATE_V_GET(x) (((x) & RTC_STATE_V_MASK) >> RTC_STATE_V_LSB) |
| 419 | |
| 420 | #endif /* _HW_H_ */ |