Path: blob/main/sys/contrib/dev/athk/ath10k/targaddrs.h
48375 views
/* SPDX-License-Identifier: ISC */1/*2* Copyright (c) 2005-2011 Atheros Communications Inc.3* Copyright (c) 2011-2016 Qualcomm Atheros, Inc.4*/56#ifndef __TARGADDRS_H__7#define __TARGADDRS_H__89#include "hw.h"1011/*12* xxx_HOST_INTEREST_ADDRESS is the address in Target RAM of the13* host_interest structure. It must match the address of the _host_interest14* symbol (see linker script).15*16* Host Interest is shared between Host and Target in order to coordinate17* between the two, and is intended to remain constant (with additions only18* at the end) across software releases.19*20* All addresses are available here so that it's possible to21* write a single binary that works with all Target Types.22* May be used in assembler code as well as C.23*/24#define QCA988X_HOST_INTEREST_ADDRESS 0x0040080025#define HOST_INTEREST_MAX_SIZE 0x2002627/*28* These are items that the Host may need to access via BMI or via the29* Diagnostic Window. The position of items in this structure must remain30* constant across firmware revisions! Types for each item must be fixed31* size across target and host platforms. More items may be added at the end.32*/33struct host_interest {34/*35* Pointer to application-defined area, if any.36* Set by Target application during startup.37*/38u32 hi_app_host_interest; /* 0x00 */3940/* Pointer to register dump area, valid after Target crash. */41u32 hi_failure_state; /* 0x04 */4243/* Pointer to debug logging header */44u32 hi_dbglog_hdr; /* 0x08 */4546u32 hi_unused0c; /* 0x0c */4748/*49* General-purpose flag bits, similar to SOC_OPTION_* flags.50* Can be used by application rather than by OS.51*/52u32 hi_option_flag; /* 0x10 */5354/*55* Boolean that determines whether or not to56* display messages on the serial port.57*/58u32 hi_serial_enable; /* 0x14 */5960/* Start address of DataSet index, if any */61u32 hi_dset_list_head; /* 0x18 */6263/* Override Target application start address */64u32 hi_app_start; /* 0x1c */6566/* Clock and voltage tuning */67u32 hi_skip_clock_init; /* 0x20 */68u32 hi_core_clock_setting; /* 0x24 */69u32 hi_cpu_clock_setting; /* 0x28 */70u32 hi_system_sleep_setting; /* 0x2c */71u32 hi_xtal_control_setting; /* 0x30 */72u32 hi_pll_ctrl_setting_24ghz; /* 0x34 */73u32 hi_pll_ctrl_setting_5ghz; /* 0x38 */74u32 hi_ref_voltage_trim_setting; /* 0x3c */75u32 hi_clock_info; /* 0x40 */7677/* Host uses BE CPU or not */78u32 hi_be; /* 0x44 */7980u32 hi_stack; /* normal stack */ /* 0x48 */81u32 hi_err_stack; /* error stack */ /* 0x4c */82u32 hi_desired_cpu_speed_hz; /* 0x50 */8384/* Pointer to Board Data */85u32 hi_board_data; /* 0x54 */8687/*88* Indication of Board Data state:89* 0: board data is not yet initialized.90* 1: board data is initialized; unknown size91* >1: number of bytes of initialized board data92*/93u32 hi_board_data_initialized; /* 0x58 */9495u32 hi_dset_ram_index_table; /* 0x5c */9697u32 hi_desired_baud_rate; /* 0x60 */98u32 hi_dbglog_config; /* 0x64 */99u32 hi_end_ram_reserve_sz; /* 0x68 */100u32 hi_mbox_io_block_sz; /* 0x6c */101102u32 hi_num_bpatch_streams; /* 0x70 -- unused */103u32 hi_mbox_isr_yield_limit; /* 0x74 */104105u32 hi_refclk_hz; /* 0x78 */106u32 hi_ext_clk_detected; /* 0x7c */107u32 hi_dbg_uart_txpin; /* 0x80 */108u32 hi_dbg_uart_rxpin; /* 0x84 */109u32 hi_hci_uart_baud; /* 0x88 */110u32 hi_hci_uart_pin_assignments; /* 0x8C */111112u32 hi_hci_uart_baud_scale_val; /* 0x90 */113u32 hi_hci_uart_baud_step_val; /* 0x94 */114115u32 hi_allocram_start; /* 0x98 */116u32 hi_allocram_sz; /* 0x9c */117u32 hi_hci_bridge_flags; /* 0xa0 */118u32 hi_hci_uart_support_pins; /* 0xa4 */119120u32 hi_hci_uart_pwr_mgmt_params; /* 0xa8 */121122/*123* 0xa8 - [1]: 0 = UART FC active low, 1 = UART FC active high124* [31:16]: wakeup timeout in ms125*/126/* Pointer to extended board Data */127u32 hi_board_ext_data; /* 0xac */128u32 hi_board_ext_data_config; /* 0xb0 */129/*130* Bit [0] : valid131* Bit[31:16: size132*/133/*134* hi_reset_flag is used to do some stuff when target reset.135* such as restore app_start after warm reset or136* preserve host Interest area, or preserve ROM data, literals etc.137*/138u32 hi_reset_flag; /* 0xb4 */139/* indicate hi_reset_flag is valid */140u32 hi_reset_flag_valid; /* 0xb8 */141u32 hi_hci_uart_pwr_mgmt_params_ext; /* 0xbc */142/* 0xbc - [31:0]: idle timeout in ms */143/* ACS flags */144u32 hi_acs_flags; /* 0xc0 */145u32 hi_console_flags; /* 0xc4 */146u32 hi_nvram_state; /* 0xc8 */147u32 hi_option_flag2; /* 0xcc */148149/* If non-zero, override values sent to Host in WMI_READY event. */150u32 hi_sw_version_override; /* 0xd0 */151u32 hi_abi_version_override; /* 0xd4 */152153/*154* Percentage of high priority RX traffic to total expected RX traffic155* applicable only to ar6004156*/157u32 hi_hp_rx_traffic_ratio; /* 0xd8 */158159/* test applications flags */160u32 hi_test_apps_related; /* 0xdc */161/* location of test script */162u32 hi_ota_testscript; /* 0xe0 */163/* location of CAL data */164u32 hi_cal_data; /* 0xe4 */165166/* Number of packet log buffers */167u32 hi_pktlog_num_buffers; /* 0xe8 */168169/* wow extension configuration */170u32 hi_wow_ext_config; /* 0xec */171u32 hi_pwr_save_flags; /* 0xf0 */172173/* Spatial Multiplexing Power Save (SMPS) options */174u32 hi_smps_options; /* 0xf4 */175176/* Interconnect-specific state */177u32 hi_interconnect_state; /* 0xf8 */178179/* Coex configuration flags */180u32 hi_coex_config; /* 0xfc */181182/* Early allocation support */183u32 hi_early_alloc; /* 0x100 */184/* FW swap field */185/*186* Bits of this 32bit word will be used to pass specific swap187* instruction to FW188*/189/*190* Bit 0 -- AP Nart descriptor no swap. When this bit is set191* FW will not swap TX descriptor. Meaning packets are formed192* on the target processor.193*/194/* Bit 1 - unused */195u32 hi_fw_swap; /* 0x104 */196197/* global arenas pointer address, used by host driver debug */198u32 hi_dynamic_mem_arenas_addr; /* 0x108 */199200/* allocated bytes of DRAM use by allocated */201u32 hi_dynamic_mem_allocated; /* 0x10C */202203/* remaining bytes of DRAM */204u32 hi_dynamic_mem_remaining; /* 0x110 */205206/* memory track count, configured by host */207u32 hi_dynamic_mem_track_max; /* 0x114 */208209/* minidump buffer */210u32 hi_minidump; /* 0x118 */211212/* bdata's sig and key addr */213u32 hi_bd_sig_key; /* 0x11c */214} __packed;215216#define HI_ITEM(item) offsetof(struct host_interest, item)217218/* Bits defined in hi_option_flag */219220/* Enable timer workaround */221#define HI_OPTION_TIMER_WAR 0x01222/* Limit BMI command credits */223#define HI_OPTION_BMI_CRED_LIMIT 0x02224/* Relay Dot11 hdr to/from host */225#define HI_OPTION_RELAY_DOT11_HDR 0x04226/* MAC addr method 0-locally administred 1-globally unique addrs */227#define HI_OPTION_MAC_ADDR_METHOD 0x08228/* Firmware Bridging */229#define HI_OPTION_FW_BRIDGE 0x10230/* Enable CPU profiling */231#define HI_OPTION_ENABLE_PROFILE 0x20232/* Disable debug logging */233#define HI_OPTION_DISABLE_DBGLOG 0x40234/* Skip Era Tracking */235#define HI_OPTION_SKIP_ERA_TRACKING 0x80236/* Disable PAPRD (debug) */237#define HI_OPTION_PAPRD_DISABLE 0x100238#define HI_OPTION_NUM_DEV_LSB 0x200239#define HI_OPTION_NUM_DEV_MSB 0x800240#define HI_OPTION_DEV_MODE_LSB 0x1000241#define HI_OPTION_DEV_MODE_MSB 0x8000000242/* Disable LowFreq Timer Stabilization */243#define HI_OPTION_NO_LFT_STBL 0x10000000244/* Skip regulatory scan */245#define HI_OPTION_SKIP_REG_SCAN 0x20000000246/*247* Do regulatory scan during init before248* sending WMI ready event to host249*/250#define HI_OPTION_INIT_REG_SCAN 0x40000000251252/* REV6: Do not adjust memory map */253#define HI_OPTION_SKIP_MEMMAP 0x80000000254255#define HI_OPTION_MAC_ADDR_METHOD_SHIFT 3256257/* 2 bits of hi_option_flag are used to represent 3 modes */258#define HI_OPTION_FW_MODE_IBSS 0x0 /* IBSS Mode */259#define HI_OPTION_FW_MODE_BSS_STA 0x1 /* STA Mode */260#define HI_OPTION_FW_MODE_AP 0x2 /* AP Mode */261#define HI_OPTION_FW_MODE_BT30AMP 0x3 /* BT30 AMP Mode */262263/* 2 bits of hi_option flag are usedto represent 4 submodes */264#define HI_OPTION_FW_SUBMODE_NONE 0x0 /* Normal mode */265#define HI_OPTION_FW_SUBMODE_P2PDEV 0x1 /* p2p device mode */266#define HI_OPTION_FW_SUBMODE_P2PCLIENT 0x2 /* p2p client mode */267#define HI_OPTION_FW_SUBMODE_P2PGO 0x3 /* p2p go mode */268269/* Num dev Mask */270#define HI_OPTION_NUM_DEV_MASK 0x7271#define HI_OPTION_NUM_DEV_SHIFT 0x9272273/* firmware bridging */274#define HI_OPTION_FW_BRIDGE_SHIFT 0x04275276/*277* Fw Mode/SubMode Mask278*-----------------------------------------------------------------------------279* SUB | SUB | SUB | SUB | | | |280*MODE[3] | MODE[2] | MODE[1] | MODE[0] | MODE[3] | MODE[2] | MODE[1] | MODE[0]281* (2) | (2) | (2) | (2) | (2) | (2) | (2) | (2)282*-----------------------------------------------------------------------------283*/284#define HI_OPTION_FW_MODE_BITS 0x2285#define HI_OPTION_FW_MODE_MASK 0x3286#define HI_OPTION_FW_MODE_SHIFT 0xC287#define HI_OPTION_ALL_FW_MODE_MASK 0xFF288289#define HI_OPTION_FW_SUBMODE_BITS 0x2290#define HI_OPTION_FW_SUBMODE_MASK 0x3291#define HI_OPTION_FW_SUBMODE_SHIFT 0x14292#define HI_OPTION_ALL_FW_SUBMODE_MASK 0xFF00293#define HI_OPTION_ALL_FW_SUBMODE_SHIFT 0x8294295/* hi_option_flag2 options */296#define HI_OPTION_OFFLOAD_AMSDU 0x01297#define HI_OPTION_DFS_SUPPORT 0x02 /* Enable DFS support */298#define HI_OPTION_ENABLE_RFKILL 0x04 /* RFKill Enable Feature*/299#define HI_OPTION_RADIO_RETENTION_DISABLE 0x08 /* Disable radio retention */300#define HI_OPTION_EARLY_CFG_DONE 0x10 /* Early configuration is complete */301302#define HI_OPTION_RF_KILL_SHIFT 0x2303#define HI_OPTION_RF_KILL_MASK 0x1304305/* hi_reset_flag */306/* preserve App Start address */307#define HI_RESET_FLAG_PRESERVE_APP_START 0x01308/* preserve host interest */309#define HI_RESET_FLAG_PRESERVE_HOST_INTEREST 0x02310/* preserve ROM data */311#define HI_RESET_FLAG_PRESERVE_ROMDATA 0x04312#define HI_RESET_FLAG_PRESERVE_NVRAM_STATE 0x08313#define HI_RESET_FLAG_PRESERVE_BOOT_INFO 0x10314#define HI_RESET_FLAG_WARM_RESET 0x20315316/* define hi_fw_swap bits */317#define HI_DESC_IN_FW_BIT 0x01318319/* indicate the reset flag is valid */320#define HI_RESET_FLAG_IS_VALID 0x12345678321322/* ACS is enabled */323#define HI_ACS_FLAGS_ENABLED (1 << 0)324/* Use physical WWAN device */325#define HI_ACS_FLAGS_USE_WWAN (1 << 1)326/* Use test VAP */327#define HI_ACS_FLAGS_TEST_VAP (1 << 2)328/* SDIO/mailbox ACS flag definitions */329#define HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET (1 << 0)330#define HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET (1 << 1)331#define HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE (1 << 2)332#define HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_FW_ACK (1 << 16)333#define HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_FW_ACK (1 << 17)334335/*336* If both SDIO_CRASH_DUMP_ENHANCEMENT_HOST and SDIO_CRASH_DUMP_ENHANCEMENT_FW337* flags are set, then crashdump upload will be done using the BMI host/target338* communication channel.339*/340/* HOST to support using BMI dump FW memory when hit assert */341#define HI_OPTION_SDIO_CRASH_DUMP_ENHANCEMENT_HOST 0x400342343/* FW to support using BMI dump FW memory when hit assert */344#define HI_OPTION_SDIO_CRASH_DUMP_ENHANCEMENT_FW 0x800345346/*347* CONSOLE FLAGS348*349* Bit Range Meaning350* --------- --------------------------------351* 2..0 UART ID (0 = Default)352* 3 Baud Select (0 = 9600, 1 = 115200)353* 30..4 Reserved354* 31 Enable Console355*356*/357358#define HI_CONSOLE_FLAGS_ENABLE (1 << 31)359#define HI_CONSOLE_FLAGS_UART_MASK (0x7)360#define HI_CONSOLE_FLAGS_UART_SHIFT 0361#define HI_CONSOLE_FLAGS_BAUD_SELECT (1 << 3)362363/* SM power save options */364#define HI_SMPS_ALLOW_MASK (0x00000001)365#define HI_SMPS_MODE_MASK (0x00000002)366#define HI_SMPS_MODE_STATIC (0x00000000)367#define HI_SMPS_MODE_DYNAMIC (0x00000002)368#define HI_SMPS_DISABLE_AUTO_MODE (0x00000004)369#define HI_SMPS_DATA_THRESH_MASK (0x000007f8)370#define HI_SMPS_DATA_THRESH_SHIFT (3)371#define HI_SMPS_RSSI_THRESH_MASK (0x0007f800)372#define HI_SMPS_RSSI_THRESH_SHIFT (11)373#define HI_SMPS_LOWPWR_CM_MASK (0x00380000)374#define HI_SMPS_LOWPWR_CM_SHIFT (15)375#define HI_SMPS_HIPWR_CM_MASK (0x03c00000)376#define HI_SMPS_HIPWR_CM_SHIFT (19)377378/*379* WOW Extension configuration380*381* Bit Range Meaning382* --------- --------------------------------383* 8..0 Size of each WOW pattern (max 511)384* 15..9 Number of patterns per list (max 127)385* 17..16 Number of lists (max 4)386* 30..18 Reserved387* 31 Enabled388*389* set values (except enable) to zeros for default settings390*/391392#define HI_WOW_EXT_ENABLED_MASK (1 << 31)393#define HI_WOW_EXT_NUM_LIST_SHIFT 16394#define HI_WOW_EXT_NUM_LIST_MASK (0x3 << HI_WOW_EXT_NUM_LIST_SHIFT)395#define HI_WOW_EXT_NUM_PATTERNS_SHIFT 9396#define HI_WOW_EXT_NUM_PATTERNS_MASK (0x7F << HI_WOW_EXT_NUM_PATTERNS_SHIFT)397#define HI_WOW_EXT_PATTERN_SIZE_SHIFT 0398#define HI_WOW_EXT_PATTERN_SIZE_MASK (0x1FF << HI_WOW_EXT_PATTERN_SIZE_SHIFT)399400#define HI_WOW_EXT_MAKE_CONFIG(num_lists, count, size) \401((((num_lists) << HI_WOW_EXT_NUM_LIST_SHIFT) & \402HI_WOW_EXT_NUM_LIST_MASK) | \403(((count) << HI_WOW_EXT_NUM_PATTERNS_SHIFT) & \404HI_WOW_EXT_NUM_PATTERNS_MASK) | \405(((size) << HI_WOW_EXT_PATTERN_SIZE_SHIFT) & \406HI_WOW_EXT_PATTERN_SIZE_MASK))407408#define HI_WOW_EXT_GET_NUM_LISTS(config) \409(((config) & HI_WOW_EXT_NUM_LIST_MASK) >> HI_WOW_EXT_NUM_LIST_SHIFT)410#define HI_WOW_EXT_GET_NUM_PATTERNS(config) \411(((config) & HI_WOW_EXT_NUM_PATTERNS_MASK) >> \412HI_WOW_EXT_NUM_PATTERNS_SHIFT)413#define HI_WOW_EXT_GET_PATTERN_SIZE(config) \414(((config) & HI_WOW_EXT_PATTERN_SIZE_MASK) >> \415HI_WOW_EXT_PATTERN_SIZE_SHIFT)416417/*418* Early allocation configuration419* Support RAM bank configuration before BMI done and this eases the memory420* allocation at very early stage421* Bit Range Meaning422* --------- ----------------------------------423* [0:3] number of bank assigned to be IRAM424* [4:15] reserved425* [16:31] magic number426*427* Note:428* 1. target firmware would check magic number and if it's a match, firmware429* would consider the bits[0:15] are valid and base on that to calculate430* the end of DRAM. Early allocation would be located at that area and431* may be reclaimed when necessary432* 2. if no magic number is found, early allocation would happen at "_end"433* symbol of ROM which is located before the app-data and might NOT be434* re-claimable. If this is adopted, link script should keep this in435* mind to avoid data corruption.436*/437#define HI_EARLY_ALLOC_MAGIC 0x6d8a438#define HI_EARLY_ALLOC_MAGIC_MASK 0xffff0000439#define HI_EARLY_ALLOC_MAGIC_SHIFT 16440#define HI_EARLY_ALLOC_IRAM_BANKS_MASK 0x0000000f441#define HI_EARLY_ALLOC_IRAM_BANKS_SHIFT 0442443#define HI_EARLY_ALLOC_VALID() \444((((HOST_INTEREST->hi_early_alloc) & HI_EARLY_ALLOC_MAGIC_MASK) >> \445HI_EARLY_ALLOC_MAGIC_SHIFT) == (HI_EARLY_ALLOC_MAGIC))446#define HI_EARLY_ALLOC_GET_IRAM_BANKS() \447(((HOST_INTEREST->hi_early_alloc) & HI_EARLY_ALLOC_IRAM_BANKS_MASK) \448>> HI_EARLY_ALLOC_IRAM_BANKS_SHIFT)449450/*power save flag bit definitions*/451#define HI_PWR_SAVE_LPL_ENABLED 0x1452/*b1-b3 reserved*/453/*b4-b5 : dev0 LPL type : 0 - none454* 1- Reduce Pwr Search455* 2- Reduce Pwr Listen456*/457/*b6-b7 : dev1 LPL type and so on for Max 8 devices*/458#define HI_PWR_SAVE_LPL_DEV0_LSB 4459#define HI_PWR_SAVE_LPL_DEV_MASK 0x3460/*power save related utility macros*/461#define HI_LPL_ENABLED() \462((HOST_INTEREST->hi_pwr_save_flags & HI_PWR_SAVE_LPL_ENABLED))463#define HI_DEV_LPL_TYPE_GET(_devix) \464(HOST_INTEREST->hi_pwr_save_flags & ((HI_PWR_SAVE_LPL_DEV_MASK) << \465(HI_PWR_SAVE_LPL_DEV0_LSB + (_devix) * 2)))466467#define HOST_INTEREST_SMPS_IS_ALLOWED() \468((HOST_INTEREST->hi_smps_options & HI_SMPS_ALLOW_MASK))469470/* Reserve 1024 bytes for extended board data */471#define QCA988X_BOARD_DATA_SZ 7168472#define QCA988X_BOARD_EXT_DATA_SZ 0473474#define QCA9887_BOARD_DATA_SZ 7168475#define QCA9887_BOARD_EXT_DATA_SZ 0476477#define QCA6174_BOARD_DATA_SZ 8192478#define QCA6174_BOARD_EXT_DATA_SZ 0479480#define QCA9377_BOARD_DATA_SZ QCA6174_BOARD_DATA_SZ481#define QCA9377_BOARD_EXT_DATA_SZ 0482483#define QCA99X0_BOARD_DATA_SZ 12288484#define QCA99X0_BOARD_EXT_DATA_SZ 0485486/* Dual band extended board data */487#define QCA99X0_EXT_BOARD_DATA_SZ 2048488#define EXT_BOARD_ADDRESS_OFFSET 0x3000489490#define QCA4019_BOARD_DATA_SZ 12064491#define QCA4019_BOARD_EXT_DATA_SZ 0492493#endif /* __TARGADDRS_H__ */494495496