0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef TARGET_H
0019 #define TARGET_H
0020
0021 #define AR6003_BOARD_DATA_SZ 1024
0022 #define AR6003_BOARD_EXT_DATA_SZ 768
0023 #define AR6003_BOARD_EXT_DATA_SZ_V2 1024
0024
0025 #define AR6004_BOARD_DATA_SZ 6144
0026 #define AR6004_BOARD_EXT_DATA_SZ 0
0027
0028 #define RESET_CONTROL_ADDRESS 0x00004000
0029 #define RESET_CONTROL_COLD_RST 0x00000100
0030 #define RESET_CONTROL_MBOX_RST 0x00000004
0031
0032 #define CPU_CLOCK_STANDARD_S 0
0033 #define CPU_CLOCK_STANDARD 0x00000003
0034 #define CPU_CLOCK_ADDRESS 0x00000020
0035
0036 #define CLOCK_CONTROL_ADDRESS 0x00000028
0037 #define CLOCK_CONTROL_LF_CLK32_S 2
0038 #define CLOCK_CONTROL_LF_CLK32 0x00000004
0039
0040 #define SYSTEM_SLEEP_ADDRESS 0x000000c4
0041 #define SYSTEM_SLEEP_DISABLE_S 0
0042 #define SYSTEM_SLEEP_DISABLE 0x00000001
0043
0044 #define LPO_CAL_ADDRESS 0x000000e0
0045 #define LPO_CAL_ENABLE_S 20
0046 #define LPO_CAL_ENABLE 0x00100000
0047
0048 #define GPIO_PIN9_ADDRESS 0x0000004c
0049 #define GPIO_PIN10_ADDRESS 0x00000050
0050 #define GPIO_PIN11_ADDRESS 0x00000054
0051 #define GPIO_PIN12_ADDRESS 0x00000058
0052 #define GPIO_PIN13_ADDRESS 0x0000005c
0053
0054 #define HOST_INT_STATUS_ADDRESS 0x00000400
0055 #define HOST_INT_STATUS_ERROR_S 7
0056 #define HOST_INT_STATUS_ERROR 0x00000080
0057
0058 #define HOST_INT_STATUS_CPU_S 6
0059 #define HOST_INT_STATUS_CPU 0x00000040
0060
0061 #define HOST_INT_STATUS_COUNTER_S 4
0062 #define HOST_INT_STATUS_COUNTER 0x00000010
0063
0064 #define CPU_INT_STATUS_ADDRESS 0x00000401
0065
0066 #define ERROR_INT_STATUS_ADDRESS 0x00000402
0067 #define ERROR_INT_STATUS_WAKEUP_S 2
0068 #define ERROR_INT_STATUS_WAKEUP 0x00000004
0069
0070 #define ERROR_INT_STATUS_RX_UNDERFLOW_S 1
0071 #define ERROR_INT_STATUS_RX_UNDERFLOW 0x00000002
0072
0073 #define ERROR_INT_STATUS_TX_OVERFLOW_S 0
0074 #define ERROR_INT_STATUS_TX_OVERFLOW 0x00000001
0075
0076 #define COUNTER_INT_STATUS_ADDRESS 0x00000403
0077 #define COUNTER_INT_STATUS_COUNTER_S 0
0078 #define COUNTER_INT_STATUS_COUNTER 0x000000ff
0079
0080 #define RX_LOOKAHEAD_VALID_ADDRESS 0x00000405
0081
0082 #define INT_STATUS_ENABLE_ADDRESS 0x00000418
0083 #define INT_STATUS_ENABLE_ERROR_S 7
0084 #define INT_STATUS_ENABLE_ERROR 0x00000080
0085
0086 #define INT_STATUS_ENABLE_CPU_S 6
0087 #define INT_STATUS_ENABLE_CPU 0x00000040
0088
0089 #define INT_STATUS_ENABLE_INT_S 5
0090 #define INT_STATUS_ENABLE_INT 0x00000020
0091 #define INT_STATUS_ENABLE_COUNTER_S 4
0092 #define INT_STATUS_ENABLE_COUNTER 0x00000010
0093
0094 #define INT_STATUS_ENABLE_MBOX_DATA_S 0
0095 #define INT_STATUS_ENABLE_MBOX_DATA 0x0000000f
0096
0097 #define CPU_INT_STATUS_ENABLE_ADDRESS 0x00000419
0098 #define CPU_INT_STATUS_ENABLE_BIT_S 0
0099 #define CPU_INT_STATUS_ENABLE_BIT 0x000000ff
0100
0101 #define ERROR_STATUS_ENABLE_ADDRESS 0x0000041a
0102 #define ERROR_STATUS_ENABLE_RX_UNDERFLOW_S 1
0103 #define ERROR_STATUS_ENABLE_RX_UNDERFLOW 0x00000002
0104
0105 #define ERROR_STATUS_ENABLE_TX_OVERFLOW_S 0
0106 #define ERROR_STATUS_ENABLE_TX_OVERFLOW 0x00000001
0107
0108 #define COUNTER_INT_STATUS_ENABLE_ADDRESS 0x0000041b
0109 #define COUNTER_INT_STATUS_ENABLE_BIT_S 0
0110 #define COUNTER_INT_STATUS_ENABLE_BIT 0x000000ff
0111
0112 #define COUNT_ADDRESS 0x00000420
0113
0114 #define COUNT_DEC_ADDRESS 0x00000440
0115
0116 #define WINDOW_DATA_ADDRESS 0x00000474
0117 #define WINDOW_WRITE_ADDR_ADDRESS 0x00000478
0118 #define WINDOW_READ_ADDR_ADDRESS 0x0000047c
0119 #define CPU_DBG_SEL_ADDRESS 0x00000483
0120 #define CPU_DBG_ADDRESS 0x00000484
0121
0122 #define LOCAL_SCRATCH_ADDRESS 0x000000c0
0123 #define ATH6KL_OPTION_SLEEP_DISABLE 0x08
0124
0125 #define RTC_BASE_ADDRESS 0x00004000
0126 #define GPIO_BASE_ADDRESS 0x00014000
0127 #define MBOX_BASE_ADDRESS 0x00018000
0128 #define ANALOG_INTF_BASE_ADDRESS 0x0001c000
0129
0130
0131 #define ATH6KL_ANALOG_PLL_REGISTER (ANALOG_INTF_BASE_ADDRESS + 0x284)
0132
0133 #define SM(f, v) (((v) << f##_S) & f)
0134 #define MS(f, v) (((v) & f) >> f##_S)
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144 #define ATH6KL_AR6003_HI_START_ADDR 0x00540600
0145 #define ATH6KL_AR6004_HI_START_ADDR 0x00400800
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159 struct host_interest {
0160
0161
0162
0163
0164 u32 hi_app_host_interest;
0165
0166
0167 u32 hi_failure_state;
0168
0169
0170 u32 hi_dbglog_hdr;
0171
0172 u32 hi_unused1;
0173
0174
0175
0176
0177
0178 u32 hi_option_flag;
0179
0180
0181
0182
0183
0184 u32 hi_serial_enable;
0185
0186
0187 u32 hi_dset_list_head;
0188
0189
0190 u32 hi_app_start;
0191
0192
0193 u32 hi_skip_clock_init;
0194 u32 hi_core_clock_setting;
0195 u32 hi_cpu_clock_setting;
0196 u32 hi_system_sleep_setting;
0197 u32 hi_xtal_control_setting;
0198 u32 hi_pll_ctrl_setting_24ghz;
0199 u32 hi_pll_ctrl_setting_5ghz;
0200 u32 hi_ref_voltage_trim_setting;
0201 u32 hi_clock_info;
0202
0203
0204
0205
0206
0207
0208
0209 u32 hi_bank0_addr_value;
0210 u32 hi_bank0_read_value;
0211 u32 hi_bank0_write_value;
0212 u32 hi_bank0_config_value;
0213
0214
0215 u32 hi_board_data;
0216 u32 hi_board_data_initialized;
0217
0218 u32 hi_dset_ram_index_tbl;
0219
0220 u32 hi_desired_baud_rate;
0221 u32 hi_dbglog_config;
0222 u32 hi_end_ram_reserve_sz;
0223 u32 hi_mbox_io_block_sz;
0224
0225 u32 hi_num_bpatch_streams;
0226 u32 hi_mbox_isr_yield_limit;
0227
0228 u32 hi_refclk_hz;
0229 u32 hi_ext_clk_detected;
0230 u32 hi_dbg_uart_txpin;
0231 u32 hi_dbg_uart_rxpin;
0232 u32 hi_hci_uart_baud;
0233 u32 hi_hci_uart_pin_assignments;
0234
0235
0236
0237
0238 u32 hi_hci_uart_baud_scale_val;
0239 u32 hi_hci_uart_baud_step_val;
0240
0241 u32 hi_allocram_start;
0242 u32 hi_allocram_sz;
0243 u32 hi_hci_bridge_flags;
0244 u32 hi_hci_uart_support_pins;
0245
0246
0247
0248
0249 u32 hi_hci_uart_pwr_mgmt_params;
0250
0251
0252
0253
0254
0255
0256 u32 hi_board_ext_data;
0257 u32 hi_board_ext_data_config;
0258
0259
0260
0261
0262
0263
0264
0265
0266
0267
0268 u32 hi_reset_flag;
0269
0270 u32 hi_reset_flag_valid;
0271 u32 hi_hci_uart_pwr_mgmt_params_ext;
0272
0273
0274
0275
0276 u32 hi_acs_flags;
0277 u32 hi_console_flags;
0278 u32 hi_nvram_state;
0279 u32 hi_option_flag2;
0280
0281
0282 u32 hi_sw_version_override;
0283 u32 hi_abi_version_override;
0284
0285
0286
0287
0288
0289 u32 hi_hp_rx_traffic_ratio;
0290
0291
0292 u32 hi_test_apps_related;
0293
0294 u32 hi_ota_testscript;
0295
0296 u32 hi_cal_data;
0297
0298 u32 hi_pktlog_num_buffers;
0299
0300 } __packed;
0301
0302 #define HI_ITEM(item) offsetof(struct host_interest, item)
0303
0304 #define HI_OPTION_MAC_ADDR_METHOD_SHIFT 3
0305
0306 #define HI_OPTION_FW_MODE_IBSS 0x0
0307 #define HI_OPTION_FW_MODE_BSS_STA 0x1
0308 #define HI_OPTION_FW_MODE_AP 0x2
0309
0310 #define HI_OPTION_FW_SUBMODE_NONE 0x0
0311 #define HI_OPTION_FW_SUBMODE_P2PDEV 0x1
0312 #define HI_OPTION_FW_SUBMODE_P2PCLIENT 0x2
0313 #define HI_OPTION_FW_SUBMODE_P2PGO 0x3
0314
0315 #define HI_OPTION_NUM_DEV_SHIFT 0x9
0316
0317 #define HI_OPTION_FW_BRIDGE_SHIFT 0x04
0318
0319
0320
0321
0322
0323
0324
0325
0326 #define HI_OPTION_FW_MODE_BITS 0x2
0327 #define HI_OPTION_FW_MODE_SHIFT 0xC
0328
0329 #define HI_OPTION_FW_SUBMODE_BITS 0x2
0330 #define HI_OPTION_FW_SUBMODE_SHIFT 0x14
0331
0332
0333 #define AR6003_VTOP(vaddr) ((vaddr) & 0x001fffff)
0334 #define AR6004_VTOP(vaddr) (vaddr)
0335
0336 #define TARG_VTOP(target_type, vaddr) \
0337 (((target_type) == TARGET_TYPE_AR6003) ? AR6003_VTOP(vaddr) : \
0338 (((target_type) == TARGET_TYPE_AR6004) ? AR6004_VTOP(vaddr) : 0))
0339
0340 #define ATH6KL_FWLOG_PAYLOAD_SIZE 1500
0341
0342 struct ath6kl_dbglog_buf {
0343 __le32 next;
0344 __le32 buffer_addr;
0345 __le32 bufsize;
0346 __le32 length;
0347 __le32 count;
0348 __le32 free;
0349 } __packed;
0350
0351 struct ath6kl_dbglog_hdr {
0352 __le32 dbuf_addr;
0353 __le32 dropped;
0354 } __packed;
0355
0356 #endif