18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (c) 2004-2010 Atheros Communications Inc.
38c2ecf20Sopenharmony_ci * Copyright (c) 2011 Qualcomm Atheros, Inc.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any
68c2ecf20Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above
78c2ecf20Sopenharmony_ci * copyright notice and this permission notice appear in all copies.
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
108c2ecf20Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
118c2ecf20Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
128c2ecf20Sopenharmony_ci * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
138c2ecf20Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
148c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
158c2ecf20Sopenharmony_ci * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
168c2ecf20Sopenharmony_ci */
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#ifndef TARGET_H
198c2ecf20Sopenharmony_ci#define TARGET_H
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define AR6003_BOARD_DATA_SZ		1024
228c2ecf20Sopenharmony_ci#define AR6003_BOARD_EXT_DATA_SZ	768
238c2ecf20Sopenharmony_ci#define AR6003_BOARD_EXT_DATA_SZ_V2	1024
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#define AR6004_BOARD_DATA_SZ     6144
268c2ecf20Sopenharmony_ci#define AR6004_BOARD_EXT_DATA_SZ 0
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#define RESET_CONTROL_ADDRESS		0x00004000
298c2ecf20Sopenharmony_ci#define RESET_CONTROL_COLD_RST		0x00000100
308c2ecf20Sopenharmony_ci#define RESET_CONTROL_MBOX_RST		0x00000004
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#define CPU_CLOCK_STANDARD_S		0
338c2ecf20Sopenharmony_ci#define CPU_CLOCK_STANDARD		0x00000003
348c2ecf20Sopenharmony_ci#define CPU_CLOCK_ADDRESS		0x00000020
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci#define CLOCK_CONTROL_ADDRESS		0x00000028
378c2ecf20Sopenharmony_ci#define CLOCK_CONTROL_LF_CLK32_S	2
388c2ecf20Sopenharmony_ci#define CLOCK_CONTROL_LF_CLK32		0x00000004
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#define SYSTEM_SLEEP_ADDRESS		0x000000c4
418c2ecf20Sopenharmony_ci#define SYSTEM_SLEEP_DISABLE_S		0
428c2ecf20Sopenharmony_ci#define SYSTEM_SLEEP_DISABLE		0x00000001
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#define LPO_CAL_ADDRESS			0x000000e0
458c2ecf20Sopenharmony_ci#define LPO_CAL_ENABLE_S		20
468c2ecf20Sopenharmony_ci#define LPO_CAL_ENABLE			0x00100000
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci#define GPIO_PIN9_ADDRESS		0x0000004c
498c2ecf20Sopenharmony_ci#define GPIO_PIN10_ADDRESS		0x00000050
508c2ecf20Sopenharmony_ci#define GPIO_PIN11_ADDRESS		0x00000054
518c2ecf20Sopenharmony_ci#define GPIO_PIN12_ADDRESS		0x00000058
528c2ecf20Sopenharmony_ci#define GPIO_PIN13_ADDRESS		0x0000005c
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci#define HOST_INT_STATUS_ADDRESS		0x00000400
558c2ecf20Sopenharmony_ci#define HOST_INT_STATUS_ERROR_S		7
568c2ecf20Sopenharmony_ci#define HOST_INT_STATUS_ERROR		0x00000080
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#define HOST_INT_STATUS_CPU_S		6
598c2ecf20Sopenharmony_ci#define HOST_INT_STATUS_CPU		0x00000040
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci#define HOST_INT_STATUS_COUNTER_S	4
628c2ecf20Sopenharmony_ci#define HOST_INT_STATUS_COUNTER		0x00000010
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#define CPU_INT_STATUS_ADDRESS		0x00000401
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci#define ERROR_INT_STATUS_ADDRESS	0x00000402
678c2ecf20Sopenharmony_ci#define ERROR_INT_STATUS_WAKEUP_S	2
688c2ecf20Sopenharmony_ci#define ERROR_INT_STATUS_WAKEUP		0x00000004
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci#define ERROR_INT_STATUS_RX_UNDERFLOW_S	1
718c2ecf20Sopenharmony_ci#define ERROR_INT_STATUS_RX_UNDERFLOW	0x00000002
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci#define ERROR_INT_STATUS_TX_OVERFLOW_S	0
748c2ecf20Sopenharmony_ci#define ERROR_INT_STATUS_TX_OVERFLOW	0x00000001
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci#define COUNTER_INT_STATUS_ADDRESS	0x00000403
778c2ecf20Sopenharmony_ci#define COUNTER_INT_STATUS_COUNTER_S	0
788c2ecf20Sopenharmony_ci#define COUNTER_INT_STATUS_COUNTER	0x000000ff
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci#define RX_LOOKAHEAD_VALID_ADDRESS	0x00000405
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_ADDRESS	0x00000418
838c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_ERROR_S	7
848c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_ERROR		0x00000080
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_CPU_S		6
878c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_CPU		0x00000040
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_INT_S		5
908c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_INT		0x00000020
918c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_COUNTER_S	4
928c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_COUNTER	0x00000010
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_MBOX_DATA_S	0
958c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_MBOX_DATA	0x0000000f
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci#define CPU_INT_STATUS_ENABLE_ADDRESS	0x00000419
988c2ecf20Sopenharmony_ci#define CPU_INT_STATUS_ENABLE_BIT_S	0
998c2ecf20Sopenharmony_ci#define CPU_INT_STATUS_ENABLE_BIT	0x000000ff
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci#define ERROR_STATUS_ENABLE_ADDRESS		0x0000041a
1028c2ecf20Sopenharmony_ci#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_S	1
1038c2ecf20Sopenharmony_ci#define ERROR_STATUS_ENABLE_RX_UNDERFLOW	0x00000002
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci#define ERROR_STATUS_ENABLE_TX_OVERFLOW_S	0
1068c2ecf20Sopenharmony_ci#define ERROR_STATUS_ENABLE_TX_OVERFLOW		0x00000001
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci#define COUNTER_INT_STATUS_ENABLE_ADDRESS	0x0000041b
1098c2ecf20Sopenharmony_ci#define COUNTER_INT_STATUS_ENABLE_BIT_S		0
1108c2ecf20Sopenharmony_ci#define COUNTER_INT_STATUS_ENABLE_BIT		0x000000ff
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci#define COUNT_ADDRESS			0x00000420
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci#define COUNT_DEC_ADDRESS		0x00000440
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci#define WINDOW_DATA_ADDRESS		0x00000474
1178c2ecf20Sopenharmony_ci#define WINDOW_WRITE_ADDR_ADDRESS	0x00000478
1188c2ecf20Sopenharmony_ci#define WINDOW_READ_ADDR_ADDRESS	0x0000047c
1198c2ecf20Sopenharmony_ci#define CPU_DBG_SEL_ADDRESS		0x00000483
1208c2ecf20Sopenharmony_ci#define CPU_DBG_ADDRESS			0x00000484
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ci#define LOCAL_SCRATCH_ADDRESS		0x000000c0
1238c2ecf20Sopenharmony_ci#define ATH6KL_OPTION_SLEEP_DISABLE	0x08
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci#define RTC_BASE_ADDRESS		0x00004000
1268c2ecf20Sopenharmony_ci#define GPIO_BASE_ADDRESS		0x00014000
1278c2ecf20Sopenharmony_ci#define MBOX_BASE_ADDRESS		0x00018000
1288c2ecf20Sopenharmony_ci#define ANALOG_INTF_BASE_ADDRESS	0x0001c000
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci/* real name of the register is unknown */
1318c2ecf20Sopenharmony_ci#define ATH6KL_ANALOG_PLL_REGISTER	(ANALOG_INTF_BASE_ADDRESS + 0x284)
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci#define SM(f, v)	(((v) << f##_S) & f)
1348c2ecf20Sopenharmony_ci#define MS(f, v)	(((v) & f) >> f##_S)
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci/*
1378c2ecf20Sopenharmony_ci * xxx_HOST_INTEREST_ADDRESS is the address in Target RAM of the
1388c2ecf20Sopenharmony_ci * host_interest structure.
1398c2ecf20Sopenharmony_ci *
1408c2ecf20Sopenharmony_ci * Host Interest is shared between Host and Target in order to coordinate
1418c2ecf20Sopenharmony_ci * between the two, and is intended to remain constant (with additions only
1428c2ecf20Sopenharmony_ci * at the end).
1438c2ecf20Sopenharmony_ci */
1448c2ecf20Sopenharmony_ci#define ATH6KL_AR6003_HI_START_ADDR           0x00540600
1458c2ecf20Sopenharmony_ci#define ATH6KL_AR6004_HI_START_ADDR           0x00400800
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci/*
1488c2ecf20Sopenharmony_ci * These are items that the Host may need to access
1498c2ecf20Sopenharmony_ci * via BMI or via the Diagnostic Window. The position
1508c2ecf20Sopenharmony_ci * of items in this structure must remain constant.
1518c2ecf20Sopenharmony_ci * across firmware revisions!
1528c2ecf20Sopenharmony_ci *
1538c2ecf20Sopenharmony_ci * Types for each item must be fixed size across target and host platforms.
1548c2ecf20Sopenharmony_ci * The structure is used only to calculate offset for each register with
1558c2ecf20Sopenharmony_ci * HI_ITEM() macro, no values are stored to it.
1568c2ecf20Sopenharmony_ci *
1578c2ecf20Sopenharmony_ci * More items may be added at the end.
1588c2ecf20Sopenharmony_ci */
1598c2ecf20Sopenharmony_cistruct host_interest {
1608c2ecf20Sopenharmony_ci	/*
1618c2ecf20Sopenharmony_ci	 * Pointer to application-defined area, if any.
1628c2ecf20Sopenharmony_ci	 * Set by Target application during startup.
1638c2ecf20Sopenharmony_ci	 */
1648c2ecf20Sopenharmony_ci	u32 hi_app_host_interest;                      /* 0x00 */
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci	/* Pointer to register dump area, valid after Target crash. */
1678c2ecf20Sopenharmony_ci	u32 hi_failure_state;                          /* 0x04 */
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci	/* Pointer to debug logging header */
1708c2ecf20Sopenharmony_ci	u32 hi_dbglog_hdr;                             /* 0x08 */
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci	u32 hi_unused1;                       /* 0x0c */
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci	/*
1758c2ecf20Sopenharmony_ci	 * General-purpose flag bits, similar to ATH6KL_OPTION_* flags.
1768c2ecf20Sopenharmony_ci	 * Can be used by application rather than by OS.
1778c2ecf20Sopenharmony_ci	 */
1788c2ecf20Sopenharmony_ci	u32 hi_option_flag;                            /* 0x10 */
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_ci	/*
1818c2ecf20Sopenharmony_ci	 * Boolean that determines whether or not to
1828c2ecf20Sopenharmony_ci	 * display messages on the serial port.
1838c2ecf20Sopenharmony_ci	 */
1848c2ecf20Sopenharmony_ci	u32 hi_serial_enable;                          /* 0x14 */
1858c2ecf20Sopenharmony_ci
1868c2ecf20Sopenharmony_ci	/* Start address of DataSet index, if any */
1878c2ecf20Sopenharmony_ci	u32 hi_dset_list_head;                         /* 0x18 */
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci	/* Override Target application start address */
1908c2ecf20Sopenharmony_ci	u32 hi_app_start;                              /* 0x1c */
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ci	/* Clock and voltage tuning */
1938c2ecf20Sopenharmony_ci	u32 hi_skip_clock_init;                        /* 0x20 */
1948c2ecf20Sopenharmony_ci	u32 hi_core_clock_setting;                     /* 0x24 */
1958c2ecf20Sopenharmony_ci	u32 hi_cpu_clock_setting;                      /* 0x28 */
1968c2ecf20Sopenharmony_ci	u32 hi_system_sleep_setting;                   /* 0x2c */
1978c2ecf20Sopenharmony_ci	u32 hi_xtal_control_setting;                   /* 0x30 */
1988c2ecf20Sopenharmony_ci	u32 hi_pll_ctrl_setting_24ghz;                 /* 0x34 */
1998c2ecf20Sopenharmony_ci	u32 hi_pll_ctrl_setting_5ghz;                  /* 0x38 */
2008c2ecf20Sopenharmony_ci	u32 hi_ref_voltage_trim_setting;               /* 0x3c */
2018c2ecf20Sopenharmony_ci	u32 hi_clock_info;                             /* 0x40 */
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci	/*
2048c2ecf20Sopenharmony_ci	 * Flash configuration overrides, used only
2058c2ecf20Sopenharmony_ci	 * when firmware is not executing from flash.
2068c2ecf20Sopenharmony_ci	 * (When using flash, modify the global variables
2078c2ecf20Sopenharmony_ci	 * with equivalent names.)
2088c2ecf20Sopenharmony_ci	 */
2098c2ecf20Sopenharmony_ci	u32 hi_bank0_addr_value;                       /* 0x44 */
2108c2ecf20Sopenharmony_ci	u32 hi_bank0_read_value;                       /* 0x48 */
2118c2ecf20Sopenharmony_ci	u32 hi_bank0_write_value;                      /* 0x4c */
2128c2ecf20Sopenharmony_ci	u32 hi_bank0_config_value;                     /* 0x50 */
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci	/* Pointer to Board Data  */
2158c2ecf20Sopenharmony_ci	u32 hi_board_data;                             /* 0x54 */
2168c2ecf20Sopenharmony_ci	u32 hi_board_data_initialized;                 /* 0x58 */
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci	u32 hi_dset_ram_index_tbl;                     /* 0x5c */
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_ci	u32 hi_desired_baud_rate;                      /* 0x60 */
2218c2ecf20Sopenharmony_ci	u32 hi_dbglog_config;                          /* 0x64 */
2228c2ecf20Sopenharmony_ci	u32 hi_end_ram_reserve_sz;                     /* 0x68 */
2238c2ecf20Sopenharmony_ci	u32 hi_mbox_io_block_sz;                       /* 0x6c */
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ci	u32 hi_num_bpatch_streams;                     /* 0x70 -- unused */
2268c2ecf20Sopenharmony_ci	u32 hi_mbox_isr_yield_limit;                   /* 0x74 */
2278c2ecf20Sopenharmony_ci
2288c2ecf20Sopenharmony_ci	u32 hi_refclk_hz;                              /* 0x78 */
2298c2ecf20Sopenharmony_ci	u32 hi_ext_clk_detected;                       /* 0x7c */
2308c2ecf20Sopenharmony_ci	u32 hi_dbg_uart_txpin;                         /* 0x80 */
2318c2ecf20Sopenharmony_ci	u32 hi_dbg_uart_rxpin;                         /* 0x84 */
2328c2ecf20Sopenharmony_ci	u32 hi_hci_uart_baud;                          /* 0x88 */
2338c2ecf20Sopenharmony_ci	u32 hi_hci_uart_pin_assignments;               /* 0x8C */
2348c2ecf20Sopenharmony_ci	/*
2358c2ecf20Sopenharmony_ci	 * NOTE: byte [0] = tx pin, [1] = rx pin, [2] = rts pin, [3] = cts
2368c2ecf20Sopenharmony_ci	 * pin
2378c2ecf20Sopenharmony_ci	 */
2388c2ecf20Sopenharmony_ci	u32 hi_hci_uart_baud_scale_val;                /* 0x90 */
2398c2ecf20Sopenharmony_ci	u32 hi_hci_uart_baud_step_val;                 /* 0x94 */
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_ci	u32 hi_allocram_start;                         /* 0x98 */
2428c2ecf20Sopenharmony_ci	u32 hi_allocram_sz;                            /* 0x9c */
2438c2ecf20Sopenharmony_ci	u32 hi_hci_bridge_flags;                       /* 0xa0 */
2448c2ecf20Sopenharmony_ci	u32 hi_hci_uart_support_pins;                  /* 0xa4 */
2458c2ecf20Sopenharmony_ci	/*
2468c2ecf20Sopenharmony_ci	 * NOTE: byte [0] = RESET pin (bit 7 is polarity),
2478c2ecf20Sopenharmony_ci	 * bytes[1]..bytes[3] are for future use
2488c2ecf20Sopenharmony_ci	 */
2498c2ecf20Sopenharmony_ci	u32 hi_hci_uart_pwr_mgmt_params;               /* 0xa8 */
2508c2ecf20Sopenharmony_ci	/*
2518c2ecf20Sopenharmony_ci	 * 0xa8   - [1]: 0 = UART FC active low, 1 = UART FC active high
2528c2ecf20Sopenharmony_ci	 *      [31:16]: wakeup timeout in ms
2538c2ecf20Sopenharmony_ci	 */
2548c2ecf20Sopenharmony_ci
2558c2ecf20Sopenharmony_ci	/* Pointer to extended board data */
2568c2ecf20Sopenharmony_ci	u32 hi_board_ext_data;                /* 0xac */
2578c2ecf20Sopenharmony_ci	u32 hi_board_ext_data_config;         /* 0xb0 */
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_ci	/*
2608c2ecf20Sopenharmony_ci	 * Bit [0]  :   valid
2618c2ecf20Sopenharmony_ci	 * Bit[31:16:   size
2628c2ecf20Sopenharmony_ci	 */
2638c2ecf20Sopenharmony_ci	/*
2648c2ecf20Sopenharmony_ci	 * hi_reset_flag is used to do some stuff when target reset.
2658c2ecf20Sopenharmony_ci	 * such as restore app_start after warm reset or
2668c2ecf20Sopenharmony_ci	 * preserve host Interest area, or preserve ROM data, literals etc.
2678c2ecf20Sopenharmony_ci	 */
2688c2ecf20Sopenharmony_ci	u32 hi_reset_flag;                            /* 0xb4 */
2698c2ecf20Sopenharmony_ci	/* indicate hi_reset_flag is valid */
2708c2ecf20Sopenharmony_ci	u32 hi_reset_flag_valid;                      /* 0xb8 */
2718c2ecf20Sopenharmony_ci	u32 hi_hci_uart_pwr_mgmt_params_ext;           /* 0xbc */
2728c2ecf20Sopenharmony_ci	/*
2738c2ecf20Sopenharmony_ci	 * 0xbc - [31:0]: idle timeout in ms
2748c2ecf20Sopenharmony_ci	 */
2758c2ecf20Sopenharmony_ci	/* ACS flags */
2768c2ecf20Sopenharmony_ci	u32 hi_acs_flags;                              /* 0xc0 */
2778c2ecf20Sopenharmony_ci	u32 hi_console_flags;                          /* 0xc4 */
2788c2ecf20Sopenharmony_ci	u32 hi_nvram_state;                            /* 0xc8 */
2798c2ecf20Sopenharmony_ci	u32 hi_option_flag2;                           /* 0xcc */
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ci	/* If non-zero, override values sent to Host in WMI_READY event. */
2828c2ecf20Sopenharmony_ci	u32 hi_sw_version_override;                    /* 0xd0 */
2838c2ecf20Sopenharmony_ci	u32 hi_abi_version_override;                   /* 0xd4 */
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_ci	/*
2868c2ecf20Sopenharmony_ci	 * Percentage of high priority RX traffic to total expected RX traffic -
2878c2ecf20Sopenharmony_ci	 * applicable only to ar6004
2888c2ecf20Sopenharmony_ci	 */
2898c2ecf20Sopenharmony_ci	u32 hi_hp_rx_traffic_ratio;                    /* 0xd8 */
2908c2ecf20Sopenharmony_ci
2918c2ecf20Sopenharmony_ci	/* test applications flags */
2928c2ecf20Sopenharmony_ci	u32 hi_test_apps_related;                      /* 0xdc */
2938c2ecf20Sopenharmony_ci	/* location of test script */
2948c2ecf20Sopenharmony_ci	u32 hi_ota_testscript;                         /* 0xe0 */
2958c2ecf20Sopenharmony_ci	/* location of CAL data */
2968c2ecf20Sopenharmony_ci	u32 hi_cal_data;                               /* 0xe4 */
2978c2ecf20Sopenharmony_ci	/* Number of packet log buffers */
2988c2ecf20Sopenharmony_ci	u32 hi_pktlog_num_buffers;                     /* 0xe8 */
2998c2ecf20Sopenharmony_ci
3008c2ecf20Sopenharmony_ci} __packed;
3018c2ecf20Sopenharmony_ci
3028c2ecf20Sopenharmony_ci#define HI_ITEM(item)  offsetof(struct host_interest, item)
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_ci#define HI_OPTION_MAC_ADDR_METHOD_SHIFT	3
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ci#define HI_OPTION_FW_MODE_IBSS    0x0
3078c2ecf20Sopenharmony_ci#define HI_OPTION_FW_MODE_BSS_STA 0x1
3088c2ecf20Sopenharmony_ci#define HI_OPTION_FW_MODE_AP      0x2
3098c2ecf20Sopenharmony_ci
3108c2ecf20Sopenharmony_ci#define HI_OPTION_FW_SUBMODE_NONE      0x0
3118c2ecf20Sopenharmony_ci#define HI_OPTION_FW_SUBMODE_P2PDEV    0x1
3128c2ecf20Sopenharmony_ci#define HI_OPTION_FW_SUBMODE_P2PCLIENT 0x2
3138c2ecf20Sopenharmony_ci#define HI_OPTION_FW_SUBMODE_P2PGO     0x3
3148c2ecf20Sopenharmony_ci
3158c2ecf20Sopenharmony_ci#define HI_OPTION_NUM_DEV_SHIFT   0x9
3168c2ecf20Sopenharmony_ci
3178c2ecf20Sopenharmony_ci#define HI_OPTION_FW_BRIDGE_SHIFT 0x04
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_ci/* Fw Mode/SubMode Mask
3208c2ecf20Sopenharmony_ci|------------------------------------------------------------------------------|
3218c2ecf20Sopenharmony_ci|   SUB   |   SUB   |   SUB   |  SUB    |         |         |         |
3228c2ecf20Sopenharmony_ci| MODE[3] | MODE[2] | MODE[1] | MODE[0] | MODE[3] | MODE[2] | MODE[1] | MODE[0|
3238c2ecf20Sopenharmony_ci|   (2)   |   (2)   |   (2)   |   (2)   |   (2)   |   (2)   |   (2)   |   (2)
3248c2ecf20Sopenharmony_ci|------------------------------------------------------------------------------|
3258c2ecf20Sopenharmony_ci*/
3268c2ecf20Sopenharmony_ci#define HI_OPTION_FW_MODE_BITS	       0x2
3278c2ecf20Sopenharmony_ci#define HI_OPTION_FW_MODE_SHIFT        0xC
3288c2ecf20Sopenharmony_ci
3298c2ecf20Sopenharmony_ci#define HI_OPTION_FW_SUBMODE_BITS      0x2
3308c2ecf20Sopenharmony_ci#define HI_OPTION_FW_SUBMODE_SHIFT     0x14
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_ci/* Convert a Target virtual address into a Target physical address */
3338c2ecf20Sopenharmony_ci#define AR6003_VTOP(vaddr) ((vaddr) & 0x001fffff)
3348c2ecf20Sopenharmony_ci#define AR6004_VTOP(vaddr) (vaddr)
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_ci#define TARG_VTOP(target_type, vaddr) \
3378c2ecf20Sopenharmony_ci	(((target_type) == TARGET_TYPE_AR6003) ? AR6003_VTOP(vaddr) : \
3388c2ecf20Sopenharmony_ci	(((target_type) == TARGET_TYPE_AR6004) ? AR6004_VTOP(vaddr) : 0))
3398c2ecf20Sopenharmony_ci
3408c2ecf20Sopenharmony_ci#define ATH6KL_FWLOG_PAYLOAD_SIZE		1500
3418c2ecf20Sopenharmony_ci
3428c2ecf20Sopenharmony_cistruct ath6kl_dbglog_buf {
3438c2ecf20Sopenharmony_ci	__le32 next;
3448c2ecf20Sopenharmony_ci	__le32 buffer_addr;
3458c2ecf20Sopenharmony_ci	__le32 bufsize;
3468c2ecf20Sopenharmony_ci	__le32 length;
3478c2ecf20Sopenharmony_ci	__le32 count;
3488c2ecf20Sopenharmony_ci	__le32 free;
3498c2ecf20Sopenharmony_ci} __packed;
3508c2ecf20Sopenharmony_ci
3518c2ecf20Sopenharmony_cistruct ath6kl_dbglog_hdr {
3528c2ecf20Sopenharmony_ci	__le32 dbuf_addr;
3538c2ecf20Sopenharmony_ci	__le32 dropped;
3548c2ecf20Sopenharmony_ci} __packed;
3558c2ecf20Sopenharmony_ci
3568c2ecf20Sopenharmony_ci#endif
357