1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #ifndef TARGET_H
19 #define TARGET_H
20
21 #define AR6003_BOARD_DATA_SZ 1024
22 #define AR6003_BOARD_EXT_DATA_SZ 768
23 #define AR6003_BOARD_EXT_DATA_SZ_V2 1024
24
25 #define AR6004_BOARD_DATA_SZ 6144
26 #define AR6004_BOARD_EXT_DATA_SZ 0
27
28 #define RESET_CONTROL_ADDRESS 0x00004000
29 #define RESET_CONTROL_COLD_RST 0x00000100
30 #define RESET_CONTROL_MBOX_RST 0x00000004
31
32 #define CPU_CLOCK_STANDARD_S 0
33 #define CPU_CLOCK_STANDARD 0x00000003
34 #define CPU_CLOCK_ADDRESS 0x00000020
35
36 #define CLOCK_CONTROL_ADDRESS 0x00000028
37 #define CLOCK_CONTROL_LF_CLK32_S 2
38 #define CLOCK_CONTROL_LF_CLK32 0x00000004
39
40 #define SYSTEM_SLEEP_ADDRESS 0x000000c4
41 #define SYSTEM_SLEEP_DISABLE_S 0
42 #define SYSTEM_SLEEP_DISABLE 0x00000001
43
44 #define LPO_CAL_ADDRESS 0x000000e0
45 #define LPO_CAL_ENABLE_S 20
46 #define LPO_CAL_ENABLE 0x00100000
47
48 #define GPIO_PIN9_ADDRESS 0x0000004c
49 #define GPIO_PIN10_ADDRESS 0x00000050
50 #define GPIO_PIN11_ADDRESS 0x00000054
51 #define GPIO_PIN12_ADDRESS 0x00000058
52 #define GPIO_PIN13_ADDRESS 0x0000005c
53
54 #define HOST_INT_STATUS_ADDRESS 0x00000400
55 #define HOST_INT_STATUS_ERROR_S 7
56 #define HOST_INT_STATUS_ERROR 0x00000080
57
58 #define HOST_INT_STATUS_CPU_S 6
59 #define HOST_INT_STATUS_CPU 0x00000040
60
61 #define HOST_INT_STATUS_COUNTER_S 4
62 #define HOST_INT_STATUS_COUNTER 0x00000010
63
64 #define CPU_INT_STATUS_ADDRESS 0x00000401
65
66 #define ERROR_INT_STATUS_ADDRESS 0x00000402
67 #define ERROR_INT_STATUS_WAKEUP_S 2
68 #define ERROR_INT_STATUS_WAKEUP 0x00000004
69
70 #define ERROR_INT_STATUS_RX_UNDERFLOW_S 1
71 #define ERROR_INT_STATUS_RX_UNDERFLOW 0x00000002
72
73 #define ERROR_INT_STATUS_TX_OVERFLOW_S 0
74 #define ERROR_INT_STATUS_TX_OVERFLOW 0x00000001
75
76 #define COUNTER_INT_STATUS_ADDRESS 0x00000403
77 #define COUNTER_INT_STATUS_COUNTER_S 0
78 #define COUNTER_INT_STATUS_COUNTER 0x000000ff
79
80 #define RX_LOOKAHEAD_VALID_ADDRESS 0x00000405
81
82 #define INT_STATUS_ENABLE_ADDRESS 0x00000418
83 #define INT_STATUS_ENABLE_ERROR_S 7
84 #define INT_STATUS_ENABLE_ERROR 0x00000080
85
86 #define INT_STATUS_ENABLE_CPU_S 6
87 #define INT_STATUS_ENABLE_CPU 0x00000040
88
89 #define INT_STATUS_ENABLE_INT_S 5
90 #define INT_STATUS_ENABLE_INT 0x00000020
91 #define INT_STATUS_ENABLE_COUNTER_S 4
92 #define INT_STATUS_ENABLE_COUNTER 0x00000010
93
94 #define INT_STATUS_ENABLE_MBOX_DATA_S 0
95 #define INT_STATUS_ENABLE_MBOX_DATA 0x0000000f
96
97 #define CPU_INT_STATUS_ENABLE_ADDRESS 0x00000419
98 #define CPU_INT_STATUS_ENABLE_BIT_S 0
99 #define CPU_INT_STATUS_ENABLE_BIT 0x000000ff
100
101 #define ERROR_STATUS_ENABLE_ADDRESS 0x0000041a
102 #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_S 1
103 #define ERROR_STATUS_ENABLE_RX_UNDERFLOW 0x00000002
104
105 #define ERROR_STATUS_ENABLE_TX_OVERFLOW_S 0
106 #define ERROR_STATUS_ENABLE_TX_OVERFLOW 0x00000001
107
108 #define COUNTER_INT_STATUS_ENABLE_ADDRESS 0x0000041b
109 #define COUNTER_INT_STATUS_ENABLE_BIT_S 0
110 #define COUNTER_INT_STATUS_ENABLE_BIT 0x000000ff
111
112 #define COUNT_ADDRESS 0x00000420
113
114 #define COUNT_DEC_ADDRESS 0x00000440
115
116 #define WINDOW_DATA_ADDRESS 0x00000474
117 #define WINDOW_WRITE_ADDR_ADDRESS 0x00000478
118 #define WINDOW_READ_ADDR_ADDRESS 0x0000047c
119 #define CPU_DBG_SEL_ADDRESS 0x00000483
120 #define CPU_DBG_ADDRESS 0x00000484
121
122 #define LOCAL_SCRATCH_ADDRESS 0x000000c0
123 #define ATH6KL_OPTION_SLEEP_DISABLE 0x08
124
125 #define RTC_BASE_ADDRESS 0x00004000
126 #define GPIO_BASE_ADDRESS 0x00014000
127 #define MBOX_BASE_ADDRESS 0x00018000
128 #define ANALOG_INTF_BASE_ADDRESS 0x0001c000
129
130
131 #define ATH6KL_ANALOG_PLL_REGISTER (ANALOG_INTF_BASE_ADDRESS + 0x284)
132
133 #define SM(f, v) (((v) << f##_S) & f)
134 #define MS(f, v) (((v) & f) >> f##_S)
135
136
137
138
139
140
141
142
143
144 #define ATH6KL_AR6003_HI_START_ADDR 0x00540600
145 #define ATH6KL_AR6004_HI_START_ADDR 0x00400800
146
147
148
149
150
151
152
153
154
155
156
157
158
159 struct host_interest {
160
161
162
163
164 u32 hi_app_host_interest;
165
166
167 u32 hi_failure_state;
168
169
170 u32 hi_dbglog_hdr;
171
172 u32 hi_unused1;
173
174
175
176
177
178 u32 hi_option_flag;
179
180
181
182
183
184 u32 hi_serial_enable;
185
186
187 u32 hi_dset_list_head;
188
189
190 u32 hi_app_start;
191
192
193 u32 hi_skip_clock_init;
194 u32 hi_core_clock_setting;
195 u32 hi_cpu_clock_setting;
196 u32 hi_system_sleep_setting;
197 u32 hi_xtal_control_setting;
198 u32 hi_pll_ctrl_setting_24ghz;
199 u32 hi_pll_ctrl_setting_5ghz;
200 u32 hi_ref_voltage_trim_setting;
201 u32 hi_clock_info;
202
203
204
205
206
207
208
209 u32 hi_bank0_addr_value;
210 u32 hi_bank0_read_value;
211 u32 hi_bank0_write_value;
212 u32 hi_bank0_config_value;
213
214
215 u32 hi_board_data;
216 u32 hi_board_data_initialized;
217
218 u32 hi_dset_ram_index_tbl;
219
220 u32 hi_desired_baud_rate;
221 u32 hi_dbglog_config;
222 u32 hi_end_ram_reserve_sz;
223 u32 hi_mbox_io_block_sz;
224
225 u32 hi_num_bpatch_streams;
226 u32 hi_mbox_isr_yield_limit;
227
228 u32 hi_refclk_hz;
229 u32 hi_ext_clk_detected;
230 u32 hi_dbg_uart_txpin;
231 u32 hi_dbg_uart_rxpin;
232 u32 hi_hci_uart_baud;
233 u32 hi_hci_uart_pin_assignments;
234
235
236
237
238 u32 hi_hci_uart_baud_scale_val;
239 u32 hi_hci_uart_baud_step_val;
240
241 u32 hi_allocram_start;
242 u32 hi_allocram_sz;
243 u32 hi_hci_bridge_flags;
244 u32 hi_hci_uart_support_pins;
245
246
247
248
249 u32 hi_hci_uart_pwr_mgmt_params;
250
251
252
253
254
255
256 u32 hi_board_ext_data;
257 u32 hi_board_ext_data_config;
258
259
260
261
262
263
264
265
266
267
268 u32 hi_reset_flag;
269
270 u32 hi_reset_flag_valid;
271 u32 hi_hci_uart_pwr_mgmt_params_ext;
272
273
274
275
276 u32 hi_acs_flags;
277 u32 hi_console_flags;
278 u32 hi_nvram_state;
279 u32 hi_option_flag2;
280
281
282 u32 hi_sw_version_override;
283 u32 hi_abi_version_override;
284
285
286
287
288
289 u32 hi_hp_rx_traffic_ratio;
290
291
292 u32 hi_test_apps_related;
293
294 u32 hi_ota_testscript;
295
296 u32 hi_cal_data;
297
298 u32 hi_pktlog_num_buffers;
299
300 } __packed;
301
302 #define HI_ITEM(item) offsetof(struct host_interest, item)
303
304 #define HI_OPTION_MAC_ADDR_METHOD_SHIFT 3
305
306 #define HI_OPTION_FW_MODE_IBSS 0x0
307 #define HI_OPTION_FW_MODE_BSS_STA 0x1
308 #define HI_OPTION_FW_MODE_AP 0x2
309
310 #define HI_OPTION_FW_SUBMODE_NONE 0x0
311 #define HI_OPTION_FW_SUBMODE_P2PDEV 0x1
312 #define HI_OPTION_FW_SUBMODE_P2PCLIENT 0x2
313 #define HI_OPTION_FW_SUBMODE_P2PGO 0x3
314
315 #define HI_OPTION_NUM_DEV_SHIFT 0x9
316
317 #define HI_OPTION_FW_BRIDGE_SHIFT 0x04
318
319
320
321
322
323
324
325
326 #define HI_OPTION_FW_MODE_BITS 0x2
327 #define HI_OPTION_FW_MODE_SHIFT 0xC
328
329 #define HI_OPTION_FW_SUBMODE_BITS 0x2
330 #define HI_OPTION_FW_SUBMODE_SHIFT 0x14
331
332
333 #define AR6003_VTOP(vaddr) ((vaddr) & 0x001fffff)
334 #define AR6004_VTOP(vaddr) (vaddr)
335
336 #define TARG_VTOP(target_type, vaddr) \
337 (((target_type) == TARGET_TYPE_AR6003) ? AR6003_VTOP(vaddr) : \
338 (((target_type) == TARGET_TYPE_AR6004) ? AR6004_VTOP(vaddr) : 0))
339
340 #define ATH6KL_FWLOG_PAYLOAD_SIZE 1500
341
342 struct ath6kl_dbglog_buf {
343 __le32 next;
344 __le32 buffer_addr;
345 __le32 bufsize;
346 __le32 length;
347 __le32 count;
348 __le32 free;
349 } __packed;
350
351 struct ath6kl_dbglog_hdr {
352 __le32 dbuf_addr;
353 __le32 dropped;
354 } __packed;
355
356 #endif