162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Driver for NXP MCR20A 802.15.4 Wireless-PAN Networking controller
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (C) 2018 Xue Liu <liuxuenetmail@gmail.com>
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci#ifndef _MCR20A_H
862306a36Sopenharmony_ci#define _MCR20A_H
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci/* Direct Accress Register */
1162306a36Sopenharmony_ci#define DAR_IRQ_STS1		0x00
1262306a36Sopenharmony_ci#define DAR_IRQ_STS2		0x01
1362306a36Sopenharmony_ci#define DAR_IRQ_STS3		0x02
1462306a36Sopenharmony_ci#define DAR_PHY_CTRL1		0x03
1562306a36Sopenharmony_ci#define DAR_PHY_CTRL2		0x04
1662306a36Sopenharmony_ci#define DAR_PHY_CTRL3		0x05
1762306a36Sopenharmony_ci#define DAR_RX_FRM_LEN		0x06
1862306a36Sopenharmony_ci#define DAR_PHY_CTRL4		0x07
1962306a36Sopenharmony_ci#define DAR_SRC_CTRL		0x08
2062306a36Sopenharmony_ci#define DAR_SRC_ADDRS_SUM_LSB	0x09
2162306a36Sopenharmony_ci#define DAR_SRC_ADDRS_SUM_MSB	0x0A
2262306a36Sopenharmony_ci#define DAR_CCA1_ED_FNL		0x0B
2362306a36Sopenharmony_ci#define DAR_EVENT_TMR_LSB	0x0C
2462306a36Sopenharmony_ci#define DAR_EVENT_TMR_MSB	0x0D
2562306a36Sopenharmony_ci#define DAR_EVENT_TMR_USB	0x0E
2662306a36Sopenharmony_ci#define DAR_TIMESTAMP_LSB	0x0F
2762306a36Sopenharmony_ci#define DAR_TIMESTAMP_MSB	0x10
2862306a36Sopenharmony_ci#define DAR_TIMESTAMP_USB	0x11
2962306a36Sopenharmony_ci#define DAR_T3CMP_LSB		0x12
3062306a36Sopenharmony_ci#define DAR_T3CMP_MSB		0x13
3162306a36Sopenharmony_ci#define DAR_T3CMP_USB		0x14
3262306a36Sopenharmony_ci#define DAR_T2PRIMECMP_LSB	0x15
3362306a36Sopenharmony_ci#define DAR_T2PRIMECMP_MSB	0x16
3462306a36Sopenharmony_ci#define DAR_T1CMP_LSB		0x17
3562306a36Sopenharmony_ci#define DAR_T1CMP_MSB		0x18
3662306a36Sopenharmony_ci#define DAR_T1CMP_USB		0x19
3762306a36Sopenharmony_ci#define DAR_T2CMP_LSB		0x1A
3862306a36Sopenharmony_ci#define DAR_T2CMP_MSB		0x1B
3962306a36Sopenharmony_ci#define DAR_T2CMP_USB		0x1C
4062306a36Sopenharmony_ci#define DAR_T4CMP_LSB		0x1D
4162306a36Sopenharmony_ci#define DAR_T4CMP_MSB		0x1E
4262306a36Sopenharmony_ci#define DAR_T4CMP_USB		0x1F
4362306a36Sopenharmony_ci#define DAR_PLL_INT0		0x20
4462306a36Sopenharmony_ci#define DAR_PLL_FRAC0_LSB	0x21
4562306a36Sopenharmony_ci#define DAR_PLL_FRAC0_MSB	0x22
4662306a36Sopenharmony_ci#define DAR_PA_PWR		0x23
4762306a36Sopenharmony_ci#define DAR_SEQ_STATE		0x24
4862306a36Sopenharmony_ci#define DAR_LQI_VALUE		0x25
4962306a36Sopenharmony_ci#define DAR_RSSI_CCA_CONT	0x26
5062306a36Sopenharmony_ci/*------------------            0x27 */
5162306a36Sopenharmony_ci#define DAR_ASM_CTRL1		0x28
5262306a36Sopenharmony_ci#define DAR_ASM_CTRL2		0x29
5362306a36Sopenharmony_ci#define DAR_ASM_DATA_0		0x2A
5462306a36Sopenharmony_ci#define DAR_ASM_DATA_1		0x2B
5562306a36Sopenharmony_ci#define DAR_ASM_DATA_2		0x2C
5662306a36Sopenharmony_ci#define DAR_ASM_DATA_3		0x2D
5762306a36Sopenharmony_ci#define DAR_ASM_DATA_4		0x2E
5862306a36Sopenharmony_ci#define DAR_ASM_DATA_5		0x2F
5962306a36Sopenharmony_ci#define DAR_ASM_DATA_6		0x30
6062306a36Sopenharmony_ci#define DAR_ASM_DATA_7		0x31
6162306a36Sopenharmony_ci#define DAR_ASM_DATA_8		0x32
6262306a36Sopenharmony_ci#define DAR_ASM_DATA_9		0x33
6362306a36Sopenharmony_ci#define DAR_ASM_DATA_A		0x34
6462306a36Sopenharmony_ci#define DAR_ASM_DATA_B		0x35
6562306a36Sopenharmony_ci#define DAR_ASM_DATA_C		0x36
6662306a36Sopenharmony_ci#define DAR_ASM_DATA_D		0x37
6762306a36Sopenharmony_ci#define DAR_ASM_DATA_E		0x38
6862306a36Sopenharmony_ci#define DAR_ASM_DATA_F		0x39
6962306a36Sopenharmony_ci/*-----------------------       0x3A */
7062306a36Sopenharmony_ci#define DAR_OVERWRITE_VER	0x3B
7162306a36Sopenharmony_ci#define DAR_CLK_OUT_CTRL	0x3C
7262306a36Sopenharmony_ci#define DAR_PWR_MODES		0x3D
7362306a36Sopenharmony_ci#define IAR_INDEX		0x3E
7462306a36Sopenharmony_ci#define IAR_DATA		0x3F
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_ci/* Indirect Resgister Memory */
7762306a36Sopenharmony_ci#define IAR_PART_ID		0x00
7862306a36Sopenharmony_ci#define IAR_XTAL_TRIM		0x01
7962306a36Sopenharmony_ci#define IAR_PMC_LP_TRIM		0x02
8062306a36Sopenharmony_ci#define IAR_MACPANID0_LSB	0x03
8162306a36Sopenharmony_ci#define IAR_MACPANID0_MSB	0x04
8262306a36Sopenharmony_ci#define IAR_MACSHORTADDRS0_LSB	0x05
8362306a36Sopenharmony_ci#define IAR_MACSHORTADDRS0_MSB	0x06
8462306a36Sopenharmony_ci#define IAR_MACLONGADDRS0_0	0x07
8562306a36Sopenharmony_ci#define IAR_MACLONGADDRS0_8	0x08
8662306a36Sopenharmony_ci#define IAR_MACLONGADDRS0_16	0x09
8762306a36Sopenharmony_ci#define IAR_MACLONGADDRS0_24	0x0A
8862306a36Sopenharmony_ci#define IAR_MACLONGADDRS0_32	0x0B
8962306a36Sopenharmony_ci#define IAR_MACLONGADDRS0_40	0x0C
9062306a36Sopenharmony_ci#define IAR_MACLONGADDRS0_48	0x0D
9162306a36Sopenharmony_ci#define IAR_MACLONGADDRS0_56	0x0E
9262306a36Sopenharmony_ci#define IAR_RX_FRAME_FILTER	0x0F
9362306a36Sopenharmony_ci#define IAR_PLL_INT1		0x10
9462306a36Sopenharmony_ci#define IAR_PLL_FRAC1_LSB	0x11
9562306a36Sopenharmony_ci#define IAR_PLL_FRAC1_MSB	0x12
9662306a36Sopenharmony_ci#define IAR_MACPANID1_LSB	0x13
9762306a36Sopenharmony_ci#define IAR_MACPANID1_MSB	0x14
9862306a36Sopenharmony_ci#define IAR_MACSHORTADDRS1_LSB	0x15
9962306a36Sopenharmony_ci#define IAR_MACSHORTADDRS1_MSB	0x16
10062306a36Sopenharmony_ci#define IAR_MACLONGADDRS1_0	0x17
10162306a36Sopenharmony_ci#define IAR_MACLONGADDRS1_8	0x18
10262306a36Sopenharmony_ci#define IAR_MACLONGADDRS1_16	0x19
10362306a36Sopenharmony_ci#define IAR_MACLONGADDRS1_24	0x1A
10462306a36Sopenharmony_ci#define IAR_MACLONGADDRS1_32	0x1B
10562306a36Sopenharmony_ci#define IAR_MACLONGADDRS1_40	0x1C
10662306a36Sopenharmony_ci#define IAR_MACLONGADDRS1_48	0x1D
10762306a36Sopenharmony_ci#define IAR_MACLONGADDRS1_56	0x1E
10862306a36Sopenharmony_ci#define IAR_DUAL_PAN_CTRL	0x1F
10962306a36Sopenharmony_ci#define IAR_DUAL_PAN_DWELL	0x20
11062306a36Sopenharmony_ci#define IAR_DUAL_PAN_STS	0x21
11162306a36Sopenharmony_ci#define IAR_CCA1_THRESH		0x22
11262306a36Sopenharmony_ci#define IAR_CCA1_ED_OFFSET_COMP	0x23
11362306a36Sopenharmony_ci#define IAR_LQI_OFFSET_COMP	0x24
11462306a36Sopenharmony_ci#define IAR_CCA_CTRL		0x25
11562306a36Sopenharmony_ci#define IAR_CCA2_CORR_PEAKS	0x26
11662306a36Sopenharmony_ci#define IAR_CCA2_CORR_THRESH	0x27
11762306a36Sopenharmony_ci#define IAR_TMR_PRESCALE	0x28
11862306a36Sopenharmony_ci/*--------------------          0x29 */
11962306a36Sopenharmony_ci#define IAR_GPIO_DATA		0x2A
12062306a36Sopenharmony_ci#define IAR_GPIO_DIR		0x2B
12162306a36Sopenharmony_ci#define IAR_GPIO_PUL_EN		0x2C
12262306a36Sopenharmony_ci#define IAR_GPIO_PUL_SEL	0x2D
12362306a36Sopenharmony_ci#define IAR_GPIO_DS		0x2E
12462306a36Sopenharmony_ci/*------------------            0x2F */
12562306a36Sopenharmony_ci#define IAR_ANT_PAD_CTRL	0x30
12662306a36Sopenharmony_ci#define IAR_MISC_PAD_CTRL	0x31
12762306a36Sopenharmony_ci#define IAR_BSM_CTRL		0x32
12862306a36Sopenharmony_ci/*-------------------           0x33 */
12962306a36Sopenharmony_ci#define IAR_RNG			0x34
13062306a36Sopenharmony_ci#define IAR_RX_BYTE_COUNT	0x35
13162306a36Sopenharmony_ci#define IAR_RX_WTR_MARK		0x36
13262306a36Sopenharmony_ci#define IAR_SOFT_RESET		0x37
13362306a36Sopenharmony_ci#define IAR_TXDELAY		0x38
13462306a36Sopenharmony_ci#define IAR_ACKDELAY		0x39
13562306a36Sopenharmony_ci#define IAR_SEQ_MGR_CTRL	0x3A
13662306a36Sopenharmony_ci#define IAR_SEQ_MGR_STS		0x3B
13762306a36Sopenharmony_ci#define IAR_SEQ_T_STS		0x3C
13862306a36Sopenharmony_ci#define IAR_ABORT_STS		0x3D
13962306a36Sopenharmony_ci#define IAR_CCCA_BUSY_CNT	0x3E
14062306a36Sopenharmony_ci#define IAR_SRC_ADDR_CHECKSUM1	0x3F
14162306a36Sopenharmony_ci#define IAR_SRC_ADDR_CHECKSUM2	0x40
14262306a36Sopenharmony_ci#define IAR_SRC_TBL_VALID1	0x41
14362306a36Sopenharmony_ci#define IAR_SRC_TBL_VALID2	0x42
14462306a36Sopenharmony_ci#define IAR_FILTERFAIL_CODE1	0x43
14562306a36Sopenharmony_ci#define IAR_FILTERFAIL_CODE2	0x44
14662306a36Sopenharmony_ci#define IAR_SLOT_PRELOAD	0x45
14762306a36Sopenharmony_ci/*--------------------          0x46 */
14862306a36Sopenharmony_ci#define IAR_CORR_VT		0x47
14962306a36Sopenharmony_ci#define IAR_SYNC_CTRL		0x48
15062306a36Sopenharmony_ci#define IAR_PN_LSB_0		0x49
15162306a36Sopenharmony_ci#define IAR_PN_LSB_1		0x4A
15262306a36Sopenharmony_ci#define IAR_PN_MSB_0		0x4B
15362306a36Sopenharmony_ci#define IAR_PN_MSB_1		0x4C
15462306a36Sopenharmony_ci#define IAR_CORR_NVAL		0x4D
15562306a36Sopenharmony_ci#define IAR_TX_MODE_CTRL	0x4E
15662306a36Sopenharmony_ci#define IAR_SNF_THR		0x4F
15762306a36Sopenharmony_ci#define IAR_FAD_THR		0x50
15862306a36Sopenharmony_ci#define IAR_ANT_AGC_CTRL	0x51
15962306a36Sopenharmony_ci#define IAR_AGC_THR1		0x52
16062306a36Sopenharmony_ci#define IAR_AGC_THR2		0x53
16162306a36Sopenharmony_ci#define IAR_AGC_HYS		0x54
16262306a36Sopenharmony_ci#define IAR_AFC			0x55
16362306a36Sopenharmony_ci/*-------------------           0x56 */
16462306a36Sopenharmony_ci/*-------------------           0x57 */
16562306a36Sopenharmony_ci#define IAR_PHY_STS		0x58
16662306a36Sopenharmony_ci#define IAR_RX_MAX_CORR		0x59
16762306a36Sopenharmony_ci#define IAR_RX_MAX_PREAMBLE	0x5A
16862306a36Sopenharmony_ci#define IAR_RSSI		0x5B
16962306a36Sopenharmony_ci/*-------------------           0x5C */
17062306a36Sopenharmony_ci/*-------------------           0x5D */
17162306a36Sopenharmony_ci#define IAR_PLL_DIG_CTRL	0x5E
17262306a36Sopenharmony_ci#define IAR_VCO_CAL		0x5F
17362306a36Sopenharmony_ci#define IAR_VCO_BEST_DIFF	0x60
17462306a36Sopenharmony_ci#define IAR_VCO_BIAS		0x61
17562306a36Sopenharmony_ci#define IAR_KMOD_CTRL		0x62
17662306a36Sopenharmony_ci#define IAR_KMOD_CAL		0x63
17762306a36Sopenharmony_ci#define IAR_PA_CAL		0x64
17862306a36Sopenharmony_ci#define IAR_PA_PWRCAL		0x65
17962306a36Sopenharmony_ci#define IAR_ATT_RSSI1		0x66
18062306a36Sopenharmony_ci#define IAR_ATT_RSSI2		0x67
18162306a36Sopenharmony_ci#define IAR_RSSI_OFFSET		0x68
18262306a36Sopenharmony_ci#define IAR_RSSI_SLOPE		0x69
18362306a36Sopenharmony_ci#define IAR_RSSI_CAL1		0x6A
18462306a36Sopenharmony_ci#define IAR_RSSI_CAL2		0x6B
18562306a36Sopenharmony_ci/*-------------------           0x6C */
18662306a36Sopenharmony_ci/*-------------------           0x6D */
18762306a36Sopenharmony_ci#define IAR_XTAL_CTRL		0x6E
18862306a36Sopenharmony_ci#define IAR_XTAL_COMP_MIN	0x6F
18962306a36Sopenharmony_ci#define IAR_XTAL_COMP_MAX	0x70
19062306a36Sopenharmony_ci#define IAR_XTAL_GM		0x71
19162306a36Sopenharmony_ci/*-------------------           0x72 */
19262306a36Sopenharmony_ci/*-------------------           0x73 */
19362306a36Sopenharmony_ci#define IAR_LNA_TUNE		0x74
19462306a36Sopenharmony_ci#define IAR_LNA_AGCGAIN		0x75
19562306a36Sopenharmony_ci/*-------------------           0x76 */
19662306a36Sopenharmony_ci/*-------------------           0x77 */
19762306a36Sopenharmony_ci#define IAR_CHF_PMA_GAIN	0x78
19862306a36Sopenharmony_ci#define IAR_CHF_IBUF		0x79
19962306a36Sopenharmony_ci#define IAR_CHF_QBUF		0x7A
20062306a36Sopenharmony_ci#define IAR_CHF_IRIN		0x7B
20162306a36Sopenharmony_ci#define IAR_CHF_QRIN		0x7C
20262306a36Sopenharmony_ci#define IAR_CHF_IL		0x7D
20362306a36Sopenharmony_ci#define IAR_CHF_QL		0x7E
20462306a36Sopenharmony_ci#define IAR_CHF_CC1		0x7F
20562306a36Sopenharmony_ci#define IAR_CHF_CCL		0x80
20662306a36Sopenharmony_ci#define IAR_CHF_CC2		0x81
20762306a36Sopenharmony_ci#define IAR_CHF_IROUT		0x82
20862306a36Sopenharmony_ci#define IAR_CHF_QROUT		0x83
20962306a36Sopenharmony_ci/*-------------------           0x84 */
21062306a36Sopenharmony_ci/*-------------------           0x85 */
21162306a36Sopenharmony_ci#define IAR_RSSI_CTRL		0x86
21262306a36Sopenharmony_ci/*-------------------           0x87 */
21362306a36Sopenharmony_ci/*-------------------           0x88 */
21462306a36Sopenharmony_ci#define IAR_PA_BIAS		0x89
21562306a36Sopenharmony_ci#define IAR_PA_TUNING		0x8A
21662306a36Sopenharmony_ci/*-------------------           0x8B */
21762306a36Sopenharmony_ci/*-------------------           0x8C */
21862306a36Sopenharmony_ci#define IAR_PMC_HP_TRIM		0x8D
21962306a36Sopenharmony_ci#define IAR_VREGA_TRIM		0x8E
22062306a36Sopenharmony_ci/*-------------------           0x8F */
22162306a36Sopenharmony_ci/*-------------------           0x90 */
22262306a36Sopenharmony_ci#define IAR_VCO_CTRL1		0x91
22362306a36Sopenharmony_ci#define IAR_VCO_CTRL2		0x92
22462306a36Sopenharmony_ci/*-------------------           0x93 */
22562306a36Sopenharmony_ci/*-------------------           0x94 */
22662306a36Sopenharmony_ci#define IAR_ANA_SPARE_OUT1	0x95
22762306a36Sopenharmony_ci#define IAR_ANA_SPARE_OUT2	0x96
22862306a36Sopenharmony_ci#define IAR_ANA_SPARE_IN	0x97
22962306a36Sopenharmony_ci#define IAR_MISCELLANEOUS	0x98
23062306a36Sopenharmony_ci/*-------------------           0x99 */
23162306a36Sopenharmony_ci#define IAR_SEQ_MGR_OVRD0	0x9A
23262306a36Sopenharmony_ci#define IAR_SEQ_MGR_OVRD1	0x9B
23362306a36Sopenharmony_ci#define IAR_SEQ_MGR_OVRD2	0x9C
23462306a36Sopenharmony_ci#define IAR_SEQ_MGR_OVRD3	0x9D
23562306a36Sopenharmony_ci#define IAR_SEQ_MGR_OVRD4	0x9E
23662306a36Sopenharmony_ci#define IAR_SEQ_MGR_OVRD5	0x9F
23762306a36Sopenharmony_ci#define IAR_SEQ_MGR_OVRD6	0xA0
23862306a36Sopenharmony_ci#define IAR_SEQ_MGR_OVRD7	0xA1
23962306a36Sopenharmony_ci/*-------------------           0xA2 */
24062306a36Sopenharmony_ci#define IAR_TESTMODE_CTRL	0xA3
24162306a36Sopenharmony_ci#define IAR_DTM_CTRL1		0xA4
24262306a36Sopenharmony_ci#define IAR_DTM_CTRL2		0xA5
24362306a36Sopenharmony_ci#define IAR_ATM_CTRL1		0xA6
24462306a36Sopenharmony_ci#define IAR_ATM_CTRL2		0xA7
24562306a36Sopenharmony_ci#define IAR_ATM_CTRL3		0xA8
24662306a36Sopenharmony_ci/*-------------------           0xA9 */
24762306a36Sopenharmony_ci#define IAR_LIM_FE_TEST_CTRL	0xAA
24862306a36Sopenharmony_ci#define IAR_CHF_TEST_CTRL	0xAB
24962306a36Sopenharmony_ci#define IAR_VCO_TEST_CTRL	0xAC
25062306a36Sopenharmony_ci#define IAR_PLL_TEST_CTRL	0xAD
25162306a36Sopenharmony_ci#define IAR_PA_TEST_CTRL	0xAE
25262306a36Sopenharmony_ci#define IAR_PMC_TEST_CTRL	0xAF
25362306a36Sopenharmony_ci#define IAR_SCAN_DTM_PROTECT_1	0xFE
25462306a36Sopenharmony_ci#define IAR_SCAN_DTM_PROTECT_0	0xFF
25562306a36Sopenharmony_ci
25662306a36Sopenharmony_ci/* IRQSTS1 bits */
25762306a36Sopenharmony_ci#define DAR_IRQSTS1_RX_FRM_PEND		BIT(7)
25862306a36Sopenharmony_ci#define DAR_IRQSTS1_PLL_UNLOCK_IRQ	BIT(6)
25962306a36Sopenharmony_ci#define DAR_IRQSTS1_FILTERFAIL_IRQ	BIT(5)
26062306a36Sopenharmony_ci#define DAR_IRQSTS1_RXWTRMRKIRQ		BIT(4)
26162306a36Sopenharmony_ci#define DAR_IRQSTS1_CCAIRQ		BIT(3)
26262306a36Sopenharmony_ci#define DAR_IRQSTS1_RXIRQ		BIT(2)
26362306a36Sopenharmony_ci#define DAR_IRQSTS1_TXIRQ		BIT(1)
26462306a36Sopenharmony_ci#define DAR_IRQSTS1_SEQIRQ		BIT(0)
26562306a36Sopenharmony_ci
26662306a36Sopenharmony_ci/* IRQSTS2 bits */
26762306a36Sopenharmony_ci#define DAR_IRQSTS2_CRCVALID		BIT(7)
26862306a36Sopenharmony_ci#define DAR_IRQSTS2_CCA			BIT(6)
26962306a36Sopenharmony_ci#define DAR_IRQSTS2_SRCADDR		BIT(5)
27062306a36Sopenharmony_ci#define DAR_IRQSTS2_PI			BIT(4)
27162306a36Sopenharmony_ci#define DAR_IRQSTS2_TMRSTATUS		BIT(3)
27262306a36Sopenharmony_ci#define DAR_IRQSTS2_ASM_IRQ		BIT(2)
27362306a36Sopenharmony_ci#define DAR_IRQSTS2_PB_ERR_IRQ		BIT(1)
27462306a36Sopenharmony_ci#define DAR_IRQSTS2_WAKE_IRQ		BIT(0)
27562306a36Sopenharmony_ci
27662306a36Sopenharmony_ci/* IRQSTS3 bits */
27762306a36Sopenharmony_ci#define DAR_IRQSTS3_TMR4MSK		BIT(7)
27862306a36Sopenharmony_ci#define DAR_IRQSTS3_TMR3MSK		BIT(6)
27962306a36Sopenharmony_ci#define DAR_IRQSTS3_TMR2MSK		BIT(5)
28062306a36Sopenharmony_ci#define DAR_IRQSTS3_TMR1MSK		BIT(4)
28162306a36Sopenharmony_ci#define DAR_IRQSTS3_TMR4IRQ		BIT(3)
28262306a36Sopenharmony_ci#define DAR_IRQSTS3_TMR3IRQ		BIT(2)
28362306a36Sopenharmony_ci#define DAR_IRQSTS3_TMR2IRQ		BIT(1)
28462306a36Sopenharmony_ci#define DAR_IRQSTS3_TMR1IRQ		BIT(0)
28562306a36Sopenharmony_ci
28662306a36Sopenharmony_ci/* PHY_CTRL1 bits */
28762306a36Sopenharmony_ci#define DAR_PHY_CTRL1_TMRTRIGEN		BIT(7)
28862306a36Sopenharmony_ci#define DAR_PHY_CTRL1_SLOTTED		BIT(6)
28962306a36Sopenharmony_ci#define DAR_PHY_CTRL1_CCABFRTX		BIT(5)
29062306a36Sopenharmony_ci#define DAR_PHY_CTRL1_CCABFRTX_SHIFT	5
29162306a36Sopenharmony_ci#define DAR_PHY_CTRL1_RXACKRQD		BIT(4)
29262306a36Sopenharmony_ci#define DAR_PHY_CTRL1_AUTOACK		BIT(3)
29362306a36Sopenharmony_ci#define DAR_PHY_CTRL1_XCVSEQ_MASK	0x07
29462306a36Sopenharmony_ci
29562306a36Sopenharmony_ci/* PHY_CTRL2 bits */
29662306a36Sopenharmony_ci#define DAR_PHY_CTRL2_CRC_MSK		BIT(7)
29762306a36Sopenharmony_ci#define DAR_PHY_CTRL2_PLL_UNLOCK_MSK	BIT(6)
29862306a36Sopenharmony_ci#define DAR_PHY_CTRL2_FILTERFAIL_MSK	BIT(5)
29962306a36Sopenharmony_ci#define DAR_PHY_CTRL2_RX_WMRK_MSK	BIT(4)
30062306a36Sopenharmony_ci#define DAR_PHY_CTRL2_CCAMSK		BIT(3)
30162306a36Sopenharmony_ci#define DAR_PHY_CTRL2_RXMSK		BIT(2)
30262306a36Sopenharmony_ci#define DAR_PHY_CTRL2_TXMSK		BIT(1)
30362306a36Sopenharmony_ci#define DAR_PHY_CTRL2_SEQMSK		BIT(0)
30462306a36Sopenharmony_ci
30562306a36Sopenharmony_ci/* PHY_CTRL3 bits */
30662306a36Sopenharmony_ci#define DAR_PHY_CTRL3_TMR4CMP_EN	BIT(7)
30762306a36Sopenharmony_ci#define DAR_PHY_CTRL3_TMR3CMP_EN	BIT(6)
30862306a36Sopenharmony_ci#define DAR_PHY_CTRL3_TMR2CMP_EN	BIT(5)
30962306a36Sopenharmony_ci#define DAR_PHY_CTRL3_TMR1CMP_EN	BIT(4)
31062306a36Sopenharmony_ci#define DAR_PHY_CTRL3_ASM_MSK		BIT(2)
31162306a36Sopenharmony_ci#define DAR_PHY_CTRL3_PB_ERR_MSK	BIT(1)
31262306a36Sopenharmony_ci#define DAR_PHY_CTRL3_WAKE_MSK		BIT(0)
31362306a36Sopenharmony_ci
31462306a36Sopenharmony_ci/* RX_FRM_LEN bits */
31562306a36Sopenharmony_ci#define DAR_RX_FRAME_LENGTH_MASK	(0x7F)
31662306a36Sopenharmony_ci
31762306a36Sopenharmony_ci/* PHY_CTRL4 bits */
31862306a36Sopenharmony_ci#define DAR_PHY_CTRL4_TRCV_MSK		BIT(7)
31962306a36Sopenharmony_ci#define DAR_PHY_CTRL4_TC3TMOUT		BIT(6)
32062306a36Sopenharmony_ci#define DAR_PHY_CTRL4_PANCORDNTR0	BIT(5)
32162306a36Sopenharmony_ci#define DAR_PHY_CTRL4_CCATYPE		(3)
32262306a36Sopenharmony_ci#define DAR_PHY_CTRL4_CCATYPE_SHIFT	(3)
32362306a36Sopenharmony_ci#define DAR_PHY_CTRL4_CCATYPE_MASK	(0x18)
32462306a36Sopenharmony_ci#define DAR_PHY_CTRL4_TMRLOAD		BIT(2)
32562306a36Sopenharmony_ci#define DAR_PHY_CTRL4_PROMISCUOUS	BIT(1)
32662306a36Sopenharmony_ci#define DAR_PHY_CTRL4_TC2PRIME_EN	BIT(0)
32762306a36Sopenharmony_ci
32862306a36Sopenharmony_ci/* SRC_CTRL bits */
32962306a36Sopenharmony_ci#define DAR_SRC_CTRL_INDEX		(0x0F)
33062306a36Sopenharmony_ci#define DAR_SRC_CTRL_INDEX_SHIFT	(4)
33162306a36Sopenharmony_ci#define DAR_SRC_CTRL_ACK_FRM_PND	BIT(3)
33262306a36Sopenharmony_ci#define DAR_SRC_CTRL_SRCADDR_EN		BIT(2)
33362306a36Sopenharmony_ci#define DAR_SRC_CTRL_INDEX_EN		BIT(1)
33462306a36Sopenharmony_ci#define DAR_SRC_CTRL_INDEX_DISABLE	BIT(0)
33562306a36Sopenharmony_ci
33662306a36Sopenharmony_ci/* DAR_ASM_CTRL1 bits */
33762306a36Sopenharmony_ci#define DAR_ASM_CTRL1_CLEAR		BIT(7)
33862306a36Sopenharmony_ci#define DAR_ASM_CTRL1_START		BIT(6)
33962306a36Sopenharmony_ci#define DAR_ASM_CTRL1_SELFTST		BIT(5)
34062306a36Sopenharmony_ci#define DAR_ASM_CTRL1_CTR		BIT(4)
34162306a36Sopenharmony_ci#define DAR_ASM_CTRL1_CBC		BIT(3)
34262306a36Sopenharmony_ci#define DAR_ASM_CTRL1_AES		BIT(2)
34362306a36Sopenharmony_ci#define DAR_ASM_CTRL1_LOAD_MAC		BIT(1)
34462306a36Sopenharmony_ci
34562306a36Sopenharmony_ci/* DAR_ASM_CTRL2 bits */
34662306a36Sopenharmony_ci#define DAR_ASM_CTRL2_DATA_REG_TYPE_SEL		(7)
34762306a36Sopenharmony_ci#define DAR_ASM_CTRL2_DATA_REG_TYPE_SEL_SHIFT	(5)
34862306a36Sopenharmony_ci#define DAR_ASM_CTRL2_TSTPAS			BIT(1)
34962306a36Sopenharmony_ci
35062306a36Sopenharmony_ci/* DAR_CLK_OUT_CTRL bits */
35162306a36Sopenharmony_ci#define DAR_CLK_OUT_CTRL_EXTEND		BIT(7)
35262306a36Sopenharmony_ci#define DAR_CLK_OUT_CTRL_HIZ		BIT(6)
35362306a36Sopenharmony_ci#define DAR_CLK_OUT_CTRL_SR		BIT(5)
35462306a36Sopenharmony_ci#define DAR_CLK_OUT_CTRL_DS		BIT(4)
35562306a36Sopenharmony_ci#define DAR_CLK_OUT_CTRL_EN		BIT(3)
35662306a36Sopenharmony_ci#define DAR_CLK_OUT_CTRL_DIV		(7)
35762306a36Sopenharmony_ci
35862306a36Sopenharmony_ci/* DAR_PWR_MODES bits */
35962306a36Sopenharmony_ci#define DAR_PWR_MODES_XTAL_READY	BIT(5)
36062306a36Sopenharmony_ci#define DAR_PWR_MODES_XTALEN		BIT(4)
36162306a36Sopenharmony_ci#define DAR_PWR_MODES_ASM_CLK_EN	BIT(3)
36262306a36Sopenharmony_ci#define DAR_PWR_MODES_AUTODOZE		BIT(1)
36362306a36Sopenharmony_ci#define DAR_PWR_MODES_PMC_MODE		BIT(0)
36462306a36Sopenharmony_ci
36562306a36Sopenharmony_ci/* RX_FRAME_FILTER bits */
36662306a36Sopenharmony_ci#define IAR_RX_FRAME_FLT_FRM_VER		(0xC0)
36762306a36Sopenharmony_ci#define IAR_RX_FRAME_FLT_FRM_VER_SHIFT		(6)
36862306a36Sopenharmony_ci#define IAR_RX_FRAME_FLT_ACTIVE_PROMISCUOUS	BIT(5)
36962306a36Sopenharmony_ci#define IAR_RX_FRAME_FLT_NS_FT			BIT(4)
37062306a36Sopenharmony_ci#define IAR_RX_FRAME_FLT_CMD_FT			BIT(3)
37162306a36Sopenharmony_ci#define IAR_RX_FRAME_FLT_ACK_FT			BIT(2)
37262306a36Sopenharmony_ci#define IAR_RX_FRAME_FLT_DATA_FT		BIT(1)
37362306a36Sopenharmony_ci#define IAR_RX_FRAME_FLT_BEACON_FT		BIT(0)
37462306a36Sopenharmony_ci
37562306a36Sopenharmony_ci/* DUAL_PAN_CTRL bits */
37662306a36Sopenharmony_ci#define IAR_DUAL_PAN_CTRL_DUAL_PAN_SAM_LVL_MSK	(0xF0)
37762306a36Sopenharmony_ci#define IAR_DUAL_PAN_CTRL_DUAL_PAN_SAM_LVL_SHIFT	(4)
37862306a36Sopenharmony_ci#define IAR_DUAL_PAN_CTRL_CURRENT_NETWORK	BIT(3)
37962306a36Sopenharmony_ci#define IAR_DUAL_PAN_CTRL_PANCORDNTR1		BIT(2)
38062306a36Sopenharmony_ci#define IAR_DUAL_PAN_CTRL_DUAL_PAN_AUTO		BIT(1)
38162306a36Sopenharmony_ci#define IAR_DUAL_PAN_CTRL_ACTIVE_NETWORK	BIT(0)
38262306a36Sopenharmony_ci
38362306a36Sopenharmony_ci/* DUAL_PAN_STS bits */
38462306a36Sopenharmony_ci#define IAR_DUAL_PAN_STS_RECD_ON_PAN1		BIT(7)
38562306a36Sopenharmony_ci#define IAR_DUAL_PAN_STS_RECD_ON_PAN0		BIT(6)
38662306a36Sopenharmony_ci#define IAR_DUAL_PAN_STS_DUAL_PAN_REMAIN	(0x3F)
38762306a36Sopenharmony_ci
38862306a36Sopenharmony_ci/* CCA_CTRL bits */
38962306a36Sopenharmony_ci#define IAR_CCA_CTRL_AGC_FRZ_EN			BIT(6)
39062306a36Sopenharmony_ci#define IAR_CCA_CTRL_CONT_RSSI_EN		BIT(5)
39162306a36Sopenharmony_ci#define IAR_CCA_CTRL_LQI_RSSI_NOT_CORR	BIT(4)
39262306a36Sopenharmony_ci#define IAR_CCA_CTRL_CCA3_AND_NOT_OR	BIT(3)
39362306a36Sopenharmony_ci#define IAR_CCA_CTRL_POWER_COMP_EN_LQI	BIT(2)
39462306a36Sopenharmony_ci#define IAR_CCA_CTRL_POWER_COMP_EN_ED	BIT(1)
39562306a36Sopenharmony_ci#define IAR_CCA_CTRL_POWER_COMP_EN_CCA1	BIT(0)
39662306a36Sopenharmony_ci
39762306a36Sopenharmony_ci/* ANT_PAD_CTRL bits */
39862306a36Sopenharmony_ci#define IAR_ANT_PAD_CTRL_ANTX_POL	(0x0F)
39962306a36Sopenharmony_ci#define IAR_ANT_PAD_CTRL_ANTX_POL_SHIFT	(4)
40062306a36Sopenharmony_ci#define IAR_ANT_PAD_CTRL_ANTX_CTRLMODE	BIT(3)
40162306a36Sopenharmony_ci#define IAR_ANT_PAD_CTRL_ANTX_HZ	BIT(2)
40262306a36Sopenharmony_ci#define IAR_ANT_PAD_CTRL_ANTX_EN	(3)
40362306a36Sopenharmony_ci
40462306a36Sopenharmony_ci/* MISC_PAD_CTRL bits */
40562306a36Sopenharmony_ci#define IAR_MISC_PAD_CTRL_MISO_HIZ_EN	BIT(3)
40662306a36Sopenharmony_ci#define IAR_MISC_PAD_CTRL_IRQ_B_OD	BIT(2)
40762306a36Sopenharmony_ci#define IAR_MISC_PAD_CTRL_NON_GPIO_DS	BIT(1)
40862306a36Sopenharmony_ci#define IAR_MISC_PAD_CTRL_ANTX_CURR	(1)
40962306a36Sopenharmony_ci
41062306a36Sopenharmony_ci/* ANT_AGC_CTRL bits */
41162306a36Sopenharmony_ci#define IAR_ANT_AGC_CTRL_FAD_EN_SHIFT	(0)
41262306a36Sopenharmony_ci#define IAR_ANT_AGC_CTRL_FAD_EN_MASK	(1)
41362306a36Sopenharmony_ci#define IAR_ANT_AGC_CTRL_ANTX_SHIFT	(1)
41462306a36Sopenharmony_ci#define IAR_ANT_AGC_CTRL_ANTX_MASK	BIT(AR_ANT_AGC_CTRL_ANTX_SHIFT)
41562306a36Sopenharmony_ci
41662306a36Sopenharmony_ci/* BSM_CTRL bits */
41762306a36Sopenharmony_ci#define BSM_CTRL_BSM_EN		(1)
41862306a36Sopenharmony_ci
41962306a36Sopenharmony_ci/* SOFT_RESET bits */
42062306a36Sopenharmony_ci#define IAR_SOFT_RESET_SOG_RST		BIT(7)
42162306a36Sopenharmony_ci#define IAR_SOFT_RESET_REGS_RST		BIT(4)
42262306a36Sopenharmony_ci#define IAR_SOFT_RESET_PLL_RST		BIT(3)
42362306a36Sopenharmony_ci#define IAR_SOFT_RESET_TX_RST		BIT(2)
42462306a36Sopenharmony_ci#define IAR_SOFT_RESET_RX_RST		BIT(1)
42562306a36Sopenharmony_ci#define IAR_SOFT_RESET_SEQ_MGR_RST	BIT(0)
42662306a36Sopenharmony_ci
42762306a36Sopenharmony_ci/* SEQ_MGR_CTRL bits */
42862306a36Sopenharmony_ci#define IAR_SEQ_MGR_CTRL_SEQ_STATE_CTRL		(3)
42962306a36Sopenharmony_ci#define IAR_SEQ_MGR_CTRL_SEQ_STATE_CTRL_SHIFT	(6)
43062306a36Sopenharmony_ci#define IAR_SEQ_MGR_CTRL_NO_RX_RECYCLE		BIT(5)
43162306a36Sopenharmony_ci#define IAR_SEQ_MGR_CTRL_LATCH_PREAMBLE		BIT(4)
43262306a36Sopenharmony_ci#define IAR_SEQ_MGR_CTRL_EVENT_TMR_DO_NOT_LATCH	BIT(3)
43362306a36Sopenharmony_ci#define IAR_SEQ_MGR_CTRL_CLR_NEW_SEQ_INHIBIT	BIT(2)
43462306a36Sopenharmony_ci#define IAR_SEQ_MGR_CTRL_PSM_LOCK_DIS		BIT(1)
43562306a36Sopenharmony_ci#define IAR_SEQ_MGR_CTRL_PLL_ABORT_OVRD		BIT(0)
43662306a36Sopenharmony_ci
43762306a36Sopenharmony_ci/* SEQ_MGR_STS bits */
43862306a36Sopenharmony_ci#define IAR_SEQ_MGR_STS_TMR2_SEQ_TRIG_ARMED	BIT(7)
43962306a36Sopenharmony_ci#define IAR_SEQ_MGR_STS_RX_MODE			BIT(6)
44062306a36Sopenharmony_ci#define IAR_SEQ_MGR_STS_RX_TIMEOUT_PENDING	BIT(5)
44162306a36Sopenharmony_ci#define IAR_SEQ_MGR_STS_NEW_SEQ_INHIBIT		BIT(4)
44262306a36Sopenharmony_ci#define IAR_SEQ_MGR_STS_SEQ_IDLE		BIT(3)
44362306a36Sopenharmony_ci#define IAR_SEQ_MGR_STS_XCVSEQ_ACTUAL		(7)
44462306a36Sopenharmony_ci
44562306a36Sopenharmony_ci/* ABORT_STS bits */
44662306a36Sopenharmony_ci#define IAR_ABORT_STS_PLL_ABORTED	BIT(2)
44762306a36Sopenharmony_ci#define IAR_ABORT_STS_TC3_ABORTED	BIT(1)
44862306a36Sopenharmony_ci#define IAR_ABORT_STS_SW_ABORTED	BIT(0)
44962306a36Sopenharmony_ci
45062306a36Sopenharmony_ci/* IAR_FILTERFAIL_CODE2 bits */
45162306a36Sopenharmony_ci#define IAR_FILTERFAIL_CODE2_PAN_SEL	BIT(7)
45262306a36Sopenharmony_ci#define IAR_FILTERFAIL_CODE2_9_8	(3)
45362306a36Sopenharmony_ci
45462306a36Sopenharmony_ci/* PHY_STS bits */
45562306a36Sopenharmony_ci#define IAR_PHY_STS_PLL_UNLOCK		BIT(7)
45662306a36Sopenharmony_ci#define IAR_PHY_STS_PLL_LOCK_ERR	BIT(6)
45762306a36Sopenharmony_ci#define IAR_PHY_STS_PLL_LOCK		BIT(5)
45862306a36Sopenharmony_ci#define IAR_PHY_STS_CRCVALID		BIT(3)
45962306a36Sopenharmony_ci#define IAR_PHY_STS_FILTERFAIL_FLAG_SEL	BIT(2)
46062306a36Sopenharmony_ci#define IAR_PHY_STS_SFD_DET		BIT(1)
46162306a36Sopenharmony_ci#define IAR_PHY_STS_PREAMBLE_DET	BIT(0)
46262306a36Sopenharmony_ci
46362306a36Sopenharmony_ci/* TESTMODE_CTRL bits */
46462306a36Sopenharmony_ci#define IAR_TEST_MODE_CTRL_HOT_ANT		BIT(4)
46562306a36Sopenharmony_ci#define IAR_TEST_MODE_CTRL_IDEAL_RSSI_EN	BIT(3)
46662306a36Sopenharmony_ci#define IAR_TEST_MODE_CTRL_IDEAL_PFC_EN		BIT(2)
46762306a36Sopenharmony_ci#define IAR_TEST_MODE_CTRL_CONTINUOUS_EN	BIT(1)
46862306a36Sopenharmony_ci#define IAR_TEST_MODE_CTRL_FPGA_EN		BIT(0)
46962306a36Sopenharmony_ci
47062306a36Sopenharmony_ci/* DTM_CTRL1 bits */
47162306a36Sopenharmony_ci#define IAR_DTM_CTRL1_ATM_LOCKED	BIT(7)
47262306a36Sopenharmony_ci#define IAR_DTM_CTRL1_DTM_EN		BIT(6)
47362306a36Sopenharmony_ci#define IAR_DTM_CTRL1_PAGE5		BIT(5)
47462306a36Sopenharmony_ci#define IAR_DTM_CTRL1_PAGE4		BIT(4)
47562306a36Sopenharmony_ci#define IAR_DTM_CTRL1_PAGE3		BIT(3)
47662306a36Sopenharmony_ci#define IAR_DTM_CTRL1_PAGE2		BIT(2)
47762306a36Sopenharmony_ci#define IAR_DTM_CTRL1_PAGE1		BIT(1)
47862306a36Sopenharmony_ci#define IAR_DTM_CTRL1_PAGE0		BIT(0)
47962306a36Sopenharmony_ci
48062306a36Sopenharmony_ci/* TX_MODE_CTRL */
48162306a36Sopenharmony_ci#define IAR_TX_MODE_CTRL_TX_INV		BIT(4)
48262306a36Sopenharmony_ci#define IAR_TX_MODE_CTRL_BT_EN		BIT(3)
48362306a36Sopenharmony_ci#define IAR_TX_MODE_CTRL_DTS2		BIT(2)
48462306a36Sopenharmony_ci#define IAR_TX_MODE_CTRL_DTS1		BIT(1)
48562306a36Sopenharmony_ci#define IAR_TX_MODE_CTRL_DTS0		BIT(0)
48662306a36Sopenharmony_ci
48762306a36Sopenharmony_ci#define TX_MODE_CTRL_DTS_MASK	(7)
48862306a36Sopenharmony_ci
48962306a36Sopenharmony_ci#endif /* _MCR20A_H */
490