162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
262306a36Sopenharmony_ci/* Copyright(c) 2018-2019  Realtek Corporation
362306a36Sopenharmony_ci */
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#ifndef __RTW8723D_H__
662306a36Sopenharmony_ci#define __RTW8723D_H__
762306a36Sopenharmony_ci
862306a36Sopenharmony_cienum rtw8723d_path {
962306a36Sopenharmony_ci	PATH_S1,
1062306a36Sopenharmony_ci	PATH_S0,
1162306a36Sopenharmony_ci	PATH_NR,
1262306a36Sopenharmony_ci};
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_cienum rtw8723d_iqk_round {
1562306a36Sopenharmony_ci	IQK_ROUND_0,
1662306a36Sopenharmony_ci	IQK_ROUND_1,
1762306a36Sopenharmony_ci	IQK_ROUND_2,
1862306a36Sopenharmony_ci	IQK_ROUND_HYBRID,
1962306a36Sopenharmony_ci	IQK_ROUND_SIZE,
2062306a36Sopenharmony_ci	IQK_ROUND_INVALID = 0xff,
2162306a36Sopenharmony_ci};
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_cienum rtw8723d_iqk_result {
2462306a36Sopenharmony_ci	IQK_S1_TX_X,
2562306a36Sopenharmony_ci	IQK_S1_TX_Y,
2662306a36Sopenharmony_ci	IQK_S1_RX_X,
2762306a36Sopenharmony_ci	IQK_S1_RX_Y,
2862306a36Sopenharmony_ci	IQK_S0_TX_X,
2962306a36Sopenharmony_ci	IQK_S0_TX_Y,
3062306a36Sopenharmony_ci	IQK_S0_RX_X,
3162306a36Sopenharmony_ci	IQK_S0_RX_Y,
3262306a36Sopenharmony_ci	IQK_NR,
3362306a36Sopenharmony_ci	IQK_SX_NR = IQK_NR / PATH_NR,
3462306a36Sopenharmony_ci};
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_cistruct rtw8723de_efuse {
3762306a36Sopenharmony_ci	u8 mac_addr[ETH_ALEN];		/* 0xd0 */
3862306a36Sopenharmony_ci	u8 vender_id[2];
3962306a36Sopenharmony_ci	u8 device_id[2];
4062306a36Sopenharmony_ci	u8 sub_vender_id[2];
4162306a36Sopenharmony_ci	u8 sub_device_id[2];
4262306a36Sopenharmony_ci};
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_cistruct rtw8723du_efuse {
4562306a36Sopenharmony_ci	u8 res4[48];                    /* 0xd0 */
4662306a36Sopenharmony_ci	u8 vender_id[2];                /* 0x100 */
4762306a36Sopenharmony_ci	u8 product_id[2];               /* 0x102 */
4862306a36Sopenharmony_ci	u8 usb_option;                  /* 0x104 */
4962306a36Sopenharmony_ci	u8 res5[2];			/* 0x105 */
5062306a36Sopenharmony_ci	u8 mac_addr[ETH_ALEN];          /* 0x107 */
5162306a36Sopenharmony_ci};
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_cistruct rtw8723ds_efuse {
5462306a36Sopenharmony_ci	u8 res4[0x4a];			/* 0xd0 */
5562306a36Sopenharmony_ci	u8 mac_addr[ETH_ALEN];		/* 0x11a */
5662306a36Sopenharmony_ci};
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_cistruct rtw8723d_efuse {
5962306a36Sopenharmony_ci	__le16 rtl_id;
6062306a36Sopenharmony_ci	u8 rsvd[2];
6162306a36Sopenharmony_ci	u8 afe;
6262306a36Sopenharmony_ci	u8 rsvd1[11];
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci	/* power index for four RF paths */
6562306a36Sopenharmony_ci	struct rtw_txpwr_idx txpwr_idx_table[4];
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci	u8 channel_plan;		/* 0xb8 */
6862306a36Sopenharmony_ci	u8 xtal_k;
6962306a36Sopenharmony_ci	u8 thermal_meter;
7062306a36Sopenharmony_ci	u8 iqk_lck;
7162306a36Sopenharmony_ci	u8 pa_type;			/* 0xbc */
7262306a36Sopenharmony_ci	u8 lna_type_2g[2];		/* 0xbd */
7362306a36Sopenharmony_ci	u8 lna_type_5g[2];
7462306a36Sopenharmony_ci	u8 rf_board_option;
7562306a36Sopenharmony_ci	u8 rf_feature_option;
7662306a36Sopenharmony_ci	u8 rf_bt_setting;
7762306a36Sopenharmony_ci	u8 eeprom_version;
7862306a36Sopenharmony_ci	u8 eeprom_customer_id;
7962306a36Sopenharmony_ci	u8 tx_bb_swing_setting_2g;
8062306a36Sopenharmony_ci	u8 res_c7;
8162306a36Sopenharmony_ci	u8 tx_pwr_calibrate_rate;
8262306a36Sopenharmony_ci	u8 rf_antenna_option;		/* 0xc9 */
8362306a36Sopenharmony_ci	u8 rfe_option;
8462306a36Sopenharmony_ci	u8 country_code[2];
8562306a36Sopenharmony_ci	u8 res[3];
8662306a36Sopenharmony_ci	union {
8762306a36Sopenharmony_ci		struct rtw8723de_efuse e;
8862306a36Sopenharmony_ci		struct rtw8723du_efuse u;
8962306a36Sopenharmony_ci		struct rtw8723ds_efuse s;
9062306a36Sopenharmony_ci	};
9162306a36Sopenharmony_ci};
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ciextern const struct rtw_chip_info rtw8723d_hw_spec;
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ci/* phy status page0 */
9662306a36Sopenharmony_ci#define GET_PHY_STAT_P0_PWDB(phy_stat)                                         \
9762306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x00), GENMASK(15, 8))
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ci/* phy status page1 */
10062306a36Sopenharmony_ci#define GET_PHY_STAT_P1_PWDB_A(phy_stat)                                       \
10162306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x00), GENMASK(15, 8))
10262306a36Sopenharmony_ci#define GET_PHY_STAT_P1_PWDB_B(phy_stat)                                       \
10362306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x00), GENMASK(23, 16))
10462306a36Sopenharmony_ci#define GET_PHY_STAT_P1_RF_MODE(phy_stat)                                      \
10562306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x03), GENMASK(29, 28))
10662306a36Sopenharmony_ci#define GET_PHY_STAT_P1_L_RXSC(phy_stat)                                       \
10762306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x01), GENMASK(11, 8))
10862306a36Sopenharmony_ci#define GET_PHY_STAT_P1_HT_RXSC(phy_stat)                                      \
10962306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x01), GENMASK(15, 12))
11062306a36Sopenharmony_ci#define GET_PHY_STAT_P1_RXEVM_A(phy_stat)                                      \
11162306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x04), GENMASK(7, 0))
11262306a36Sopenharmony_ci#define GET_PHY_STAT_P1_CFO_TAIL_A(phy_stat)                                   \
11362306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x05), GENMASK(7, 0))
11462306a36Sopenharmony_ci#define GET_PHY_STAT_P1_RXSNR_A(phy_stat)                                      \
11562306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x06), GENMASK(7, 0))
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_cistatic inline s32 iqkxy_to_s32(s32 val)
11862306a36Sopenharmony_ci{
11962306a36Sopenharmony_ci	/* val is Q10.8 */
12062306a36Sopenharmony_ci	return sign_extend32(val, 9);
12162306a36Sopenharmony_ci}
12262306a36Sopenharmony_ci
12362306a36Sopenharmony_cistatic inline s32 iqk_mult(s32 x, s32 y, s32 *ext)
12462306a36Sopenharmony_ci{
12562306a36Sopenharmony_ci	/* x, y and return value are Q10.8 */
12662306a36Sopenharmony_ci	s32 t;
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_ci	t = x * y;
12962306a36Sopenharmony_ci	if (ext)
13062306a36Sopenharmony_ci		*ext = (t >> 7) & 0x1;	/* Q.16 --> Q.9; get LSB of Q.9 */
13162306a36Sopenharmony_ci
13262306a36Sopenharmony_ci	return (t >> 8);	/* Q.16 --> Q.8 */
13362306a36Sopenharmony_ci}
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_ci#define OFDM_SWING_A(swing)		FIELD_GET(GENMASK(9, 0), swing)
13662306a36Sopenharmony_ci#define OFDM_SWING_B(swing)		FIELD_GET(GENMASK(15, 10), swing)
13762306a36Sopenharmony_ci#define OFDM_SWING_C(swing)		FIELD_GET(GENMASK(21, 16), swing)
13862306a36Sopenharmony_ci#define OFDM_SWING_D(swing)		FIELD_GET(GENMASK(31, 22), swing)
13962306a36Sopenharmony_ci#define RTW_DEF_OFDM_SWING_INDEX	28
14062306a36Sopenharmony_ci#define RTW_DEF_CCK_SWING_INDEX		28
14162306a36Sopenharmony_ci
14262306a36Sopenharmony_ci#define MAX_TOLERANCE	5
14362306a36Sopenharmony_ci#define IQK_TX_X_ERR	0x142
14462306a36Sopenharmony_ci#define IQK_TX_Y_ERR	0x42
14562306a36Sopenharmony_ci#define IQK_RX_X_UPPER	0x11a
14662306a36Sopenharmony_ci#define IQK_RX_X_LOWER	0xe6
14762306a36Sopenharmony_ci#define IQK_RX_Y_LMT	0x1a
14862306a36Sopenharmony_ci#define IQK_TX_OK	BIT(0)
14962306a36Sopenharmony_ci#define IQK_RX_OK	BIT(1)
15062306a36Sopenharmony_ci#define PATH_IQK_RETRY	2
15162306a36Sopenharmony_ci
15262306a36Sopenharmony_ci#define SPUR_THRES		0x16
15362306a36Sopenharmony_ci#define CCK_DFIR_NR		3
15462306a36Sopenharmony_ci#define DIS_3WIRE		0xccf000c0
15562306a36Sopenharmony_ci#define EN_3WIRE		0xccc000c0
15662306a36Sopenharmony_ci#define START_PSD		0x400000
15762306a36Sopenharmony_ci#define FREQ_CH13		0xfccd
15862306a36Sopenharmony_ci#define FREQ_CH14		0xff9a
15962306a36Sopenharmony_ci#define RFCFGCH_CHANNEL_MASK	GENMASK(7, 0)
16062306a36Sopenharmony_ci#define RFCFGCH_BW_MASK		(BIT(11) | BIT(10))
16162306a36Sopenharmony_ci#define RFCFGCH_BW_20M		(BIT(11) | BIT(10))
16262306a36Sopenharmony_ci#define RFCFGCH_BW_40M		BIT(10)
16362306a36Sopenharmony_ci#define BIT_MASK_RFMOD		BIT(0)
16462306a36Sopenharmony_ci#define BIT_LCK			BIT(15)
16562306a36Sopenharmony_ci
16662306a36Sopenharmony_ci#define REG_GPIO_INTM		0x0048
16762306a36Sopenharmony_ci#define REG_BTG_SEL		0x0067
16862306a36Sopenharmony_ci#define BIT_MASK_BTG_WL		BIT(7)
16962306a36Sopenharmony_ci#define REG_LTECOEX_PATH_CONTROL	0x0070
17062306a36Sopenharmony_ci#define REG_LTECOEX_CTRL	0x07c0
17162306a36Sopenharmony_ci#define REG_LTECOEX_WRITE_DATA	0x07c4
17262306a36Sopenharmony_ci#define REG_LTECOEX_READ_DATA	0x07c8
17362306a36Sopenharmony_ci#define REG_PSDFN		0x0808
17462306a36Sopenharmony_ci#define REG_BB_PWR_SAV1_11N	0x0874
17562306a36Sopenharmony_ci#define REG_ANA_PARAM1		0x0880
17662306a36Sopenharmony_ci#define REG_ANALOG_P4		0x088c
17762306a36Sopenharmony_ci#define REG_PSDRPT		0x08b4
17862306a36Sopenharmony_ci#define REG_FPGA1_RFMOD		0x0900
17962306a36Sopenharmony_ci#define REG_BB_SEL_BTG		0x0948
18062306a36Sopenharmony_ci#define REG_BBRX_DFIR		0x0954
18162306a36Sopenharmony_ci#define BIT_MASK_RXBB_DFIR	GENMASK(27, 24)
18262306a36Sopenharmony_ci#define BIT_RXBB_DFIR_EN	BIT(19)
18362306a36Sopenharmony_ci#define REG_CCK0_SYS		0x0a00
18462306a36Sopenharmony_ci#define BIT_CCK_SIDE_BAND	BIT(4)
18562306a36Sopenharmony_ci#define REG_CCK_ANT_SEL_11N	0x0a04
18662306a36Sopenharmony_ci#define REG_PWRTH		0x0a08
18762306a36Sopenharmony_ci#define REG_CCK_FA_RST_11N	0x0a2c
18862306a36Sopenharmony_ci#define BIT_MASK_CCK_CNT_KEEP	BIT(12)
18962306a36Sopenharmony_ci#define BIT_MASK_CCK_CNT_EN	BIT(13)
19062306a36Sopenharmony_ci#define BIT_MASK_CCK_CNT_KPEN	(BIT_MASK_CCK_CNT_KEEP | BIT_MASK_CCK_CNT_EN)
19162306a36Sopenharmony_ci#define BIT_MASK_CCK_FA_KEEP	BIT(14)
19262306a36Sopenharmony_ci#define BIT_MASK_CCK_FA_EN	BIT(15)
19362306a36Sopenharmony_ci#define BIT_MASK_CCK_FA_KPEN	(BIT_MASK_CCK_FA_KEEP | BIT_MASK_CCK_FA_EN)
19462306a36Sopenharmony_ci#define REG_CCK_FA_LSB_11N	0x0a5c
19562306a36Sopenharmony_ci#define REG_CCK_FA_MSB_11N	0x0a58
19662306a36Sopenharmony_ci#define REG_CCK_CCA_CNT_11N	0x0a60
19762306a36Sopenharmony_ci#define BIT_MASK_CCK_FA_MSB	GENMASK(7, 0)
19862306a36Sopenharmony_ci#define BIT_MASK_CCK_FA_LSB	GENMASK(15, 8)
19962306a36Sopenharmony_ci#define REG_PWRTH2		0x0aa8
20062306a36Sopenharmony_ci#define REG_CSRATIO		0x0aaa
20162306a36Sopenharmony_ci#define REG_OFDM_FA_HOLDC_11N	0x0c00
20262306a36Sopenharmony_ci#define BIT_MASK_OFDM_FA_KEEP	BIT(31)
20362306a36Sopenharmony_ci#define REG_BB_RX_PATH_11N	0x0c04
20462306a36Sopenharmony_ci#define REG_TRMUX_11N		0x0c08
20562306a36Sopenharmony_ci#define REG_OFDM_FA_RSTC_11N	0x0c0c
20662306a36Sopenharmony_ci#define BIT_MASK_OFDM_FA_RST	BIT(31)
20762306a36Sopenharmony_ci#define REG_A_RXIQI		0x0c14
20862306a36Sopenharmony_ci#define BIT_MASK_RXIQ_S1_X	0x000003FF
20962306a36Sopenharmony_ci#define BIT_MASK_RXIQ_S1_Y1	0x0000FC00
21062306a36Sopenharmony_ci#define BIT_SET_RXIQ_S1_Y1(y)	((y) & 0x3F)
21162306a36Sopenharmony_ci#define REG_OFDM0_RXDSP		0x0c40
21262306a36Sopenharmony_ci#define BIT_MASK_RXDSP		GENMASK(28, 24)
21362306a36Sopenharmony_ci#define BIT_EN_RXDSP		BIT(9)
21462306a36Sopenharmony_ci#define REG_OFDM_0_ECCA_THRESHOLD	0x0c4c
21562306a36Sopenharmony_ci#define BIT_MASK_OFDM0_EXT_A	BIT(31)
21662306a36Sopenharmony_ci#define BIT_MASK_OFDM0_EXT_C	BIT(29)
21762306a36Sopenharmony_ci#define BIT_MASK_OFDM0_EXTS	(BIT(31) | BIT(29) | BIT(28))
21862306a36Sopenharmony_ci#define BIT_SET_OFDM0_EXTS(a, c, d) (((a) << 31) | ((c) << 29) | ((d) << 28))
21962306a36Sopenharmony_ci#define REG_OFDM0_XAAGC1	0x0c50
22062306a36Sopenharmony_ci#define REG_OFDM0_XBAGC1	0x0c58
22162306a36Sopenharmony_ci#define REG_AGCRSSI		0x0c78
22262306a36Sopenharmony_ci#define REG_OFDM_0_XA_TX_IQ_IMBALANCE	0x0c80
22362306a36Sopenharmony_ci#define BIT_MASK_TXIQ_ELM_A	0x03ff
22462306a36Sopenharmony_ci#define BIT_SET_TXIQ_ELM_ACD(a, c, d) (((d) << 22) | (((c) & 0x3F) << 16) |    \
22562306a36Sopenharmony_ci				       ((a) & 0x03ff))
22662306a36Sopenharmony_ci#define BIT_MASK_TXIQ_ELM_C	GENMASK(21, 16)
22762306a36Sopenharmony_ci#define BIT_SET_TXIQ_ELM_C2(c)	((c) & 0x3F)
22862306a36Sopenharmony_ci#define BIT_MASK_TXIQ_ELM_D	GENMASK(31, 22)
22962306a36Sopenharmony_ci#define REG_TXIQK_MATRIXA_LSB2_11N	0x0c94
23062306a36Sopenharmony_ci#define BIT_SET_TXIQ_ELM_C1(c)	(((c) & 0x000003C0) >> 6)
23162306a36Sopenharmony_ci#define REG_RXIQK_MATRIX_LSB_11N	0x0ca0
23262306a36Sopenharmony_ci#define BIT_MASK_RXIQ_S1_Y2	0xF0000000
23362306a36Sopenharmony_ci#define BIT_SET_RXIQ_S1_Y2(y)	(((y) >> 6) & 0xF)
23462306a36Sopenharmony_ci#define REG_TXIQ_AB_S0		0x0cd0
23562306a36Sopenharmony_ci#define BIT_MASK_TXIQ_A_S0	0x000007FE
23662306a36Sopenharmony_ci#define BIT_MASK_TXIQ_A_EXT_S0	BIT(0)
23762306a36Sopenharmony_ci#define BIT_MASK_TXIQ_B_S0	0x0007E000
23862306a36Sopenharmony_ci#define REG_TXIQ_CD_S0		0x0cd4
23962306a36Sopenharmony_ci#define BIT_MASK_TXIQ_C_S0	0x000007FE
24062306a36Sopenharmony_ci#define BIT_MASK_TXIQ_C_EXT_S0	BIT(0)
24162306a36Sopenharmony_ci#define BIT_MASK_TXIQ_D_S0	GENMASK(22, 13)
24262306a36Sopenharmony_ci#define BIT_MASK_TXIQ_D_EXT_S0	BIT(12)
24362306a36Sopenharmony_ci#define REG_RXIQ_AB_S0		0x0cd8
24462306a36Sopenharmony_ci#define BIT_MASK_RXIQ_X_S0	0x000003FF
24562306a36Sopenharmony_ci#define BIT_MASK_RXIQ_Y_S0	0x003FF000
24662306a36Sopenharmony_ci#define REG_OFDM_FA_TYPE1_11N	0x0cf0
24762306a36Sopenharmony_ci#define BIT_MASK_OFDM_FF_CNT	GENMASK(15, 0)
24862306a36Sopenharmony_ci#define BIT_MASK_OFDM_SF_CNT	GENMASK(31, 16)
24962306a36Sopenharmony_ci#define REG_OFDM_FA_RSTD_11N	0x0d00
25062306a36Sopenharmony_ci#define BIT_MASK_OFDM_FA_RST1	BIT(27)
25162306a36Sopenharmony_ci#define BIT_MASK_OFDM_FA_KEEP1	BIT(31)
25262306a36Sopenharmony_ci#define REG_CTX			0x0d03
25362306a36Sopenharmony_ci#define BIT_MASK_CTX_TYPE	GENMASK(6, 4)
25462306a36Sopenharmony_ci#define REG_OFDM1_CFOTRK	0x0d2c
25562306a36Sopenharmony_ci#define BIT_EN_CFOTRK		BIT(28)
25662306a36Sopenharmony_ci#define REG_OFDM1_CSI1		0x0d40
25762306a36Sopenharmony_ci#define REG_OFDM1_CSI2		0x0d44
25862306a36Sopenharmony_ci#define REG_OFDM1_CSI3		0x0d48
25962306a36Sopenharmony_ci#define REG_OFDM1_CSI4		0x0d4c
26062306a36Sopenharmony_ci#define REG_OFDM_FA_TYPE2_11N	0x0da0
26162306a36Sopenharmony_ci#define BIT_MASK_OFDM_CCA_CNT	GENMASK(15, 0)
26262306a36Sopenharmony_ci#define BIT_MASK_OFDM_PF_CNT	GENMASK(31, 16)
26362306a36Sopenharmony_ci#define REG_OFDM_FA_TYPE3_11N	0x0da4
26462306a36Sopenharmony_ci#define BIT_MASK_OFDM_RI_CNT	GENMASK(15, 0)
26562306a36Sopenharmony_ci#define BIT_MASK_OFDM_CRC_CNT	GENMASK(31, 16)
26662306a36Sopenharmony_ci#define REG_OFDM_FA_TYPE4_11N	0x0da8
26762306a36Sopenharmony_ci#define BIT_MASK_OFDM_MNS_CNT	GENMASK(15, 0)
26862306a36Sopenharmony_ci#define REG_FPGA0_IQK_11N	0x0e28
26962306a36Sopenharmony_ci#define BIT_MASK_IQK_MOD	0xffffff00
27062306a36Sopenharmony_ci#define EN_IQK			0x808000
27162306a36Sopenharmony_ci#define RST_IQK			0x000000
27262306a36Sopenharmony_ci#define REG_TXIQK_TONE_A_11N	0x0e30
27362306a36Sopenharmony_ci#define REG_RXIQK_TONE_A_11N	0x0e34
27462306a36Sopenharmony_ci#define REG_TXIQK_PI_A_11N	0x0e38
27562306a36Sopenharmony_ci#define REG_RXIQK_PI_A_11N	0x0e3c
27662306a36Sopenharmony_ci#define REG_TXIQK_11N		0x0e40
27762306a36Sopenharmony_ci#define BIT_SET_TXIQK_11N(x, y)	(0x80007C00 | ((x) << 16) | (y))
27862306a36Sopenharmony_ci#define REG_RXIQK_11N		0x0e44
27962306a36Sopenharmony_ci#define REG_IQK_AGC_PTS_11N	0x0e48
28062306a36Sopenharmony_ci#define REG_IQK_AGC_RSP_11N	0x0e4c
28162306a36Sopenharmony_ci#define REG_TX_IQK_TONE_B	0x0e50
28262306a36Sopenharmony_ci#define REG_RX_IQK_TONE_B	0x0e54
28362306a36Sopenharmony_ci#define REG_IQK_RES_TX		0x0e94
28462306a36Sopenharmony_ci#define BIT_MASK_RES_TX		GENMASK(25, 16)
28562306a36Sopenharmony_ci#define REG_IQK_RES_TY		0x0e9c
28662306a36Sopenharmony_ci#define BIT_MASK_RES_TY		GENMASK(25, 16)
28762306a36Sopenharmony_ci#define REG_IQK_RES_RX		0x0ea4
28862306a36Sopenharmony_ci#define BIT_MASK_RES_RX		GENMASK(25, 16)
28962306a36Sopenharmony_ci#define REG_IQK_RES_RY		0x0eac
29062306a36Sopenharmony_ci#define BIT_IQK_TX_FAIL		BIT(28)
29162306a36Sopenharmony_ci#define BIT_IQK_RX_FAIL		BIT(27)
29262306a36Sopenharmony_ci#define BIT_IQK_DONE		BIT(26)
29362306a36Sopenharmony_ci#define BIT_MASK_RES_RY		GENMASK(25, 16)
29462306a36Sopenharmony_ci#define REG_PAGE_F_RST_11N		0x0f14
29562306a36Sopenharmony_ci#define BIT_MASK_F_RST_ALL		BIT(16)
29662306a36Sopenharmony_ci#define REG_IGI_C_11N			0x0f84
29762306a36Sopenharmony_ci#define REG_IGI_D_11N			0x0f88
29862306a36Sopenharmony_ci#define REG_HT_CRC32_CNT_11N		0x0f90
29962306a36Sopenharmony_ci#define BIT_MASK_HT_CRC_OK		GENMASK(15, 0)
30062306a36Sopenharmony_ci#define BIT_MASK_HT_CRC_ERR		GENMASK(31, 16)
30162306a36Sopenharmony_ci#define REG_OFDM_CRC32_CNT_11N		0x0f94
30262306a36Sopenharmony_ci#define BIT_MASK_OFDM_LCRC_OK		GENMASK(15, 0)
30362306a36Sopenharmony_ci#define BIT_MASK_OFDM_LCRC_ERR		GENMASK(31, 16)
30462306a36Sopenharmony_ci#define REG_HT_CRC32_CNT_11N_AGG	0x0fb8
30562306a36Sopenharmony_ci
30662306a36Sopenharmony_ci#endif
307