162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci Copyright (C) 2004 - 2010 Ivo van Doorn <IvDoorn@gmail.com> 462306a36Sopenharmony_ci Copyright (C) 2010 Willow Garage <http://www.willowgarage.com> 562306a36Sopenharmony_ci Copyright (C) 2009 Alban Browaeys <prahal@yahoo.com> 662306a36Sopenharmony_ci Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org> 762306a36Sopenharmony_ci Copyright (C) 2009 Luis Correia <luis.f.correia@gmail.com> 862306a36Sopenharmony_ci Copyright (C) 2009 Mattias Nissler <mattias.nissler@gmx.de> 962306a36Sopenharmony_ci Copyright (C) 2009 Mark Asselstine <asselsm@gmail.com> 1062306a36Sopenharmony_ci Copyright (C) 2009 Xose Vazquez Perez <xose.vazquez@gmail.com> 1162306a36Sopenharmony_ci Copyright (C) 2009 Bart Zolnierkiewicz <bzolnier@gmail.com> 1262306a36Sopenharmony_ci <http://rt2x00.serialmonkey.com> 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci */ 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci/* 1762306a36Sopenharmony_ci Module: rt2800 1862306a36Sopenharmony_ci Abstract: Data structures and registers for the rt2800 modules. 1962306a36Sopenharmony_ci Supported chipsets: RT2800E, RT2800ED & RT2800U. 2062306a36Sopenharmony_ci */ 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci#ifndef RT2800_H 2362306a36Sopenharmony_ci#define RT2800_H 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci/* 2662306a36Sopenharmony_ci * RF chip defines. 2762306a36Sopenharmony_ci * 2862306a36Sopenharmony_ci * RF2820 2.4G 2T3R 2962306a36Sopenharmony_ci * RF2850 2.4G/5G 2T3R 3062306a36Sopenharmony_ci * RF2720 2.4G 1T2R 3162306a36Sopenharmony_ci * RF2750 2.4G/5G 1T2R 3262306a36Sopenharmony_ci * RF3020 2.4G 1T1R 3362306a36Sopenharmony_ci * RF2020 2.4G B/G 3462306a36Sopenharmony_ci * RF3021 2.4G 1T2R 3562306a36Sopenharmony_ci * RF3022 2.4G 2T2R 3662306a36Sopenharmony_ci * RF3052 2.4G/5G 2T2R 3762306a36Sopenharmony_ci * RF2853 2.4G/5G 3T3R 3862306a36Sopenharmony_ci * RF3320 2.4G 1T1R(RT3350/RT3370/RT3390) 3962306a36Sopenharmony_ci * RF3322 2.4G 2T2R(RT3352/RT3371/RT3372/RT3391/RT3392) 4062306a36Sopenharmony_ci * RF3053 2.4G/5G 3T3R(RT3563/RT3573/RT3593) 4162306a36Sopenharmony_ci * RF3853 2.4G/5G 3T3R(RT3883/RT3662) 4262306a36Sopenharmony_ci * RF5592 2.4G/5G 2T2R 4362306a36Sopenharmony_ci * RF3070 2.4G 1T1R 4462306a36Sopenharmony_ci * RF5360 2.4G 1T1R 4562306a36Sopenharmony_ci * RF5362 2.4G 1T1R 4662306a36Sopenharmony_ci * RF5370 2.4G 1T1R 4762306a36Sopenharmony_ci * RF5390 2.4G 1T1R 4862306a36Sopenharmony_ci */ 4962306a36Sopenharmony_ci#define RF2820 0x0001 5062306a36Sopenharmony_ci#define RF2850 0x0002 5162306a36Sopenharmony_ci#define RF2720 0x0003 5262306a36Sopenharmony_ci#define RF2750 0x0004 5362306a36Sopenharmony_ci#define RF3020 0x0005 5462306a36Sopenharmony_ci#define RF2020 0x0006 5562306a36Sopenharmony_ci#define RF3021 0x0007 5662306a36Sopenharmony_ci#define RF3022 0x0008 5762306a36Sopenharmony_ci#define RF3052 0x0009 5862306a36Sopenharmony_ci#define RF2853 0x000a 5962306a36Sopenharmony_ci#define RF3320 0x000b 6062306a36Sopenharmony_ci#define RF3322 0x000c 6162306a36Sopenharmony_ci#define RF3053 0x000d 6262306a36Sopenharmony_ci#define RF5592 0x000f 6362306a36Sopenharmony_ci#define RF3070 0x3070 6462306a36Sopenharmony_ci#define RF3290 0x3290 6562306a36Sopenharmony_ci#define RF3853 0x3853 6662306a36Sopenharmony_ci#define RF5350 0x5350 6762306a36Sopenharmony_ci#define RF5360 0x5360 6862306a36Sopenharmony_ci#define RF5362 0x5362 6962306a36Sopenharmony_ci#define RF5370 0x5370 7062306a36Sopenharmony_ci#define RF5372 0x5372 7162306a36Sopenharmony_ci#define RF5390 0x5390 7262306a36Sopenharmony_ci#define RF5392 0x5392 7362306a36Sopenharmony_ci#define RF7620 0x7620 7462306a36Sopenharmony_ci 7562306a36Sopenharmony_ci/* 7662306a36Sopenharmony_ci * Chipset revisions. 7762306a36Sopenharmony_ci */ 7862306a36Sopenharmony_ci#define REV_RT2860C 0x0100 7962306a36Sopenharmony_ci#define REV_RT2860D 0x0101 8062306a36Sopenharmony_ci#define REV_RT2872E 0x0200 8162306a36Sopenharmony_ci#define REV_RT3070E 0x0200 8262306a36Sopenharmony_ci#define REV_RT3070F 0x0201 8362306a36Sopenharmony_ci#define REV_RT3071E 0x0211 8462306a36Sopenharmony_ci#define REV_RT3090E 0x0211 8562306a36Sopenharmony_ci#define REV_RT3390E 0x0211 8662306a36Sopenharmony_ci#define REV_RT3593E 0x0211 8762306a36Sopenharmony_ci#define REV_RT5390F 0x0502 8862306a36Sopenharmony_ci#define REV_RT5370G 0x0503 8962306a36Sopenharmony_ci#define REV_RT5390R 0x1502 9062306a36Sopenharmony_ci#define REV_RT5592C 0x0221 9162306a36Sopenharmony_ci 9262306a36Sopenharmony_ci#define DEFAULT_RSSI_OFFSET 120 9362306a36Sopenharmony_ci 9462306a36Sopenharmony_ci/* 9562306a36Sopenharmony_ci * Register layout information. 9662306a36Sopenharmony_ci */ 9762306a36Sopenharmony_ci#define CSR_REG_BASE 0x1000 9862306a36Sopenharmony_ci#define CSR_REG_SIZE 0x0800 9962306a36Sopenharmony_ci#define EEPROM_BASE 0x0000 10062306a36Sopenharmony_ci#define EEPROM_SIZE 0x0200 10162306a36Sopenharmony_ci#define BBP_BASE 0x0000 10262306a36Sopenharmony_ci#define BBP_SIZE 0x00ff 10362306a36Sopenharmony_ci#define RF_BASE 0x0004 10462306a36Sopenharmony_ci#define RF_SIZE 0x0010 10562306a36Sopenharmony_ci#define RFCSR_BASE 0x0000 10662306a36Sopenharmony_ci#define RFCSR_SIZE 0x0040 10762306a36Sopenharmony_ci 10862306a36Sopenharmony_ci/* 10962306a36Sopenharmony_ci * Number of TX queues. 11062306a36Sopenharmony_ci */ 11162306a36Sopenharmony_ci#define NUM_TX_QUEUES 4 11262306a36Sopenharmony_ci 11362306a36Sopenharmony_ci/* 11462306a36Sopenharmony_ci * Registers. 11562306a36Sopenharmony_ci */ 11662306a36Sopenharmony_ci 11762306a36Sopenharmony_ci 11862306a36Sopenharmony_ci/* 11962306a36Sopenharmony_ci * MAC_CSR0_3290: MAC_CSR0 for RT3290 to identity MAC version number. 12062306a36Sopenharmony_ci */ 12162306a36Sopenharmony_ci#define MAC_CSR0_3290 0x0000 12262306a36Sopenharmony_ci 12362306a36Sopenharmony_ci/* 12462306a36Sopenharmony_ci * E2PROM_CSR: PCI EEPROM control register. 12562306a36Sopenharmony_ci * RELOAD: Write 1 to reload eeprom content. 12662306a36Sopenharmony_ci * TYPE: 0: 93c46, 1:93c66. 12762306a36Sopenharmony_ci * LOAD_STATUS: 1:loading, 0:done. 12862306a36Sopenharmony_ci */ 12962306a36Sopenharmony_ci#define E2PROM_CSR 0x0004 13062306a36Sopenharmony_ci#define E2PROM_CSR_DATA_CLOCK FIELD32(0x00000001) 13162306a36Sopenharmony_ci#define E2PROM_CSR_CHIP_SELECT FIELD32(0x00000002) 13262306a36Sopenharmony_ci#define E2PROM_CSR_DATA_IN FIELD32(0x00000004) 13362306a36Sopenharmony_ci#define E2PROM_CSR_DATA_OUT FIELD32(0x00000008) 13462306a36Sopenharmony_ci#define E2PROM_CSR_TYPE FIELD32(0x00000030) 13562306a36Sopenharmony_ci#define E2PROM_CSR_LOAD_STATUS FIELD32(0x00000040) 13662306a36Sopenharmony_ci#define E2PROM_CSR_RELOAD FIELD32(0x00000080) 13762306a36Sopenharmony_ci 13862306a36Sopenharmony_ci/* 13962306a36Sopenharmony_ci * CMB_CTRL_CFG 14062306a36Sopenharmony_ci */ 14162306a36Sopenharmony_ci#define CMB_CTRL 0x0020 14262306a36Sopenharmony_ci#define AUX_OPT_BIT0 FIELD32(0x00000001) 14362306a36Sopenharmony_ci#define AUX_OPT_BIT1 FIELD32(0x00000002) 14462306a36Sopenharmony_ci#define AUX_OPT_BIT2 FIELD32(0x00000004) 14562306a36Sopenharmony_ci#define AUX_OPT_BIT3 FIELD32(0x00000008) 14662306a36Sopenharmony_ci#define AUX_OPT_BIT4 FIELD32(0x00000010) 14762306a36Sopenharmony_ci#define AUX_OPT_BIT5 FIELD32(0x00000020) 14862306a36Sopenharmony_ci#define AUX_OPT_BIT6 FIELD32(0x00000040) 14962306a36Sopenharmony_ci#define AUX_OPT_BIT7 FIELD32(0x00000080) 15062306a36Sopenharmony_ci#define AUX_OPT_BIT8 FIELD32(0x00000100) 15162306a36Sopenharmony_ci#define AUX_OPT_BIT9 FIELD32(0x00000200) 15262306a36Sopenharmony_ci#define AUX_OPT_BIT10 FIELD32(0x00000400) 15362306a36Sopenharmony_ci#define AUX_OPT_BIT11 FIELD32(0x00000800) 15462306a36Sopenharmony_ci#define AUX_OPT_BIT12 FIELD32(0x00001000) 15562306a36Sopenharmony_ci#define AUX_OPT_BIT13 FIELD32(0x00002000) 15662306a36Sopenharmony_ci#define AUX_OPT_BIT14 FIELD32(0x00004000) 15762306a36Sopenharmony_ci#define AUX_OPT_BIT15 FIELD32(0x00008000) 15862306a36Sopenharmony_ci#define LDO25_LEVEL FIELD32(0x00030000) 15962306a36Sopenharmony_ci#define LDO25_LARGEA FIELD32(0x00040000) 16062306a36Sopenharmony_ci#define LDO25_FRC_ON FIELD32(0x00080000) 16162306a36Sopenharmony_ci#define CMB_RSV FIELD32(0x00300000) 16262306a36Sopenharmony_ci#define XTAL_RDY FIELD32(0x00400000) 16362306a36Sopenharmony_ci#define PLL_LD FIELD32(0x00800000) 16462306a36Sopenharmony_ci#define LDO_CORE_LEVEL FIELD32(0x0F000000) 16562306a36Sopenharmony_ci#define LDO_BGSEL FIELD32(0x30000000) 16662306a36Sopenharmony_ci#define LDO3_EN FIELD32(0x40000000) 16762306a36Sopenharmony_ci#define LDO0_EN FIELD32(0x80000000) 16862306a36Sopenharmony_ci 16962306a36Sopenharmony_ci/* 17062306a36Sopenharmony_ci * EFUSE_CSR_3290: RT3290 EEPROM 17162306a36Sopenharmony_ci */ 17262306a36Sopenharmony_ci#define EFUSE_CTRL_3290 0x0024 17362306a36Sopenharmony_ci 17462306a36Sopenharmony_ci/* 17562306a36Sopenharmony_ci * EFUSE_DATA3 of 3290 17662306a36Sopenharmony_ci */ 17762306a36Sopenharmony_ci#define EFUSE_DATA3_3290 0x0028 17862306a36Sopenharmony_ci 17962306a36Sopenharmony_ci/* 18062306a36Sopenharmony_ci * EFUSE_DATA2 of 3290 18162306a36Sopenharmony_ci */ 18262306a36Sopenharmony_ci#define EFUSE_DATA2_3290 0x002c 18362306a36Sopenharmony_ci 18462306a36Sopenharmony_ci/* 18562306a36Sopenharmony_ci * EFUSE_DATA1 of 3290 18662306a36Sopenharmony_ci */ 18762306a36Sopenharmony_ci#define EFUSE_DATA1_3290 0x0030 18862306a36Sopenharmony_ci 18962306a36Sopenharmony_ci/* 19062306a36Sopenharmony_ci * EFUSE_DATA0 of 3290 19162306a36Sopenharmony_ci */ 19262306a36Sopenharmony_ci#define EFUSE_DATA0_3290 0x0034 19362306a36Sopenharmony_ci 19462306a36Sopenharmony_ci/* 19562306a36Sopenharmony_ci * OSC_CTRL_CFG 19662306a36Sopenharmony_ci * Ring oscillator configuration 19762306a36Sopenharmony_ci */ 19862306a36Sopenharmony_ci#define OSC_CTRL 0x0038 19962306a36Sopenharmony_ci#define OSC_REF_CYCLE FIELD32(0x00001fff) 20062306a36Sopenharmony_ci#define OSC_RSV FIELD32(0x0000e000) 20162306a36Sopenharmony_ci#define OSC_CAL_CNT FIELD32(0x0fff0000) 20262306a36Sopenharmony_ci#define OSC_CAL_ACK FIELD32(0x10000000) 20362306a36Sopenharmony_ci#define OSC_CLK_32K_VLD FIELD32(0x20000000) 20462306a36Sopenharmony_ci#define OSC_CAL_REQ FIELD32(0x40000000) 20562306a36Sopenharmony_ci#define OSC_ROSC_EN FIELD32(0x80000000) 20662306a36Sopenharmony_ci 20762306a36Sopenharmony_ci/* 20862306a36Sopenharmony_ci * COEX_CFG_0 20962306a36Sopenharmony_ci */ 21062306a36Sopenharmony_ci#define COEX_CFG0 0x0040 21162306a36Sopenharmony_ci#define COEX_CFG_ANT FIELD32(0xff000000) 21262306a36Sopenharmony_ci/* 21362306a36Sopenharmony_ci * COEX_CFG_1 21462306a36Sopenharmony_ci */ 21562306a36Sopenharmony_ci#define COEX_CFG1 0x0044 21662306a36Sopenharmony_ci 21762306a36Sopenharmony_ci/* 21862306a36Sopenharmony_ci * COEX_CFG_2 21962306a36Sopenharmony_ci */ 22062306a36Sopenharmony_ci#define COEX_CFG2 0x0048 22162306a36Sopenharmony_ci#define BT_COEX_CFG1 FIELD32(0xff000000) 22262306a36Sopenharmony_ci#define BT_COEX_CFG0 FIELD32(0x00ff0000) 22362306a36Sopenharmony_ci#define WL_COEX_CFG1 FIELD32(0x0000ff00) 22462306a36Sopenharmony_ci#define WL_COEX_CFG0 FIELD32(0x000000ff) 22562306a36Sopenharmony_ci/* 22662306a36Sopenharmony_ci * PLL_CTRL_CFG 22762306a36Sopenharmony_ci * PLL configuration register 22862306a36Sopenharmony_ci */ 22962306a36Sopenharmony_ci#define PLL_CTRL 0x0050 23062306a36Sopenharmony_ci#define PLL_RESERVED_INPUT1 FIELD32(0x000000ff) 23162306a36Sopenharmony_ci#define PLL_RESERVED_INPUT2 FIELD32(0x0000ff00) 23262306a36Sopenharmony_ci#define PLL_CONTROL FIELD32(0x00070000) 23362306a36Sopenharmony_ci#define PLL_LPF_R1 FIELD32(0x00080000) 23462306a36Sopenharmony_ci#define PLL_LPF_C1_CTRL FIELD32(0x00300000) 23562306a36Sopenharmony_ci#define PLL_LPF_C2_CTRL FIELD32(0x00c00000) 23662306a36Sopenharmony_ci#define PLL_CP_CURRENT_CTRL FIELD32(0x03000000) 23762306a36Sopenharmony_ci#define PLL_PFD_DELAY_CTRL FIELD32(0x0c000000) 23862306a36Sopenharmony_ci#define PLL_LOCK_CTRL FIELD32(0x70000000) 23962306a36Sopenharmony_ci#define PLL_VBGBK_EN FIELD32(0x80000000) 24062306a36Sopenharmony_ci 24162306a36Sopenharmony_ci 24262306a36Sopenharmony_ci/* 24362306a36Sopenharmony_ci * WLAN_CTRL_CFG 24462306a36Sopenharmony_ci * RT3290 wlan configuration 24562306a36Sopenharmony_ci */ 24662306a36Sopenharmony_ci#define WLAN_FUN_CTRL 0x0080 24762306a36Sopenharmony_ci#define WLAN_EN FIELD32(0x00000001) 24862306a36Sopenharmony_ci#define WLAN_CLK_EN FIELD32(0x00000002) 24962306a36Sopenharmony_ci#define WLAN_RSV1 FIELD32(0x00000004) 25062306a36Sopenharmony_ci#define WLAN_RESET FIELD32(0x00000008) 25162306a36Sopenharmony_ci#define PCIE_APP0_CLK_REQ FIELD32(0x00000010) 25262306a36Sopenharmony_ci#define FRC_WL_ANT_SET FIELD32(0x00000020) 25362306a36Sopenharmony_ci#define INV_TR_SW0 FIELD32(0x00000040) 25462306a36Sopenharmony_ci#define WLAN_GPIO_IN_BIT0 FIELD32(0x00000100) 25562306a36Sopenharmony_ci#define WLAN_GPIO_IN_BIT1 FIELD32(0x00000200) 25662306a36Sopenharmony_ci#define WLAN_GPIO_IN_BIT2 FIELD32(0x00000400) 25762306a36Sopenharmony_ci#define WLAN_GPIO_IN_BIT3 FIELD32(0x00000800) 25862306a36Sopenharmony_ci#define WLAN_GPIO_IN_BIT4 FIELD32(0x00001000) 25962306a36Sopenharmony_ci#define WLAN_GPIO_IN_BIT5 FIELD32(0x00002000) 26062306a36Sopenharmony_ci#define WLAN_GPIO_IN_BIT6 FIELD32(0x00004000) 26162306a36Sopenharmony_ci#define WLAN_GPIO_IN_BIT7 FIELD32(0x00008000) 26262306a36Sopenharmony_ci#define WLAN_GPIO_IN_BIT_ALL FIELD32(0x0000ff00) 26362306a36Sopenharmony_ci#define WLAN_GPIO_OUT_BIT0 FIELD32(0x00010000) 26462306a36Sopenharmony_ci#define WLAN_GPIO_OUT_BIT1 FIELD32(0x00020000) 26562306a36Sopenharmony_ci#define WLAN_GPIO_OUT_BIT2 FIELD32(0x00040000) 26662306a36Sopenharmony_ci#define WLAN_GPIO_OUT_BIT3 FIELD32(0x00050000) 26762306a36Sopenharmony_ci#define WLAN_GPIO_OUT_BIT4 FIELD32(0x00100000) 26862306a36Sopenharmony_ci#define WLAN_GPIO_OUT_BIT5 FIELD32(0x00200000) 26962306a36Sopenharmony_ci#define WLAN_GPIO_OUT_BIT6 FIELD32(0x00400000) 27062306a36Sopenharmony_ci#define WLAN_GPIO_OUT_BIT7 FIELD32(0x00800000) 27162306a36Sopenharmony_ci#define WLAN_GPIO_OUT_BIT_ALL FIELD32(0x00ff0000) 27262306a36Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT0 FIELD32(0x01000000) 27362306a36Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT1 FIELD32(0x02000000) 27462306a36Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT2 FIELD32(0x04000000) 27562306a36Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT3 FIELD32(0x08000000) 27662306a36Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT4 FIELD32(0x10000000) 27762306a36Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT5 FIELD32(0x20000000) 27862306a36Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT6 FIELD32(0x40000000) 27962306a36Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT7 FIELD32(0x80000000) 28062306a36Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT_ALL FIELD32(0xff000000) 28162306a36Sopenharmony_ci 28262306a36Sopenharmony_ci/* 28362306a36Sopenharmony_ci * AUX_CTRL: Aux/PCI-E related configuration 28462306a36Sopenharmony_ci */ 28562306a36Sopenharmony_ci#define AUX_CTRL 0x10c 28662306a36Sopenharmony_ci#define AUX_CTRL_WAKE_PCIE_EN FIELD32(0x00000002) 28762306a36Sopenharmony_ci#define AUX_CTRL_FORCE_PCIE_CLK FIELD32(0x00000400) 28862306a36Sopenharmony_ci 28962306a36Sopenharmony_ci/* 29062306a36Sopenharmony_ci * OPT_14: Unknown register used by rt3xxx devices. 29162306a36Sopenharmony_ci */ 29262306a36Sopenharmony_ci#define OPT_14_CSR 0x0114 29362306a36Sopenharmony_ci#define OPT_14_CSR_BIT0 FIELD32(0x00000001) 29462306a36Sopenharmony_ci 29562306a36Sopenharmony_ci/* 29662306a36Sopenharmony_ci * INT_SOURCE_CSR: Interrupt source register. 29762306a36Sopenharmony_ci * Write one to clear corresponding bit. 29862306a36Sopenharmony_ci * TX_FIFO_STATUS: FIFO Statistics is full, sw should read TX_STA_FIFO 29962306a36Sopenharmony_ci */ 30062306a36Sopenharmony_ci#define INT_SOURCE_CSR 0x0200 30162306a36Sopenharmony_ci#define INT_SOURCE_CSR_RXDELAYINT FIELD32(0x00000001) 30262306a36Sopenharmony_ci#define INT_SOURCE_CSR_TXDELAYINT FIELD32(0x00000002) 30362306a36Sopenharmony_ci#define INT_SOURCE_CSR_RX_DONE FIELD32(0x00000004) 30462306a36Sopenharmony_ci#define INT_SOURCE_CSR_AC0_DMA_DONE FIELD32(0x00000008) 30562306a36Sopenharmony_ci#define INT_SOURCE_CSR_AC1_DMA_DONE FIELD32(0x00000010) 30662306a36Sopenharmony_ci#define INT_SOURCE_CSR_AC2_DMA_DONE FIELD32(0x00000020) 30762306a36Sopenharmony_ci#define INT_SOURCE_CSR_AC3_DMA_DONE FIELD32(0x00000040) 30862306a36Sopenharmony_ci#define INT_SOURCE_CSR_HCCA_DMA_DONE FIELD32(0x00000080) 30962306a36Sopenharmony_ci#define INT_SOURCE_CSR_MGMT_DMA_DONE FIELD32(0x00000100) 31062306a36Sopenharmony_ci#define INT_SOURCE_CSR_MCU_COMMAND FIELD32(0x00000200) 31162306a36Sopenharmony_ci#define INT_SOURCE_CSR_RXTX_COHERENT FIELD32(0x00000400) 31262306a36Sopenharmony_ci#define INT_SOURCE_CSR_TBTT FIELD32(0x00000800) 31362306a36Sopenharmony_ci#define INT_SOURCE_CSR_PRE_TBTT FIELD32(0x00001000) 31462306a36Sopenharmony_ci#define INT_SOURCE_CSR_TX_FIFO_STATUS FIELD32(0x00002000) 31562306a36Sopenharmony_ci#define INT_SOURCE_CSR_AUTO_WAKEUP FIELD32(0x00004000) 31662306a36Sopenharmony_ci#define INT_SOURCE_CSR_GPTIMER FIELD32(0x00008000) 31762306a36Sopenharmony_ci#define INT_SOURCE_CSR_RX_COHERENT FIELD32(0x00010000) 31862306a36Sopenharmony_ci#define INT_SOURCE_CSR_TX_COHERENT FIELD32(0x00020000) 31962306a36Sopenharmony_ci 32062306a36Sopenharmony_ci/* 32162306a36Sopenharmony_ci * INT_MASK_CSR: Interrupt MASK register. 1: the interrupt is mask OFF. 32262306a36Sopenharmony_ci */ 32362306a36Sopenharmony_ci#define INT_MASK_CSR 0x0204 32462306a36Sopenharmony_ci#define INT_MASK_CSR_RXDELAYINT FIELD32(0x00000001) 32562306a36Sopenharmony_ci#define INT_MASK_CSR_TXDELAYINT FIELD32(0x00000002) 32662306a36Sopenharmony_ci#define INT_MASK_CSR_RX_DONE FIELD32(0x00000004) 32762306a36Sopenharmony_ci#define INT_MASK_CSR_AC0_DMA_DONE FIELD32(0x00000008) 32862306a36Sopenharmony_ci#define INT_MASK_CSR_AC1_DMA_DONE FIELD32(0x00000010) 32962306a36Sopenharmony_ci#define INT_MASK_CSR_AC2_DMA_DONE FIELD32(0x00000020) 33062306a36Sopenharmony_ci#define INT_MASK_CSR_AC3_DMA_DONE FIELD32(0x00000040) 33162306a36Sopenharmony_ci#define INT_MASK_CSR_HCCA_DMA_DONE FIELD32(0x00000080) 33262306a36Sopenharmony_ci#define INT_MASK_CSR_MGMT_DMA_DONE FIELD32(0x00000100) 33362306a36Sopenharmony_ci#define INT_MASK_CSR_MCU_COMMAND FIELD32(0x00000200) 33462306a36Sopenharmony_ci#define INT_MASK_CSR_RXTX_COHERENT FIELD32(0x00000400) 33562306a36Sopenharmony_ci#define INT_MASK_CSR_TBTT FIELD32(0x00000800) 33662306a36Sopenharmony_ci#define INT_MASK_CSR_PRE_TBTT FIELD32(0x00001000) 33762306a36Sopenharmony_ci#define INT_MASK_CSR_TX_FIFO_STATUS FIELD32(0x00002000) 33862306a36Sopenharmony_ci#define INT_MASK_CSR_AUTO_WAKEUP FIELD32(0x00004000) 33962306a36Sopenharmony_ci#define INT_MASK_CSR_GPTIMER FIELD32(0x00008000) 34062306a36Sopenharmony_ci#define INT_MASK_CSR_RX_COHERENT FIELD32(0x00010000) 34162306a36Sopenharmony_ci#define INT_MASK_CSR_TX_COHERENT FIELD32(0x00020000) 34262306a36Sopenharmony_ci 34362306a36Sopenharmony_ci/* 34462306a36Sopenharmony_ci * WPDMA_GLO_CFG 34562306a36Sopenharmony_ci */ 34662306a36Sopenharmony_ci#define WPDMA_GLO_CFG 0x0208 34762306a36Sopenharmony_ci#define WPDMA_GLO_CFG_ENABLE_TX_DMA FIELD32(0x00000001) 34862306a36Sopenharmony_ci#define WPDMA_GLO_CFG_TX_DMA_BUSY FIELD32(0x00000002) 34962306a36Sopenharmony_ci#define WPDMA_GLO_CFG_ENABLE_RX_DMA FIELD32(0x00000004) 35062306a36Sopenharmony_ci#define WPDMA_GLO_CFG_RX_DMA_BUSY FIELD32(0x00000008) 35162306a36Sopenharmony_ci#define WPDMA_GLO_CFG_WP_DMA_BURST_SIZE FIELD32(0x00000030) 35262306a36Sopenharmony_ci#define WPDMA_GLO_CFG_TX_WRITEBACK_DONE FIELD32(0x00000040) 35362306a36Sopenharmony_ci#define WPDMA_GLO_CFG_BIG_ENDIAN FIELD32(0x00000080) 35462306a36Sopenharmony_ci#define WPDMA_GLO_CFG_RX_HDR_SCATTER FIELD32(0x0000ff00) 35562306a36Sopenharmony_ci#define WPDMA_GLO_CFG_HDR_SEG_LEN FIELD32(0xffff0000) 35662306a36Sopenharmony_ci 35762306a36Sopenharmony_ci/* 35862306a36Sopenharmony_ci * WPDMA_RST_IDX 35962306a36Sopenharmony_ci */ 36062306a36Sopenharmony_ci#define WPDMA_RST_IDX 0x020c 36162306a36Sopenharmony_ci#define WPDMA_RST_IDX_DTX_IDX0 FIELD32(0x00000001) 36262306a36Sopenharmony_ci#define WPDMA_RST_IDX_DTX_IDX1 FIELD32(0x00000002) 36362306a36Sopenharmony_ci#define WPDMA_RST_IDX_DTX_IDX2 FIELD32(0x00000004) 36462306a36Sopenharmony_ci#define WPDMA_RST_IDX_DTX_IDX3 FIELD32(0x00000008) 36562306a36Sopenharmony_ci#define WPDMA_RST_IDX_DTX_IDX4 FIELD32(0x00000010) 36662306a36Sopenharmony_ci#define WPDMA_RST_IDX_DTX_IDX5 FIELD32(0x00000020) 36762306a36Sopenharmony_ci#define WPDMA_RST_IDX_DRX_IDX0 FIELD32(0x00010000) 36862306a36Sopenharmony_ci 36962306a36Sopenharmony_ci/* 37062306a36Sopenharmony_ci * DELAY_INT_CFG 37162306a36Sopenharmony_ci */ 37262306a36Sopenharmony_ci#define DELAY_INT_CFG 0x0210 37362306a36Sopenharmony_ci#define DELAY_INT_CFG_RXMAX_PTIME FIELD32(0x000000ff) 37462306a36Sopenharmony_ci#define DELAY_INT_CFG_RXMAX_PINT FIELD32(0x00007f00) 37562306a36Sopenharmony_ci#define DELAY_INT_CFG_RXDLY_INT_EN FIELD32(0x00008000) 37662306a36Sopenharmony_ci#define DELAY_INT_CFG_TXMAX_PTIME FIELD32(0x00ff0000) 37762306a36Sopenharmony_ci#define DELAY_INT_CFG_TXMAX_PINT FIELD32(0x7f000000) 37862306a36Sopenharmony_ci#define DELAY_INT_CFG_TXDLY_INT_EN FIELD32(0x80000000) 37962306a36Sopenharmony_ci 38062306a36Sopenharmony_ci/* 38162306a36Sopenharmony_ci * WMM_AIFSN_CFG: Aifsn for each EDCA AC 38262306a36Sopenharmony_ci * AIFSN0: AC_VO 38362306a36Sopenharmony_ci * AIFSN1: AC_VI 38462306a36Sopenharmony_ci * AIFSN2: AC_BE 38562306a36Sopenharmony_ci * AIFSN3: AC_BK 38662306a36Sopenharmony_ci */ 38762306a36Sopenharmony_ci#define WMM_AIFSN_CFG 0x0214 38862306a36Sopenharmony_ci#define WMM_AIFSN_CFG_AIFSN0 FIELD32(0x0000000f) 38962306a36Sopenharmony_ci#define WMM_AIFSN_CFG_AIFSN1 FIELD32(0x000000f0) 39062306a36Sopenharmony_ci#define WMM_AIFSN_CFG_AIFSN2 FIELD32(0x00000f00) 39162306a36Sopenharmony_ci#define WMM_AIFSN_CFG_AIFSN3 FIELD32(0x0000f000) 39262306a36Sopenharmony_ci 39362306a36Sopenharmony_ci/* 39462306a36Sopenharmony_ci * WMM_CWMIN_CSR: CWmin for each EDCA AC 39562306a36Sopenharmony_ci * CWMIN0: AC_VO 39662306a36Sopenharmony_ci * CWMIN1: AC_VI 39762306a36Sopenharmony_ci * CWMIN2: AC_BE 39862306a36Sopenharmony_ci * CWMIN3: AC_BK 39962306a36Sopenharmony_ci */ 40062306a36Sopenharmony_ci#define WMM_CWMIN_CFG 0x0218 40162306a36Sopenharmony_ci#define WMM_CWMIN_CFG_CWMIN0 FIELD32(0x0000000f) 40262306a36Sopenharmony_ci#define WMM_CWMIN_CFG_CWMIN1 FIELD32(0x000000f0) 40362306a36Sopenharmony_ci#define WMM_CWMIN_CFG_CWMIN2 FIELD32(0x00000f00) 40462306a36Sopenharmony_ci#define WMM_CWMIN_CFG_CWMIN3 FIELD32(0x0000f000) 40562306a36Sopenharmony_ci 40662306a36Sopenharmony_ci/* 40762306a36Sopenharmony_ci * WMM_CWMAX_CSR: CWmax for each EDCA AC 40862306a36Sopenharmony_ci * CWMAX0: AC_VO 40962306a36Sopenharmony_ci * CWMAX1: AC_VI 41062306a36Sopenharmony_ci * CWMAX2: AC_BE 41162306a36Sopenharmony_ci * CWMAX3: AC_BK 41262306a36Sopenharmony_ci */ 41362306a36Sopenharmony_ci#define WMM_CWMAX_CFG 0x021c 41462306a36Sopenharmony_ci#define WMM_CWMAX_CFG_CWMAX0 FIELD32(0x0000000f) 41562306a36Sopenharmony_ci#define WMM_CWMAX_CFG_CWMAX1 FIELD32(0x000000f0) 41662306a36Sopenharmony_ci#define WMM_CWMAX_CFG_CWMAX2 FIELD32(0x00000f00) 41762306a36Sopenharmony_ci#define WMM_CWMAX_CFG_CWMAX3 FIELD32(0x0000f000) 41862306a36Sopenharmony_ci 41962306a36Sopenharmony_ci/* 42062306a36Sopenharmony_ci * AC_TXOP0: AC_VO/AC_VI TXOP register 42162306a36Sopenharmony_ci * AC0TXOP: AC_VO in unit of 32us 42262306a36Sopenharmony_ci * AC1TXOP: AC_VI in unit of 32us 42362306a36Sopenharmony_ci */ 42462306a36Sopenharmony_ci#define WMM_TXOP0_CFG 0x0220 42562306a36Sopenharmony_ci#define WMM_TXOP0_CFG_AC0TXOP FIELD32(0x0000ffff) 42662306a36Sopenharmony_ci#define WMM_TXOP0_CFG_AC1TXOP FIELD32(0xffff0000) 42762306a36Sopenharmony_ci 42862306a36Sopenharmony_ci/* 42962306a36Sopenharmony_ci * AC_TXOP1: AC_BE/AC_BK TXOP register 43062306a36Sopenharmony_ci * AC2TXOP: AC_BE in unit of 32us 43162306a36Sopenharmony_ci * AC3TXOP: AC_BK in unit of 32us 43262306a36Sopenharmony_ci */ 43362306a36Sopenharmony_ci#define WMM_TXOP1_CFG 0x0224 43462306a36Sopenharmony_ci#define WMM_TXOP1_CFG_AC2TXOP FIELD32(0x0000ffff) 43562306a36Sopenharmony_ci#define WMM_TXOP1_CFG_AC3TXOP FIELD32(0xffff0000) 43662306a36Sopenharmony_ci 43762306a36Sopenharmony_ci/* 43862306a36Sopenharmony_ci * GPIO_CTRL: 43962306a36Sopenharmony_ci * GPIO_CTRL_VALx: GPIO value 44062306a36Sopenharmony_ci * GPIO_CTRL_DIRx: GPIO direction: 0 = output; 1 = input 44162306a36Sopenharmony_ci */ 44262306a36Sopenharmony_ci#define GPIO_CTRL 0x0228 44362306a36Sopenharmony_ci#define GPIO_CTRL_VAL0 FIELD32(0x00000001) 44462306a36Sopenharmony_ci#define GPIO_CTRL_VAL1 FIELD32(0x00000002) 44562306a36Sopenharmony_ci#define GPIO_CTRL_VAL2 FIELD32(0x00000004) 44662306a36Sopenharmony_ci#define GPIO_CTRL_VAL3 FIELD32(0x00000008) 44762306a36Sopenharmony_ci#define GPIO_CTRL_VAL4 FIELD32(0x00000010) 44862306a36Sopenharmony_ci#define GPIO_CTRL_VAL5 FIELD32(0x00000020) 44962306a36Sopenharmony_ci#define GPIO_CTRL_VAL6 FIELD32(0x00000040) 45062306a36Sopenharmony_ci#define GPIO_CTRL_VAL7 FIELD32(0x00000080) 45162306a36Sopenharmony_ci#define GPIO_CTRL_DIR0 FIELD32(0x00000100) 45262306a36Sopenharmony_ci#define GPIO_CTRL_DIR1 FIELD32(0x00000200) 45362306a36Sopenharmony_ci#define GPIO_CTRL_DIR2 FIELD32(0x00000400) 45462306a36Sopenharmony_ci#define GPIO_CTRL_DIR3 FIELD32(0x00000800) 45562306a36Sopenharmony_ci#define GPIO_CTRL_DIR4 FIELD32(0x00001000) 45662306a36Sopenharmony_ci#define GPIO_CTRL_DIR5 FIELD32(0x00002000) 45762306a36Sopenharmony_ci#define GPIO_CTRL_DIR6 FIELD32(0x00004000) 45862306a36Sopenharmony_ci#define GPIO_CTRL_DIR7 FIELD32(0x00008000) 45962306a36Sopenharmony_ci#define GPIO_CTRL_VAL8 FIELD32(0x00010000) 46062306a36Sopenharmony_ci#define GPIO_CTRL_VAL9 FIELD32(0x00020000) 46162306a36Sopenharmony_ci#define GPIO_CTRL_VAL10 FIELD32(0x00040000) 46262306a36Sopenharmony_ci#define GPIO_CTRL_DIR8 FIELD32(0x01000000) 46362306a36Sopenharmony_ci#define GPIO_CTRL_DIR9 FIELD32(0x02000000) 46462306a36Sopenharmony_ci#define GPIO_CTRL_DIR10 FIELD32(0x04000000) 46562306a36Sopenharmony_ci 46662306a36Sopenharmony_ci/* 46762306a36Sopenharmony_ci * MCU_CMD_CFG 46862306a36Sopenharmony_ci */ 46962306a36Sopenharmony_ci#define MCU_CMD_CFG 0x022c 47062306a36Sopenharmony_ci 47162306a36Sopenharmony_ci/* 47262306a36Sopenharmony_ci * AC_VO register offsets 47362306a36Sopenharmony_ci */ 47462306a36Sopenharmony_ci#define TX_BASE_PTR0 0x0230 47562306a36Sopenharmony_ci#define TX_MAX_CNT0 0x0234 47662306a36Sopenharmony_ci#define TX_CTX_IDX0 0x0238 47762306a36Sopenharmony_ci#define TX_DTX_IDX0 0x023c 47862306a36Sopenharmony_ci 47962306a36Sopenharmony_ci/* 48062306a36Sopenharmony_ci * AC_VI register offsets 48162306a36Sopenharmony_ci */ 48262306a36Sopenharmony_ci#define TX_BASE_PTR1 0x0240 48362306a36Sopenharmony_ci#define TX_MAX_CNT1 0x0244 48462306a36Sopenharmony_ci#define TX_CTX_IDX1 0x0248 48562306a36Sopenharmony_ci#define TX_DTX_IDX1 0x024c 48662306a36Sopenharmony_ci 48762306a36Sopenharmony_ci/* 48862306a36Sopenharmony_ci * AC_BE register offsets 48962306a36Sopenharmony_ci */ 49062306a36Sopenharmony_ci#define TX_BASE_PTR2 0x0250 49162306a36Sopenharmony_ci#define TX_MAX_CNT2 0x0254 49262306a36Sopenharmony_ci#define TX_CTX_IDX2 0x0258 49362306a36Sopenharmony_ci#define TX_DTX_IDX2 0x025c 49462306a36Sopenharmony_ci 49562306a36Sopenharmony_ci/* 49662306a36Sopenharmony_ci * AC_BK register offsets 49762306a36Sopenharmony_ci */ 49862306a36Sopenharmony_ci#define TX_BASE_PTR3 0x0260 49962306a36Sopenharmony_ci#define TX_MAX_CNT3 0x0264 50062306a36Sopenharmony_ci#define TX_CTX_IDX3 0x0268 50162306a36Sopenharmony_ci#define TX_DTX_IDX3 0x026c 50262306a36Sopenharmony_ci 50362306a36Sopenharmony_ci/* 50462306a36Sopenharmony_ci * HCCA register offsets 50562306a36Sopenharmony_ci */ 50662306a36Sopenharmony_ci#define TX_BASE_PTR4 0x0270 50762306a36Sopenharmony_ci#define TX_MAX_CNT4 0x0274 50862306a36Sopenharmony_ci#define TX_CTX_IDX4 0x0278 50962306a36Sopenharmony_ci#define TX_DTX_IDX4 0x027c 51062306a36Sopenharmony_ci 51162306a36Sopenharmony_ci/* 51262306a36Sopenharmony_ci * MGMT register offsets 51362306a36Sopenharmony_ci */ 51462306a36Sopenharmony_ci#define TX_BASE_PTR5 0x0280 51562306a36Sopenharmony_ci#define TX_MAX_CNT5 0x0284 51662306a36Sopenharmony_ci#define TX_CTX_IDX5 0x0288 51762306a36Sopenharmony_ci#define TX_DTX_IDX5 0x028c 51862306a36Sopenharmony_ci 51962306a36Sopenharmony_ci/* 52062306a36Sopenharmony_ci * RX register offsets 52162306a36Sopenharmony_ci */ 52262306a36Sopenharmony_ci#define RX_BASE_PTR 0x0290 52362306a36Sopenharmony_ci#define RX_MAX_CNT 0x0294 52462306a36Sopenharmony_ci#define RX_CRX_IDX 0x0298 52562306a36Sopenharmony_ci#define RX_DRX_IDX 0x029c 52662306a36Sopenharmony_ci 52762306a36Sopenharmony_ci/* 52862306a36Sopenharmony_ci * USB_DMA_CFG 52962306a36Sopenharmony_ci * RX_BULK_AGG_TIMEOUT: Rx Bulk Aggregation TimeOut in unit of 33ns. 53062306a36Sopenharmony_ci * RX_BULK_AGG_LIMIT: Rx Bulk Aggregation Limit in unit of 256 bytes. 53162306a36Sopenharmony_ci * PHY_CLEAR: phy watch dog enable. 53262306a36Sopenharmony_ci * TX_CLEAR: Clear USB DMA TX path. 53362306a36Sopenharmony_ci * TXOP_HALT: Halt TXOP count down when TX buffer is full. 53462306a36Sopenharmony_ci * RX_BULK_AGG_EN: Enable Rx Bulk Aggregation. 53562306a36Sopenharmony_ci * RX_BULK_EN: Enable USB DMA Rx. 53662306a36Sopenharmony_ci * TX_BULK_EN: Enable USB DMA Tx. 53762306a36Sopenharmony_ci * EP_OUT_VALID: OUT endpoint data valid. 53862306a36Sopenharmony_ci * RX_BUSY: USB DMA RX FSM busy. 53962306a36Sopenharmony_ci * TX_BUSY: USB DMA TX FSM busy. 54062306a36Sopenharmony_ci */ 54162306a36Sopenharmony_ci#define USB_DMA_CFG 0x02a0 54262306a36Sopenharmony_ci#define USB_DMA_CFG_RX_BULK_AGG_TIMEOUT FIELD32(0x000000ff) 54362306a36Sopenharmony_ci#define USB_DMA_CFG_RX_BULK_AGG_LIMIT FIELD32(0x0000ff00) 54462306a36Sopenharmony_ci#define USB_DMA_CFG_PHY_CLEAR FIELD32(0x00010000) 54562306a36Sopenharmony_ci#define USB_DMA_CFG_TX_CLEAR FIELD32(0x00080000) 54662306a36Sopenharmony_ci#define USB_DMA_CFG_TXOP_HALT FIELD32(0x00100000) 54762306a36Sopenharmony_ci#define USB_DMA_CFG_RX_BULK_AGG_EN FIELD32(0x00200000) 54862306a36Sopenharmony_ci#define USB_DMA_CFG_RX_BULK_EN FIELD32(0x00400000) 54962306a36Sopenharmony_ci#define USB_DMA_CFG_TX_BULK_EN FIELD32(0x00800000) 55062306a36Sopenharmony_ci#define USB_DMA_CFG_EP_OUT_VALID FIELD32(0x3f000000) 55162306a36Sopenharmony_ci#define USB_DMA_CFG_RX_BUSY FIELD32(0x40000000) 55262306a36Sopenharmony_ci#define USB_DMA_CFG_TX_BUSY FIELD32(0x80000000) 55362306a36Sopenharmony_ci 55462306a36Sopenharmony_ci/* 55562306a36Sopenharmony_ci * US_CYC_CNT 55662306a36Sopenharmony_ci * BT_MODE_EN: Bluetooth mode enable 55762306a36Sopenharmony_ci * CLOCK CYCLE: Clock cycle count in 1us. 55862306a36Sopenharmony_ci * PCI:0x21, PCIE:0x7d, USB:0x1e 55962306a36Sopenharmony_ci */ 56062306a36Sopenharmony_ci#define US_CYC_CNT 0x02a4 56162306a36Sopenharmony_ci#define US_CYC_CNT_BT_MODE_EN FIELD32(0x00000100) 56262306a36Sopenharmony_ci#define US_CYC_CNT_CLOCK_CYCLE FIELD32(0x000000ff) 56362306a36Sopenharmony_ci 56462306a36Sopenharmony_ci/* 56562306a36Sopenharmony_ci * PBF_SYS_CTRL 56662306a36Sopenharmony_ci * HOST_RAM_WRITE: enable Host program ram write selection 56762306a36Sopenharmony_ci */ 56862306a36Sopenharmony_ci#define PBF_SYS_CTRL 0x0400 56962306a36Sopenharmony_ci#define PBF_SYS_CTRL_READY FIELD32(0x00000080) 57062306a36Sopenharmony_ci#define PBF_SYS_CTRL_HOST_RAM_WRITE FIELD32(0x00010000) 57162306a36Sopenharmony_ci 57262306a36Sopenharmony_ci/* 57362306a36Sopenharmony_ci * HOST-MCU shared memory 57462306a36Sopenharmony_ci */ 57562306a36Sopenharmony_ci#define HOST_CMD_CSR 0x0404 57662306a36Sopenharmony_ci#define HOST_CMD_CSR_HOST_COMMAND FIELD32(0x000000ff) 57762306a36Sopenharmony_ci 57862306a36Sopenharmony_ci/* 57962306a36Sopenharmony_ci * PBF registers 58062306a36Sopenharmony_ci * Most are for debug. Driver doesn't touch PBF register. 58162306a36Sopenharmony_ci */ 58262306a36Sopenharmony_ci#define PBF_CFG 0x0408 58362306a36Sopenharmony_ci#define PBF_MAX_PCNT 0x040c 58462306a36Sopenharmony_ci#define PBF_CTRL 0x0410 58562306a36Sopenharmony_ci#define PBF_INT_STA 0x0414 58662306a36Sopenharmony_ci#define PBF_INT_ENA 0x0418 58762306a36Sopenharmony_ci 58862306a36Sopenharmony_ci/* 58962306a36Sopenharmony_ci * BCN_OFFSET0: 59062306a36Sopenharmony_ci */ 59162306a36Sopenharmony_ci#define BCN_OFFSET0 0x042c 59262306a36Sopenharmony_ci#define BCN_OFFSET0_BCN0 FIELD32(0x000000ff) 59362306a36Sopenharmony_ci#define BCN_OFFSET0_BCN1 FIELD32(0x0000ff00) 59462306a36Sopenharmony_ci#define BCN_OFFSET0_BCN2 FIELD32(0x00ff0000) 59562306a36Sopenharmony_ci#define BCN_OFFSET0_BCN3 FIELD32(0xff000000) 59662306a36Sopenharmony_ci 59762306a36Sopenharmony_ci/* 59862306a36Sopenharmony_ci * BCN_OFFSET1: 59962306a36Sopenharmony_ci */ 60062306a36Sopenharmony_ci#define BCN_OFFSET1 0x0430 60162306a36Sopenharmony_ci#define BCN_OFFSET1_BCN4 FIELD32(0x000000ff) 60262306a36Sopenharmony_ci#define BCN_OFFSET1_BCN5 FIELD32(0x0000ff00) 60362306a36Sopenharmony_ci#define BCN_OFFSET1_BCN6 FIELD32(0x00ff0000) 60462306a36Sopenharmony_ci#define BCN_OFFSET1_BCN7 FIELD32(0xff000000) 60562306a36Sopenharmony_ci 60662306a36Sopenharmony_ci/* 60762306a36Sopenharmony_ci * TXRXQ_PCNT: PBF register 60862306a36Sopenharmony_ci * PCNT_TX0Q: Page count for TX hardware queue 0 60962306a36Sopenharmony_ci * PCNT_TX1Q: Page count for TX hardware queue 1 61062306a36Sopenharmony_ci * PCNT_TX2Q: Page count for TX hardware queue 2 61162306a36Sopenharmony_ci * PCNT_RX0Q: Page count for RX hardware queue 61262306a36Sopenharmony_ci */ 61362306a36Sopenharmony_ci#define TXRXQ_PCNT 0x0438 61462306a36Sopenharmony_ci#define TXRXQ_PCNT_TX0Q FIELD32(0x000000ff) 61562306a36Sopenharmony_ci#define TXRXQ_PCNT_TX1Q FIELD32(0x0000ff00) 61662306a36Sopenharmony_ci#define TXRXQ_PCNT_TX2Q FIELD32(0x00ff0000) 61762306a36Sopenharmony_ci#define TXRXQ_PCNT_RX0Q FIELD32(0xff000000) 61862306a36Sopenharmony_ci 61962306a36Sopenharmony_ci/* 62062306a36Sopenharmony_ci * PBF register 62162306a36Sopenharmony_ci * Debug. Driver doesn't touch PBF register. 62262306a36Sopenharmony_ci */ 62362306a36Sopenharmony_ci#define PBF_DBG 0x043c 62462306a36Sopenharmony_ci 62562306a36Sopenharmony_ci/* 62662306a36Sopenharmony_ci * RF registers 62762306a36Sopenharmony_ci */ 62862306a36Sopenharmony_ci#define RF_CSR_CFG 0x0500 62962306a36Sopenharmony_ci#define RF_CSR_CFG_DATA FIELD32(0x000000ff) 63062306a36Sopenharmony_ci#define RF_CSR_CFG_REGNUM FIELD32(0x00003f00) 63162306a36Sopenharmony_ci#define RF_CSR_CFG_WRITE FIELD32(0x00010000) 63262306a36Sopenharmony_ci#define RF_CSR_CFG_BUSY FIELD32(0x00020000) 63362306a36Sopenharmony_ci 63462306a36Sopenharmony_ci/* 63562306a36Sopenharmony_ci * MT7620 RF registers (reversed order) 63662306a36Sopenharmony_ci */ 63762306a36Sopenharmony_ci#define RF_CSR_CFG_DATA_MT7620 FIELD32(0x0000ff00) 63862306a36Sopenharmony_ci#define RF_CSR_CFG_REGNUM_MT7620 FIELD32(0x03ff0000) 63962306a36Sopenharmony_ci#define RF_CSR_CFG_WRITE_MT7620 FIELD32(0x00000010) 64062306a36Sopenharmony_ci#define RF_CSR_CFG_BUSY_MT7620 FIELD32(0x00000001) 64162306a36Sopenharmony_ci 64262306a36Sopenharmony_ci/* undocumented registers for calibration of new MAC */ 64362306a36Sopenharmony_ci#define RF_CONTROL0 0x0518 64462306a36Sopenharmony_ci#define RF_BYPASS0 0x051c 64562306a36Sopenharmony_ci#define RF_CONTROL1 0x0520 64662306a36Sopenharmony_ci#define RF_BYPASS1 0x0524 64762306a36Sopenharmony_ci#define RF_CONTROL2 0x0528 64862306a36Sopenharmony_ci#define RF_BYPASS2 0x052c 64962306a36Sopenharmony_ci#define RF_CONTROL3 0x0530 65062306a36Sopenharmony_ci#define RF_BYPASS3 0x0534 65162306a36Sopenharmony_ci 65262306a36Sopenharmony_ci/* 65362306a36Sopenharmony_ci * EFUSE_CSR: RT30x0 EEPROM 65462306a36Sopenharmony_ci */ 65562306a36Sopenharmony_ci#define EFUSE_CTRL 0x0580 65662306a36Sopenharmony_ci#define EFUSE_CTRL_ADDRESS_IN FIELD32(0x03fe0000) 65762306a36Sopenharmony_ci#define EFUSE_CTRL_MODE FIELD32(0x000000c0) 65862306a36Sopenharmony_ci#define EFUSE_CTRL_KICK FIELD32(0x40000000) 65962306a36Sopenharmony_ci#define EFUSE_CTRL_PRESENT FIELD32(0x80000000) 66062306a36Sopenharmony_ci 66162306a36Sopenharmony_ci/* 66262306a36Sopenharmony_ci * EFUSE_DATA0 66362306a36Sopenharmony_ci */ 66462306a36Sopenharmony_ci#define EFUSE_DATA0 0x0590 66562306a36Sopenharmony_ci 66662306a36Sopenharmony_ci/* 66762306a36Sopenharmony_ci * EFUSE_DATA1 66862306a36Sopenharmony_ci */ 66962306a36Sopenharmony_ci#define EFUSE_DATA1 0x0594 67062306a36Sopenharmony_ci 67162306a36Sopenharmony_ci/* 67262306a36Sopenharmony_ci * EFUSE_DATA2 67362306a36Sopenharmony_ci */ 67462306a36Sopenharmony_ci#define EFUSE_DATA2 0x0598 67562306a36Sopenharmony_ci 67662306a36Sopenharmony_ci/* 67762306a36Sopenharmony_ci * EFUSE_DATA3 67862306a36Sopenharmony_ci */ 67962306a36Sopenharmony_ci#define EFUSE_DATA3 0x059c 68062306a36Sopenharmony_ci 68162306a36Sopenharmony_ci/* 68262306a36Sopenharmony_ci * LDO_CFG0 68362306a36Sopenharmony_ci */ 68462306a36Sopenharmony_ci#define LDO_CFG0 0x05d4 68562306a36Sopenharmony_ci#define LDO_CFG0_DELAY3 FIELD32(0x000000ff) 68662306a36Sopenharmony_ci#define LDO_CFG0_DELAY2 FIELD32(0x0000ff00) 68762306a36Sopenharmony_ci#define LDO_CFG0_DELAY1 FIELD32(0x00ff0000) 68862306a36Sopenharmony_ci#define LDO_CFG0_BGSEL FIELD32(0x03000000) 68962306a36Sopenharmony_ci#define LDO_CFG0_LDO_CORE_VLEVEL FIELD32(0x1c000000) 69062306a36Sopenharmony_ci#define LD0_CFG0_LDO25_LEVEL FIELD32(0x60000000) 69162306a36Sopenharmony_ci#define LDO_CFG0_LDO25_LARGEA FIELD32(0x80000000) 69262306a36Sopenharmony_ci 69362306a36Sopenharmony_ci/* 69462306a36Sopenharmony_ci * GPIO_SWITCH 69562306a36Sopenharmony_ci */ 69662306a36Sopenharmony_ci#define GPIO_SWITCH 0x05dc 69762306a36Sopenharmony_ci#define GPIO_SWITCH_0 FIELD32(0x00000001) 69862306a36Sopenharmony_ci#define GPIO_SWITCH_1 FIELD32(0x00000002) 69962306a36Sopenharmony_ci#define GPIO_SWITCH_2 FIELD32(0x00000004) 70062306a36Sopenharmony_ci#define GPIO_SWITCH_3 FIELD32(0x00000008) 70162306a36Sopenharmony_ci#define GPIO_SWITCH_4 FIELD32(0x00000010) 70262306a36Sopenharmony_ci#define GPIO_SWITCH_5 FIELD32(0x00000020) 70362306a36Sopenharmony_ci#define GPIO_SWITCH_6 FIELD32(0x00000040) 70462306a36Sopenharmony_ci#define GPIO_SWITCH_7 FIELD32(0x00000080) 70562306a36Sopenharmony_ci 70662306a36Sopenharmony_ci/* 70762306a36Sopenharmony_ci * FIXME: where the DEBUG_INDEX name come from? 70862306a36Sopenharmony_ci */ 70962306a36Sopenharmony_ci#define MAC_DEBUG_INDEX 0x05e8 71062306a36Sopenharmony_ci#define MAC_DEBUG_INDEX_XTAL FIELD32(0x80000000) 71162306a36Sopenharmony_ci 71262306a36Sopenharmony_ci/* 71362306a36Sopenharmony_ci * MAC Control/Status Registers(CSR). 71462306a36Sopenharmony_ci * Some values are set in TU, whereas 1 TU == 1024 us. 71562306a36Sopenharmony_ci */ 71662306a36Sopenharmony_ci 71762306a36Sopenharmony_ci/* 71862306a36Sopenharmony_ci * MAC_CSR0: ASIC revision number. 71962306a36Sopenharmony_ci * ASIC_REV: 0 72062306a36Sopenharmony_ci * ASIC_VER: 2860 or 2870 72162306a36Sopenharmony_ci */ 72262306a36Sopenharmony_ci#define MAC_CSR0 0x1000 72362306a36Sopenharmony_ci#define MAC_CSR0_REVISION FIELD32(0x0000ffff) 72462306a36Sopenharmony_ci#define MAC_CSR0_CHIPSET FIELD32(0xffff0000) 72562306a36Sopenharmony_ci 72662306a36Sopenharmony_ci/* 72762306a36Sopenharmony_ci * MAC_SYS_CTRL: 72862306a36Sopenharmony_ci */ 72962306a36Sopenharmony_ci#define MAC_SYS_CTRL 0x1004 73062306a36Sopenharmony_ci#define MAC_SYS_CTRL_RESET_CSR FIELD32(0x00000001) 73162306a36Sopenharmony_ci#define MAC_SYS_CTRL_RESET_BBP FIELD32(0x00000002) 73262306a36Sopenharmony_ci#define MAC_SYS_CTRL_ENABLE_TX FIELD32(0x00000004) 73362306a36Sopenharmony_ci#define MAC_SYS_CTRL_ENABLE_RX FIELD32(0x00000008) 73462306a36Sopenharmony_ci#define MAC_SYS_CTRL_CONTINUOUS_TX FIELD32(0x00000010) 73562306a36Sopenharmony_ci#define MAC_SYS_CTRL_LOOPBACK FIELD32(0x00000020) 73662306a36Sopenharmony_ci#define MAC_SYS_CTRL_WLAN_HALT FIELD32(0x00000040) 73762306a36Sopenharmony_ci#define MAC_SYS_CTRL_RX_TIMESTAMP FIELD32(0x00000080) 73862306a36Sopenharmony_ci 73962306a36Sopenharmony_ci/* 74062306a36Sopenharmony_ci * MAC_ADDR_DW0: STA MAC register 0 74162306a36Sopenharmony_ci */ 74262306a36Sopenharmony_ci#define MAC_ADDR_DW0 0x1008 74362306a36Sopenharmony_ci#define MAC_ADDR_DW0_BYTE0 FIELD32(0x000000ff) 74462306a36Sopenharmony_ci#define MAC_ADDR_DW0_BYTE1 FIELD32(0x0000ff00) 74562306a36Sopenharmony_ci#define MAC_ADDR_DW0_BYTE2 FIELD32(0x00ff0000) 74662306a36Sopenharmony_ci#define MAC_ADDR_DW0_BYTE3 FIELD32(0xff000000) 74762306a36Sopenharmony_ci 74862306a36Sopenharmony_ci/* 74962306a36Sopenharmony_ci * MAC_ADDR_DW1: STA MAC register 1 75062306a36Sopenharmony_ci * UNICAST_TO_ME_MASK: 75162306a36Sopenharmony_ci * Used to mask off bits from byte 5 of the MAC address 75262306a36Sopenharmony_ci * to determine the UNICAST_TO_ME bit for RX frames. 75362306a36Sopenharmony_ci * The full mask is complemented by BSS_ID_MASK: 75462306a36Sopenharmony_ci * MASK = BSS_ID_MASK & UNICAST_TO_ME_MASK 75562306a36Sopenharmony_ci */ 75662306a36Sopenharmony_ci#define MAC_ADDR_DW1 0x100c 75762306a36Sopenharmony_ci#define MAC_ADDR_DW1_BYTE4 FIELD32(0x000000ff) 75862306a36Sopenharmony_ci#define MAC_ADDR_DW1_BYTE5 FIELD32(0x0000ff00) 75962306a36Sopenharmony_ci#define MAC_ADDR_DW1_UNICAST_TO_ME_MASK FIELD32(0x00ff0000) 76062306a36Sopenharmony_ci 76162306a36Sopenharmony_ci/* 76262306a36Sopenharmony_ci * MAC_BSSID_DW0: BSSID register 0 76362306a36Sopenharmony_ci */ 76462306a36Sopenharmony_ci#define MAC_BSSID_DW0 0x1010 76562306a36Sopenharmony_ci#define MAC_BSSID_DW0_BYTE0 FIELD32(0x000000ff) 76662306a36Sopenharmony_ci#define MAC_BSSID_DW0_BYTE1 FIELD32(0x0000ff00) 76762306a36Sopenharmony_ci#define MAC_BSSID_DW0_BYTE2 FIELD32(0x00ff0000) 76862306a36Sopenharmony_ci#define MAC_BSSID_DW0_BYTE3 FIELD32(0xff000000) 76962306a36Sopenharmony_ci 77062306a36Sopenharmony_ci/* 77162306a36Sopenharmony_ci * MAC_BSSID_DW1: BSSID register 1 77262306a36Sopenharmony_ci * BSS_ID_MASK: 77362306a36Sopenharmony_ci * 0: 1-BSSID mode (BSS index = 0) 77462306a36Sopenharmony_ci * 1: 2-BSSID mode (BSS index: Byte5, bit 0) 77562306a36Sopenharmony_ci * 2: 4-BSSID mode (BSS index: byte5, bit 0 - 1) 77662306a36Sopenharmony_ci * 3: 8-BSSID mode (BSS index: byte5, bit 0 - 2) 77762306a36Sopenharmony_ci * This mask is used to mask off bits 0, 1 and 2 of byte 5 of the 77862306a36Sopenharmony_ci * BSSID. This will make sure that those bits will be ignored 77962306a36Sopenharmony_ci * when determining the MY_BSS of RX frames. 78062306a36Sopenharmony_ci */ 78162306a36Sopenharmony_ci#define MAC_BSSID_DW1 0x1014 78262306a36Sopenharmony_ci#define MAC_BSSID_DW1_BYTE4 FIELD32(0x000000ff) 78362306a36Sopenharmony_ci#define MAC_BSSID_DW1_BYTE5 FIELD32(0x0000ff00) 78462306a36Sopenharmony_ci#define MAC_BSSID_DW1_BSS_ID_MASK FIELD32(0x00030000) 78562306a36Sopenharmony_ci#define MAC_BSSID_DW1_BSS_BCN_NUM FIELD32(0x001c0000) 78662306a36Sopenharmony_ci 78762306a36Sopenharmony_ci/* 78862306a36Sopenharmony_ci * MAX_LEN_CFG: Maximum frame length register. 78962306a36Sopenharmony_ci * MAX_MPDU: rt2860b max 16k bytes 79062306a36Sopenharmony_ci * MAX_PSDU: Maximum PSDU length 79162306a36Sopenharmony_ci * (power factor) 0:2^13, 1:2^14, 2:2^15, 3:2^16 79262306a36Sopenharmony_ci */ 79362306a36Sopenharmony_ci#define MAX_LEN_CFG 0x1018 79462306a36Sopenharmony_ci#define MAX_LEN_CFG_MAX_MPDU FIELD32(0x00000fff) 79562306a36Sopenharmony_ci#define MAX_LEN_CFG_MAX_PSDU FIELD32(0x00003000) 79662306a36Sopenharmony_ci#define MAX_LEN_CFG_MIN_PSDU FIELD32(0x0000c000) 79762306a36Sopenharmony_ci#define MAX_LEN_CFG_MIN_MPDU FIELD32(0x000f0000) 79862306a36Sopenharmony_ci 79962306a36Sopenharmony_ci/* 80062306a36Sopenharmony_ci * BBP_CSR_CFG: BBP serial control register 80162306a36Sopenharmony_ci * VALUE: Register value to program into BBP 80262306a36Sopenharmony_ci * REG_NUM: Selected BBP register 80362306a36Sopenharmony_ci * READ_CONTROL: 0 write BBP, 1 read BBP 80462306a36Sopenharmony_ci * BUSY: ASIC is busy executing BBP commands 80562306a36Sopenharmony_ci * BBP_PAR_DUR: 0 4 MAC clocks, 1 8 MAC clocks 80662306a36Sopenharmony_ci * BBP_RW_MODE: 0 serial, 1 parallel 80762306a36Sopenharmony_ci */ 80862306a36Sopenharmony_ci#define BBP_CSR_CFG 0x101c 80962306a36Sopenharmony_ci#define BBP_CSR_CFG_VALUE FIELD32(0x000000ff) 81062306a36Sopenharmony_ci#define BBP_CSR_CFG_REGNUM FIELD32(0x0000ff00) 81162306a36Sopenharmony_ci#define BBP_CSR_CFG_READ_CONTROL FIELD32(0x00010000) 81262306a36Sopenharmony_ci#define BBP_CSR_CFG_BUSY FIELD32(0x00020000) 81362306a36Sopenharmony_ci#define BBP_CSR_CFG_BBP_PAR_DUR FIELD32(0x00040000) 81462306a36Sopenharmony_ci#define BBP_CSR_CFG_BBP_RW_MODE FIELD32(0x00080000) 81562306a36Sopenharmony_ci 81662306a36Sopenharmony_ci/* 81762306a36Sopenharmony_ci * RF_CSR_CFG0: RF control register 81862306a36Sopenharmony_ci * REGID_AND_VALUE: Register value to program into RF 81962306a36Sopenharmony_ci * BITWIDTH: Selected RF register 82062306a36Sopenharmony_ci * STANDBYMODE: 0 high when standby, 1 low when standby 82162306a36Sopenharmony_ci * SEL: 0 RF_LE0 activate, 1 RF_LE1 activate 82262306a36Sopenharmony_ci * BUSY: ASIC is busy executing RF commands 82362306a36Sopenharmony_ci */ 82462306a36Sopenharmony_ci#define RF_CSR_CFG0 0x1020 82562306a36Sopenharmony_ci#define RF_CSR_CFG0_REGID_AND_VALUE FIELD32(0x00ffffff) 82662306a36Sopenharmony_ci#define RF_CSR_CFG0_BITWIDTH FIELD32(0x1f000000) 82762306a36Sopenharmony_ci#define RF_CSR_CFG0_REG_VALUE_BW FIELD32(0x1fffffff) 82862306a36Sopenharmony_ci#define RF_CSR_CFG0_STANDBYMODE FIELD32(0x20000000) 82962306a36Sopenharmony_ci#define RF_CSR_CFG0_SEL FIELD32(0x40000000) 83062306a36Sopenharmony_ci#define RF_CSR_CFG0_BUSY FIELD32(0x80000000) 83162306a36Sopenharmony_ci 83262306a36Sopenharmony_ci/* 83362306a36Sopenharmony_ci * RF_CSR_CFG1: RF control register 83462306a36Sopenharmony_ci * REGID_AND_VALUE: Register value to program into RF 83562306a36Sopenharmony_ci * RFGAP: Gap between BB_CONTROL_RF and RF_LE 83662306a36Sopenharmony_ci * 0: 3 system clock cycle (37.5usec) 83762306a36Sopenharmony_ci * 1: 5 system clock cycle (62.5usec) 83862306a36Sopenharmony_ci */ 83962306a36Sopenharmony_ci#define RF_CSR_CFG1 0x1024 84062306a36Sopenharmony_ci#define RF_CSR_CFG1_REGID_AND_VALUE FIELD32(0x00ffffff) 84162306a36Sopenharmony_ci#define RF_CSR_CFG1_RFGAP FIELD32(0x1f000000) 84262306a36Sopenharmony_ci 84362306a36Sopenharmony_ci/* 84462306a36Sopenharmony_ci * RF_CSR_CFG2: RF control register 84562306a36Sopenharmony_ci * VALUE: Register value to program into RF 84662306a36Sopenharmony_ci */ 84762306a36Sopenharmony_ci#define RF_CSR_CFG2 0x1028 84862306a36Sopenharmony_ci#define RF_CSR_CFG2_VALUE FIELD32(0x00ffffff) 84962306a36Sopenharmony_ci 85062306a36Sopenharmony_ci/* 85162306a36Sopenharmony_ci * LED_CFG: LED control 85262306a36Sopenharmony_ci * ON_PERIOD: LED active time (ms) during TX (only used for LED mode 1) 85362306a36Sopenharmony_ci * OFF_PERIOD: LED inactive time (ms) during TX (only used for LED mode 1) 85462306a36Sopenharmony_ci * SLOW_BLINK_PERIOD: LED blink interval in seconds (only used for LED mode 2) 85562306a36Sopenharmony_ci * color LED's: 85662306a36Sopenharmony_ci * 0: off 85762306a36Sopenharmony_ci * 1: blinking upon TX2 85862306a36Sopenharmony_ci * 2: periodic slow blinking 85962306a36Sopenharmony_ci * 3: always on 86062306a36Sopenharmony_ci * LED polarity: 86162306a36Sopenharmony_ci * 0: active low 86262306a36Sopenharmony_ci * 1: active high 86362306a36Sopenharmony_ci */ 86462306a36Sopenharmony_ci#define LED_CFG 0x102c 86562306a36Sopenharmony_ci#define LED_CFG_ON_PERIOD FIELD32(0x000000ff) 86662306a36Sopenharmony_ci#define LED_CFG_OFF_PERIOD FIELD32(0x0000ff00) 86762306a36Sopenharmony_ci#define LED_CFG_SLOW_BLINK_PERIOD FIELD32(0x003f0000) 86862306a36Sopenharmony_ci#define LED_CFG_R_LED_MODE FIELD32(0x03000000) 86962306a36Sopenharmony_ci#define LED_CFG_G_LED_MODE FIELD32(0x0c000000) 87062306a36Sopenharmony_ci#define LED_CFG_Y_LED_MODE FIELD32(0x30000000) 87162306a36Sopenharmony_ci#define LED_CFG_LED_POLAR FIELD32(0x40000000) 87262306a36Sopenharmony_ci 87362306a36Sopenharmony_ci/* 87462306a36Sopenharmony_ci * AMPDU_BA_WINSIZE: Force BlockAck window size 87562306a36Sopenharmony_ci * FORCE_WINSIZE_ENABLE: 87662306a36Sopenharmony_ci * 0: Disable forcing of BlockAck window size 87762306a36Sopenharmony_ci * 1: Enable forcing of BlockAck window size, overwrites values BlockAck 87862306a36Sopenharmony_ci * window size values in the TXWI 87962306a36Sopenharmony_ci * FORCE_WINSIZE: BlockAck window size 88062306a36Sopenharmony_ci */ 88162306a36Sopenharmony_ci#define AMPDU_BA_WINSIZE 0x1040 88262306a36Sopenharmony_ci#define AMPDU_BA_WINSIZE_FORCE_WINSIZE_ENABLE FIELD32(0x00000020) 88362306a36Sopenharmony_ci#define AMPDU_BA_WINSIZE_FORCE_WINSIZE FIELD32(0x0000001f) 88462306a36Sopenharmony_ci 88562306a36Sopenharmony_ci/* 88662306a36Sopenharmony_ci * XIFS_TIME_CFG: MAC timing 88762306a36Sopenharmony_ci * CCKM_SIFS_TIME: unit 1us. Applied after CCK RX/TX 88862306a36Sopenharmony_ci * OFDM_SIFS_TIME: unit 1us. Applied after OFDM RX/TX 88962306a36Sopenharmony_ci * OFDM_XIFS_TIME: unit 1us. Applied after OFDM RX 89062306a36Sopenharmony_ci * when MAC doesn't reference BBP signal BBRXEND 89162306a36Sopenharmony_ci * EIFS: unit 1us 89262306a36Sopenharmony_ci * BB_RXEND_ENABLE: reference RXEND signal to begin XIFS defer 89362306a36Sopenharmony_ci * 89462306a36Sopenharmony_ci */ 89562306a36Sopenharmony_ci#define XIFS_TIME_CFG 0x1100 89662306a36Sopenharmony_ci#define XIFS_TIME_CFG_CCKM_SIFS_TIME FIELD32(0x000000ff) 89762306a36Sopenharmony_ci#define XIFS_TIME_CFG_OFDM_SIFS_TIME FIELD32(0x0000ff00) 89862306a36Sopenharmony_ci#define XIFS_TIME_CFG_OFDM_XIFS_TIME FIELD32(0x000f0000) 89962306a36Sopenharmony_ci#define XIFS_TIME_CFG_EIFS FIELD32(0x1ff00000) 90062306a36Sopenharmony_ci#define XIFS_TIME_CFG_BB_RXEND_ENABLE FIELD32(0x20000000) 90162306a36Sopenharmony_ci 90262306a36Sopenharmony_ci/* 90362306a36Sopenharmony_ci * BKOFF_SLOT_CFG: 90462306a36Sopenharmony_ci */ 90562306a36Sopenharmony_ci#define BKOFF_SLOT_CFG 0x1104 90662306a36Sopenharmony_ci#define BKOFF_SLOT_CFG_SLOT_TIME FIELD32(0x000000ff) 90762306a36Sopenharmony_ci#define BKOFF_SLOT_CFG_CC_DELAY_TIME FIELD32(0x0000ff00) 90862306a36Sopenharmony_ci 90962306a36Sopenharmony_ci/* 91062306a36Sopenharmony_ci * NAV_TIME_CFG: 91162306a36Sopenharmony_ci */ 91262306a36Sopenharmony_ci#define NAV_TIME_CFG 0x1108 91362306a36Sopenharmony_ci#define NAV_TIME_CFG_SIFS FIELD32(0x000000ff) 91462306a36Sopenharmony_ci#define NAV_TIME_CFG_SLOT_TIME FIELD32(0x0000ff00) 91562306a36Sopenharmony_ci#define NAV_TIME_CFG_EIFS FIELD32(0x01ff0000) 91662306a36Sopenharmony_ci#define NAV_TIME_ZERO_SIFS FIELD32(0x02000000) 91762306a36Sopenharmony_ci 91862306a36Sopenharmony_ci/* 91962306a36Sopenharmony_ci * CH_TIME_CFG: count as channel busy 92062306a36Sopenharmony_ci * EIFS_BUSY: Count EIFS as channel busy 92162306a36Sopenharmony_ci * NAV_BUSY: Count NAS as channel busy 92262306a36Sopenharmony_ci * RX_BUSY: Count RX as channel busy 92362306a36Sopenharmony_ci * TX_BUSY: Count TX as channel busy 92462306a36Sopenharmony_ci * TMR_EN: Enable channel statistics timer 92562306a36Sopenharmony_ci */ 92662306a36Sopenharmony_ci#define CH_TIME_CFG 0x110c 92762306a36Sopenharmony_ci#define CH_TIME_CFG_EIFS_BUSY FIELD32(0x00000010) 92862306a36Sopenharmony_ci#define CH_TIME_CFG_NAV_BUSY FIELD32(0x00000008) 92962306a36Sopenharmony_ci#define CH_TIME_CFG_RX_BUSY FIELD32(0x00000004) 93062306a36Sopenharmony_ci#define CH_TIME_CFG_TX_BUSY FIELD32(0x00000002) 93162306a36Sopenharmony_ci#define CH_TIME_CFG_TMR_EN FIELD32(0x00000001) 93262306a36Sopenharmony_ci 93362306a36Sopenharmony_ci/* 93462306a36Sopenharmony_ci * PBF_LIFE_TIMER: TX/RX MPDU timestamp timer (free run) Unit: 1us 93562306a36Sopenharmony_ci */ 93662306a36Sopenharmony_ci#define PBF_LIFE_TIMER 0x1110 93762306a36Sopenharmony_ci 93862306a36Sopenharmony_ci/* 93962306a36Sopenharmony_ci * BCN_TIME_CFG: 94062306a36Sopenharmony_ci * BEACON_INTERVAL: in unit of 1/16 TU 94162306a36Sopenharmony_ci * TSF_TICKING: Enable TSF auto counting 94262306a36Sopenharmony_ci * TSF_SYNC: Enable TSF sync, 00: disable, 01: infra mode, 10: ad-hoc mode 94362306a36Sopenharmony_ci * BEACON_GEN: Enable beacon generator 94462306a36Sopenharmony_ci */ 94562306a36Sopenharmony_ci#define BCN_TIME_CFG 0x1114 94662306a36Sopenharmony_ci#define BCN_TIME_CFG_BEACON_INTERVAL FIELD32(0x0000ffff) 94762306a36Sopenharmony_ci#define BCN_TIME_CFG_TSF_TICKING FIELD32(0x00010000) 94862306a36Sopenharmony_ci#define BCN_TIME_CFG_TSF_SYNC FIELD32(0x00060000) 94962306a36Sopenharmony_ci#define BCN_TIME_CFG_TBTT_ENABLE FIELD32(0x00080000) 95062306a36Sopenharmony_ci#define BCN_TIME_CFG_BEACON_GEN FIELD32(0x00100000) 95162306a36Sopenharmony_ci#define BCN_TIME_CFG_TX_TIME_COMPENSATE FIELD32(0xf0000000) 95262306a36Sopenharmony_ci 95362306a36Sopenharmony_ci/* 95462306a36Sopenharmony_ci * TBTT_SYNC_CFG: 95562306a36Sopenharmony_ci * BCN_AIFSN: Beacon AIFSN after TBTT interrupt in slots 95662306a36Sopenharmony_ci * BCN_CWMIN: Beacon CWMin after TBTT interrupt in slots 95762306a36Sopenharmony_ci */ 95862306a36Sopenharmony_ci#define TBTT_SYNC_CFG 0x1118 95962306a36Sopenharmony_ci#define TBTT_SYNC_CFG_TBTT_ADJUST FIELD32(0x000000ff) 96062306a36Sopenharmony_ci#define TBTT_SYNC_CFG_BCN_EXP_WIN FIELD32(0x0000ff00) 96162306a36Sopenharmony_ci#define TBTT_SYNC_CFG_BCN_AIFSN FIELD32(0x000f0000) 96262306a36Sopenharmony_ci#define TBTT_SYNC_CFG_BCN_CWMIN FIELD32(0x00f00000) 96362306a36Sopenharmony_ci 96462306a36Sopenharmony_ci/* 96562306a36Sopenharmony_ci * TSF_TIMER_DW0: Local lsb TSF timer, read-only 96662306a36Sopenharmony_ci */ 96762306a36Sopenharmony_ci#define TSF_TIMER_DW0 0x111c 96862306a36Sopenharmony_ci#define TSF_TIMER_DW0_LOW_WORD FIELD32(0xffffffff) 96962306a36Sopenharmony_ci 97062306a36Sopenharmony_ci/* 97162306a36Sopenharmony_ci * TSF_TIMER_DW1: Local msb TSF timer, read-only 97262306a36Sopenharmony_ci */ 97362306a36Sopenharmony_ci#define TSF_TIMER_DW1 0x1120 97462306a36Sopenharmony_ci#define TSF_TIMER_DW1_HIGH_WORD FIELD32(0xffffffff) 97562306a36Sopenharmony_ci 97662306a36Sopenharmony_ci/* 97762306a36Sopenharmony_ci * TBTT_TIMER: TImer remains till next TBTT, read-only 97862306a36Sopenharmony_ci */ 97962306a36Sopenharmony_ci#define TBTT_TIMER 0x1124 98062306a36Sopenharmony_ci 98162306a36Sopenharmony_ci/* 98262306a36Sopenharmony_ci * INT_TIMER_CFG: timer configuration 98362306a36Sopenharmony_ci * PRE_TBTT_TIMER: leadtime to tbtt for pretbtt interrupt in units of 1/16 TU 98462306a36Sopenharmony_ci * GP_TIMER: period of general purpose timer in units of 1/16 TU 98562306a36Sopenharmony_ci */ 98662306a36Sopenharmony_ci#define INT_TIMER_CFG 0x1128 98762306a36Sopenharmony_ci#define INT_TIMER_CFG_PRE_TBTT_TIMER FIELD32(0x0000ffff) 98862306a36Sopenharmony_ci#define INT_TIMER_CFG_GP_TIMER FIELD32(0xffff0000) 98962306a36Sopenharmony_ci 99062306a36Sopenharmony_ci/* 99162306a36Sopenharmony_ci * INT_TIMER_EN: GP-timer and pre-tbtt Int enable 99262306a36Sopenharmony_ci */ 99362306a36Sopenharmony_ci#define INT_TIMER_EN 0x112c 99462306a36Sopenharmony_ci#define INT_TIMER_EN_PRE_TBTT_TIMER FIELD32(0x00000001) 99562306a36Sopenharmony_ci#define INT_TIMER_EN_GP_TIMER FIELD32(0x00000002) 99662306a36Sopenharmony_ci 99762306a36Sopenharmony_ci/* 99862306a36Sopenharmony_ci * CH_IDLE_STA: channel idle time (in us) 99962306a36Sopenharmony_ci */ 100062306a36Sopenharmony_ci#define CH_IDLE_STA 0x1130 100162306a36Sopenharmony_ci 100262306a36Sopenharmony_ci/* 100362306a36Sopenharmony_ci * CH_BUSY_STA: channel busy time on primary channel (in us) 100462306a36Sopenharmony_ci */ 100562306a36Sopenharmony_ci#define CH_BUSY_STA 0x1134 100662306a36Sopenharmony_ci 100762306a36Sopenharmony_ci/* 100862306a36Sopenharmony_ci * CH_BUSY_STA_SEC: channel busy time on secondary channel in HT40 mode (in us) 100962306a36Sopenharmony_ci */ 101062306a36Sopenharmony_ci#define CH_BUSY_STA_SEC 0x1138 101162306a36Sopenharmony_ci 101262306a36Sopenharmony_ci/* 101362306a36Sopenharmony_ci * MAC_STATUS_CFG: 101462306a36Sopenharmony_ci * BBP_RF_BUSY: When set to 0, BBP and RF are stable. 101562306a36Sopenharmony_ci * if 1 or higher one of the 2 registers is busy. 101662306a36Sopenharmony_ci */ 101762306a36Sopenharmony_ci#define MAC_STATUS_CFG 0x1200 101862306a36Sopenharmony_ci#define MAC_STATUS_CFG_BBP_RF_BUSY FIELD32(0x00000003) 101962306a36Sopenharmony_ci#define MAC_STATUS_CFG_BBP_RF_BUSY_TX FIELD32(0x00000001) 102062306a36Sopenharmony_ci#define MAC_STATUS_CFG_BBP_RF_BUSY_RX FIELD32(0x00000002) 102162306a36Sopenharmony_ci 102262306a36Sopenharmony_ci/* 102362306a36Sopenharmony_ci * PWR_PIN_CFG: 102462306a36Sopenharmony_ci */ 102562306a36Sopenharmony_ci#define PWR_PIN_CFG 0x1204 102662306a36Sopenharmony_ci 102762306a36Sopenharmony_ci/* 102862306a36Sopenharmony_ci * AUTOWAKEUP_CFG: Manual power control / status register 102962306a36Sopenharmony_ci * TBCN_BEFORE_WAKE: ForceWake has high privilege than PutToSleep when both set 103062306a36Sopenharmony_ci * AUTOWAKE: 0:sleep, 1:awake 103162306a36Sopenharmony_ci */ 103262306a36Sopenharmony_ci#define AUTOWAKEUP_CFG 0x1208 103362306a36Sopenharmony_ci#define AUTOWAKEUP_CFG_AUTO_LEAD_TIME FIELD32(0x000000ff) 103462306a36Sopenharmony_ci#define AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE FIELD32(0x00007f00) 103562306a36Sopenharmony_ci#define AUTOWAKEUP_CFG_AUTOWAKE FIELD32(0x00008000) 103662306a36Sopenharmony_ci 103762306a36Sopenharmony_ci/* 103862306a36Sopenharmony_ci * MIMO_PS_CFG: MIMO Power-save Configuration 103962306a36Sopenharmony_ci */ 104062306a36Sopenharmony_ci#define MIMO_PS_CFG 0x1210 104162306a36Sopenharmony_ci#define MIMO_PS_CFG_MMPS_BB_EN FIELD32(0x00000001) 104262306a36Sopenharmony_ci#define MIMO_PS_CFG_MMPS_RX_ANT_NUM FIELD32(0x00000006) 104362306a36Sopenharmony_ci#define MIMO_PS_CFG_MMPS_RF_EN FIELD32(0x00000008) 104462306a36Sopenharmony_ci#define MIMO_PS_CFG_RX_STBY_POL FIELD32(0x00000010) 104562306a36Sopenharmony_ci#define MIMO_PS_CFG_RX_RX_STBY0 FIELD32(0x00000020) 104662306a36Sopenharmony_ci 104762306a36Sopenharmony_ci/* 104862306a36Sopenharmony_ci * EDCA_AC0_CFG: 104962306a36Sopenharmony_ci */ 105062306a36Sopenharmony_ci#define EDCA_AC0_CFG 0x1300 105162306a36Sopenharmony_ci#define EDCA_AC0_CFG_TX_OP FIELD32(0x000000ff) 105262306a36Sopenharmony_ci#define EDCA_AC0_CFG_AIFSN FIELD32(0x00000f00) 105362306a36Sopenharmony_ci#define EDCA_AC0_CFG_CWMIN FIELD32(0x0000f000) 105462306a36Sopenharmony_ci#define EDCA_AC0_CFG_CWMAX FIELD32(0x000f0000) 105562306a36Sopenharmony_ci 105662306a36Sopenharmony_ci/* 105762306a36Sopenharmony_ci * EDCA_AC1_CFG: 105862306a36Sopenharmony_ci */ 105962306a36Sopenharmony_ci#define EDCA_AC1_CFG 0x1304 106062306a36Sopenharmony_ci#define EDCA_AC1_CFG_TX_OP FIELD32(0x000000ff) 106162306a36Sopenharmony_ci#define EDCA_AC1_CFG_AIFSN FIELD32(0x00000f00) 106262306a36Sopenharmony_ci#define EDCA_AC1_CFG_CWMIN FIELD32(0x0000f000) 106362306a36Sopenharmony_ci#define EDCA_AC1_CFG_CWMAX FIELD32(0x000f0000) 106462306a36Sopenharmony_ci 106562306a36Sopenharmony_ci/* 106662306a36Sopenharmony_ci * EDCA_AC2_CFG: 106762306a36Sopenharmony_ci */ 106862306a36Sopenharmony_ci#define EDCA_AC2_CFG 0x1308 106962306a36Sopenharmony_ci#define EDCA_AC2_CFG_TX_OP FIELD32(0x000000ff) 107062306a36Sopenharmony_ci#define EDCA_AC2_CFG_AIFSN FIELD32(0x00000f00) 107162306a36Sopenharmony_ci#define EDCA_AC2_CFG_CWMIN FIELD32(0x0000f000) 107262306a36Sopenharmony_ci#define EDCA_AC2_CFG_CWMAX FIELD32(0x000f0000) 107362306a36Sopenharmony_ci 107462306a36Sopenharmony_ci/* 107562306a36Sopenharmony_ci * EDCA_AC3_CFG: 107662306a36Sopenharmony_ci */ 107762306a36Sopenharmony_ci#define EDCA_AC3_CFG 0x130c 107862306a36Sopenharmony_ci#define EDCA_AC3_CFG_TX_OP FIELD32(0x000000ff) 107962306a36Sopenharmony_ci#define EDCA_AC3_CFG_AIFSN FIELD32(0x00000f00) 108062306a36Sopenharmony_ci#define EDCA_AC3_CFG_CWMIN FIELD32(0x0000f000) 108162306a36Sopenharmony_ci#define EDCA_AC3_CFG_CWMAX FIELD32(0x000f0000) 108262306a36Sopenharmony_ci 108362306a36Sopenharmony_ci/* 108462306a36Sopenharmony_ci * EDCA_TID_AC_MAP: 108562306a36Sopenharmony_ci */ 108662306a36Sopenharmony_ci#define EDCA_TID_AC_MAP 0x1310 108762306a36Sopenharmony_ci 108862306a36Sopenharmony_ci/* 108962306a36Sopenharmony_ci * TX_PWR_CFG: 109062306a36Sopenharmony_ci */ 109162306a36Sopenharmony_ci#define TX_PWR_CFG_RATE0 FIELD32(0x0000000f) 109262306a36Sopenharmony_ci#define TX_PWR_CFG_RATE1 FIELD32(0x000000f0) 109362306a36Sopenharmony_ci#define TX_PWR_CFG_RATE2 FIELD32(0x00000f00) 109462306a36Sopenharmony_ci#define TX_PWR_CFG_RATE3 FIELD32(0x0000f000) 109562306a36Sopenharmony_ci#define TX_PWR_CFG_RATE4 FIELD32(0x000f0000) 109662306a36Sopenharmony_ci#define TX_PWR_CFG_RATE5 FIELD32(0x00f00000) 109762306a36Sopenharmony_ci#define TX_PWR_CFG_RATE6 FIELD32(0x0f000000) 109862306a36Sopenharmony_ci#define TX_PWR_CFG_RATE7 FIELD32(0xf0000000) 109962306a36Sopenharmony_ci 110062306a36Sopenharmony_ci/* 110162306a36Sopenharmony_ci * TX_PWR_CFG_0: 110262306a36Sopenharmony_ci */ 110362306a36Sopenharmony_ci#define TX_PWR_CFG_0 0x1314 110462306a36Sopenharmony_ci#define TX_PWR_CFG_0_1MBS FIELD32(0x0000000f) 110562306a36Sopenharmony_ci#define TX_PWR_CFG_0_2MBS FIELD32(0x000000f0) 110662306a36Sopenharmony_ci#define TX_PWR_CFG_0_55MBS FIELD32(0x00000f00) 110762306a36Sopenharmony_ci#define TX_PWR_CFG_0_11MBS FIELD32(0x0000f000) 110862306a36Sopenharmony_ci#define TX_PWR_CFG_0_6MBS FIELD32(0x000f0000) 110962306a36Sopenharmony_ci#define TX_PWR_CFG_0_9MBS FIELD32(0x00f00000) 111062306a36Sopenharmony_ci#define TX_PWR_CFG_0_12MBS FIELD32(0x0f000000) 111162306a36Sopenharmony_ci#define TX_PWR_CFG_0_18MBS FIELD32(0xf0000000) 111262306a36Sopenharmony_ci/* bits for 3T devices */ 111362306a36Sopenharmony_ci#define TX_PWR_CFG_0_CCK1_CH0 FIELD32(0x0000000f) 111462306a36Sopenharmony_ci#define TX_PWR_CFG_0_CCK1_CH1 FIELD32(0x000000f0) 111562306a36Sopenharmony_ci#define TX_PWR_CFG_0_CCK5_CH0 FIELD32(0x00000f00) 111662306a36Sopenharmony_ci#define TX_PWR_CFG_0_CCK5_CH1 FIELD32(0x0000f000) 111762306a36Sopenharmony_ci#define TX_PWR_CFG_0_OFDM6_CH0 FIELD32(0x000f0000) 111862306a36Sopenharmony_ci#define TX_PWR_CFG_0_OFDM6_CH1 FIELD32(0x00f00000) 111962306a36Sopenharmony_ci#define TX_PWR_CFG_0_OFDM12_CH0 FIELD32(0x0f000000) 112062306a36Sopenharmony_ci#define TX_PWR_CFG_0_OFDM12_CH1 FIELD32(0xf0000000) 112162306a36Sopenharmony_ci/* bits for new 2T devices */ 112262306a36Sopenharmony_ci#define TX_PWR_CFG_0B_1MBS_2MBS FIELD32(0x000000ff) 112362306a36Sopenharmony_ci#define TX_PWR_CFG_0B_5MBS_11MBS FIELD32(0x0000ff00) 112462306a36Sopenharmony_ci#define TX_PWR_CFG_0B_6MBS_9MBS FIELD32(0x00ff0000) 112562306a36Sopenharmony_ci#define TX_PWR_CFG_0B_12MBS_18MBS FIELD32(0xff000000) 112662306a36Sopenharmony_ci 112762306a36Sopenharmony_ci 112862306a36Sopenharmony_ci/* 112962306a36Sopenharmony_ci * TX_PWR_CFG_1: 113062306a36Sopenharmony_ci */ 113162306a36Sopenharmony_ci#define TX_PWR_CFG_1 0x1318 113262306a36Sopenharmony_ci#define TX_PWR_CFG_1_24MBS FIELD32(0x0000000f) 113362306a36Sopenharmony_ci#define TX_PWR_CFG_1_36MBS FIELD32(0x000000f0) 113462306a36Sopenharmony_ci#define TX_PWR_CFG_1_48MBS FIELD32(0x00000f00) 113562306a36Sopenharmony_ci#define TX_PWR_CFG_1_54MBS FIELD32(0x0000f000) 113662306a36Sopenharmony_ci#define TX_PWR_CFG_1_MCS0 FIELD32(0x000f0000) 113762306a36Sopenharmony_ci#define TX_PWR_CFG_1_MCS1 FIELD32(0x00f00000) 113862306a36Sopenharmony_ci#define TX_PWR_CFG_1_MCS2 FIELD32(0x0f000000) 113962306a36Sopenharmony_ci#define TX_PWR_CFG_1_MCS3 FIELD32(0xf0000000) 114062306a36Sopenharmony_ci/* bits for 3T devices */ 114162306a36Sopenharmony_ci#define TX_PWR_CFG_1_OFDM24_CH0 FIELD32(0x0000000f) 114262306a36Sopenharmony_ci#define TX_PWR_CFG_1_OFDM24_CH1 FIELD32(0x000000f0) 114362306a36Sopenharmony_ci#define TX_PWR_CFG_1_OFDM48_CH0 FIELD32(0x00000f00) 114462306a36Sopenharmony_ci#define TX_PWR_CFG_1_OFDM48_CH1 FIELD32(0x0000f000) 114562306a36Sopenharmony_ci#define TX_PWR_CFG_1_MCS0_CH0 FIELD32(0x000f0000) 114662306a36Sopenharmony_ci#define TX_PWR_CFG_1_MCS0_CH1 FIELD32(0x00f00000) 114762306a36Sopenharmony_ci#define TX_PWR_CFG_1_MCS2_CH0 FIELD32(0x0f000000) 114862306a36Sopenharmony_ci#define TX_PWR_CFG_1_MCS2_CH1 FIELD32(0xf0000000) 114962306a36Sopenharmony_ci/* bits for new 2T devices */ 115062306a36Sopenharmony_ci#define TX_PWR_CFG_1B_24MBS_36MBS FIELD32(0x000000ff) 115162306a36Sopenharmony_ci#define TX_PWR_CFG_1B_48MBS FIELD32(0x0000ff00) 115262306a36Sopenharmony_ci#define TX_PWR_CFG_1B_MCS0_MCS1 FIELD32(0x00ff0000) 115362306a36Sopenharmony_ci#define TX_PWR_CFG_1B_MCS2_MCS3 FIELD32(0xff000000) 115462306a36Sopenharmony_ci 115562306a36Sopenharmony_ci/* 115662306a36Sopenharmony_ci * TX_PWR_CFG_2: 115762306a36Sopenharmony_ci */ 115862306a36Sopenharmony_ci#define TX_PWR_CFG_2 0x131c 115962306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS4 FIELD32(0x0000000f) 116062306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS5 FIELD32(0x000000f0) 116162306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS6 FIELD32(0x00000f00) 116262306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS7 FIELD32(0x0000f000) 116362306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS8 FIELD32(0x000f0000) 116462306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS9 FIELD32(0x00f00000) 116562306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS10 FIELD32(0x0f000000) 116662306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS11 FIELD32(0xf0000000) 116762306a36Sopenharmony_ci/* bits for 3T devices */ 116862306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS4_CH0 FIELD32(0x0000000f) 116962306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS4_CH1 FIELD32(0x000000f0) 117062306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS6_CH0 FIELD32(0x00000f00) 117162306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS6_CH1 FIELD32(0x0000f000) 117262306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS8_CH0 FIELD32(0x000f0000) 117362306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS8_CH1 FIELD32(0x00f00000) 117462306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS10_CH0 FIELD32(0x0f000000) 117562306a36Sopenharmony_ci#define TX_PWR_CFG_2_MCS10_CH1 FIELD32(0xf0000000) 117662306a36Sopenharmony_ci/* bits for new 2T devices */ 117762306a36Sopenharmony_ci#define TX_PWR_CFG_2B_MCS4_MCS5 FIELD32(0x000000ff) 117862306a36Sopenharmony_ci#define TX_PWR_CFG_2B_MCS6_MCS7 FIELD32(0x0000ff00) 117962306a36Sopenharmony_ci#define TX_PWR_CFG_2B_MCS8_MCS9 FIELD32(0x00ff0000) 118062306a36Sopenharmony_ci#define TX_PWR_CFG_2B_MCS10_MCS11 FIELD32(0xff000000) 118162306a36Sopenharmony_ci 118262306a36Sopenharmony_ci/* 118362306a36Sopenharmony_ci * TX_PWR_CFG_3: 118462306a36Sopenharmony_ci */ 118562306a36Sopenharmony_ci#define TX_PWR_CFG_3 0x1320 118662306a36Sopenharmony_ci#define TX_PWR_CFG_3_MCS12 FIELD32(0x0000000f) 118762306a36Sopenharmony_ci#define TX_PWR_CFG_3_MCS13 FIELD32(0x000000f0) 118862306a36Sopenharmony_ci#define TX_PWR_CFG_3_MCS14 FIELD32(0x00000f00) 118962306a36Sopenharmony_ci#define TX_PWR_CFG_3_MCS15 FIELD32(0x0000f000) 119062306a36Sopenharmony_ci#define TX_PWR_CFG_3_UNKNOWN1 FIELD32(0x000f0000) 119162306a36Sopenharmony_ci#define TX_PWR_CFG_3_UNKNOWN2 FIELD32(0x00f00000) 119262306a36Sopenharmony_ci#define TX_PWR_CFG_3_UNKNOWN3 FIELD32(0x0f000000) 119362306a36Sopenharmony_ci#define TX_PWR_CFG_3_UNKNOWN4 FIELD32(0xf0000000) 119462306a36Sopenharmony_ci/* bits for 3T devices */ 119562306a36Sopenharmony_ci#define TX_PWR_CFG_3_MCS12_CH0 FIELD32(0x0000000f) 119662306a36Sopenharmony_ci#define TX_PWR_CFG_3_MCS12_CH1 FIELD32(0x000000f0) 119762306a36Sopenharmony_ci#define TX_PWR_CFG_3_MCS14_CH0 FIELD32(0x00000f00) 119862306a36Sopenharmony_ci#define TX_PWR_CFG_3_MCS14_CH1 FIELD32(0x0000f000) 119962306a36Sopenharmony_ci#define TX_PWR_CFG_3_STBC0_CH0 FIELD32(0x000f0000) 120062306a36Sopenharmony_ci#define TX_PWR_CFG_3_STBC0_CH1 FIELD32(0x00f00000) 120162306a36Sopenharmony_ci#define TX_PWR_CFG_3_STBC2_CH0 FIELD32(0x0f000000) 120262306a36Sopenharmony_ci#define TX_PWR_CFG_3_STBC2_CH1 FIELD32(0xf0000000) 120362306a36Sopenharmony_ci/* bits for new 2T devices */ 120462306a36Sopenharmony_ci#define TX_PWR_CFG_3B_MCS12_MCS13 FIELD32(0x000000ff) 120562306a36Sopenharmony_ci#define TX_PWR_CFG_3B_MCS14 FIELD32(0x0000ff00) 120662306a36Sopenharmony_ci#define TX_PWR_CFG_3B_STBC_MCS0_MCS1 FIELD32(0x00ff0000) 120762306a36Sopenharmony_ci#define TX_PWR_CFG_3B_STBC_MCS2_MSC3 FIELD32(0xff000000) 120862306a36Sopenharmony_ci 120962306a36Sopenharmony_ci/* 121062306a36Sopenharmony_ci * TX_PWR_CFG_4: 121162306a36Sopenharmony_ci */ 121262306a36Sopenharmony_ci#define TX_PWR_CFG_4 0x1324 121362306a36Sopenharmony_ci#define TX_PWR_CFG_4_UNKNOWN5 FIELD32(0x0000000f) 121462306a36Sopenharmony_ci#define TX_PWR_CFG_4_UNKNOWN6 FIELD32(0x000000f0) 121562306a36Sopenharmony_ci#define TX_PWR_CFG_4_UNKNOWN7 FIELD32(0x00000f00) 121662306a36Sopenharmony_ci#define TX_PWR_CFG_4_UNKNOWN8 FIELD32(0x0000f000) 121762306a36Sopenharmony_ci/* bits for 3T devices */ 121862306a36Sopenharmony_ci#define TX_PWR_CFG_4_STBC4_CH0 FIELD32(0x0000000f) 121962306a36Sopenharmony_ci#define TX_PWR_CFG_4_STBC4_CH1 FIELD32(0x000000f0) 122062306a36Sopenharmony_ci#define TX_PWR_CFG_4_STBC6_CH0 FIELD32(0x00000f00) 122162306a36Sopenharmony_ci#define TX_PWR_CFG_4_STBC6_CH1 FIELD32(0x0000f000) 122262306a36Sopenharmony_ci/* bits for new 2T devices */ 122362306a36Sopenharmony_ci#define TX_PWR_CFG_4B_STBC_MCS4_MCS5 FIELD32(0x000000ff) 122462306a36Sopenharmony_ci#define TX_PWR_CFG_4B_STBC_MCS6 FIELD32(0x0000ff00) 122562306a36Sopenharmony_ci 122662306a36Sopenharmony_ci/* 122762306a36Sopenharmony_ci * TX_PIN_CFG: 122862306a36Sopenharmony_ci */ 122962306a36Sopenharmony_ci#define TX_PIN_CFG 0x1328 123062306a36Sopenharmony_ci#define TX_PIN_CFG_PA_PE_DISABLE 0xfcfffff0 123162306a36Sopenharmony_ci#define TX_PIN_CFG_PA_PE_A0_EN FIELD32(0x00000001) 123262306a36Sopenharmony_ci#define TX_PIN_CFG_PA_PE_G0_EN FIELD32(0x00000002) 123362306a36Sopenharmony_ci#define TX_PIN_CFG_PA_PE_A1_EN FIELD32(0x00000004) 123462306a36Sopenharmony_ci#define TX_PIN_CFG_PA_PE_G1_EN FIELD32(0x00000008) 123562306a36Sopenharmony_ci#define TX_PIN_CFG_PA_PE_A0_POL FIELD32(0x00000010) 123662306a36Sopenharmony_ci#define TX_PIN_CFG_PA_PE_G0_POL FIELD32(0x00000020) 123762306a36Sopenharmony_ci#define TX_PIN_CFG_PA_PE_A1_POL FIELD32(0x00000040) 123862306a36Sopenharmony_ci#define TX_PIN_CFG_PA_PE_G1_POL FIELD32(0x00000080) 123962306a36Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_A0_EN FIELD32(0x00000100) 124062306a36Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_G0_EN FIELD32(0x00000200) 124162306a36Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_A1_EN FIELD32(0x00000400) 124262306a36Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_G1_EN FIELD32(0x00000800) 124362306a36Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_A0_POL FIELD32(0x00001000) 124462306a36Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_G0_POL FIELD32(0x00002000) 124562306a36Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_A1_POL FIELD32(0x00004000) 124662306a36Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_G1_POL FIELD32(0x00008000) 124762306a36Sopenharmony_ci#define TX_PIN_CFG_RFTR_EN FIELD32(0x00010000) 124862306a36Sopenharmony_ci#define TX_PIN_CFG_RFTR_POL FIELD32(0x00020000) 124962306a36Sopenharmony_ci#define TX_PIN_CFG_TRSW_EN FIELD32(0x00040000) 125062306a36Sopenharmony_ci#define TX_PIN_CFG_TRSW_POL FIELD32(0x00080000) 125162306a36Sopenharmony_ci#define TX_PIN_CFG_RFRX_EN FIELD32(0x00100000) 125262306a36Sopenharmony_ci#define TX_PIN_CFG_RFRX_POL FIELD32(0x00200000) 125362306a36Sopenharmony_ci#define TX_PIN_CFG_PA_PE_A2_EN FIELD32(0x01000000) 125462306a36Sopenharmony_ci#define TX_PIN_CFG_PA_PE_G2_EN FIELD32(0x02000000) 125562306a36Sopenharmony_ci#define TX_PIN_CFG_PA_PE_A2_POL FIELD32(0x04000000) 125662306a36Sopenharmony_ci#define TX_PIN_CFG_PA_PE_G2_POL FIELD32(0x08000000) 125762306a36Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_A2_EN FIELD32(0x10000000) 125862306a36Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_G2_EN FIELD32(0x20000000) 125962306a36Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_A2_POL FIELD32(0x40000000) 126062306a36Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_G2_POL FIELD32(0x80000000) 126162306a36Sopenharmony_ci 126262306a36Sopenharmony_ci/* 126362306a36Sopenharmony_ci * TX_BAND_CFG: 0x1 use upper 20MHz, 0x0 use lower 20MHz 126462306a36Sopenharmony_ci */ 126562306a36Sopenharmony_ci#define TX_BAND_CFG 0x132c 126662306a36Sopenharmony_ci#define TX_BAND_CFG_HT40_MINUS FIELD32(0x00000001) 126762306a36Sopenharmony_ci#define TX_BAND_CFG_A FIELD32(0x00000002) 126862306a36Sopenharmony_ci#define TX_BAND_CFG_BG FIELD32(0x00000004) 126962306a36Sopenharmony_ci 127062306a36Sopenharmony_ci/* 127162306a36Sopenharmony_ci * TX_SW_CFG0: 127262306a36Sopenharmony_ci */ 127362306a36Sopenharmony_ci#define TX_SW_CFG0 0x1330 127462306a36Sopenharmony_ci 127562306a36Sopenharmony_ci/* 127662306a36Sopenharmony_ci * TX_SW_CFG1: 127762306a36Sopenharmony_ci */ 127862306a36Sopenharmony_ci#define TX_SW_CFG1 0x1334 127962306a36Sopenharmony_ci 128062306a36Sopenharmony_ci/* 128162306a36Sopenharmony_ci * TX_SW_CFG2: 128262306a36Sopenharmony_ci */ 128362306a36Sopenharmony_ci#define TX_SW_CFG2 0x1338 128462306a36Sopenharmony_ci 128562306a36Sopenharmony_ci/* 128662306a36Sopenharmony_ci * TXOP_THRES_CFG: 128762306a36Sopenharmony_ci */ 128862306a36Sopenharmony_ci#define TXOP_THRES_CFG 0x133c 128962306a36Sopenharmony_ci 129062306a36Sopenharmony_ci/* 129162306a36Sopenharmony_ci * TXOP_CTRL_CFG: 129262306a36Sopenharmony_ci * TIMEOUT_TRUN_EN: Enable/Disable TXOP timeout truncation 129362306a36Sopenharmony_ci * AC_TRUN_EN: Enable/Disable truncation for AC change 129462306a36Sopenharmony_ci * TXRATEGRP_TRUN_EN: Enable/Disable truncation for TX rate group change 129562306a36Sopenharmony_ci * USER_MODE_TRUN_EN: Enable/Disable truncation for user TXOP mode 129662306a36Sopenharmony_ci * MIMO_PS_TRUN_EN: Enable/Disable truncation for MIMO PS RTS/CTS 129762306a36Sopenharmony_ci * RESERVED_TRUN_EN: Reserved 129862306a36Sopenharmony_ci * LSIG_TXOP_EN: Enable/Disable L-SIG TXOP protection 129962306a36Sopenharmony_ci * EXT_CCA_EN: Enable/Disable extension channel CCA reference (Defer 40Mhz 130062306a36Sopenharmony_ci * transmissions if extension CCA is clear). 130162306a36Sopenharmony_ci * EXT_CCA_DLY: Extension CCA signal delay time (unit: us) 130262306a36Sopenharmony_ci * EXT_CWMIN: CwMin for extension channel backoff 130362306a36Sopenharmony_ci * 0: Disabled 130462306a36Sopenharmony_ci * 130562306a36Sopenharmony_ci */ 130662306a36Sopenharmony_ci#define TXOP_CTRL_CFG 0x1340 130762306a36Sopenharmony_ci#define TXOP_CTRL_CFG_TIMEOUT_TRUN_EN FIELD32(0x00000001) 130862306a36Sopenharmony_ci#define TXOP_CTRL_CFG_AC_TRUN_EN FIELD32(0x00000002) 130962306a36Sopenharmony_ci#define TXOP_CTRL_CFG_TXRATEGRP_TRUN_EN FIELD32(0x00000004) 131062306a36Sopenharmony_ci#define TXOP_CTRL_CFG_USER_MODE_TRUN_EN FIELD32(0x00000008) 131162306a36Sopenharmony_ci#define TXOP_CTRL_CFG_MIMO_PS_TRUN_EN FIELD32(0x00000010) 131262306a36Sopenharmony_ci#define TXOP_CTRL_CFG_RESERVED_TRUN_EN FIELD32(0x00000020) 131362306a36Sopenharmony_ci#define TXOP_CTRL_CFG_LSIG_TXOP_EN FIELD32(0x00000040) 131462306a36Sopenharmony_ci#define TXOP_CTRL_CFG_EXT_CCA_EN FIELD32(0x00000080) 131562306a36Sopenharmony_ci#define TXOP_CTRL_CFG_EXT_CCA_DLY FIELD32(0x0000ff00) 131662306a36Sopenharmony_ci#define TXOP_CTRL_CFG_EXT_CWMIN FIELD32(0x000f0000) 131762306a36Sopenharmony_ci 131862306a36Sopenharmony_ci/* 131962306a36Sopenharmony_ci * TX_RTS_CFG: 132062306a36Sopenharmony_ci * RTS_THRES: unit:byte 132162306a36Sopenharmony_ci * RTS_FBK_EN: enable rts rate fallback 132262306a36Sopenharmony_ci */ 132362306a36Sopenharmony_ci#define TX_RTS_CFG 0x1344 132462306a36Sopenharmony_ci#define TX_RTS_CFG_AUTO_RTS_RETRY_LIMIT FIELD32(0x000000ff) 132562306a36Sopenharmony_ci#define TX_RTS_CFG_RTS_THRES FIELD32(0x00ffff00) 132662306a36Sopenharmony_ci#define TX_RTS_CFG_RTS_FBK_EN FIELD32(0x01000000) 132762306a36Sopenharmony_ci 132862306a36Sopenharmony_ci/* 132962306a36Sopenharmony_ci * TX_TIMEOUT_CFG: 133062306a36Sopenharmony_ci * MPDU_LIFETIME: expiration time = 2^(9+MPDU LIFE TIME) us 133162306a36Sopenharmony_ci * RX_ACK_TIMEOUT: unit:slot. Used for TX procedure 133262306a36Sopenharmony_ci * TX_OP_TIMEOUT: TXOP timeout value for TXOP truncation. 133362306a36Sopenharmony_ci * it is recommended that: 133462306a36Sopenharmony_ci * (SLOT_TIME) > (TX_OP_TIMEOUT) > (RX_ACK_TIMEOUT) 133562306a36Sopenharmony_ci */ 133662306a36Sopenharmony_ci#define TX_TIMEOUT_CFG 0x1348 133762306a36Sopenharmony_ci#define TX_TIMEOUT_CFG_MPDU_LIFETIME FIELD32(0x000000f0) 133862306a36Sopenharmony_ci#define TX_TIMEOUT_CFG_RX_ACK_TIMEOUT FIELD32(0x0000ff00) 133962306a36Sopenharmony_ci#define TX_TIMEOUT_CFG_TX_OP_TIMEOUT FIELD32(0x00ff0000) 134062306a36Sopenharmony_ci 134162306a36Sopenharmony_ci/* 134262306a36Sopenharmony_ci * TX_RTY_CFG: 134362306a36Sopenharmony_ci * SHORT_RTY_LIMIT: short retry limit 134462306a36Sopenharmony_ci * LONG_RTY_LIMIT: long retry limit 134562306a36Sopenharmony_ci * LONG_RTY_THRE: Long retry threshoold 134662306a36Sopenharmony_ci * NON_AGG_RTY_MODE: Non-Aggregate MPDU retry mode 134762306a36Sopenharmony_ci * 0:expired by retry limit, 1: expired by mpdu life timer 134862306a36Sopenharmony_ci * AGG_RTY_MODE: Aggregate MPDU retry mode 134962306a36Sopenharmony_ci * 0:expired by retry limit, 1: expired by mpdu life timer 135062306a36Sopenharmony_ci * TX_AUTO_FB_ENABLE: Tx retry PHY rate auto fallback enable 135162306a36Sopenharmony_ci */ 135262306a36Sopenharmony_ci#define TX_RTY_CFG 0x134c 135362306a36Sopenharmony_ci#define TX_RTY_CFG_SHORT_RTY_LIMIT FIELD32(0x000000ff) 135462306a36Sopenharmony_ci#define TX_RTY_CFG_LONG_RTY_LIMIT FIELD32(0x0000ff00) 135562306a36Sopenharmony_ci#define TX_RTY_CFG_LONG_RTY_THRE FIELD32(0x0fff0000) 135662306a36Sopenharmony_ci#define TX_RTY_CFG_NON_AGG_RTY_MODE FIELD32(0x10000000) 135762306a36Sopenharmony_ci#define TX_RTY_CFG_AGG_RTY_MODE FIELD32(0x20000000) 135862306a36Sopenharmony_ci#define TX_RTY_CFG_TX_AUTO_FB_ENABLE FIELD32(0x40000000) 135962306a36Sopenharmony_ci 136062306a36Sopenharmony_ci/* 136162306a36Sopenharmony_ci * TX_LINK_CFG: 136262306a36Sopenharmony_ci * REMOTE_MFB_LIFETIME: remote MFB life time. unit: 32us 136362306a36Sopenharmony_ci * MFB_ENABLE: TX apply remote MFB 1:enable 136462306a36Sopenharmony_ci * REMOTE_UMFS_ENABLE: remote unsolicit MFB enable 136562306a36Sopenharmony_ci * 0: not apply remote remote unsolicit (MFS=7) 136662306a36Sopenharmony_ci * TX_MRQ_EN: MCS request TX enable 136762306a36Sopenharmony_ci * TX_RDG_EN: RDG TX enable 136862306a36Sopenharmony_ci * TX_CF_ACK_EN: Piggyback CF-ACK enable 136962306a36Sopenharmony_ci * REMOTE_MFB: remote MCS feedback 137062306a36Sopenharmony_ci * REMOTE_MFS: remote MCS feedback sequence number 137162306a36Sopenharmony_ci */ 137262306a36Sopenharmony_ci#define TX_LINK_CFG 0x1350 137362306a36Sopenharmony_ci#define TX_LINK_CFG_REMOTE_MFB_LIFETIME FIELD32(0x000000ff) 137462306a36Sopenharmony_ci#define TX_LINK_CFG_MFB_ENABLE FIELD32(0x00000100) 137562306a36Sopenharmony_ci#define TX_LINK_CFG_REMOTE_UMFS_ENABLE FIELD32(0x00000200) 137662306a36Sopenharmony_ci#define TX_LINK_CFG_TX_MRQ_EN FIELD32(0x00000400) 137762306a36Sopenharmony_ci#define TX_LINK_CFG_TX_RDG_EN FIELD32(0x00000800) 137862306a36Sopenharmony_ci#define TX_LINK_CFG_TX_CF_ACK_EN FIELD32(0x00001000) 137962306a36Sopenharmony_ci#define TX_LINK_CFG_REMOTE_MFB FIELD32(0x00ff0000) 138062306a36Sopenharmony_ci#define TX_LINK_CFG_REMOTE_MFS FIELD32(0xff000000) 138162306a36Sopenharmony_ci 138262306a36Sopenharmony_ci/* 138362306a36Sopenharmony_ci * HT_FBK_CFG0: 138462306a36Sopenharmony_ci */ 138562306a36Sopenharmony_ci#define HT_FBK_CFG0 0x1354 138662306a36Sopenharmony_ci#define HT_FBK_CFG0_HTMCS0FBK FIELD32(0x0000000f) 138762306a36Sopenharmony_ci#define HT_FBK_CFG0_HTMCS1FBK FIELD32(0x000000f0) 138862306a36Sopenharmony_ci#define HT_FBK_CFG0_HTMCS2FBK FIELD32(0x00000f00) 138962306a36Sopenharmony_ci#define HT_FBK_CFG0_HTMCS3FBK FIELD32(0x0000f000) 139062306a36Sopenharmony_ci#define HT_FBK_CFG0_HTMCS4FBK FIELD32(0x000f0000) 139162306a36Sopenharmony_ci#define HT_FBK_CFG0_HTMCS5FBK FIELD32(0x00f00000) 139262306a36Sopenharmony_ci#define HT_FBK_CFG0_HTMCS6FBK FIELD32(0x0f000000) 139362306a36Sopenharmony_ci#define HT_FBK_CFG0_HTMCS7FBK FIELD32(0xf0000000) 139462306a36Sopenharmony_ci 139562306a36Sopenharmony_ci/* 139662306a36Sopenharmony_ci * HT_FBK_CFG1: 139762306a36Sopenharmony_ci */ 139862306a36Sopenharmony_ci#define HT_FBK_CFG1 0x1358 139962306a36Sopenharmony_ci#define HT_FBK_CFG1_HTMCS8FBK FIELD32(0x0000000f) 140062306a36Sopenharmony_ci#define HT_FBK_CFG1_HTMCS9FBK FIELD32(0x000000f0) 140162306a36Sopenharmony_ci#define HT_FBK_CFG1_HTMCS10FBK FIELD32(0x00000f00) 140262306a36Sopenharmony_ci#define HT_FBK_CFG1_HTMCS11FBK FIELD32(0x0000f000) 140362306a36Sopenharmony_ci#define HT_FBK_CFG1_HTMCS12FBK FIELD32(0x000f0000) 140462306a36Sopenharmony_ci#define HT_FBK_CFG1_HTMCS13FBK FIELD32(0x00f00000) 140562306a36Sopenharmony_ci#define HT_FBK_CFG1_HTMCS14FBK FIELD32(0x0f000000) 140662306a36Sopenharmony_ci#define HT_FBK_CFG1_HTMCS15FBK FIELD32(0xf0000000) 140762306a36Sopenharmony_ci 140862306a36Sopenharmony_ci/* 140962306a36Sopenharmony_ci * LG_FBK_CFG0: 141062306a36Sopenharmony_ci */ 141162306a36Sopenharmony_ci#define LG_FBK_CFG0 0x135c 141262306a36Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS0FBK FIELD32(0x0000000f) 141362306a36Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS1FBK FIELD32(0x000000f0) 141462306a36Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS2FBK FIELD32(0x00000f00) 141562306a36Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS3FBK FIELD32(0x0000f000) 141662306a36Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS4FBK FIELD32(0x000f0000) 141762306a36Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS5FBK FIELD32(0x00f00000) 141862306a36Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS6FBK FIELD32(0x0f000000) 141962306a36Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS7FBK FIELD32(0xf0000000) 142062306a36Sopenharmony_ci 142162306a36Sopenharmony_ci/* 142262306a36Sopenharmony_ci * LG_FBK_CFG1: 142362306a36Sopenharmony_ci */ 142462306a36Sopenharmony_ci#define LG_FBK_CFG1 0x1360 142562306a36Sopenharmony_ci#define LG_FBK_CFG0_CCKMCS0FBK FIELD32(0x0000000f) 142662306a36Sopenharmony_ci#define LG_FBK_CFG0_CCKMCS1FBK FIELD32(0x000000f0) 142762306a36Sopenharmony_ci#define LG_FBK_CFG0_CCKMCS2FBK FIELD32(0x00000f00) 142862306a36Sopenharmony_ci#define LG_FBK_CFG0_CCKMCS3FBK FIELD32(0x0000f000) 142962306a36Sopenharmony_ci 143062306a36Sopenharmony_ci/* 143162306a36Sopenharmony_ci * CCK_PROT_CFG: CCK Protection 143262306a36Sopenharmony_ci * PROTECT_RATE: Protection control frame rate for CCK TX(RTS/CTS/CFEnd) 143362306a36Sopenharmony_ci * PROTECT_CTRL: Protection control frame type for CCK TX 143462306a36Sopenharmony_ci * 0:none, 1:RTS/CTS, 2:CTS-to-self 143562306a36Sopenharmony_ci * PROTECT_NAV_SHORT: TXOP protection type for CCK TX with short NAV 143662306a36Sopenharmony_ci * PROTECT_NAV_LONG: TXOP protection type for CCK TX with long NAV 143762306a36Sopenharmony_ci * TX_OP_ALLOW_CCK: CCK TXOP allowance, 0:disallow 143862306a36Sopenharmony_ci * TX_OP_ALLOW_OFDM: CCK TXOP allowance, 0:disallow 143962306a36Sopenharmony_ci * TX_OP_ALLOW_MM20: CCK TXOP allowance, 0:disallow 144062306a36Sopenharmony_ci * TX_OP_ALLOW_MM40: CCK TXOP allowance, 0:disallow 144162306a36Sopenharmony_ci * TX_OP_ALLOW_GF20: CCK TXOP allowance, 0:disallow 144262306a36Sopenharmony_ci * TX_OP_ALLOW_GF40: CCK TXOP allowance, 0:disallow 144362306a36Sopenharmony_ci * RTS_TH_EN: RTS threshold enable on CCK TX 144462306a36Sopenharmony_ci */ 144562306a36Sopenharmony_ci#define CCK_PROT_CFG 0x1364 144662306a36Sopenharmony_ci#define CCK_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff) 144762306a36Sopenharmony_ci#define CCK_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000) 144862306a36Sopenharmony_ci#define CCK_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000) 144962306a36Sopenharmony_ci#define CCK_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000) 145062306a36Sopenharmony_ci#define CCK_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000) 145162306a36Sopenharmony_ci#define CCK_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000) 145262306a36Sopenharmony_ci#define CCK_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000) 145362306a36Sopenharmony_ci#define CCK_PROT_CFG_TX_OP_ALLOW_MM40 FIELD32(0x00800000) 145462306a36Sopenharmony_ci#define CCK_PROT_CFG_TX_OP_ALLOW_GF20 FIELD32(0x01000000) 145562306a36Sopenharmony_ci#define CCK_PROT_CFG_TX_OP_ALLOW_GF40 FIELD32(0x02000000) 145662306a36Sopenharmony_ci#define CCK_PROT_CFG_RTS_TH_EN FIELD32(0x04000000) 145762306a36Sopenharmony_ci 145862306a36Sopenharmony_ci/* 145962306a36Sopenharmony_ci * OFDM_PROT_CFG: OFDM Protection 146062306a36Sopenharmony_ci */ 146162306a36Sopenharmony_ci#define OFDM_PROT_CFG 0x1368 146262306a36Sopenharmony_ci#define OFDM_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff) 146362306a36Sopenharmony_ci#define OFDM_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000) 146462306a36Sopenharmony_ci#define OFDM_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000) 146562306a36Sopenharmony_ci#define OFDM_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000) 146662306a36Sopenharmony_ci#define OFDM_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000) 146762306a36Sopenharmony_ci#define OFDM_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000) 146862306a36Sopenharmony_ci#define OFDM_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000) 146962306a36Sopenharmony_ci#define OFDM_PROT_CFG_TX_OP_ALLOW_MM40 FIELD32(0x00800000) 147062306a36Sopenharmony_ci#define OFDM_PROT_CFG_TX_OP_ALLOW_GF20 FIELD32(0x01000000) 147162306a36Sopenharmony_ci#define OFDM_PROT_CFG_TX_OP_ALLOW_GF40 FIELD32(0x02000000) 147262306a36Sopenharmony_ci#define OFDM_PROT_CFG_RTS_TH_EN FIELD32(0x04000000) 147362306a36Sopenharmony_ci 147462306a36Sopenharmony_ci/* 147562306a36Sopenharmony_ci * MM20_PROT_CFG: MM20 Protection 147662306a36Sopenharmony_ci */ 147762306a36Sopenharmony_ci#define MM20_PROT_CFG 0x136c 147862306a36Sopenharmony_ci#define MM20_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff) 147962306a36Sopenharmony_ci#define MM20_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000) 148062306a36Sopenharmony_ci#define MM20_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000) 148162306a36Sopenharmony_ci#define MM20_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000) 148262306a36Sopenharmony_ci#define MM20_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000) 148362306a36Sopenharmony_ci#define MM20_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000) 148462306a36Sopenharmony_ci#define MM20_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000) 148562306a36Sopenharmony_ci#define MM20_PROT_CFG_TX_OP_ALLOW_MM40 FIELD32(0x00800000) 148662306a36Sopenharmony_ci#define MM20_PROT_CFG_TX_OP_ALLOW_GF20 FIELD32(0x01000000) 148762306a36Sopenharmony_ci#define MM20_PROT_CFG_TX_OP_ALLOW_GF40 FIELD32(0x02000000) 148862306a36Sopenharmony_ci#define MM20_PROT_CFG_RTS_TH_EN FIELD32(0x04000000) 148962306a36Sopenharmony_ci 149062306a36Sopenharmony_ci/* 149162306a36Sopenharmony_ci * MM40_PROT_CFG: MM40 Protection 149262306a36Sopenharmony_ci */ 149362306a36Sopenharmony_ci#define MM40_PROT_CFG 0x1370 149462306a36Sopenharmony_ci#define MM40_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff) 149562306a36Sopenharmony_ci#define MM40_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000) 149662306a36Sopenharmony_ci#define MM40_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000) 149762306a36Sopenharmony_ci#define MM40_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000) 149862306a36Sopenharmony_ci#define MM40_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000) 149962306a36Sopenharmony_ci#define MM40_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000) 150062306a36Sopenharmony_ci#define MM40_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000) 150162306a36Sopenharmony_ci#define MM40_PROT_CFG_TX_OP_ALLOW_MM40 FIELD32(0x00800000) 150262306a36Sopenharmony_ci#define MM40_PROT_CFG_TX_OP_ALLOW_GF20 FIELD32(0x01000000) 150362306a36Sopenharmony_ci#define MM40_PROT_CFG_TX_OP_ALLOW_GF40 FIELD32(0x02000000) 150462306a36Sopenharmony_ci#define MM40_PROT_CFG_RTS_TH_EN FIELD32(0x04000000) 150562306a36Sopenharmony_ci 150662306a36Sopenharmony_ci/* 150762306a36Sopenharmony_ci * GF20_PROT_CFG: GF20 Protection 150862306a36Sopenharmony_ci */ 150962306a36Sopenharmony_ci#define GF20_PROT_CFG 0x1374 151062306a36Sopenharmony_ci#define GF20_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff) 151162306a36Sopenharmony_ci#define GF20_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000) 151262306a36Sopenharmony_ci#define GF20_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000) 151362306a36Sopenharmony_ci#define GF20_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000) 151462306a36Sopenharmony_ci#define GF20_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000) 151562306a36Sopenharmony_ci#define GF20_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000) 151662306a36Sopenharmony_ci#define GF20_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000) 151762306a36Sopenharmony_ci#define GF20_PROT_CFG_TX_OP_ALLOW_MM40 FIELD32(0x00800000) 151862306a36Sopenharmony_ci#define GF20_PROT_CFG_TX_OP_ALLOW_GF20 FIELD32(0x01000000) 151962306a36Sopenharmony_ci#define GF20_PROT_CFG_TX_OP_ALLOW_GF40 FIELD32(0x02000000) 152062306a36Sopenharmony_ci#define GF20_PROT_CFG_RTS_TH_EN FIELD32(0x04000000) 152162306a36Sopenharmony_ci 152262306a36Sopenharmony_ci/* 152362306a36Sopenharmony_ci * GF40_PROT_CFG: GF40 Protection 152462306a36Sopenharmony_ci */ 152562306a36Sopenharmony_ci#define GF40_PROT_CFG 0x1378 152662306a36Sopenharmony_ci#define GF40_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff) 152762306a36Sopenharmony_ci#define GF40_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000) 152862306a36Sopenharmony_ci#define GF40_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000) 152962306a36Sopenharmony_ci#define GF40_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000) 153062306a36Sopenharmony_ci#define GF40_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000) 153162306a36Sopenharmony_ci#define GF40_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000) 153262306a36Sopenharmony_ci#define GF40_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000) 153362306a36Sopenharmony_ci#define GF40_PROT_CFG_TX_OP_ALLOW_MM40 FIELD32(0x00800000) 153462306a36Sopenharmony_ci#define GF40_PROT_CFG_TX_OP_ALLOW_GF20 FIELD32(0x01000000) 153562306a36Sopenharmony_ci#define GF40_PROT_CFG_TX_OP_ALLOW_GF40 FIELD32(0x02000000) 153662306a36Sopenharmony_ci#define GF40_PROT_CFG_RTS_TH_EN FIELD32(0x04000000) 153762306a36Sopenharmony_ci 153862306a36Sopenharmony_ci/* 153962306a36Sopenharmony_ci * EXP_CTS_TIME: 154062306a36Sopenharmony_ci */ 154162306a36Sopenharmony_ci#define EXP_CTS_TIME 0x137c 154262306a36Sopenharmony_ci 154362306a36Sopenharmony_ci/* 154462306a36Sopenharmony_ci * EXP_ACK_TIME: 154562306a36Sopenharmony_ci */ 154662306a36Sopenharmony_ci#define EXP_ACK_TIME 0x1380 154762306a36Sopenharmony_ci 154862306a36Sopenharmony_ci/* TX_PWR_CFG_5 */ 154962306a36Sopenharmony_ci#define TX_PWR_CFG_5 0x1384 155062306a36Sopenharmony_ci#define TX_PWR_CFG_5_MCS16_CH0 FIELD32(0x0000000f) 155162306a36Sopenharmony_ci#define TX_PWR_CFG_5_MCS16_CH1 FIELD32(0x000000f0) 155262306a36Sopenharmony_ci#define TX_PWR_CFG_5_MCS16_CH2 FIELD32(0x00000f00) 155362306a36Sopenharmony_ci#define TX_PWR_CFG_5_MCS18_CH0 FIELD32(0x000f0000) 155462306a36Sopenharmony_ci#define TX_PWR_CFG_5_MCS18_CH1 FIELD32(0x00f00000) 155562306a36Sopenharmony_ci#define TX_PWR_CFG_5_MCS18_CH2 FIELD32(0x0f000000) 155662306a36Sopenharmony_ci 155762306a36Sopenharmony_ci/* TX_PWR_CFG_6 */ 155862306a36Sopenharmony_ci#define TX_PWR_CFG_6 0x1388 155962306a36Sopenharmony_ci#define TX_PWR_CFG_6_MCS20_CH0 FIELD32(0x0000000f) 156062306a36Sopenharmony_ci#define TX_PWR_CFG_6_MCS20_CH1 FIELD32(0x000000f0) 156162306a36Sopenharmony_ci#define TX_PWR_CFG_6_MCS20_CH2 FIELD32(0x00000f00) 156262306a36Sopenharmony_ci#define TX_PWR_CFG_6_MCS22_CH0 FIELD32(0x000f0000) 156362306a36Sopenharmony_ci#define TX_PWR_CFG_6_MCS22_CH1 FIELD32(0x00f00000) 156462306a36Sopenharmony_ci#define TX_PWR_CFG_6_MCS22_CH2 FIELD32(0x0f000000) 156562306a36Sopenharmony_ci 156662306a36Sopenharmony_ci/* TX_PWR_CFG_0_EXT */ 156762306a36Sopenharmony_ci#define TX_PWR_CFG_0_EXT 0x1390 156862306a36Sopenharmony_ci#define TX_PWR_CFG_0_EXT_CCK1_CH2 FIELD32(0x0000000f) 156962306a36Sopenharmony_ci#define TX_PWR_CFG_0_EXT_CCK5_CH2 FIELD32(0x00000f00) 157062306a36Sopenharmony_ci#define TX_PWR_CFG_0_EXT_OFDM6_CH2 FIELD32(0x000f0000) 157162306a36Sopenharmony_ci#define TX_PWR_CFG_0_EXT_OFDM12_CH2 FIELD32(0x0f000000) 157262306a36Sopenharmony_ci 157362306a36Sopenharmony_ci/* TX_PWR_CFG_1_EXT */ 157462306a36Sopenharmony_ci#define TX_PWR_CFG_1_EXT 0x1394 157562306a36Sopenharmony_ci#define TX_PWR_CFG_1_EXT_OFDM24_CH2 FIELD32(0x0000000f) 157662306a36Sopenharmony_ci#define TX_PWR_CFG_1_EXT_OFDM48_CH2 FIELD32(0x00000f00) 157762306a36Sopenharmony_ci#define TX_PWR_CFG_1_EXT_MCS0_CH2 FIELD32(0x000f0000) 157862306a36Sopenharmony_ci#define TX_PWR_CFG_1_EXT_MCS2_CH2 FIELD32(0x0f000000) 157962306a36Sopenharmony_ci 158062306a36Sopenharmony_ci/* TX_PWR_CFG_2_EXT */ 158162306a36Sopenharmony_ci#define TX_PWR_CFG_2_EXT 0x1398 158262306a36Sopenharmony_ci#define TX_PWR_CFG_2_EXT_MCS4_CH2 FIELD32(0x0000000f) 158362306a36Sopenharmony_ci#define TX_PWR_CFG_2_EXT_MCS6_CH2 FIELD32(0x00000f00) 158462306a36Sopenharmony_ci#define TX_PWR_CFG_2_EXT_MCS8_CH2 FIELD32(0x000f0000) 158562306a36Sopenharmony_ci#define TX_PWR_CFG_2_EXT_MCS10_CH2 FIELD32(0x0f000000) 158662306a36Sopenharmony_ci 158762306a36Sopenharmony_ci/* TX_PWR_CFG_3_EXT */ 158862306a36Sopenharmony_ci#define TX_PWR_CFG_3_EXT 0x139c 158962306a36Sopenharmony_ci#define TX_PWR_CFG_3_EXT_MCS12_CH2 FIELD32(0x0000000f) 159062306a36Sopenharmony_ci#define TX_PWR_CFG_3_EXT_MCS14_CH2 FIELD32(0x00000f00) 159162306a36Sopenharmony_ci#define TX_PWR_CFG_3_EXT_STBC0_CH2 FIELD32(0x000f0000) 159262306a36Sopenharmony_ci#define TX_PWR_CFG_3_EXT_STBC2_CH2 FIELD32(0x0f000000) 159362306a36Sopenharmony_ci 159462306a36Sopenharmony_ci/* TX_PWR_CFG_4_EXT */ 159562306a36Sopenharmony_ci#define TX_PWR_CFG_4_EXT 0x13a0 159662306a36Sopenharmony_ci#define TX_PWR_CFG_4_EXT_STBC4_CH2 FIELD32(0x0000000f) 159762306a36Sopenharmony_ci#define TX_PWR_CFG_4_EXT_STBC6_CH2 FIELD32(0x00000f00) 159862306a36Sopenharmony_ci 159962306a36Sopenharmony_ci/* TXn_RF_GAIN_CORRECT: RF Gain Correction for each RF_ALC[3:2] 160062306a36Sopenharmony_ci * Unit: 0.1 dB, Range: -3.2 dB to 3.1 dB 160162306a36Sopenharmony_ci */ 160262306a36Sopenharmony_ci#define TX0_RF_GAIN_CORRECT 0x13a0 160362306a36Sopenharmony_ci#define TX0_RF_GAIN_CORRECT_GAIN_CORR_0 FIELD32(0x0000003f) 160462306a36Sopenharmony_ci#define TX0_RF_GAIN_CORRECT_GAIN_CORR_1 FIELD32(0x00003f00) 160562306a36Sopenharmony_ci#define TX0_RF_GAIN_CORRECT_GAIN_CORR_2 FIELD32(0x003f0000) 160662306a36Sopenharmony_ci#define TX0_RF_GAIN_CORRECT_GAIN_CORR_3 FIELD32(0x3f000000) 160762306a36Sopenharmony_ci 160862306a36Sopenharmony_ci#define TX1_RF_GAIN_CORRECT 0x13a4 160962306a36Sopenharmony_ci#define TX1_RF_GAIN_CORRECT_GAIN_CORR_0 FIELD32(0x0000003f) 161062306a36Sopenharmony_ci#define TX1_RF_GAIN_CORRECT_GAIN_CORR_1 FIELD32(0x00003f00) 161162306a36Sopenharmony_ci#define TX1_RF_GAIN_CORRECT_GAIN_CORR_2 FIELD32(0x003f0000) 161262306a36Sopenharmony_ci#define TX1_RF_GAIN_CORRECT_GAIN_CORR_3 FIELD32(0x3f000000) 161362306a36Sopenharmony_ci 161462306a36Sopenharmony_ci/* TXn_RF_GAIN_ATTEN: TXn RF Gain Attenuation Level 161562306a36Sopenharmony_ci * Format: 7-bit, signed value 161662306a36Sopenharmony_ci * Unit: 0.5 dB, Range: -20 dB to -5 dB 161762306a36Sopenharmony_ci */ 161862306a36Sopenharmony_ci#define TX0_RF_GAIN_ATTEN 0x13a8 161962306a36Sopenharmony_ci#define TX0_RF_GAIN_ATTEN_LEVEL_0 FIELD32(0x0000007f) 162062306a36Sopenharmony_ci#define TX0_RF_GAIN_ATTEN_LEVEL_1 FIELD32(0x00007f00) 162162306a36Sopenharmony_ci#define TX0_RF_GAIN_ATTEN_LEVEL_2 FIELD32(0x007f0000) 162262306a36Sopenharmony_ci#define TX0_RF_GAIN_ATTEN_LEVEL_3 FIELD32(0x7f000000) 162362306a36Sopenharmony_ci#define TX1_RF_GAIN_ATTEN 0x13ac 162462306a36Sopenharmony_ci#define TX1_RF_GAIN_ATTEN_LEVEL_0 FIELD32(0x0000007f) 162562306a36Sopenharmony_ci#define TX1_RF_GAIN_ATTEN_LEVEL_1 FIELD32(0x00007f00) 162662306a36Sopenharmony_ci#define TX1_RF_GAIN_ATTEN_LEVEL_2 FIELD32(0x007f0000) 162762306a36Sopenharmony_ci#define TX1_RF_GAIN_ATTEN_LEVEL_3 FIELD32(0x7f000000) 162862306a36Sopenharmony_ci 162962306a36Sopenharmony_ci/* TX_ALC_CFG_0: TX Automatic Level Control Configuration 0 163062306a36Sopenharmony_ci * TX_ALC_LIMIT_n: TXn upper limit 163162306a36Sopenharmony_ci * TX_ALC_CH_INIT_n: TXn channel initial transmission gain 163262306a36Sopenharmony_ci * Unit: 0.5 dB, Range: 0 to 23.5 dB 163362306a36Sopenharmony_ci */ 163462306a36Sopenharmony_ci#define TX_ALC_CFG_0 0x13b0 163562306a36Sopenharmony_ci#define TX_ALC_CFG_0_CH_INIT_0 FIELD32(0x0000003f) 163662306a36Sopenharmony_ci#define TX_ALC_CFG_0_CH_INIT_1 FIELD32(0x00003f00) 163762306a36Sopenharmony_ci#define TX_ALC_CFG_0_LIMIT_0 FIELD32(0x003f0000) 163862306a36Sopenharmony_ci#define TX_ALC_CFG_0_LIMIT_1 FIELD32(0x3f000000) 163962306a36Sopenharmony_ci 164062306a36Sopenharmony_ci/* TX_ALC_CFG_1: TX Automatic Level Control Configuration 1 164162306a36Sopenharmony_ci * TX_TEMP_COMP: TX Power Temperature Compensation 164262306a36Sopenharmony_ci * Unit: 0.5 dB, Range: -10 dB to 10 dB 164362306a36Sopenharmony_ci * TXn_GAIN_FINE: TXn Gain Fine Adjustment 164462306a36Sopenharmony_ci * Unit: 0.1 dB, Range: -0.8 dB to 0.7 dB 164562306a36Sopenharmony_ci * RF_TOS_DLY: Sets the RF_TOS_EN assertion delay after 164662306a36Sopenharmony_ci * deassertion of PA_PE. 164762306a36Sopenharmony_ci * Unit: 0.25 usec 164862306a36Sopenharmony_ci * TXn_RF_GAIN_ATTEN: TXn RF gain attentuation selector 164962306a36Sopenharmony_ci * RF_TOS_TIMEOUT: time-out value for RF_TOS_ENABLE 165062306a36Sopenharmony_ci * deassertion if RF_TOS_DONE is missing. 165162306a36Sopenharmony_ci * Unit: 0.25 usec 165262306a36Sopenharmony_ci * RF_TOS_ENABLE: TX offset calibration enable 165362306a36Sopenharmony_ci * ROS_BUSY_EN: RX offset calibration busy enable 165462306a36Sopenharmony_ci */ 165562306a36Sopenharmony_ci#define TX_ALC_CFG_1 0x13b4 165662306a36Sopenharmony_ci#define TX_ALC_CFG_1_TX_TEMP_COMP FIELD32(0x0000003f) 165762306a36Sopenharmony_ci#define TX_ALC_CFG_1_TX0_GAIN_FINE FIELD32(0x00000f00) 165862306a36Sopenharmony_ci#define TX_ALC_CFG_1_TX1_GAIN_FINE FIELD32(0x0000f000) 165962306a36Sopenharmony_ci#define TX_ALC_CFG_1_RF_TOS_DLY FIELD32(0x00070000) 166062306a36Sopenharmony_ci#define TX_ALC_CFG_1_TX0_RF_GAIN_ATTEN FIELD32(0x00300000) 166162306a36Sopenharmony_ci#define TX_ALC_CFG_1_TX1_RF_GAIN_ATTEN FIELD32(0x00c00000) 166262306a36Sopenharmony_ci#define TX_ALC_CFG_1_RF_TOS_TIMEOUT FIELD32(0x3f000000) 166362306a36Sopenharmony_ci#define TX_ALC_CFG_1_RF_TOS_ENABLE FIELD32(0x40000000) 166462306a36Sopenharmony_ci#define TX_ALC_CFG_1_ROS_BUSY_EN FIELD32(0x80000000) 166562306a36Sopenharmony_ci 166662306a36Sopenharmony_ci/* TXn_BB_GAIN_ATTEN: TXn RF Gain Attenuation Level 166762306a36Sopenharmony_ci * Format: 5-bit signed values 166862306a36Sopenharmony_ci * Unit: 0.5 dB, Range: -8 dB to 7 dB 166962306a36Sopenharmony_ci */ 167062306a36Sopenharmony_ci#define TX0_BB_GAIN_ATTEN 0x13c0 167162306a36Sopenharmony_ci#define TX0_BB_GAIN_ATTEN_LEVEL_0 FIELD32(0x0000001f) 167262306a36Sopenharmony_ci#define TX0_BB_GAIN_ATTEN_LEVEL_1 FIELD32(0x00001f00) 167362306a36Sopenharmony_ci#define TX0_BB_GAIN_ATTEN_LEVEL_2 FIELD32(0x001f0000) 167462306a36Sopenharmony_ci#define TX0_BB_GAIN_ATTEN_LEVEL_3 FIELD32(0x1f000000) 167562306a36Sopenharmony_ci#define TX1_BB_GAIN_ATTEN 0x13c4 167662306a36Sopenharmony_ci#define TX1_BB_GAIN_ATTEN_LEVEL_0 FIELD32(0x0000001f) 167762306a36Sopenharmony_ci#define TX1_BB_GAIN_ATTEN_LEVEL_1 FIELD32(0x00001f00) 167862306a36Sopenharmony_ci#define TX1_BB_GAIN_ATTEN_LEVEL_2 FIELD32(0x001f0000) 167962306a36Sopenharmony_ci#define TX1_BB_GAIN_ATTEN_LEVEL_3 FIELD32(0x1f000000) 168062306a36Sopenharmony_ci 168162306a36Sopenharmony_ci/* TX_ALC_VGA3: TX Automatic Level Correction Variable Gain Amplifier 3 */ 168262306a36Sopenharmony_ci#define TX_ALC_VGA3 0x13c8 168362306a36Sopenharmony_ci#define TX_ALC_VGA3_TX0_ALC_VGA3 FIELD32(0x0000001f) 168462306a36Sopenharmony_ci#define TX_ALC_VGA3_TX1_ALC_VGA3 FIELD32(0x00001f00) 168562306a36Sopenharmony_ci#define TX_ALC_VGA3_TX0_ALC_VGA2 FIELD32(0x001f0000) 168662306a36Sopenharmony_ci#define TX_ALC_VGA3_TX1_ALC_VGA2 FIELD32(0x1f000000) 168762306a36Sopenharmony_ci 168862306a36Sopenharmony_ci/* TX_PWR_CFG_7 */ 168962306a36Sopenharmony_ci#define TX_PWR_CFG_7 0x13d4 169062306a36Sopenharmony_ci#define TX_PWR_CFG_7_OFDM54_CH0 FIELD32(0x0000000f) 169162306a36Sopenharmony_ci#define TX_PWR_CFG_7_OFDM54_CH1 FIELD32(0x000000f0) 169262306a36Sopenharmony_ci#define TX_PWR_CFG_7_OFDM54_CH2 FIELD32(0x00000f00) 169362306a36Sopenharmony_ci#define TX_PWR_CFG_7_MCS7_CH0 FIELD32(0x000f0000) 169462306a36Sopenharmony_ci#define TX_PWR_CFG_7_MCS7_CH1 FIELD32(0x00f00000) 169562306a36Sopenharmony_ci#define TX_PWR_CFG_7_MCS7_CH2 FIELD32(0x0f000000) 169662306a36Sopenharmony_ci/* bits for new 2T devices */ 169762306a36Sopenharmony_ci#define TX_PWR_CFG_7B_54MBS FIELD32(0x000000ff) 169862306a36Sopenharmony_ci#define TX_PWR_CFG_7B_MCS7 FIELD32(0x00ff0000) 169962306a36Sopenharmony_ci 170062306a36Sopenharmony_ci 170162306a36Sopenharmony_ci/* TX_PWR_CFG_8 */ 170262306a36Sopenharmony_ci#define TX_PWR_CFG_8 0x13d8 170362306a36Sopenharmony_ci#define TX_PWR_CFG_8_MCS15_CH0 FIELD32(0x0000000f) 170462306a36Sopenharmony_ci#define TX_PWR_CFG_8_MCS15_CH1 FIELD32(0x000000f0) 170562306a36Sopenharmony_ci#define TX_PWR_CFG_8_MCS15_CH2 FIELD32(0x00000f00) 170662306a36Sopenharmony_ci#define TX_PWR_CFG_8_MCS23_CH0 FIELD32(0x000f0000) 170762306a36Sopenharmony_ci#define TX_PWR_CFG_8_MCS23_CH1 FIELD32(0x00f00000) 170862306a36Sopenharmony_ci#define TX_PWR_CFG_8_MCS23_CH2 FIELD32(0x0f000000) 170962306a36Sopenharmony_ci/* bits for new 2T devices */ 171062306a36Sopenharmony_ci#define TX_PWR_CFG_8B_MCS15 FIELD32(0x000000ff) 171162306a36Sopenharmony_ci 171262306a36Sopenharmony_ci 171362306a36Sopenharmony_ci/* TX_PWR_CFG_9 */ 171462306a36Sopenharmony_ci#define TX_PWR_CFG_9 0x13dc 171562306a36Sopenharmony_ci#define TX_PWR_CFG_9_STBC7_CH0 FIELD32(0x0000000f) 171662306a36Sopenharmony_ci#define TX_PWR_CFG_9_STBC7_CH1 FIELD32(0x000000f0) 171762306a36Sopenharmony_ci#define TX_PWR_CFG_9_STBC7_CH2 FIELD32(0x00000f00) 171862306a36Sopenharmony_ci/* bits for new 2T devices */ 171962306a36Sopenharmony_ci#define TX_PWR_CFG_9B_STBC_MCS7 FIELD32(0x000000ff) 172062306a36Sopenharmony_ci 172162306a36Sopenharmony_ci/* 172262306a36Sopenharmony_ci * TX_TXBF_CFG: 172362306a36Sopenharmony_ci */ 172462306a36Sopenharmony_ci#define TX_TXBF_CFG_0 0x138c 172562306a36Sopenharmony_ci#define TX_TXBF_CFG_1 0x13a4 172662306a36Sopenharmony_ci#define TX_TXBF_CFG_2 0x13a8 172762306a36Sopenharmony_ci#define TX_TXBF_CFG_3 0x13ac 172862306a36Sopenharmony_ci 172962306a36Sopenharmony_ci/* 173062306a36Sopenharmony_ci * TX_FBK_CFG_3S: 173162306a36Sopenharmony_ci */ 173262306a36Sopenharmony_ci#define TX_FBK_CFG_3S_0 0x13c4 173362306a36Sopenharmony_ci#define TX_FBK_CFG_3S_1 0x13c8 173462306a36Sopenharmony_ci 173562306a36Sopenharmony_ci/* 173662306a36Sopenharmony_ci * RX_FILTER_CFG: RX configuration register. 173762306a36Sopenharmony_ci */ 173862306a36Sopenharmony_ci#define RX_FILTER_CFG 0x1400 173962306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_CRC_ERROR FIELD32(0x00000001) 174062306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_PHY_ERROR FIELD32(0x00000002) 174162306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_NOT_TO_ME FIELD32(0x00000004) 174262306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_NOT_MY_BSSD FIELD32(0x00000008) 174362306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_VER_ERROR FIELD32(0x00000010) 174462306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_MULTICAST FIELD32(0x00000020) 174562306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_BROADCAST FIELD32(0x00000040) 174662306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_DUPLICATE FIELD32(0x00000080) 174762306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_CF_END_ACK FIELD32(0x00000100) 174862306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_CF_END FIELD32(0x00000200) 174962306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_ACK FIELD32(0x00000400) 175062306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_CTS FIELD32(0x00000800) 175162306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_RTS FIELD32(0x00001000) 175262306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_PSPOLL FIELD32(0x00002000) 175362306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_BA FIELD32(0x00004000) 175462306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_BAR FIELD32(0x00008000) 175562306a36Sopenharmony_ci#define RX_FILTER_CFG_DROP_CNTL FIELD32(0x00010000) 175662306a36Sopenharmony_ci 175762306a36Sopenharmony_ci/* 175862306a36Sopenharmony_ci * AUTO_RSP_CFG: 175962306a36Sopenharmony_ci * AUTORESPONDER: 0: disable, 1: enable 176062306a36Sopenharmony_ci * BAC_ACK_POLICY: 0:long, 1:short preamble 176162306a36Sopenharmony_ci * CTS_40_MMODE: Response CTS 40MHz duplicate mode 176262306a36Sopenharmony_ci * CTS_40_MREF: Response CTS 40MHz duplicate mode 176362306a36Sopenharmony_ci * AR_PREAMBLE: Auto responder preamble 0:long, 1:short preamble 176462306a36Sopenharmony_ci * DUAL_CTS_EN: Power bit value in control frame 176562306a36Sopenharmony_ci * ACK_CTS_PSM_BIT:Power bit value in control frame 176662306a36Sopenharmony_ci */ 176762306a36Sopenharmony_ci#define AUTO_RSP_CFG 0x1404 176862306a36Sopenharmony_ci#define AUTO_RSP_CFG_AUTORESPONDER FIELD32(0x00000001) 176962306a36Sopenharmony_ci#define AUTO_RSP_CFG_BAC_ACK_POLICY FIELD32(0x00000002) 177062306a36Sopenharmony_ci#define AUTO_RSP_CFG_CTS_40_MMODE FIELD32(0x00000004) 177162306a36Sopenharmony_ci#define AUTO_RSP_CFG_CTS_40_MREF FIELD32(0x00000008) 177262306a36Sopenharmony_ci#define AUTO_RSP_CFG_AR_PREAMBLE FIELD32(0x00000010) 177362306a36Sopenharmony_ci#define AUTO_RSP_CFG_DUAL_CTS_EN FIELD32(0x00000040) 177462306a36Sopenharmony_ci#define AUTO_RSP_CFG_ACK_CTS_PSM_BIT FIELD32(0x00000080) 177562306a36Sopenharmony_ci 177662306a36Sopenharmony_ci/* 177762306a36Sopenharmony_ci * LEGACY_BASIC_RATE: 177862306a36Sopenharmony_ci */ 177962306a36Sopenharmony_ci#define LEGACY_BASIC_RATE 0x1408 178062306a36Sopenharmony_ci 178162306a36Sopenharmony_ci/* 178262306a36Sopenharmony_ci * HT_BASIC_RATE: 178362306a36Sopenharmony_ci */ 178462306a36Sopenharmony_ci#define HT_BASIC_RATE 0x140c 178562306a36Sopenharmony_ci 178662306a36Sopenharmony_ci/* 178762306a36Sopenharmony_ci * HT_CTRL_CFG: 178862306a36Sopenharmony_ci */ 178962306a36Sopenharmony_ci#define HT_CTRL_CFG 0x1410 179062306a36Sopenharmony_ci 179162306a36Sopenharmony_ci/* 179262306a36Sopenharmony_ci * SIFS_COST_CFG: 179362306a36Sopenharmony_ci */ 179462306a36Sopenharmony_ci#define SIFS_COST_CFG 0x1414 179562306a36Sopenharmony_ci 179662306a36Sopenharmony_ci/* 179762306a36Sopenharmony_ci * RX_PARSER_CFG: 179862306a36Sopenharmony_ci * Set NAV for all received frames 179962306a36Sopenharmony_ci */ 180062306a36Sopenharmony_ci#define RX_PARSER_CFG 0x1418 180162306a36Sopenharmony_ci 180262306a36Sopenharmony_ci/* 180362306a36Sopenharmony_ci * TX_SEC_CNT0: 180462306a36Sopenharmony_ci */ 180562306a36Sopenharmony_ci#define TX_SEC_CNT0 0x1500 180662306a36Sopenharmony_ci 180762306a36Sopenharmony_ci/* 180862306a36Sopenharmony_ci * RX_SEC_CNT0: 180962306a36Sopenharmony_ci */ 181062306a36Sopenharmony_ci#define RX_SEC_CNT0 0x1504 181162306a36Sopenharmony_ci 181262306a36Sopenharmony_ci/* 181362306a36Sopenharmony_ci * CCMP_FC_MUTE: 181462306a36Sopenharmony_ci */ 181562306a36Sopenharmony_ci#define CCMP_FC_MUTE 0x1508 181662306a36Sopenharmony_ci 181762306a36Sopenharmony_ci/* 181862306a36Sopenharmony_ci * TXOP_HLDR_ADDR0: 181962306a36Sopenharmony_ci */ 182062306a36Sopenharmony_ci#define TXOP_HLDR_ADDR0 0x1600 182162306a36Sopenharmony_ci 182262306a36Sopenharmony_ci/* 182362306a36Sopenharmony_ci * TXOP_HLDR_ADDR1: 182462306a36Sopenharmony_ci */ 182562306a36Sopenharmony_ci#define TXOP_HLDR_ADDR1 0x1604 182662306a36Sopenharmony_ci 182762306a36Sopenharmony_ci/* 182862306a36Sopenharmony_ci * TXOP_HLDR_ET: 182962306a36Sopenharmony_ci */ 183062306a36Sopenharmony_ci#define TXOP_HLDR_ET 0x1608 183162306a36Sopenharmony_ci 183262306a36Sopenharmony_ci/* 183362306a36Sopenharmony_ci * QOS_CFPOLL_RA_DW0: 183462306a36Sopenharmony_ci */ 183562306a36Sopenharmony_ci#define QOS_CFPOLL_RA_DW0 0x160c 183662306a36Sopenharmony_ci 183762306a36Sopenharmony_ci/* 183862306a36Sopenharmony_ci * QOS_CFPOLL_RA_DW1: 183962306a36Sopenharmony_ci */ 184062306a36Sopenharmony_ci#define QOS_CFPOLL_RA_DW1 0x1610 184162306a36Sopenharmony_ci 184262306a36Sopenharmony_ci/* 184362306a36Sopenharmony_ci * QOS_CFPOLL_QC: 184462306a36Sopenharmony_ci */ 184562306a36Sopenharmony_ci#define QOS_CFPOLL_QC 0x1614 184662306a36Sopenharmony_ci 184762306a36Sopenharmony_ci/* 184862306a36Sopenharmony_ci * RX_STA_CNT0: RX PLCP error count & RX CRC error count 184962306a36Sopenharmony_ci */ 185062306a36Sopenharmony_ci#define RX_STA_CNT0 0x1700 185162306a36Sopenharmony_ci#define RX_STA_CNT0_CRC_ERR FIELD32(0x0000ffff) 185262306a36Sopenharmony_ci#define RX_STA_CNT0_PHY_ERR FIELD32(0xffff0000) 185362306a36Sopenharmony_ci 185462306a36Sopenharmony_ci/* 185562306a36Sopenharmony_ci * RX_STA_CNT1: RX False CCA count & RX LONG frame count 185662306a36Sopenharmony_ci */ 185762306a36Sopenharmony_ci#define RX_STA_CNT1 0x1704 185862306a36Sopenharmony_ci#define RX_STA_CNT1_FALSE_CCA FIELD32(0x0000ffff) 185962306a36Sopenharmony_ci#define RX_STA_CNT1_PLCP_ERR FIELD32(0xffff0000) 186062306a36Sopenharmony_ci 186162306a36Sopenharmony_ci/* 186262306a36Sopenharmony_ci * RX_STA_CNT2: 186362306a36Sopenharmony_ci */ 186462306a36Sopenharmony_ci#define RX_STA_CNT2 0x1708 186562306a36Sopenharmony_ci#define RX_STA_CNT2_RX_DUPLI_COUNT FIELD32(0x0000ffff) 186662306a36Sopenharmony_ci#define RX_STA_CNT2_RX_FIFO_OVERFLOW FIELD32(0xffff0000) 186762306a36Sopenharmony_ci 186862306a36Sopenharmony_ci/* 186962306a36Sopenharmony_ci * TX_STA_CNT0: TX Beacon count 187062306a36Sopenharmony_ci */ 187162306a36Sopenharmony_ci#define TX_STA_CNT0 0x170c 187262306a36Sopenharmony_ci#define TX_STA_CNT0_TX_FAIL_COUNT FIELD32(0x0000ffff) 187362306a36Sopenharmony_ci#define TX_STA_CNT0_TX_BEACON_COUNT FIELD32(0xffff0000) 187462306a36Sopenharmony_ci 187562306a36Sopenharmony_ci/* 187662306a36Sopenharmony_ci * TX_STA_CNT1: TX tx count 187762306a36Sopenharmony_ci */ 187862306a36Sopenharmony_ci#define TX_STA_CNT1 0x1710 187962306a36Sopenharmony_ci#define TX_STA_CNT1_TX_SUCCESS FIELD32(0x0000ffff) 188062306a36Sopenharmony_ci#define TX_STA_CNT1_TX_RETRANSMIT FIELD32(0xffff0000) 188162306a36Sopenharmony_ci 188262306a36Sopenharmony_ci/* 188362306a36Sopenharmony_ci * TX_STA_CNT2: TX tx count 188462306a36Sopenharmony_ci */ 188562306a36Sopenharmony_ci#define TX_STA_CNT2 0x1714 188662306a36Sopenharmony_ci#define TX_STA_CNT2_TX_ZERO_LEN_COUNT FIELD32(0x0000ffff) 188762306a36Sopenharmony_ci#define TX_STA_CNT2_TX_UNDER_FLOW_COUNT FIELD32(0xffff0000) 188862306a36Sopenharmony_ci 188962306a36Sopenharmony_ci/* 189062306a36Sopenharmony_ci * TX_STA_FIFO: TX Result for specific PID status fifo register. 189162306a36Sopenharmony_ci * 189262306a36Sopenharmony_ci * This register is implemented as FIFO with 16 entries in the HW. Each 189362306a36Sopenharmony_ci * register read fetches the next tx result. If the FIFO is full because 189462306a36Sopenharmony_ci * it wasn't read fast enough after the according interrupt (TX_FIFO_STATUS) 189562306a36Sopenharmony_ci * triggered, the hw seems to simply drop further tx results. 189662306a36Sopenharmony_ci * 189762306a36Sopenharmony_ci * VALID: 1: this tx result is valid 189862306a36Sopenharmony_ci * 0: no valid tx result -> driver should stop reading 189962306a36Sopenharmony_ci * PID_TYPE: The PID latched from the PID field in the TXWI, can be used 190062306a36Sopenharmony_ci * to match a frame with its tx result (even though the PID is 190162306a36Sopenharmony_ci * only 4 bits wide). 190262306a36Sopenharmony_ci * PID_QUEUE: Part of PID_TYPE, this is the queue index number (0-3) 190362306a36Sopenharmony_ci * PID_ENTRY: Part of PID_TYPE, this is the queue entry index number (1-3) 190462306a36Sopenharmony_ci * This identification number is calculated by ((idx % 3) + 1). 190562306a36Sopenharmony_ci * TX_SUCCESS: Indicates tx success (1) or failure (0) 190662306a36Sopenharmony_ci * TX_AGGRE: Indicates if the frame was part of an aggregate (1) or not (0) 190762306a36Sopenharmony_ci * TX_ACK_REQUIRED: Indicates if the frame needed to get ack'ed (1) or not (0) 190862306a36Sopenharmony_ci * WCID: The wireless client ID. 190962306a36Sopenharmony_ci * MCS: The tx rate used during the last transmission of this frame, be it 191062306a36Sopenharmony_ci * successful or not. 191162306a36Sopenharmony_ci * PHYMODE: The phymode used for the transmission. 191262306a36Sopenharmony_ci */ 191362306a36Sopenharmony_ci#define TX_STA_FIFO 0x1718 191462306a36Sopenharmony_ci#define TX_STA_FIFO_VALID FIELD32(0x00000001) 191562306a36Sopenharmony_ci#define TX_STA_FIFO_PID_TYPE FIELD32(0x0000001e) 191662306a36Sopenharmony_ci#define TX_STA_FIFO_PID_QUEUE FIELD32(0x00000006) 191762306a36Sopenharmony_ci#define TX_STA_FIFO_PID_ENTRY FIELD32(0x00000018) 191862306a36Sopenharmony_ci#define TX_STA_FIFO_TX_SUCCESS FIELD32(0x00000020) 191962306a36Sopenharmony_ci#define TX_STA_FIFO_TX_AGGRE FIELD32(0x00000040) 192062306a36Sopenharmony_ci#define TX_STA_FIFO_TX_ACK_REQUIRED FIELD32(0x00000080) 192162306a36Sopenharmony_ci#define TX_STA_FIFO_WCID FIELD32(0x0000ff00) 192262306a36Sopenharmony_ci#define TX_STA_FIFO_SUCCESS_RATE FIELD32(0xffff0000) 192362306a36Sopenharmony_ci#define TX_STA_FIFO_MCS FIELD32(0x007f0000) 192462306a36Sopenharmony_ci#define TX_STA_FIFO_BW FIELD32(0x00800000) 192562306a36Sopenharmony_ci#define TX_STA_FIFO_SGI FIELD32(0x01000000) 192662306a36Sopenharmony_ci#define TX_STA_FIFO_PHYMODE FIELD32(0xc0000000) 192762306a36Sopenharmony_ci 192862306a36Sopenharmony_ci/* 192962306a36Sopenharmony_ci * TX_AGG_CNT: Debug counter 193062306a36Sopenharmony_ci */ 193162306a36Sopenharmony_ci#define TX_AGG_CNT 0x171c 193262306a36Sopenharmony_ci#define TX_AGG_CNT_NON_AGG_TX_COUNT FIELD32(0x0000ffff) 193362306a36Sopenharmony_ci#define TX_AGG_CNT_AGG_TX_COUNT FIELD32(0xffff0000) 193462306a36Sopenharmony_ci 193562306a36Sopenharmony_ci/* 193662306a36Sopenharmony_ci * TX_AGG_CNT0: 193762306a36Sopenharmony_ci */ 193862306a36Sopenharmony_ci#define TX_AGG_CNT0 0x1720 193962306a36Sopenharmony_ci#define TX_AGG_CNT0_AGG_SIZE_1_COUNT FIELD32(0x0000ffff) 194062306a36Sopenharmony_ci#define TX_AGG_CNT0_AGG_SIZE_2_COUNT FIELD32(0xffff0000) 194162306a36Sopenharmony_ci 194262306a36Sopenharmony_ci/* 194362306a36Sopenharmony_ci * TX_AGG_CNT1: 194462306a36Sopenharmony_ci */ 194562306a36Sopenharmony_ci#define TX_AGG_CNT1 0x1724 194662306a36Sopenharmony_ci#define TX_AGG_CNT1_AGG_SIZE_3_COUNT FIELD32(0x0000ffff) 194762306a36Sopenharmony_ci#define TX_AGG_CNT1_AGG_SIZE_4_COUNT FIELD32(0xffff0000) 194862306a36Sopenharmony_ci 194962306a36Sopenharmony_ci/* 195062306a36Sopenharmony_ci * TX_AGG_CNT2: 195162306a36Sopenharmony_ci */ 195262306a36Sopenharmony_ci#define TX_AGG_CNT2 0x1728 195362306a36Sopenharmony_ci#define TX_AGG_CNT2_AGG_SIZE_5_COUNT FIELD32(0x0000ffff) 195462306a36Sopenharmony_ci#define TX_AGG_CNT2_AGG_SIZE_6_COUNT FIELD32(0xffff0000) 195562306a36Sopenharmony_ci 195662306a36Sopenharmony_ci/* 195762306a36Sopenharmony_ci * TX_AGG_CNT3: 195862306a36Sopenharmony_ci */ 195962306a36Sopenharmony_ci#define TX_AGG_CNT3 0x172c 196062306a36Sopenharmony_ci#define TX_AGG_CNT3_AGG_SIZE_7_COUNT FIELD32(0x0000ffff) 196162306a36Sopenharmony_ci#define TX_AGG_CNT3_AGG_SIZE_8_COUNT FIELD32(0xffff0000) 196262306a36Sopenharmony_ci 196362306a36Sopenharmony_ci/* 196462306a36Sopenharmony_ci * TX_AGG_CNT4: 196562306a36Sopenharmony_ci */ 196662306a36Sopenharmony_ci#define TX_AGG_CNT4 0x1730 196762306a36Sopenharmony_ci#define TX_AGG_CNT4_AGG_SIZE_9_COUNT FIELD32(0x0000ffff) 196862306a36Sopenharmony_ci#define TX_AGG_CNT4_AGG_SIZE_10_COUNT FIELD32(0xffff0000) 196962306a36Sopenharmony_ci 197062306a36Sopenharmony_ci/* 197162306a36Sopenharmony_ci * TX_AGG_CNT5: 197262306a36Sopenharmony_ci */ 197362306a36Sopenharmony_ci#define TX_AGG_CNT5 0x1734 197462306a36Sopenharmony_ci#define TX_AGG_CNT5_AGG_SIZE_11_COUNT FIELD32(0x0000ffff) 197562306a36Sopenharmony_ci#define TX_AGG_CNT5_AGG_SIZE_12_COUNT FIELD32(0xffff0000) 197662306a36Sopenharmony_ci 197762306a36Sopenharmony_ci/* 197862306a36Sopenharmony_ci * TX_AGG_CNT6: 197962306a36Sopenharmony_ci */ 198062306a36Sopenharmony_ci#define TX_AGG_CNT6 0x1738 198162306a36Sopenharmony_ci#define TX_AGG_CNT6_AGG_SIZE_13_COUNT FIELD32(0x0000ffff) 198262306a36Sopenharmony_ci#define TX_AGG_CNT6_AGG_SIZE_14_COUNT FIELD32(0xffff0000) 198362306a36Sopenharmony_ci 198462306a36Sopenharmony_ci/* 198562306a36Sopenharmony_ci * TX_AGG_CNT7: 198662306a36Sopenharmony_ci */ 198762306a36Sopenharmony_ci#define TX_AGG_CNT7 0x173c 198862306a36Sopenharmony_ci#define TX_AGG_CNT7_AGG_SIZE_15_COUNT FIELD32(0x0000ffff) 198962306a36Sopenharmony_ci#define TX_AGG_CNT7_AGG_SIZE_16_COUNT FIELD32(0xffff0000) 199062306a36Sopenharmony_ci 199162306a36Sopenharmony_ci/* 199262306a36Sopenharmony_ci * MPDU_DENSITY_CNT: 199362306a36Sopenharmony_ci * TX_ZERO_DEL: TX zero length delimiter count 199462306a36Sopenharmony_ci * RX_ZERO_DEL: RX zero length delimiter count 199562306a36Sopenharmony_ci */ 199662306a36Sopenharmony_ci#define MPDU_DENSITY_CNT 0x1740 199762306a36Sopenharmony_ci#define MPDU_DENSITY_CNT_TX_ZERO_DEL FIELD32(0x0000ffff) 199862306a36Sopenharmony_ci#define MPDU_DENSITY_CNT_RX_ZERO_DEL FIELD32(0xffff0000) 199962306a36Sopenharmony_ci 200062306a36Sopenharmony_ci/* 200162306a36Sopenharmony_ci * Security key table memory. 200262306a36Sopenharmony_ci * 200362306a36Sopenharmony_ci * The pairwise key table shares some memory with the beacon frame 200462306a36Sopenharmony_ci * buffers 6 and 7. That basically means that when beacon 6 & 7 200562306a36Sopenharmony_ci * are used we should only use the reduced pairwise key table which 200662306a36Sopenharmony_ci * has a maximum of 222 entries. 200762306a36Sopenharmony_ci * 200862306a36Sopenharmony_ci * --------------------------------------------- 200962306a36Sopenharmony_ci * |0x4000 | Pairwise Key | Reduced Pairwise | 201062306a36Sopenharmony_ci * | | Table | Key Table | 201162306a36Sopenharmony_ci * | | Size: 256 * 32 | Size: 222 * 32 | 201262306a36Sopenharmony_ci * |0x5BC0 | |------------------- 201362306a36Sopenharmony_ci * | | | Beacon 6 | 201462306a36Sopenharmony_ci * |0x5DC0 | |------------------- 201562306a36Sopenharmony_ci * | | | Beacon 7 | 201662306a36Sopenharmony_ci * |0x5FC0 | |------------------- 201762306a36Sopenharmony_ci * |0x5FFF | | 201862306a36Sopenharmony_ci * -------------------------- 201962306a36Sopenharmony_ci * 202062306a36Sopenharmony_ci * MAC_WCID_BASE: 8-bytes (use only 6 bytes) * 256 entry 202162306a36Sopenharmony_ci * PAIRWISE_KEY_TABLE_BASE: 32-byte * 256 entry 202262306a36Sopenharmony_ci * MAC_IVEIV_TABLE_BASE: 8-byte * 256-entry 202362306a36Sopenharmony_ci * MAC_WCID_ATTRIBUTE_BASE: 4-byte * 256-entry 202462306a36Sopenharmony_ci * SHARED_KEY_TABLE_BASE: 32-byte * 16-entry 202562306a36Sopenharmony_ci * SHARED_KEY_MODE_BASE: 4-byte * 16-entry 202662306a36Sopenharmony_ci */ 202762306a36Sopenharmony_ci#define MAC_WCID_BASE 0x1800 202862306a36Sopenharmony_ci#define PAIRWISE_KEY_TABLE_BASE 0x4000 202962306a36Sopenharmony_ci#define MAC_IVEIV_TABLE_BASE 0x6000 203062306a36Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_BASE 0x6800 203162306a36Sopenharmony_ci#define SHARED_KEY_TABLE_BASE 0x6c00 203262306a36Sopenharmony_ci#define SHARED_KEY_MODE_BASE 0x7000 203362306a36Sopenharmony_ci 203462306a36Sopenharmony_ci#define MAC_WCID_ENTRY(__idx) \ 203562306a36Sopenharmony_ci (MAC_WCID_BASE + ((__idx) * sizeof(struct mac_wcid_entry))) 203662306a36Sopenharmony_ci#define PAIRWISE_KEY_ENTRY(__idx) \ 203762306a36Sopenharmony_ci (PAIRWISE_KEY_TABLE_BASE + ((__idx) * sizeof(struct hw_key_entry))) 203862306a36Sopenharmony_ci#define MAC_IVEIV_ENTRY(__idx) \ 203962306a36Sopenharmony_ci (MAC_IVEIV_TABLE_BASE + ((__idx) * sizeof(struct mac_iveiv_entry))) 204062306a36Sopenharmony_ci#define MAC_WCID_ATTR_ENTRY(__idx) \ 204162306a36Sopenharmony_ci (MAC_WCID_ATTRIBUTE_BASE + ((__idx) * sizeof(u32))) 204262306a36Sopenharmony_ci#define SHARED_KEY_ENTRY(__idx) \ 204362306a36Sopenharmony_ci (SHARED_KEY_TABLE_BASE + ((__idx) * sizeof(struct hw_key_entry))) 204462306a36Sopenharmony_ci#define SHARED_KEY_MODE_ENTRY(__idx) \ 204562306a36Sopenharmony_ci (SHARED_KEY_MODE_BASE + ((__idx) * sizeof(u32))) 204662306a36Sopenharmony_ci 204762306a36Sopenharmony_cistruct mac_wcid_entry { 204862306a36Sopenharmony_ci u8 mac[6]; 204962306a36Sopenharmony_ci u8 reserved[2]; 205062306a36Sopenharmony_ci} __packed; 205162306a36Sopenharmony_ci 205262306a36Sopenharmony_cistruct hw_key_entry { 205362306a36Sopenharmony_ci u8 key[16]; 205462306a36Sopenharmony_ci u8 tx_mic[8]; 205562306a36Sopenharmony_ci u8 rx_mic[8]; 205662306a36Sopenharmony_ci} __packed; 205762306a36Sopenharmony_ci 205862306a36Sopenharmony_cistruct mac_iveiv_entry { 205962306a36Sopenharmony_ci u8 iv[8]; 206062306a36Sopenharmony_ci} __packed; 206162306a36Sopenharmony_ci 206262306a36Sopenharmony_ci/* 206362306a36Sopenharmony_ci * MAC_WCID_ATTRIBUTE: 206462306a36Sopenharmony_ci */ 206562306a36Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_KEYTAB FIELD32(0x00000001) 206662306a36Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_CIPHER FIELD32(0x0000000e) 206762306a36Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_BSS_IDX FIELD32(0x00000070) 206862306a36Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_RX_WIUDF FIELD32(0x00000380) 206962306a36Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_CIPHER_EXT FIELD32(0x00000400) 207062306a36Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_BSS_IDX_EXT FIELD32(0x00000800) 207162306a36Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_WAPI_MCBC FIELD32(0x00008000) 207262306a36Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_WAPI_KEY_IDX FIELD32(0xff000000) 207362306a36Sopenharmony_ci 207462306a36Sopenharmony_ci/* 207562306a36Sopenharmony_ci * SHARED_KEY_MODE: 207662306a36Sopenharmony_ci */ 207762306a36Sopenharmony_ci#define SHARED_KEY_MODE_BSS0_KEY0 FIELD32(0x00000007) 207862306a36Sopenharmony_ci#define SHARED_KEY_MODE_BSS0_KEY1 FIELD32(0x00000070) 207962306a36Sopenharmony_ci#define SHARED_KEY_MODE_BSS0_KEY2 FIELD32(0x00000700) 208062306a36Sopenharmony_ci#define SHARED_KEY_MODE_BSS0_KEY3 FIELD32(0x00007000) 208162306a36Sopenharmony_ci#define SHARED_KEY_MODE_BSS1_KEY0 FIELD32(0x00070000) 208262306a36Sopenharmony_ci#define SHARED_KEY_MODE_BSS1_KEY1 FIELD32(0x00700000) 208362306a36Sopenharmony_ci#define SHARED_KEY_MODE_BSS1_KEY2 FIELD32(0x07000000) 208462306a36Sopenharmony_ci#define SHARED_KEY_MODE_BSS1_KEY3 FIELD32(0x70000000) 208562306a36Sopenharmony_ci 208662306a36Sopenharmony_ci/* 208762306a36Sopenharmony_ci * HOST-MCU communication 208862306a36Sopenharmony_ci */ 208962306a36Sopenharmony_ci 209062306a36Sopenharmony_ci/* 209162306a36Sopenharmony_ci * H2M_MAILBOX_CSR: Host-to-MCU Mailbox. 209262306a36Sopenharmony_ci * CMD_TOKEN: Command id, 0xff disable status reporting. 209362306a36Sopenharmony_ci */ 209462306a36Sopenharmony_ci#define H2M_MAILBOX_CSR 0x7010 209562306a36Sopenharmony_ci#define H2M_MAILBOX_CSR_ARG0 FIELD32(0x000000ff) 209662306a36Sopenharmony_ci#define H2M_MAILBOX_CSR_ARG1 FIELD32(0x0000ff00) 209762306a36Sopenharmony_ci#define H2M_MAILBOX_CSR_CMD_TOKEN FIELD32(0x00ff0000) 209862306a36Sopenharmony_ci#define H2M_MAILBOX_CSR_OWNER FIELD32(0xff000000) 209962306a36Sopenharmony_ci 210062306a36Sopenharmony_ci/* 210162306a36Sopenharmony_ci * H2M_MAILBOX_CID: 210262306a36Sopenharmony_ci * Free slots contain 0xff. MCU will store command's token to lowest free slot. 210362306a36Sopenharmony_ci * If all slots are occupied status will be dropped. 210462306a36Sopenharmony_ci */ 210562306a36Sopenharmony_ci#define H2M_MAILBOX_CID 0x7014 210662306a36Sopenharmony_ci#define H2M_MAILBOX_CID_CMD0 FIELD32(0x000000ff) 210762306a36Sopenharmony_ci#define H2M_MAILBOX_CID_CMD1 FIELD32(0x0000ff00) 210862306a36Sopenharmony_ci#define H2M_MAILBOX_CID_CMD2 FIELD32(0x00ff0000) 210962306a36Sopenharmony_ci#define H2M_MAILBOX_CID_CMD3 FIELD32(0xff000000) 211062306a36Sopenharmony_ci 211162306a36Sopenharmony_ci/* 211262306a36Sopenharmony_ci * H2M_MAILBOX_STATUS: 211362306a36Sopenharmony_ci * Command status will be saved to same slot as command id. 211462306a36Sopenharmony_ci */ 211562306a36Sopenharmony_ci#define H2M_MAILBOX_STATUS 0x701c 211662306a36Sopenharmony_ci 211762306a36Sopenharmony_ci/* 211862306a36Sopenharmony_ci * H2M_INT_SRC: 211962306a36Sopenharmony_ci */ 212062306a36Sopenharmony_ci#define H2M_INT_SRC 0x7024 212162306a36Sopenharmony_ci 212262306a36Sopenharmony_ci/* 212362306a36Sopenharmony_ci * H2M_BBP_AGENT: 212462306a36Sopenharmony_ci */ 212562306a36Sopenharmony_ci#define H2M_BBP_AGENT 0x7028 212662306a36Sopenharmony_ci 212762306a36Sopenharmony_ci/* 212862306a36Sopenharmony_ci * MCU_LEDCS: LED control for MCU Mailbox. 212962306a36Sopenharmony_ci */ 213062306a36Sopenharmony_ci#define MCU_LEDCS_LED_MODE FIELD8(0x1f) 213162306a36Sopenharmony_ci#define MCU_LEDCS_POLARITY FIELD8(0x01) 213262306a36Sopenharmony_ci 213362306a36Sopenharmony_ci/* 213462306a36Sopenharmony_ci * HW_CS_CTS_BASE: 213562306a36Sopenharmony_ci * Carrier-sense CTS frame base address. 213662306a36Sopenharmony_ci * It's where mac stores carrier-sense frame for carrier-sense function. 213762306a36Sopenharmony_ci */ 213862306a36Sopenharmony_ci#define HW_CS_CTS_BASE 0x7700 213962306a36Sopenharmony_ci 214062306a36Sopenharmony_ci/* 214162306a36Sopenharmony_ci * HW_DFS_CTS_BASE: 214262306a36Sopenharmony_ci * DFS CTS frame base address. It's where mac stores CTS frame for DFS. 214362306a36Sopenharmony_ci */ 214462306a36Sopenharmony_ci#define HW_DFS_CTS_BASE 0x7780 214562306a36Sopenharmony_ci 214662306a36Sopenharmony_ci/* 214762306a36Sopenharmony_ci * TXRX control registers - base address 0x3000 214862306a36Sopenharmony_ci */ 214962306a36Sopenharmony_ci 215062306a36Sopenharmony_ci/* 215162306a36Sopenharmony_ci * TXRX_CSR1: 215262306a36Sopenharmony_ci * rt2860b UNKNOWN reg use R/O Reg Addr 0x77d0 first.. 215362306a36Sopenharmony_ci */ 215462306a36Sopenharmony_ci#define TXRX_CSR1 0x77d0 215562306a36Sopenharmony_ci 215662306a36Sopenharmony_ci/* 215762306a36Sopenharmony_ci * HW_DEBUG_SETTING_BASE: 215862306a36Sopenharmony_ci * since NULL frame won't be that long (256 byte) 215962306a36Sopenharmony_ci * We steal 16 tail bytes to save debugging settings 216062306a36Sopenharmony_ci */ 216162306a36Sopenharmony_ci#define HW_DEBUG_SETTING_BASE 0x77f0 216262306a36Sopenharmony_ci#define HW_DEBUG_SETTING_BASE2 0x7770 216362306a36Sopenharmony_ci 216462306a36Sopenharmony_ci/* 216562306a36Sopenharmony_ci * HW_BEACON_BASE 216662306a36Sopenharmony_ci * In order to support maximum 8 MBSS and its maximum length 216762306a36Sopenharmony_ci * is 512 bytes for each beacon 216862306a36Sopenharmony_ci * Three section discontinue memory segments will be used. 216962306a36Sopenharmony_ci * 1. The original region for BCN 0~3 217062306a36Sopenharmony_ci * 2. Extract memory from FCE table for BCN 4~5 217162306a36Sopenharmony_ci * 3. Extract memory from Pair-wise key table for BCN 6~7 217262306a36Sopenharmony_ci * It occupied those memory of wcid 238~253 for BCN 6 217362306a36Sopenharmony_ci * and wcid 222~237 for BCN 7 (see Security key table memory 217462306a36Sopenharmony_ci * for more info). 217562306a36Sopenharmony_ci * 217662306a36Sopenharmony_ci * IMPORTANT NOTE: Not sure why legacy driver does this, 217762306a36Sopenharmony_ci * but HW_BEACON_BASE7 is 0x0200 bytes below HW_BEACON_BASE6. 217862306a36Sopenharmony_ci */ 217962306a36Sopenharmony_ci#define HW_BEACON_BASE0 0x7800 218062306a36Sopenharmony_ci#define HW_BEACON_BASE1 0x7a00 218162306a36Sopenharmony_ci#define HW_BEACON_BASE2 0x7c00 218262306a36Sopenharmony_ci#define HW_BEACON_BASE3 0x7e00 218362306a36Sopenharmony_ci#define HW_BEACON_BASE4 0x7200 218462306a36Sopenharmony_ci#define HW_BEACON_BASE5 0x7400 218562306a36Sopenharmony_ci#define HW_BEACON_BASE6 0x5dc0 218662306a36Sopenharmony_ci#define HW_BEACON_BASE7 0x5bc0 218762306a36Sopenharmony_ci 218862306a36Sopenharmony_ci#define HW_BEACON_BASE(__index) \ 218962306a36Sopenharmony_ci (((__index) < 4) ? (HW_BEACON_BASE0 + (__index * 0x0200)) : \ 219062306a36Sopenharmony_ci (((__index) < 6) ? (HW_BEACON_BASE4 + ((__index - 4) * 0x0200)) : \ 219162306a36Sopenharmony_ci (HW_BEACON_BASE6 - ((__index - 6) * 0x0200)))) 219262306a36Sopenharmony_ci 219362306a36Sopenharmony_ci#define BEACON_BASE_TO_OFFSET(_base) (((_base) - 0x4000) / 64) 219462306a36Sopenharmony_ci 219562306a36Sopenharmony_ci/* 219662306a36Sopenharmony_ci * BBP registers. 219762306a36Sopenharmony_ci * The wordsize of the BBP is 8 bits. 219862306a36Sopenharmony_ci */ 219962306a36Sopenharmony_ci 220062306a36Sopenharmony_ci/* 220162306a36Sopenharmony_ci * BBP 1: TX Antenna & Power Control 220262306a36Sopenharmony_ci * POWER_CTRL: 220362306a36Sopenharmony_ci * 0 - normal, 220462306a36Sopenharmony_ci * 1 - drop tx power by 6dBm, 220562306a36Sopenharmony_ci * 2 - drop tx power by 12dBm, 220662306a36Sopenharmony_ci * 3 - increase tx power by 6dBm 220762306a36Sopenharmony_ci */ 220862306a36Sopenharmony_ci#define BBP1_TX_POWER_CTRL FIELD8(0x03) 220962306a36Sopenharmony_ci#define BBP1_TX_ANTENNA FIELD8(0x18) 221062306a36Sopenharmony_ci 221162306a36Sopenharmony_ci/* 221262306a36Sopenharmony_ci * BBP 3: RX Antenna 221362306a36Sopenharmony_ci */ 221462306a36Sopenharmony_ci#define BBP3_RX_ADC FIELD8(0x03) 221562306a36Sopenharmony_ci#define BBP3_RX_ANTENNA FIELD8(0x18) 221662306a36Sopenharmony_ci#define BBP3_HT40_MINUS FIELD8(0x20) 221762306a36Sopenharmony_ci#define BBP3_ADC_MODE_SWITCH FIELD8(0x40) 221862306a36Sopenharmony_ci#define BBP3_ADC_INIT_MODE FIELD8(0x80) 221962306a36Sopenharmony_ci 222062306a36Sopenharmony_ci/* 222162306a36Sopenharmony_ci * BBP 4: Bandwidth 222262306a36Sopenharmony_ci */ 222362306a36Sopenharmony_ci#define BBP4_TX_BF FIELD8(0x01) 222462306a36Sopenharmony_ci#define BBP4_BANDWIDTH FIELD8(0x18) 222562306a36Sopenharmony_ci#define BBP4_MAC_IF_CTRL FIELD8(0x40) 222662306a36Sopenharmony_ci 222762306a36Sopenharmony_ci/* BBP27 */ 222862306a36Sopenharmony_ci#define BBP27_RX_CHAIN_SEL FIELD8(0x60) 222962306a36Sopenharmony_ci 223062306a36Sopenharmony_ci/* 223162306a36Sopenharmony_ci * BBP 47: Bandwidth 223262306a36Sopenharmony_ci */ 223362306a36Sopenharmony_ci#define BBP47_TSSI_REPORT_SEL FIELD8(0x03) 223462306a36Sopenharmony_ci#define BBP47_TSSI_UPDATE_REQ FIELD8(0x04) 223562306a36Sopenharmony_ci#define BBP47_TSSI_TSSI_MODE FIELD8(0x18) 223662306a36Sopenharmony_ci#define BBP47_TSSI_ADC6 FIELD8(0x80) 223762306a36Sopenharmony_ci 223862306a36Sopenharmony_ci/* 223962306a36Sopenharmony_ci * BBP 49 224062306a36Sopenharmony_ci */ 224162306a36Sopenharmony_ci#define BBP49_UPDATE_FLAG FIELD8(0x01) 224262306a36Sopenharmony_ci 224362306a36Sopenharmony_ci/* 224462306a36Sopenharmony_ci * BBP 105: 224562306a36Sopenharmony_ci * - bit0: detect SIG on primary channel only (on 40MHz bandwidth) 224662306a36Sopenharmony_ci * - bit1: FEQ (Feed Forward Compensation) for independend streams 224762306a36Sopenharmony_ci * - bit2: MLD (Maximum Likehood Detection) for 2 streams (reserved on single 224862306a36Sopenharmony_ci * stream) 224962306a36Sopenharmony_ci * - bit4: channel estimation updates based on remodulation of 225062306a36Sopenharmony_ci * L-SIG and HT-SIG symbols 225162306a36Sopenharmony_ci */ 225262306a36Sopenharmony_ci#define BBP105_DETECT_SIG_ON_PRIMARY FIELD8(0x01) 225362306a36Sopenharmony_ci#define BBP105_FEQ FIELD8(0x02) 225462306a36Sopenharmony_ci#define BBP105_MLD FIELD8(0x04) 225562306a36Sopenharmony_ci#define BBP105_SIG_REMODULATION FIELD8(0x08) 225662306a36Sopenharmony_ci 225762306a36Sopenharmony_ci/* 225862306a36Sopenharmony_ci * BBP 109 225962306a36Sopenharmony_ci */ 226062306a36Sopenharmony_ci#define BBP109_TX0_POWER FIELD8(0x0f) 226162306a36Sopenharmony_ci#define BBP109_TX1_POWER FIELD8(0xf0) 226262306a36Sopenharmony_ci 226362306a36Sopenharmony_ci/* BBP 110 */ 226462306a36Sopenharmony_ci#define BBP110_TX2_POWER FIELD8(0x0f) 226562306a36Sopenharmony_ci 226662306a36Sopenharmony_ci 226762306a36Sopenharmony_ci/* 226862306a36Sopenharmony_ci * BBP 138: Unknown 226962306a36Sopenharmony_ci */ 227062306a36Sopenharmony_ci#define BBP138_RX_ADC1 FIELD8(0x02) 227162306a36Sopenharmony_ci#define BBP138_RX_ADC2 FIELD8(0x04) 227262306a36Sopenharmony_ci#define BBP138_TX_DAC1 FIELD8(0x20) 227362306a36Sopenharmony_ci#define BBP138_TX_DAC2 FIELD8(0x40) 227462306a36Sopenharmony_ci 227562306a36Sopenharmony_ci/* 227662306a36Sopenharmony_ci * BBP 152: Rx Ant 227762306a36Sopenharmony_ci */ 227862306a36Sopenharmony_ci#define BBP152_RX_DEFAULT_ANT FIELD8(0x80) 227962306a36Sopenharmony_ci 228062306a36Sopenharmony_ci/* 228162306a36Sopenharmony_ci * BBP 254: unknown 228262306a36Sopenharmony_ci */ 228362306a36Sopenharmony_ci#define BBP254_BIT7 FIELD8(0x80) 228462306a36Sopenharmony_ci 228562306a36Sopenharmony_ci/* 228662306a36Sopenharmony_ci * RFCSR registers 228762306a36Sopenharmony_ci * The wordsize of the RFCSR is 8 bits. 228862306a36Sopenharmony_ci */ 228962306a36Sopenharmony_ci 229062306a36Sopenharmony_ci/* 229162306a36Sopenharmony_ci * RFCSR 1: 229262306a36Sopenharmony_ci */ 229362306a36Sopenharmony_ci#define RFCSR1_RF_BLOCK_EN FIELD8(0x01) 229462306a36Sopenharmony_ci#define RFCSR1_PLL_PD FIELD8(0x02) 229562306a36Sopenharmony_ci#define RFCSR1_RX0_PD FIELD8(0x04) 229662306a36Sopenharmony_ci#define RFCSR1_TX0_PD FIELD8(0x08) 229762306a36Sopenharmony_ci#define RFCSR1_RX1_PD FIELD8(0x10) 229862306a36Sopenharmony_ci#define RFCSR1_TX1_PD FIELD8(0x20) 229962306a36Sopenharmony_ci#define RFCSR1_RX2_PD FIELD8(0x40) 230062306a36Sopenharmony_ci#define RFCSR1_TX2_PD FIELD8(0x80) 230162306a36Sopenharmony_ci#define RFCSR1_TX2_EN_MT7620 FIELD8(0x02) 230262306a36Sopenharmony_ci 230362306a36Sopenharmony_ci/* 230462306a36Sopenharmony_ci * RFCSR 2: 230562306a36Sopenharmony_ci */ 230662306a36Sopenharmony_ci#define RFCSR2_RESCAL_BP FIELD8(0x40) 230762306a36Sopenharmony_ci#define RFCSR2_RESCAL_EN FIELD8(0x80) 230862306a36Sopenharmony_ci#define RFCSR2_RX2_EN_MT7620 FIELD8(0x02) 230962306a36Sopenharmony_ci#define RFCSR2_TX2_EN_MT7620 FIELD8(0x20) 231062306a36Sopenharmony_ci 231162306a36Sopenharmony_ci/* 231262306a36Sopenharmony_ci * RFCSR 3: 231362306a36Sopenharmony_ci */ 231462306a36Sopenharmony_ci#define RFCSR3_K FIELD8(0x0f) 231562306a36Sopenharmony_ci/* Bits [7-4] for RF3320 (RT3370/RT3390), on other chipsets reserved */ 231662306a36Sopenharmony_ci#define RFCSR3_PA1_BIAS_CCK FIELD8(0x70) 231762306a36Sopenharmony_ci#define RFCSR3_PA2_CASCODE_BIAS_CCKK FIELD8(0x80) 231862306a36Sopenharmony_ci/* Bits for RF3290/RF5360/RF5362/RF5370/RF5372/RF5390/RF5392 */ 231962306a36Sopenharmony_ci#define RFCSR3_VCOCAL_EN FIELD8(0x80) 232062306a36Sopenharmony_ci/* Bits for RF3050 */ 232162306a36Sopenharmony_ci#define RFCSR3_BIT1 FIELD8(0x02) 232262306a36Sopenharmony_ci#define RFCSR3_BIT2 FIELD8(0x04) 232362306a36Sopenharmony_ci#define RFCSR3_BIT3 FIELD8(0x08) 232462306a36Sopenharmony_ci#define RFCSR3_BIT4 FIELD8(0x10) 232562306a36Sopenharmony_ci#define RFCSR3_BIT5 FIELD8(0x20) 232662306a36Sopenharmony_ci 232762306a36Sopenharmony_ci/* 232862306a36Sopenharmony_ci * RFCSR 4: 232962306a36Sopenharmony_ci * VCOCAL_EN used by MT7620 233062306a36Sopenharmony_ci */ 233162306a36Sopenharmony_ci#define RFCSR4_VCOCAL_EN FIELD8(0x80) 233262306a36Sopenharmony_ci 233362306a36Sopenharmony_ci/* 233462306a36Sopenharmony_ci * FRCSR 5: 233562306a36Sopenharmony_ci */ 233662306a36Sopenharmony_ci#define RFCSR5_R1 FIELD8(0x0c) 233762306a36Sopenharmony_ci 233862306a36Sopenharmony_ci/* 233962306a36Sopenharmony_ci * RFCSR 6: 234062306a36Sopenharmony_ci */ 234162306a36Sopenharmony_ci#define RFCSR6_R1 FIELD8(0x03) 234262306a36Sopenharmony_ci#define RFCSR6_R2 FIELD8(0x40) 234362306a36Sopenharmony_ci#define RFCSR6_TXDIV FIELD8(0x0c) 234462306a36Sopenharmony_ci/* bits for RF3053 */ 234562306a36Sopenharmony_ci#define RFCSR6_VCO_IC FIELD8(0xc0) 234662306a36Sopenharmony_ci 234762306a36Sopenharmony_ci/* 234862306a36Sopenharmony_ci * RFCSR 7: 234962306a36Sopenharmony_ci */ 235062306a36Sopenharmony_ci#define RFCSR7_RF_TUNING FIELD8(0x01) 235162306a36Sopenharmony_ci#define RFCSR7_BIT1 FIELD8(0x02) 235262306a36Sopenharmony_ci#define RFCSR7_BIT2 FIELD8(0x04) 235362306a36Sopenharmony_ci#define RFCSR7_BIT3 FIELD8(0x08) 235462306a36Sopenharmony_ci#define RFCSR7_BIT4 FIELD8(0x10) 235562306a36Sopenharmony_ci#define RFCSR7_BIT5 FIELD8(0x20) 235662306a36Sopenharmony_ci#define RFCSR7_BITS67 FIELD8(0xc0) 235762306a36Sopenharmony_ci 235862306a36Sopenharmony_ci/* 235962306a36Sopenharmony_ci * RFCSR 9: 236062306a36Sopenharmony_ci */ 236162306a36Sopenharmony_ci#define RFCSR9_K FIELD8(0x0f) 236262306a36Sopenharmony_ci#define RFCSR9_N FIELD8(0x10) 236362306a36Sopenharmony_ci#define RFCSR9_UNKNOWN FIELD8(0x60) 236462306a36Sopenharmony_ci#define RFCSR9_MOD FIELD8(0x80) 236562306a36Sopenharmony_ci 236662306a36Sopenharmony_ci/* 236762306a36Sopenharmony_ci * RFCSR 11: 236862306a36Sopenharmony_ci */ 236962306a36Sopenharmony_ci#define RFCSR11_R FIELD8(0x03) 237062306a36Sopenharmony_ci#define RFCSR11_PLL_MOD FIELD8(0x0c) 237162306a36Sopenharmony_ci#define RFCSR11_MOD FIELD8(0xc0) 237262306a36Sopenharmony_ci/* bits for RF3053 */ 237362306a36Sopenharmony_ci/* TODO: verify RFCSR11_MOD usage on other chips */ 237462306a36Sopenharmony_ci#define RFCSR11_PLL_IDOH FIELD8(0x40) 237562306a36Sopenharmony_ci 237662306a36Sopenharmony_ci 237762306a36Sopenharmony_ci/* 237862306a36Sopenharmony_ci * RFCSR 12: 237962306a36Sopenharmony_ci */ 238062306a36Sopenharmony_ci#define RFCSR12_TX_POWER FIELD8(0x1f) 238162306a36Sopenharmony_ci#define RFCSR12_DR0 FIELD8(0xe0) 238262306a36Sopenharmony_ci 238362306a36Sopenharmony_ci/* 238462306a36Sopenharmony_ci * RFCSR 13: 238562306a36Sopenharmony_ci */ 238662306a36Sopenharmony_ci#define RFCSR13_TX_POWER FIELD8(0x1f) 238762306a36Sopenharmony_ci#define RFCSR13_DR0 FIELD8(0xe0) 238862306a36Sopenharmony_ci#define RFCSR13_RDIV_MT7620 FIELD8(0x03) 238962306a36Sopenharmony_ci 239062306a36Sopenharmony_ci/* 239162306a36Sopenharmony_ci * RFCSR 15: 239262306a36Sopenharmony_ci */ 239362306a36Sopenharmony_ci#define RFCSR15_TX_LO2_EN FIELD8(0x08) 239462306a36Sopenharmony_ci 239562306a36Sopenharmony_ci/* 239662306a36Sopenharmony_ci * RFCSR 16: 239762306a36Sopenharmony_ci */ 239862306a36Sopenharmony_ci#define RFCSR16_TXMIXER_GAIN FIELD8(0x07) 239962306a36Sopenharmony_ci#define RFCSR16_RF_PLL_FREQ_SEL_MT7620 FIELD8(0x0F) 240062306a36Sopenharmony_ci#define RFCSR16_SDM_MODE_MT7620 FIELD8(0xE0) 240162306a36Sopenharmony_ci 240262306a36Sopenharmony_ci/* 240362306a36Sopenharmony_ci * RFCSR 17: 240462306a36Sopenharmony_ci */ 240562306a36Sopenharmony_ci#define RFCSR17_TXMIXER_GAIN FIELD8(0x07) 240662306a36Sopenharmony_ci#define RFCSR17_TX_LO1_EN FIELD8(0x08) 240762306a36Sopenharmony_ci#define RFCSR17_R FIELD8(0x20) 240862306a36Sopenharmony_ci#define RFCSR17_CODE FIELD8(0x7f) 240962306a36Sopenharmony_ci 241062306a36Sopenharmony_ci/* RFCSR 18 */ 241162306a36Sopenharmony_ci#define RFCSR18_XO_TUNE_BYPASS FIELD8(0x40) 241262306a36Sopenharmony_ci 241362306a36Sopenharmony_ci/* RFCSR 19 */ 241462306a36Sopenharmony_ci#define RFCSR19_K FIELD8(0x03) 241562306a36Sopenharmony_ci 241662306a36Sopenharmony_ci/* 241762306a36Sopenharmony_ci * RFCSR 20: 241862306a36Sopenharmony_ci */ 241962306a36Sopenharmony_ci#define RFCSR20_RX_LO1_EN FIELD8(0x08) 242062306a36Sopenharmony_ci 242162306a36Sopenharmony_ci/* 242262306a36Sopenharmony_ci * RFCSR 21: 242362306a36Sopenharmony_ci */ 242462306a36Sopenharmony_ci#define RFCSR21_RX_LO2_EN FIELD8(0x08) 242562306a36Sopenharmony_ci#define RFCSR21_BIT1 FIELD8(0x01) 242662306a36Sopenharmony_ci#define RFCSR21_BIT8 FIELD8(0x80) 242762306a36Sopenharmony_ci 242862306a36Sopenharmony_ci/* 242962306a36Sopenharmony_ci * RFCSR 22: 243062306a36Sopenharmony_ci */ 243162306a36Sopenharmony_ci#define RFCSR22_BASEBAND_LOOPBACK FIELD8(0x01) 243262306a36Sopenharmony_ci#define RFCSR22_FREQPLAN_D_MT7620 FIELD8(0x07) 243362306a36Sopenharmony_ci 243462306a36Sopenharmony_ci/* 243562306a36Sopenharmony_ci * RFCSR 23: 243662306a36Sopenharmony_ci */ 243762306a36Sopenharmony_ci#define RFCSR23_FREQ_OFFSET FIELD8(0x7f) 243862306a36Sopenharmony_ci 243962306a36Sopenharmony_ci/* 244062306a36Sopenharmony_ci * RFCSR 24: 244162306a36Sopenharmony_ci */ 244262306a36Sopenharmony_ci#define RFCSR24_TX_AGC_FC FIELD8(0x1f) 244362306a36Sopenharmony_ci#define RFCSR24_TX_H20M FIELD8(0x20) 244462306a36Sopenharmony_ci#define RFCSR24_TX_CALIB FIELD8(0x7f) 244562306a36Sopenharmony_ci 244662306a36Sopenharmony_ci/* 244762306a36Sopenharmony_ci * RFCSR 27: 244862306a36Sopenharmony_ci */ 244962306a36Sopenharmony_ci#define RFCSR27_R1 FIELD8(0x03) 245062306a36Sopenharmony_ci#define RFCSR27_R2 FIELD8(0x04) 245162306a36Sopenharmony_ci#define RFCSR27_R3 FIELD8(0x30) 245262306a36Sopenharmony_ci#define RFCSR27_R4 FIELD8(0x40) 245362306a36Sopenharmony_ci 245462306a36Sopenharmony_ci/* 245562306a36Sopenharmony_ci * RFCSR 28: 245662306a36Sopenharmony_ci */ 245762306a36Sopenharmony_ci#define RFCSR28_CH11_HT40 FIELD8(0x04) 245862306a36Sopenharmony_ci 245962306a36Sopenharmony_ci/* 246062306a36Sopenharmony_ci * RFCSR 29: 246162306a36Sopenharmony_ci */ 246262306a36Sopenharmony_ci#define RFCSR29_ADC6_TEST FIELD8(0x01) 246362306a36Sopenharmony_ci#define RFCSR29_ADC6_INT_TEST FIELD8(0x02) 246462306a36Sopenharmony_ci#define RFCSR29_RSSI_RESET FIELD8(0x04) 246562306a36Sopenharmony_ci#define RFCSR29_RSSI_ON FIELD8(0x08) 246662306a36Sopenharmony_ci#define RFCSR29_RSSI_RIP_CTRL FIELD8(0x30) 246762306a36Sopenharmony_ci#define RFCSR29_RSSI_GAIN FIELD8(0xc0) 246862306a36Sopenharmony_ci 246962306a36Sopenharmony_ci/* 247062306a36Sopenharmony_ci * RFCSR 30: 247162306a36Sopenharmony_ci */ 247262306a36Sopenharmony_ci#define RFCSR30_TX_H20M FIELD8(0x02) 247362306a36Sopenharmony_ci#define RFCSR30_RX_H20M FIELD8(0x04) 247462306a36Sopenharmony_ci#define RFCSR30_RX_VCM FIELD8(0x18) 247562306a36Sopenharmony_ci#define RFCSR30_RF_CALIBRATION FIELD8(0x80) 247662306a36Sopenharmony_ci#define RF3322_RFCSR30_TX_H20M FIELD8(0x01) 247762306a36Sopenharmony_ci#define RF3322_RFCSR30_RX_H20M FIELD8(0x02) 247862306a36Sopenharmony_ci 247962306a36Sopenharmony_ci/* 248062306a36Sopenharmony_ci * RFCSR 31: 248162306a36Sopenharmony_ci */ 248262306a36Sopenharmony_ci#define RFCSR31_RX_AGC_FC FIELD8(0x1f) 248362306a36Sopenharmony_ci#define RFCSR31_RX_H20M FIELD8(0x20) 248462306a36Sopenharmony_ci#define RFCSR31_RX_CALIB FIELD8(0x7f) 248562306a36Sopenharmony_ci 248662306a36Sopenharmony_ci/* RFCSR 32 bits for RF3053 */ 248762306a36Sopenharmony_ci#define RFCSR32_TX_AGC_FC FIELD8(0xf8) 248862306a36Sopenharmony_ci 248962306a36Sopenharmony_ci/* RFCSR 36 bits for RF3053 */ 249062306a36Sopenharmony_ci#define RFCSR36_RF_BS FIELD8(0x80) 249162306a36Sopenharmony_ci 249262306a36Sopenharmony_ci/* 249362306a36Sopenharmony_ci * RFCSR 34: 249462306a36Sopenharmony_ci */ 249562306a36Sopenharmony_ci#define RFCSR34_TX0_EXT_PA FIELD8(0x04) 249662306a36Sopenharmony_ci#define RFCSR34_TX1_EXT_PA FIELD8(0x08) 249762306a36Sopenharmony_ci 249862306a36Sopenharmony_ci/* 249962306a36Sopenharmony_ci * RFCSR 38: 250062306a36Sopenharmony_ci */ 250162306a36Sopenharmony_ci#define RFCSR38_RX_LO1_EN FIELD8(0x20) 250262306a36Sopenharmony_ci 250362306a36Sopenharmony_ci/* 250462306a36Sopenharmony_ci * RFCSR 39: 250562306a36Sopenharmony_ci */ 250662306a36Sopenharmony_ci#define RFCSR39_RX_DIV FIELD8(0x40) 250762306a36Sopenharmony_ci#define RFCSR39_RX_LO2_EN FIELD8(0x80) 250862306a36Sopenharmony_ci 250962306a36Sopenharmony_ci/* 251062306a36Sopenharmony_ci * RFCSR 41: 251162306a36Sopenharmony_ci */ 251262306a36Sopenharmony_ci#define RFCSR41_BIT1 FIELD8(0x01) 251362306a36Sopenharmony_ci#define RFCSR41_BIT4 FIELD8(0x08) 251462306a36Sopenharmony_ci 251562306a36Sopenharmony_ci/* 251662306a36Sopenharmony_ci * RFCSR 42: 251762306a36Sopenharmony_ci */ 251862306a36Sopenharmony_ci#define RFCSR42_BIT1 FIELD8(0x01) 251962306a36Sopenharmony_ci#define RFCSR42_BIT4 FIELD8(0x08) 252062306a36Sopenharmony_ci#define RFCSR42_TX2_EN_MT7620 FIELD8(0x40) 252162306a36Sopenharmony_ci 252262306a36Sopenharmony_ci/* 252362306a36Sopenharmony_ci * RFCSR 49: 252462306a36Sopenharmony_ci */ 252562306a36Sopenharmony_ci#define RFCSR49_TX FIELD8(0x3f) 252662306a36Sopenharmony_ci#define RFCSR49_EP FIELD8(0xc0) 252762306a36Sopenharmony_ci/* bits for RT3593 */ 252862306a36Sopenharmony_ci#define RFCSR49_TX_LO1_IC FIELD8(0x1c) 252962306a36Sopenharmony_ci#define RFCSR49_TX_DIV FIELD8(0x20) 253062306a36Sopenharmony_ci 253162306a36Sopenharmony_ci/* 253262306a36Sopenharmony_ci * RFCSR 50: 253362306a36Sopenharmony_ci */ 253462306a36Sopenharmony_ci#define RFCSR50_TX FIELD8(0x3f) 253562306a36Sopenharmony_ci#define RFCSR50_TX0_EXT_PA FIELD8(0x02) 253662306a36Sopenharmony_ci#define RFCSR50_TX1_EXT_PA FIELD8(0x10) 253762306a36Sopenharmony_ci#define RFCSR50_EP FIELD8(0xc0) 253862306a36Sopenharmony_ci/* bits for RT3593 */ 253962306a36Sopenharmony_ci#define RFCSR50_TX_LO1_EN FIELD8(0x20) 254062306a36Sopenharmony_ci#define RFCSR50_TX_LO2_EN FIELD8(0x10) 254162306a36Sopenharmony_ci 254262306a36Sopenharmony_ci/* RFCSR 51 */ 254362306a36Sopenharmony_ci/* bits for RT3593 */ 254462306a36Sopenharmony_ci#define RFCSR51_BITS01 FIELD8(0x03) 254562306a36Sopenharmony_ci#define RFCSR51_BITS24 FIELD8(0x1c) 254662306a36Sopenharmony_ci#define RFCSR51_BITS57 FIELD8(0xe0) 254762306a36Sopenharmony_ci 254862306a36Sopenharmony_ci#define RFCSR53_TX_POWER FIELD8(0x3f) 254962306a36Sopenharmony_ci#define RFCSR53_UNKNOWN FIELD8(0xc0) 255062306a36Sopenharmony_ci 255162306a36Sopenharmony_ci#define RFCSR54_TX_POWER FIELD8(0x3f) 255262306a36Sopenharmony_ci#define RFCSR54_UNKNOWN FIELD8(0xc0) 255362306a36Sopenharmony_ci 255462306a36Sopenharmony_ci#define RFCSR55_TX_POWER FIELD8(0x3f) 255562306a36Sopenharmony_ci#define RFCSR55_UNKNOWN FIELD8(0xc0) 255662306a36Sopenharmony_ci 255762306a36Sopenharmony_ci#define RFCSR57_DRV_CC FIELD8(0xfc) 255862306a36Sopenharmony_ci 255962306a36Sopenharmony_ci 256062306a36Sopenharmony_ci/* 256162306a36Sopenharmony_ci * RF registers 256262306a36Sopenharmony_ci */ 256362306a36Sopenharmony_ci 256462306a36Sopenharmony_ci/* 256562306a36Sopenharmony_ci * RF 2 256662306a36Sopenharmony_ci */ 256762306a36Sopenharmony_ci#define RF2_ANTENNA_RX2 FIELD32(0x00000040) 256862306a36Sopenharmony_ci#define RF2_ANTENNA_TX1 FIELD32(0x00004000) 256962306a36Sopenharmony_ci#define RF2_ANTENNA_RX1 FIELD32(0x00020000) 257062306a36Sopenharmony_ci 257162306a36Sopenharmony_ci/* 257262306a36Sopenharmony_ci * RF 3 257362306a36Sopenharmony_ci */ 257462306a36Sopenharmony_ci#define RF3_TXPOWER_G FIELD32(0x00003e00) 257562306a36Sopenharmony_ci#define RF3_TXPOWER_A_7DBM_BOOST FIELD32(0x00000200) 257662306a36Sopenharmony_ci#define RF3_TXPOWER_A FIELD32(0x00003c00) 257762306a36Sopenharmony_ci 257862306a36Sopenharmony_ci/* 257962306a36Sopenharmony_ci * RF 4 258062306a36Sopenharmony_ci */ 258162306a36Sopenharmony_ci#define RF4_TXPOWER_G FIELD32(0x000007c0) 258262306a36Sopenharmony_ci#define RF4_TXPOWER_A_7DBM_BOOST FIELD32(0x00000040) 258362306a36Sopenharmony_ci#define RF4_TXPOWER_A FIELD32(0x00000780) 258462306a36Sopenharmony_ci#define RF4_FREQ_OFFSET FIELD32(0x001f8000) 258562306a36Sopenharmony_ci#define RF4_HT40 FIELD32(0x00200000) 258662306a36Sopenharmony_ci 258762306a36Sopenharmony_ci/* 258862306a36Sopenharmony_ci * EEPROM content. 258962306a36Sopenharmony_ci * The wordsize of the EEPROM is 16 bits. 259062306a36Sopenharmony_ci */ 259162306a36Sopenharmony_ci 259262306a36Sopenharmony_cienum rt2800_eeprom_word { 259362306a36Sopenharmony_ci EEPROM_CHIP_ID = 0, 259462306a36Sopenharmony_ci EEPROM_VERSION, 259562306a36Sopenharmony_ci EEPROM_MAC_ADDR_0, 259662306a36Sopenharmony_ci EEPROM_MAC_ADDR_1, 259762306a36Sopenharmony_ci EEPROM_MAC_ADDR_2, 259862306a36Sopenharmony_ci EEPROM_NIC_CONF0, 259962306a36Sopenharmony_ci EEPROM_NIC_CONF1, 260062306a36Sopenharmony_ci EEPROM_FREQ, 260162306a36Sopenharmony_ci EEPROM_LED_AG_CONF, 260262306a36Sopenharmony_ci EEPROM_LED_ACT_CONF, 260362306a36Sopenharmony_ci EEPROM_LED_POLARITY, 260462306a36Sopenharmony_ci EEPROM_NIC_CONF2, 260562306a36Sopenharmony_ci EEPROM_LNA, 260662306a36Sopenharmony_ci EEPROM_RSSI_BG, 260762306a36Sopenharmony_ci EEPROM_RSSI_BG2, 260862306a36Sopenharmony_ci EEPROM_TXMIXER_GAIN_BG, 260962306a36Sopenharmony_ci EEPROM_RSSI_A, 261062306a36Sopenharmony_ci EEPROM_RSSI_A2, 261162306a36Sopenharmony_ci EEPROM_TXMIXER_GAIN_A, 261262306a36Sopenharmony_ci EEPROM_EIRP_MAX_TX_POWER, 261362306a36Sopenharmony_ci EEPROM_TXPOWER_DELTA, 261462306a36Sopenharmony_ci EEPROM_TXPOWER_BG1, 261562306a36Sopenharmony_ci EEPROM_TXPOWER_BG2, 261662306a36Sopenharmony_ci EEPROM_TSSI_BOUND_BG1, 261762306a36Sopenharmony_ci EEPROM_TSSI_BOUND_BG2, 261862306a36Sopenharmony_ci EEPROM_TSSI_BOUND_BG3, 261962306a36Sopenharmony_ci EEPROM_TSSI_BOUND_BG4, 262062306a36Sopenharmony_ci EEPROM_TSSI_BOUND_BG5, 262162306a36Sopenharmony_ci EEPROM_TXPOWER_A1, 262262306a36Sopenharmony_ci EEPROM_TXPOWER_A2, 262362306a36Sopenharmony_ci EEPROM_TXPOWER_INIT, 262462306a36Sopenharmony_ci EEPROM_TSSI_BOUND_A1, 262562306a36Sopenharmony_ci EEPROM_TSSI_BOUND_A2, 262662306a36Sopenharmony_ci EEPROM_TSSI_BOUND_A3, 262762306a36Sopenharmony_ci EEPROM_TSSI_BOUND_A4, 262862306a36Sopenharmony_ci EEPROM_TSSI_BOUND_A5, 262962306a36Sopenharmony_ci EEPROM_TXPOWER_BYRATE, 263062306a36Sopenharmony_ci EEPROM_BBP_START, 263162306a36Sopenharmony_ci 263262306a36Sopenharmony_ci /* IDs for extended EEPROM format used by three-chain devices */ 263362306a36Sopenharmony_ci EEPROM_EXT_LNA2, 263462306a36Sopenharmony_ci EEPROM_EXT_TXPOWER_BG3, 263562306a36Sopenharmony_ci EEPROM_EXT_TXPOWER_A3, 263662306a36Sopenharmony_ci 263762306a36Sopenharmony_ci /* New values must be added before this */ 263862306a36Sopenharmony_ci EEPROM_WORD_COUNT 263962306a36Sopenharmony_ci}; 264062306a36Sopenharmony_ci 264162306a36Sopenharmony_ci/* 264262306a36Sopenharmony_ci * EEPROM Version 264362306a36Sopenharmony_ci */ 264462306a36Sopenharmony_ci#define EEPROM_VERSION_FAE FIELD16(0x00ff) 264562306a36Sopenharmony_ci#define EEPROM_VERSION_VERSION FIELD16(0xff00) 264662306a36Sopenharmony_ci 264762306a36Sopenharmony_ci/* 264862306a36Sopenharmony_ci * HW MAC address. 264962306a36Sopenharmony_ci */ 265062306a36Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE0 FIELD16(0x00ff) 265162306a36Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE1 FIELD16(0xff00) 265262306a36Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE2 FIELD16(0x00ff) 265362306a36Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE3 FIELD16(0xff00) 265462306a36Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE4 FIELD16(0x00ff) 265562306a36Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE5 FIELD16(0xff00) 265662306a36Sopenharmony_ci 265762306a36Sopenharmony_ci/* 265862306a36Sopenharmony_ci * EEPROM NIC Configuration 0 265962306a36Sopenharmony_ci * RXPATH: 1: 1R, 2: 2R, 3: 3R 266062306a36Sopenharmony_ci * TXPATH: 1: 1T, 2: 2T, 3: 3T 266162306a36Sopenharmony_ci * RF_TYPE: RFIC type 266262306a36Sopenharmony_ci */ 266362306a36Sopenharmony_ci#define EEPROM_NIC_CONF0_RXPATH FIELD16(0x000f) 266462306a36Sopenharmony_ci#define EEPROM_NIC_CONF0_TXPATH FIELD16(0x00f0) 266562306a36Sopenharmony_ci#define EEPROM_NIC_CONF0_RF_TYPE FIELD16(0x0f00) 266662306a36Sopenharmony_ci 266762306a36Sopenharmony_ci/* 266862306a36Sopenharmony_ci * EEPROM NIC Configuration 1 266962306a36Sopenharmony_ci * HW_RADIO: 0: disable, 1: enable 267062306a36Sopenharmony_ci * EXTERNAL_TX_ALC: 0: disable, 1: enable 267162306a36Sopenharmony_ci * EXTERNAL_LNA_2G: 0: disable, 1: enable 267262306a36Sopenharmony_ci * EXTERNAL_LNA_5G: 0: disable, 1: enable 267362306a36Sopenharmony_ci * CARDBUS_ACCEL: 0: enable, 1: disable 267462306a36Sopenharmony_ci * BW40M_SB_2G: 0: disable, 1: enable 267562306a36Sopenharmony_ci * BW40M_SB_5G: 0: disable, 1: enable 267662306a36Sopenharmony_ci * WPS_PBC: 0: disable, 1: enable 267762306a36Sopenharmony_ci * BW40M_2G: 0: enable, 1: disable 267862306a36Sopenharmony_ci * BW40M_5G: 0: enable, 1: disable 267962306a36Sopenharmony_ci * BROADBAND_EXT_LNA: 0: disable, 1: enable 268062306a36Sopenharmony_ci * ANT_DIVERSITY: 00: Disable, 01: Diversity, 268162306a36Sopenharmony_ci * 10: Main antenna, 11: Aux antenna 268262306a36Sopenharmony_ci * INTERNAL_TX_ALC: 0: disable, 1: enable 268362306a36Sopenharmony_ci * BT_COEXIST: 0: disable, 1: enable 268462306a36Sopenharmony_ci * DAC_TEST: 0: disable, 1: enable 268562306a36Sopenharmony_ci * EXTERNAL_TX0_PA: 0: disable, 1: enable (only on RT3352) 268662306a36Sopenharmony_ci * EXTERNAL_TX1_PA: 0: disable, 1: enable (only on RT3352) 268762306a36Sopenharmony_ci */ 268862306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_HW_RADIO FIELD16(0x0001) 268962306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_EXTERNAL_TX_ALC FIELD16(0x0002) 269062306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_EXTERNAL_LNA_2G FIELD16(0x0004) 269162306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_EXTERNAL_LNA_5G FIELD16(0x0008) 269262306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_CARDBUS_ACCEL FIELD16(0x0010) 269362306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_BW40M_SB_2G FIELD16(0x0020) 269462306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_BW40M_SB_5G FIELD16(0x0040) 269562306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_WPS_PBC FIELD16(0x0080) 269662306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_BW40M_2G FIELD16(0x0100) 269762306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_BW40M_5G FIELD16(0x0200) 269862306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_BROADBAND_EXT_LNA FIELD16(0x400) 269962306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_ANT_DIVERSITY FIELD16(0x1800) 270062306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_INTERNAL_TX_ALC FIELD16(0x2000) 270162306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_BT_COEXIST FIELD16(0x4000) 270262306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_DAC_TEST FIELD16(0x8000) 270362306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352 FIELD16(0x4000) 270462306a36Sopenharmony_ci#define EEPROM_NIC_CONF1_EXTERNAL_TX1_PA_3352 FIELD16(0x8000) 270562306a36Sopenharmony_ci 270662306a36Sopenharmony_ci/* 270762306a36Sopenharmony_ci * EEPROM frequency 270862306a36Sopenharmony_ci */ 270962306a36Sopenharmony_ci#define EEPROM_FREQ_OFFSET FIELD16(0x00ff) 271062306a36Sopenharmony_ci#define EEPROM_FREQ_LED_MODE FIELD16(0x7f00) 271162306a36Sopenharmony_ci#define EEPROM_FREQ_LED_POLARITY FIELD16(0x1000) 271262306a36Sopenharmony_ci 271362306a36Sopenharmony_ci/* 271462306a36Sopenharmony_ci * EEPROM LED 271562306a36Sopenharmony_ci * POLARITY_RDY_G: Polarity RDY_G setting. 271662306a36Sopenharmony_ci * POLARITY_RDY_A: Polarity RDY_A setting. 271762306a36Sopenharmony_ci * POLARITY_ACT: Polarity ACT setting. 271862306a36Sopenharmony_ci * POLARITY_GPIO_0: Polarity GPIO0 setting. 271962306a36Sopenharmony_ci * POLARITY_GPIO_1: Polarity GPIO1 setting. 272062306a36Sopenharmony_ci * POLARITY_GPIO_2: Polarity GPIO2 setting. 272162306a36Sopenharmony_ci * POLARITY_GPIO_3: Polarity GPIO3 setting. 272262306a36Sopenharmony_ci * POLARITY_GPIO_4: Polarity GPIO4 setting. 272362306a36Sopenharmony_ci * LED_MODE: Led mode. 272462306a36Sopenharmony_ci */ 272562306a36Sopenharmony_ci#define EEPROM_LED_POLARITY_RDY_BG FIELD16(0x0001) 272662306a36Sopenharmony_ci#define EEPROM_LED_POLARITY_RDY_A FIELD16(0x0002) 272762306a36Sopenharmony_ci#define EEPROM_LED_POLARITY_ACT FIELD16(0x0004) 272862306a36Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_0 FIELD16(0x0008) 272962306a36Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_1 FIELD16(0x0010) 273062306a36Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_2 FIELD16(0x0020) 273162306a36Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_3 FIELD16(0x0040) 273262306a36Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_4 FIELD16(0x0080) 273362306a36Sopenharmony_ci#define EEPROM_LED_LED_MODE FIELD16(0x1f00) 273462306a36Sopenharmony_ci 273562306a36Sopenharmony_ci/* 273662306a36Sopenharmony_ci * EEPROM NIC Configuration 2 273762306a36Sopenharmony_ci * RX_STREAM: 0: Reserved, 1: 1 Stream, 2: 2 Stream 273862306a36Sopenharmony_ci * TX_STREAM: 0: Reserved, 1: 1 Stream, 2: 2 Stream 273962306a36Sopenharmony_ci * CRYSTAL: 00: Reserved, 01: One crystal, 10: Two crystal, 11: Reserved 274062306a36Sopenharmony_ci */ 274162306a36Sopenharmony_ci#define EEPROM_NIC_CONF2_RX_STREAM FIELD16(0x000f) 274262306a36Sopenharmony_ci#define EEPROM_NIC_CONF2_TX_STREAM FIELD16(0x00f0) 274362306a36Sopenharmony_ci#define EEPROM_NIC_CONF2_CRYSTAL FIELD16(0x0600) 274462306a36Sopenharmony_ci#define EEPROM_NIC_CONF2_EXTERNAL_PA FIELD16(0x8000) 274562306a36Sopenharmony_ci 274662306a36Sopenharmony_ci/* 274762306a36Sopenharmony_ci * EEPROM LNA 274862306a36Sopenharmony_ci */ 274962306a36Sopenharmony_ci#define EEPROM_LNA_BG FIELD16(0x00ff) 275062306a36Sopenharmony_ci#define EEPROM_LNA_A0 FIELD16(0xff00) 275162306a36Sopenharmony_ci 275262306a36Sopenharmony_ci/* 275362306a36Sopenharmony_ci * EEPROM RSSI BG offset 275462306a36Sopenharmony_ci */ 275562306a36Sopenharmony_ci#define EEPROM_RSSI_BG_OFFSET0 FIELD16(0x00ff) 275662306a36Sopenharmony_ci#define EEPROM_RSSI_BG_OFFSET1 FIELD16(0xff00) 275762306a36Sopenharmony_ci 275862306a36Sopenharmony_ci/* 275962306a36Sopenharmony_ci * EEPROM RSSI BG2 offset 276062306a36Sopenharmony_ci */ 276162306a36Sopenharmony_ci#define EEPROM_RSSI_BG2_OFFSET2 FIELD16(0x00ff) 276262306a36Sopenharmony_ci#define EEPROM_RSSI_BG2_LNA_A1 FIELD16(0xff00) 276362306a36Sopenharmony_ci 276462306a36Sopenharmony_ci/* 276562306a36Sopenharmony_ci * EEPROM TXMIXER GAIN BG offset (note overlaps with EEPROM RSSI BG2). 276662306a36Sopenharmony_ci */ 276762306a36Sopenharmony_ci#define EEPROM_TXMIXER_GAIN_BG_VAL FIELD16(0x0007) 276862306a36Sopenharmony_ci 276962306a36Sopenharmony_ci/* 277062306a36Sopenharmony_ci * EEPROM RSSI A offset 277162306a36Sopenharmony_ci */ 277262306a36Sopenharmony_ci#define EEPROM_RSSI_A_OFFSET0 FIELD16(0x00ff) 277362306a36Sopenharmony_ci#define EEPROM_RSSI_A_OFFSET1 FIELD16(0xff00) 277462306a36Sopenharmony_ci 277562306a36Sopenharmony_ci/* 277662306a36Sopenharmony_ci * EEPROM RSSI A2 offset 277762306a36Sopenharmony_ci */ 277862306a36Sopenharmony_ci#define EEPROM_RSSI_A2_OFFSET2 FIELD16(0x00ff) 277962306a36Sopenharmony_ci#define EEPROM_RSSI_A2_LNA_A2 FIELD16(0xff00) 278062306a36Sopenharmony_ci 278162306a36Sopenharmony_ci/* 278262306a36Sopenharmony_ci * EEPROM TXMIXER GAIN A offset (note overlaps with EEPROM RSSI A2). 278362306a36Sopenharmony_ci */ 278462306a36Sopenharmony_ci#define EEPROM_TXMIXER_GAIN_A_VAL FIELD16(0x0007) 278562306a36Sopenharmony_ci 278662306a36Sopenharmony_ci/* 278762306a36Sopenharmony_ci * EEPROM EIRP Maximum TX power values(unit: dbm) 278862306a36Sopenharmony_ci */ 278962306a36Sopenharmony_ci#define EEPROM_EIRP_MAX_TX_POWER_2GHZ FIELD16(0x00ff) 279062306a36Sopenharmony_ci#define EEPROM_EIRP_MAX_TX_POWER_5GHZ FIELD16(0xff00) 279162306a36Sopenharmony_ci 279262306a36Sopenharmony_ci/* 279362306a36Sopenharmony_ci * EEPROM TXpower delta: 20MHZ AND 40 MHZ use different power. 279462306a36Sopenharmony_ci * This is delta in 40MHZ. 279562306a36Sopenharmony_ci * VALUE: Tx Power dalta value, MAX=4(unit: dbm) 279662306a36Sopenharmony_ci * TYPE: 1: Plus the delta value, 0: minus the delta value 279762306a36Sopenharmony_ci * ENABLE: enable tx power compensation for 40BW 279862306a36Sopenharmony_ci */ 279962306a36Sopenharmony_ci#define EEPROM_TXPOWER_DELTA_VALUE_2G FIELD16(0x003f) 280062306a36Sopenharmony_ci#define EEPROM_TXPOWER_DELTA_TYPE_2G FIELD16(0x0040) 280162306a36Sopenharmony_ci#define EEPROM_TXPOWER_DELTA_ENABLE_2G FIELD16(0x0080) 280262306a36Sopenharmony_ci#define EEPROM_TXPOWER_DELTA_VALUE_5G FIELD16(0x3f00) 280362306a36Sopenharmony_ci#define EEPROM_TXPOWER_DELTA_TYPE_5G FIELD16(0x4000) 280462306a36Sopenharmony_ci#define EEPROM_TXPOWER_DELTA_ENABLE_5G FIELD16(0x8000) 280562306a36Sopenharmony_ci 280662306a36Sopenharmony_ci/* 280762306a36Sopenharmony_ci * EEPROM TXPOWER 802.11BG 280862306a36Sopenharmony_ci */ 280962306a36Sopenharmony_ci#define EEPROM_TXPOWER_BG_SIZE 7 281062306a36Sopenharmony_ci#define EEPROM_TXPOWER_BG_1 FIELD16(0x00ff) 281162306a36Sopenharmony_ci#define EEPROM_TXPOWER_BG_2 FIELD16(0xff00) 281262306a36Sopenharmony_ci 281362306a36Sopenharmony_ci/* 281462306a36Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11BG 281562306a36Sopenharmony_ci * MINUS4: If the actual TSSI is below this boundary, tx power needs to be 281662306a36Sopenharmony_ci * reduced by (agc_step * -4) 281762306a36Sopenharmony_ci * MINUS3: If the actual TSSI is below this boundary, tx power needs to be 281862306a36Sopenharmony_ci * reduced by (agc_step * -3) 281962306a36Sopenharmony_ci */ 282062306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG1_MINUS4 FIELD16(0x00ff) 282162306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG1_MINUS3 FIELD16(0xff00) 282262306a36Sopenharmony_ci 282362306a36Sopenharmony_ci/* 282462306a36Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11BG 282562306a36Sopenharmony_ci * MINUS2: If the actual TSSI is below this boundary, tx power needs to be 282662306a36Sopenharmony_ci * reduced by (agc_step * -2) 282762306a36Sopenharmony_ci * MINUS1: If the actual TSSI is below this boundary, tx power needs to be 282862306a36Sopenharmony_ci * reduced by (agc_step * -1) 282962306a36Sopenharmony_ci */ 283062306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG2_MINUS2 FIELD16(0x00ff) 283162306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG2_MINUS1 FIELD16(0xff00) 283262306a36Sopenharmony_ci 283362306a36Sopenharmony_ci/* 283462306a36Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11BG 283562306a36Sopenharmony_ci * REF: Reference TSSI value, no tx power changes needed 283662306a36Sopenharmony_ci * PLUS1: If the actual TSSI is above this boundary, tx power needs to be 283762306a36Sopenharmony_ci * increased by (agc_step * 1) 283862306a36Sopenharmony_ci */ 283962306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG3_REF FIELD16(0x00ff) 284062306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG3_PLUS1 FIELD16(0xff00) 284162306a36Sopenharmony_ci 284262306a36Sopenharmony_ci/* 284362306a36Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11BG 284462306a36Sopenharmony_ci * PLUS2: If the actual TSSI is above this boundary, tx power needs to be 284562306a36Sopenharmony_ci * increased by (agc_step * 2) 284662306a36Sopenharmony_ci * PLUS3: If the actual TSSI is above this boundary, tx power needs to be 284762306a36Sopenharmony_ci * increased by (agc_step * 3) 284862306a36Sopenharmony_ci */ 284962306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG4_PLUS2 FIELD16(0x00ff) 285062306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG4_PLUS3 FIELD16(0xff00) 285162306a36Sopenharmony_ci 285262306a36Sopenharmony_ci/* 285362306a36Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11BG 285462306a36Sopenharmony_ci * PLUS4: If the actual TSSI is above this boundary, tx power needs to be 285562306a36Sopenharmony_ci * increased by (agc_step * 4) 285662306a36Sopenharmony_ci * AGC_STEP: Temperature compensation step. 285762306a36Sopenharmony_ci */ 285862306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG5_PLUS4 FIELD16(0x00ff) 285962306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG5_AGC_STEP FIELD16(0xff00) 286062306a36Sopenharmony_ci 286162306a36Sopenharmony_ci/* 286262306a36Sopenharmony_ci * EEPROM TXPOWER 802.11A 286362306a36Sopenharmony_ci */ 286462306a36Sopenharmony_ci#define EEPROM_TXPOWER_A_SIZE 6 286562306a36Sopenharmony_ci#define EEPROM_TXPOWER_A_1 FIELD16(0x00ff) 286662306a36Sopenharmony_ci#define EEPROM_TXPOWER_A_2 FIELD16(0xff00) 286762306a36Sopenharmony_ci 286862306a36Sopenharmony_ci/* EEPROM_TXPOWER_{A,G} fields for RT3593 */ 286962306a36Sopenharmony_ci#define EEPROM_TXPOWER_ALC FIELD8(0x1f) 287062306a36Sopenharmony_ci#define EEPROM_TXPOWER_FINE_CTRL FIELD8(0xe0) 287162306a36Sopenharmony_ci 287262306a36Sopenharmony_ci/* 287362306a36Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11A 287462306a36Sopenharmony_ci * MINUS4: If the actual TSSI is below this boundary, tx power needs to be 287562306a36Sopenharmony_ci * reduced by (agc_step * -4) 287662306a36Sopenharmony_ci * MINUS3: If the actual TSSI is below this boundary, tx power needs to be 287762306a36Sopenharmony_ci * reduced by (agc_step * -3) 287862306a36Sopenharmony_ci */ 287962306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_A1_MINUS4 FIELD16(0x00ff) 288062306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_A1_MINUS3 FIELD16(0xff00) 288162306a36Sopenharmony_ci 288262306a36Sopenharmony_ci/* 288362306a36Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11A 288462306a36Sopenharmony_ci * MINUS2: If the actual TSSI is below this boundary, tx power needs to be 288562306a36Sopenharmony_ci * reduced by (agc_step * -2) 288662306a36Sopenharmony_ci * MINUS1: If the actual TSSI is below this boundary, tx power needs to be 288762306a36Sopenharmony_ci * reduced by (agc_step * -1) 288862306a36Sopenharmony_ci */ 288962306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_A2_MINUS2 FIELD16(0x00ff) 289062306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_A2_MINUS1 FIELD16(0xff00) 289162306a36Sopenharmony_ci 289262306a36Sopenharmony_ci/* 289362306a36Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11A 289462306a36Sopenharmony_ci * REF: Reference TSSI value, no tx power changes needed 289562306a36Sopenharmony_ci * PLUS1: If the actual TSSI is above this boundary, tx power needs to be 289662306a36Sopenharmony_ci * increased by (agc_step * 1) 289762306a36Sopenharmony_ci */ 289862306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_A3_REF FIELD16(0x00ff) 289962306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_A3_PLUS1 FIELD16(0xff00) 290062306a36Sopenharmony_ci 290162306a36Sopenharmony_ci/* 290262306a36Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11A 290362306a36Sopenharmony_ci * PLUS2: If the actual TSSI is above this boundary, tx power needs to be 290462306a36Sopenharmony_ci * increased by (agc_step * 2) 290562306a36Sopenharmony_ci * PLUS3: If the actual TSSI is above this boundary, tx power needs to be 290662306a36Sopenharmony_ci * increased by (agc_step * 3) 290762306a36Sopenharmony_ci */ 290862306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_A4_PLUS2 FIELD16(0x00ff) 290962306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_A4_PLUS3 FIELD16(0xff00) 291062306a36Sopenharmony_ci 291162306a36Sopenharmony_ci/* 291262306a36Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11A 291362306a36Sopenharmony_ci * PLUS4: If the actual TSSI is above this boundary, tx power needs to be 291462306a36Sopenharmony_ci * increased by (agc_step * 4) 291562306a36Sopenharmony_ci * AGC_STEP: Temperature compensation step. 291662306a36Sopenharmony_ci */ 291762306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_A5_PLUS4 FIELD16(0x00ff) 291862306a36Sopenharmony_ci#define EEPROM_TSSI_BOUND_A5_AGC_STEP FIELD16(0xff00) 291962306a36Sopenharmony_ci 292062306a36Sopenharmony_ci/* 292162306a36Sopenharmony_ci * EEPROM TXPOWER by rate: tx power per tx rate for HT20 mode 292262306a36Sopenharmony_ci */ 292362306a36Sopenharmony_ci#define EEPROM_TXPOWER_BYRATE_SIZE 9 292462306a36Sopenharmony_ci 292562306a36Sopenharmony_ci#define EEPROM_TXPOWER_BYRATE_RATE0 FIELD16(0x000f) 292662306a36Sopenharmony_ci#define EEPROM_TXPOWER_BYRATE_RATE1 FIELD16(0x00f0) 292762306a36Sopenharmony_ci#define EEPROM_TXPOWER_BYRATE_RATE2 FIELD16(0x0f00) 292862306a36Sopenharmony_ci#define EEPROM_TXPOWER_BYRATE_RATE3 FIELD16(0xf000) 292962306a36Sopenharmony_ci 293062306a36Sopenharmony_ci/* 293162306a36Sopenharmony_ci * EEPROM BBP. 293262306a36Sopenharmony_ci */ 293362306a36Sopenharmony_ci#define EEPROM_BBP_SIZE 16 293462306a36Sopenharmony_ci#define EEPROM_BBP_VALUE FIELD16(0x00ff) 293562306a36Sopenharmony_ci#define EEPROM_BBP_REG_ID FIELD16(0xff00) 293662306a36Sopenharmony_ci 293762306a36Sopenharmony_ci/* EEPROM_EXT_LNA2 */ 293862306a36Sopenharmony_ci#define EEPROM_EXT_LNA2_A1 FIELD16(0x00ff) 293962306a36Sopenharmony_ci#define EEPROM_EXT_LNA2_A2 FIELD16(0xff00) 294062306a36Sopenharmony_ci 294162306a36Sopenharmony_ci/* 294262306a36Sopenharmony_ci * EEPROM IQ Calibration, unlike other entries those are byte addresses. 294362306a36Sopenharmony_ci */ 294462306a36Sopenharmony_ci 294562306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX0_2G 0x130 294662306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX0_2G 0x131 294762306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX0_2G 0x132 294862306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX1_2G 0x133 294962306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX1_2G 0x134 295062306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX1_2G 0x135 295162306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX0_2G 0x136 295262306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX0_2G 0x137 295362306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX0_2G 0x138 295462306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX1_2G 0x139 295562306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX1_2G 0x13A 295662306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX1_2G 0x13B 295762306a36Sopenharmony_ci#define EEPROM_RF_IQ_COMPENSATION_CONTROL 0x13C 295862306a36Sopenharmony_ci#define EEPROM_RF_IQ_IMBALANCE_COMPENSATION_CONTROL 0x13D 295962306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX0_CH36_TO_CH64_5G 0x144 296062306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX0_CH36_TO_CH64_5G 0x145 296162306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX0_CH100_TO_CH138_5G 0X146 296262306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX0_CH100_TO_CH138_5G 0x147 296362306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX0_CH140_TO_CH165_5G 0x148 296462306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX0_CH140_TO_CH165_5G 0x149 296562306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX1_CH36_TO_CH64_5G 0x14A 296662306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX1_CH36_TO_CH64_5G 0x14B 296762306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX1_CH100_TO_CH138_5G 0X14C 296862306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX1_CH100_TO_CH138_5G 0x14D 296962306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX1_CH140_TO_CH165_5G 0x14E 297062306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX1_CH140_TO_CH165_5G 0x14F 297162306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX0_CH36_TO_CH64_5G 0x150 297262306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX1_CH36_TO_CH64_5G 0x151 297362306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX0_CH100_TO_CH138_5G 0x152 297462306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX1_CH100_TO_CH138_5G 0x153 297562306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX0_CH140_TO_CH165_5G 0x154 297662306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX1_CH140_TO_CH165_5G 0x155 297762306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX0_CH36_TO_CH64_5G 0x156 297862306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX0_CH36_TO_CH64_5G 0x157 297962306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX0_CH100_TO_CH138_5G 0X158 298062306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX0_CH100_TO_CH138_5G 0x159 298162306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX0_CH140_TO_CH165_5G 0x15A 298262306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX0_CH140_TO_CH165_5G 0x15B 298362306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX1_CH36_TO_CH64_5G 0x15C 298462306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX1_CH36_TO_CH64_5G 0x15D 298562306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX1_CH100_TO_CH138_5G 0X15E 298662306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX1_CH100_TO_CH138_5G 0x15F 298762306a36Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX1_CH140_TO_CH165_5G 0x160 298862306a36Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX1_CH140_TO_CH165_5G 0x161 298962306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX0_CH36_TO_CH64_5G 0x162 299062306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX1_CH36_TO_CH64_5G 0x163 299162306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX0_CH100_TO_CH138_5G 0x164 299262306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX1_CH100_TO_CH138_5G 0x165 299362306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX0_CH140_TO_CH165_5G 0x166 299462306a36Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX1_CH140_TO_CH165_5G 0x167 299562306a36Sopenharmony_ci 299662306a36Sopenharmony_ci/* 299762306a36Sopenharmony_ci * MCU mailbox commands. 299862306a36Sopenharmony_ci * MCU_SLEEP - go to power-save mode. 299962306a36Sopenharmony_ci * arg1: 1: save as much power as possible, 0: save less power. 300062306a36Sopenharmony_ci * status: 1: success, 2: already asleep, 300162306a36Sopenharmony_ci * 3: maybe MAC is busy so can't finish this task. 300262306a36Sopenharmony_ci * MCU_RADIO_OFF 300362306a36Sopenharmony_ci * arg0: 0: do power-saving, NOT turn off radio. 300462306a36Sopenharmony_ci */ 300562306a36Sopenharmony_ci#define MCU_SLEEP 0x30 300662306a36Sopenharmony_ci#define MCU_WAKEUP 0x31 300762306a36Sopenharmony_ci#define MCU_RADIO_OFF 0x35 300862306a36Sopenharmony_ci#define MCU_CURRENT 0x36 300962306a36Sopenharmony_ci#define MCU_LED 0x50 301062306a36Sopenharmony_ci#define MCU_LED_STRENGTH 0x51 301162306a36Sopenharmony_ci#define MCU_LED_AG_CONF 0x52 301262306a36Sopenharmony_ci#define MCU_LED_ACT_CONF 0x53 301362306a36Sopenharmony_ci#define MCU_LED_LED_POLARITY 0x54 301462306a36Sopenharmony_ci#define MCU_RADAR 0x60 301562306a36Sopenharmony_ci#define MCU_BOOT_SIGNAL 0x72 301662306a36Sopenharmony_ci#define MCU_ANT_SELECT 0X73 301762306a36Sopenharmony_ci#define MCU_FREQ_OFFSET 0x74 301862306a36Sopenharmony_ci#define MCU_BBP_SIGNAL 0x80 301962306a36Sopenharmony_ci#define MCU_POWER_SAVE 0x83 302062306a36Sopenharmony_ci#define MCU_BAND_SELECT 0x91 302162306a36Sopenharmony_ci 302262306a36Sopenharmony_ci/* 302362306a36Sopenharmony_ci * MCU mailbox tokens 302462306a36Sopenharmony_ci */ 302562306a36Sopenharmony_ci#define TOKEN_SLEEP 1 302662306a36Sopenharmony_ci#define TOKEN_RADIO_OFF 2 302762306a36Sopenharmony_ci#define TOKEN_WAKEUP 3 302862306a36Sopenharmony_ci 302962306a36Sopenharmony_ci 303062306a36Sopenharmony_ci/* 303162306a36Sopenharmony_ci * DMA descriptor defines. 303262306a36Sopenharmony_ci */ 303362306a36Sopenharmony_ci 303462306a36Sopenharmony_ci#define TXWI_DESC_SIZE_4WORDS (4 * sizeof(__le32)) 303562306a36Sopenharmony_ci#define TXWI_DESC_SIZE_5WORDS (5 * sizeof(__le32)) 303662306a36Sopenharmony_ci 303762306a36Sopenharmony_ci#define RXWI_DESC_SIZE_4WORDS (4 * sizeof(__le32)) 303862306a36Sopenharmony_ci#define RXWI_DESC_SIZE_5WORDS (5 * sizeof(__le32)) 303962306a36Sopenharmony_ci#define RXWI_DESC_SIZE_6WORDS (6 * sizeof(__le32)) 304062306a36Sopenharmony_ci 304162306a36Sopenharmony_ci/* 304262306a36Sopenharmony_ci * TX WI structure 304362306a36Sopenharmony_ci */ 304462306a36Sopenharmony_ci 304562306a36Sopenharmony_ci/* 304662306a36Sopenharmony_ci * Word0 304762306a36Sopenharmony_ci * FRAG: 1 To inform TKIP engine this is a fragment. 304862306a36Sopenharmony_ci * MIMO_PS: The remote peer is in dynamic MIMO-PS mode 304962306a36Sopenharmony_ci * TX_OP: 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs 305062306a36Sopenharmony_ci * BW: Channel bandwidth 0:20MHz, 1:40 MHz (for legacy rates this will 305162306a36Sopenharmony_ci * duplicate the frame to both channels). 305262306a36Sopenharmony_ci * STBC: 1: STBC support MCS =0-7, 2,3 : RESERVED 305362306a36Sopenharmony_ci * AMPDU: 1: this frame is eligible for AMPDU aggregation, the hw will 305462306a36Sopenharmony_ci * aggregate consecutive frames with the same RA and QoS TID. If 305562306a36Sopenharmony_ci * a frame A with the same RA and QoS TID but AMPDU=0 is queued 305662306a36Sopenharmony_ci * directly after a frame B with AMPDU=1, frame A might still 305762306a36Sopenharmony_ci * get aggregated into the AMPDU started by frame B. So, setting 305862306a36Sopenharmony_ci * AMPDU to 0 does _not_ necessarily mean the frame is sent as 305962306a36Sopenharmony_ci * MPDU, it can still end up in an AMPDU if the previous frame 306062306a36Sopenharmony_ci * was tagged as AMPDU. 306162306a36Sopenharmony_ci */ 306262306a36Sopenharmony_ci#define TXWI_W0_FRAG FIELD32(0x00000001) 306362306a36Sopenharmony_ci#define TXWI_W0_MIMO_PS FIELD32(0x00000002) 306462306a36Sopenharmony_ci#define TXWI_W0_CF_ACK FIELD32(0x00000004) 306562306a36Sopenharmony_ci#define TXWI_W0_TS FIELD32(0x00000008) 306662306a36Sopenharmony_ci#define TXWI_W0_AMPDU FIELD32(0x00000010) 306762306a36Sopenharmony_ci#define TXWI_W0_MPDU_DENSITY FIELD32(0x000000e0) 306862306a36Sopenharmony_ci#define TXWI_W0_TX_OP FIELD32(0x00000300) 306962306a36Sopenharmony_ci#define TXWI_W0_MCS FIELD32(0x007f0000) 307062306a36Sopenharmony_ci#define TXWI_W0_BW FIELD32(0x00800000) 307162306a36Sopenharmony_ci#define TXWI_W0_SHORT_GI FIELD32(0x01000000) 307262306a36Sopenharmony_ci#define TXWI_W0_STBC FIELD32(0x06000000) 307362306a36Sopenharmony_ci#define TXWI_W0_IFS FIELD32(0x08000000) 307462306a36Sopenharmony_ci#define TXWI_W0_PHYMODE FIELD32(0xc0000000) 307562306a36Sopenharmony_ci 307662306a36Sopenharmony_ci/* 307762306a36Sopenharmony_ci * Word1 307862306a36Sopenharmony_ci * ACK: 0: No Ack needed, 1: Ack needed 307962306a36Sopenharmony_ci * NSEQ: 0: Don't assign hw sequence number, 1: Assign hw sequence number 308062306a36Sopenharmony_ci * BW_WIN_SIZE: BA windows size of the recipient 308162306a36Sopenharmony_ci * WIRELESS_CLI_ID: Client ID for WCID table access 308262306a36Sopenharmony_ci * MPDU_TOTAL_BYTE_COUNT: Length of 802.11 frame 308362306a36Sopenharmony_ci * PACKETID: Will be latched into the TX_STA_FIFO register once the according 308462306a36Sopenharmony_ci * frame was processed. If multiple frames are aggregated together 308562306a36Sopenharmony_ci * (AMPDU==1) the reported tx status will always contain the packet 308662306a36Sopenharmony_ci * id of the first frame. 0: Don't report tx status for this frame. 308762306a36Sopenharmony_ci * PACKETID_QUEUE: Part of PACKETID, This is the queue index (0-3) 308862306a36Sopenharmony_ci * PACKETID_ENTRY: Part of PACKETID, THis is the queue entry index (1-3) 308962306a36Sopenharmony_ci * This identification number is calculated by ((idx % 3) + 1). 309062306a36Sopenharmony_ci * The (+1) is required to prevent PACKETID to become 0. 309162306a36Sopenharmony_ci */ 309262306a36Sopenharmony_ci#define TXWI_W1_ACK FIELD32(0x00000001) 309362306a36Sopenharmony_ci#define TXWI_W1_NSEQ FIELD32(0x00000002) 309462306a36Sopenharmony_ci#define TXWI_W1_BW_WIN_SIZE FIELD32(0x000000fc) 309562306a36Sopenharmony_ci#define TXWI_W1_WIRELESS_CLI_ID FIELD32(0x0000ff00) 309662306a36Sopenharmony_ci#define TXWI_W1_MPDU_TOTAL_BYTE_COUNT FIELD32(0x0fff0000) 309762306a36Sopenharmony_ci#define TXWI_W1_PACKETID FIELD32(0xf0000000) 309862306a36Sopenharmony_ci#define TXWI_W1_PACKETID_QUEUE FIELD32(0x30000000) 309962306a36Sopenharmony_ci#define TXWI_W1_PACKETID_ENTRY FIELD32(0xc0000000) 310062306a36Sopenharmony_ci 310162306a36Sopenharmony_ci/* 310262306a36Sopenharmony_ci * Word2 310362306a36Sopenharmony_ci */ 310462306a36Sopenharmony_ci#define TXWI_W2_IV FIELD32(0xffffffff) 310562306a36Sopenharmony_ci 310662306a36Sopenharmony_ci/* 310762306a36Sopenharmony_ci * Word3 310862306a36Sopenharmony_ci */ 310962306a36Sopenharmony_ci#define TXWI_W3_EIV FIELD32(0xffffffff) 311062306a36Sopenharmony_ci 311162306a36Sopenharmony_ci/* 311262306a36Sopenharmony_ci * RX WI structure 311362306a36Sopenharmony_ci */ 311462306a36Sopenharmony_ci 311562306a36Sopenharmony_ci/* 311662306a36Sopenharmony_ci * Word0 311762306a36Sopenharmony_ci */ 311862306a36Sopenharmony_ci#define RXWI_W0_WIRELESS_CLI_ID FIELD32(0x000000ff) 311962306a36Sopenharmony_ci#define RXWI_W0_KEY_INDEX FIELD32(0x00000300) 312062306a36Sopenharmony_ci#define RXWI_W0_BSSID FIELD32(0x00001c00) 312162306a36Sopenharmony_ci#define RXWI_W0_UDF FIELD32(0x0000e000) 312262306a36Sopenharmony_ci#define RXWI_W0_MPDU_TOTAL_BYTE_COUNT FIELD32(0x0fff0000) 312362306a36Sopenharmony_ci#define RXWI_W0_TID FIELD32(0xf0000000) 312462306a36Sopenharmony_ci 312562306a36Sopenharmony_ci/* 312662306a36Sopenharmony_ci * Word1 312762306a36Sopenharmony_ci */ 312862306a36Sopenharmony_ci#define RXWI_W1_FRAG FIELD32(0x0000000f) 312962306a36Sopenharmony_ci#define RXWI_W1_SEQUENCE FIELD32(0x0000fff0) 313062306a36Sopenharmony_ci#define RXWI_W1_MCS FIELD32(0x007f0000) 313162306a36Sopenharmony_ci#define RXWI_W1_BW FIELD32(0x00800000) 313262306a36Sopenharmony_ci#define RXWI_W1_SHORT_GI FIELD32(0x01000000) 313362306a36Sopenharmony_ci#define RXWI_W1_STBC FIELD32(0x06000000) 313462306a36Sopenharmony_ci#define RXWI_W1_PHYMODE FIELD32(0xc0000000) 313562306a36Sopenharmony_ci 313662306a36Sopenharmony_ci/* 313762306a36Sopenharmony_ci * Word2 313862306a36Sopenharmony_ci */ 313962306a36Sopenharmony_ci#define RXWI_W2_RSSI0 FIELD32(0x000000ff) 314062306a36Sopenharmony_ci#define RXWI_W2_RSSI1 FIELD32(0x0000ff00) 314162306a36Sopenharmony_ci#define RXWI_W2_RSSI2 FIELD32(0x00ff0000) 314262306a36Sopenharmony_ci 314362306a36Sopenharmony_ci/* 314462306a36Sopenharmony_ci * Word3 314562306a36Sopenharmony_ci */ 314662306a36Sopenharmony_ci#define RXWI_W3_SNR0 FIELD32(0x000000ff) 314762306a36Sopenharmony_ci#define RXWI_W3_SNR1 FIELD32(0x0000ff00) 314862306a36Sopenharmony_ci 314962306a36Sopenharmony_ci/* 315062306a36Sopenharmony_ci * Macros for converting txpower from EEPROM to mac80211 value 315162306a36Sopenharmony_ci * and from mac80211 value to register value. 315262306a36Sopenharmony_ci */ 315362306a36Sopenharmony_ci#define MIN_G_TXPOWER 0 315462306a36Sopenharmony_ci#define MIN_A_TXPOWER -7 315562306a36Sopenharmony_ci#define MAX_G_TXPOWER 31 315662306a36Sopenharmony_ci#define MAX_A_TXPOWER 15 315762306a36Sopenharmony_ci#define DEFAULT_TXPOWER 5 315862306a36Sopenharmony_ci 315962306a36Sopenharmony_ci#define MIN_A_TXPOWER_3593 0 316062306a36Sopenharmony_ci#define MAX_A_TXPOWER_3593 31 316162306a36Sopenharmony_ci 316262306a36Sopenharmony_ci#define TXPOWER_G_FROM_DEV(__txpower) \ 316362306a36Sopenharmony_ci ((__txpower) > MAX_G_TXPOWER) ? DEFAULT_TXPOWER : (__txpower) 316462306a36Sopenharmony_ci 316562306a36Sopenharmony_ci#define TXPOWER_A_FROM_DEV(__txpower) \ 316662306a36Sopenharmony_ci ((__txpower) > MAX_A_TXPOWER) ? DEFAULT_TXPOWER : (__txpower) 316762306a36Sopenharmony_ci 316862306a36Sopenharmony_ci/* 316962306a36Sopenharmony_ci * Board's maximun TX power limitation 317062306a36Sopenharmony_ci */ 317162306a36Sopenharmony_ci#define EIRP_MAX_TX_POWER_LIMIT 0x50 317262306a36Sopenharmony_ci 317362306a36Sopenharmony_ci/* 317462306a36Sopenharmony_ci * Number of TBTT intervals after which we have to adjust 317562306a36Sopenharmony_ci * the hw beacon timer. 317662306a36Sopenharmony_ci */ 317762306a36Sopenharmony_ci#define BCN_TBTT_OFFSET 64 317862306a36Sopenharmony_ci 317962306a36Sopenharmony_ci#endif /* RT2800_H */ 3180