linux/drivers/net/ieee802154/mcr20a.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Driver for NXP MCR20A 802.15.4 Wireless-PAN Networking controller
 *
 * Copyright (C) 2018 Xue Liu <[email protected]>
 */
#ifndef _MCR20A_H
#define _MCR20A_H

/* Direct Accress Register */
#define DAR_IRQ_STS1
#define DAR_IRQ_STS2
#define DAR_IRQ_STS3
#define DAR_PHY_CTRL1
#define DAR_PHY_CTRL2
#define DAR_PHY_CTRL3
#define DAR_RX_FRM_LEN
#define DAR_PHY_CTRL4
#define DAR_SRC_CTRL
#define DAR_SRC_ADDRS_SUM_LSB
#define DAR_SRC_ADDRS_SUM_MSB
#define DAR_CCA1_ED_FNL
#define DAR_EVENT_TMR_LSB
#define DAR_EVENT_TMR_MSB
#define DAR_EVENT_TMR_USB
#define DAR_TIMESTAMP_LSB
#define DAR_TIMESTAMP_MSB
#define DAR_TIMESTAMP_USB
#define DAR_T3CMP_LSB
#define DAR_T3CMP_MSB
#define DAR_T3CMP_USB
#define DAR_T2PRIMECMP_LSB
#define DAR_T2PRIMECMP_MSB
#define DAR_T1CMP_LSB
#define DAR_T1CMP_MSB
#define DAR_T1CMP_USB
#define DAR_T2CMP_LSB
#define DAR_T2CMP_MSB
#define DAR_T2CMP_USB
#define DAR_T4CMP_LSB
#define DAR_T4CMP_MSB
#define DAR_T4CMP_USB
#define DAR_PLL_INT0
#define DAR_PLL_FRAC0_LSB
#define DAR_PLL_FRAC0_MSB
#define DAR_PA_PWR
#define DAR_SEQ_STATE
#define DAR_LQI_VALUE
#define DAR_RSSI_CCA_CONT
/*------------------            0x27 */
#define DAR_ASM_CTRL1
#define DAR_ASM_CTRL2
#define DAR_ASM_DATA_0
#define DAR_ASM_DATA_1
#define DAR_ASM_DATA_2
#define DAR_ASM_DATA_3
#define DAR_ASM_DATA_4
#define DAR_ASM_DATA_5
#define DAR_ASM_DATA_6
#define DAR_ASM_DATA_7
#define DAR_ASM_DATA_8
#define DAR_ASM_DATA_9
#define DAR_ASM_DATA_A
#define DAR_ASM_DATA_B
#define DAR_ASM_DATA_C
#define DAR_ASM_DATA_D
#define DAR_ASM_DATA_E
#define DAR_ASM_DATA_F
/*-----------------------       0x3A */
#define DAR_OVERWRITE_VER
#define DAR_CLK_OUT_CTRL
#define DAR_PWR_MODES
#define IAR_INDEX
#define IAR_DATA

/* Indirect Resgister Memory */
#define IAR_PART_ID
#define IAR_XTAL_TRIM
#define IAR_PMC_LP_TRIM
#define IAR_MACPANID0_LSB
#define IAR_MACPANID0_MSB
#define IAR_MACSHORTADDRS0_LSB
#define IAR_MACSHORTADDRS0_MSB
#define IAR_MACLONGADDRS0_0
#define IAR_MACLONGADDRS0_8
#define IAR_MACLONGADDRS0_16
#define IAR_MACLONGADDRS0_24
#define IAR_MACLONGADDRS0_32
#define IAR_MACLONGADDRS0_40
#define IAR_MACLONGADDRS0_48
#define IAR_MACLONGADDRS0_56
#define IAR_RX_FRAME_FILTER
#define IAR_PLL_INT1
#define IAR_PLL_FRAC1_LSB
#define IAR_PLL_FRAC1_MSB
#define IAR_MACPANID1_LSB
#define IAR_MACPANID1_MSB
#define IAR_MACSHORTADDRS1_LSB
#define IAR_MACSHORTADDRS1_MSB
#define IAR_MACLONGADDRS1_0
#define IAR_MACLONGADDRS1_8
#define IAR_MACLONGADDRS1_16
#define IAR_MACLONGADDRS1_24
#define IAR_MACLONGADDRS1_32
#define IAR_MACLONGADDRS1_40
#define IAR_MACLONGADDRS1_48
#define IAR_MACLONGADDRS1_56
#define IAR_DUAL_PAN_CTRL
#define IAR_DUAL_PAN_DWELL
#define IAR_DUAL_PAN_STS
#define IAR_CCA1_THRESH
#define IAR_CCA1_ED_OFFSET_COMP
#define IAR_LQI_OFFSET_COMP
#define IAR_CCA_CTRL
#define IAR_CCA2_CORR_PEAKS
#define IAR_CCA2_CORR_THRESH
#define IAR_TMR_PRESCALE
/*--------------------          0x29 */
#define IAR_GPIO_DATA
#define IAR_GPIO_DIR
#define IAR_GPIO_PUL_EN
#define IAR_GPIO_PUL_SEL
#define IAR_GPIO_DS
/*------------------            0x2F */
#define IAR_ANT_PAD_CTRL
#define IAR_MISC_PAD_CTRL
#define IAR_BSM_CTRL
/*-------------------           0x33 */
#define IAR_RNG
#define IAR_RX_BYTE_COUNT
#define IAR_RX_WTR_MARK
#define IAR_SOFT_RESET
#define IAR_TXDELAY
#define IAR_ACKDELAY
#define IAR_SEQ_MGR_CTRL
#define IAR_SEQ_MGR_STS
#define IAR_SEQ_T_STS
#define IAR_ABORT_STS
#define IAR_CCCA_BUSY_CNT
#define IAR_SRC_ADDR_CHECKSUM1
#define IAR_SRC_ADDR_CHECKSUM2
#define IAR_SRC_TBL_VALID1
#define IAR_SRC_TBL_VALID2
#define IAR_FILTERFAIL_CODE1
#define IAR_FILTERFAIL_CODE2
#define IAR_SLOT_PRELOAD
/*--------------------          0x46 */
#define IAR_CORR_VT
#define IAR_SYNC_CTRL
#define IAR_PN_LSB_0
#define IAR_PN_LSB_1
#define IAR_PN_MSB_0
#define IAR_PN_MSB_1
#define IAR_CORR_NVAL
#define IAR_TX_MODE_CTRL
#define IAR_SNF_THR
#define IAR_FAD_THR
#define IAR_ANT_AGC_CTRL
#define IAR_AGC_THR1
#define IAR_AGC_THR2
#define IAR_AGC_HYS
#define IAR_AFC
/*-------------------           0x56 */
/*-------------------           0x57 */
#define IAR_PHY_STS
#define IAR_RX_MAX_CORR
#define IAR_RX_MAX_PREAMBLE
#define IAR_RSSI
/*-------------------           0x5C */
/*-------------------           0x5D */
#define IAR_PLL_DIG_CTRL
#define IAR_VCO_CAL
#define IAR_VCO_BEST_DIFF
#define IAR_VCO_BIAS
#define IAR_KMOD_CTRL
#define IAR_KMOD_CAL
#define IAR_PA_CAL
#define IAR_PA_PWRCAL
#define IAR_ATT_RSSI1
#define IAR_ATT_RSSI2
#define IAR_RSSI_OFFSET
#define IAR_RSSI_SLOPE
#define IAR_RSSI_CAL1
#define IAR_RSSI_CAL2
/*-------------------           0x6C */
/*-------------------           0x6D */
#define IAR_XTAL_CTRL
#define IAR_XTAL_COMP_MIN
#define IAR_XTAL_COMP_MAX
#define IAR_XTAL_GM
/*-------------------           0x72 */
/*-------------------           0x73 */
#define IAR_LNA_TUNE
#define IAR_LNA_AGCGAIN
/*-------------------           0x76 */
/*-------------------           0x77 */
#define IAR_CHF_PMA_GAIN
#define IAR_CHF_IBUF
#define IAR_CHF_QBUF
#define IAR_CHF_IRIN
#define IAR_CHF_QRIN
#define IAR_CHF_IL
#define IAR_CHF_QL
#define IAR_CHF_CC1
#define IAR_CHF_CCL
#define IAR_CHF_CC2
#define IAR_CHF_IROUT
#define IAR_CHF_QROUT
/*-------------------           0x84 */
/*-------------------           0x85 */
#define IAR_RSSI_CTRL
/*-------------------           0x87 */
/*-------------------           0x88 */
#define IAR_PA_BIAS
#define IAR_PA_TUNING
/*-------------------           0x8B */
/*-------------------           0x8C */
#define IAR_PMC_HP_TRIM
#define IAR_VREGA_TRIM
/*-------------------           0x8F */
/*-------------------           0x90 */
#define IAR_VCO_CTRL1
#define IAR_VCO_CTRL2
/*-------------------           0x93 */
/*-------------------           0x94 */
#define IAR_ANA_SPARE_OUT1
#define IAR_ANA_SPARE_OUT2
#define IAR_ANA_SPARE_IN
#define IAR_MISCELLANEOUS
/*-------------------           0x99 */
#define IAR_SEQ_MGR_OVRD0
#define IAR_SEQ_MGR_OVRD1
#define IAR_SEQ_MGR_OVRD2
#define IAR_SEQ_MGR_OVRD3
#define IAR_SEQ_MGR_OVRD4
#define IAR_SEQ_MGR_OVRD5
#define IAR_SEQ_MGR_OVRD6
#define IAR_SEQ_MGR_OVRD7
/*-------------------           0xA2 */
#define IAR_TESTMODE_CTRL
#define IAR_DTM_CTRL1
#define IAR_DTM_CTRL2
#define IAR_ATM_CTRL1
#define IAR_ATM_CTRL2
#define IAR_ATM_CTRL3
/*-------------------           0xA9 */
#define IAR_LIM_FE_TEST_CTRL
#define IAR_CHF_TEST_CTRL
#define IAR_VCO_TEST_CTRL
#define IAR_PLL_TEST_CTRL
#define IAR_PA_TEST_CTRL
#define IAR_PMC_TEST_CTRL
#define IAR_SCAN_DTM_PROTECT_1
#define IAR_SCAN_DTM_PROTECT_0

/* IRQSTS1 bits */
#define DAR_IRQSTS1_RX_FRM_PEND
#define DAR_IRQSTS1_PLL_UNLOCK_IRQ
#define DAR_IRQSTS1_FILTERFAIL_IRQ
#define DAR_IRQSTS1_RXWTRMRKIRQ
#define DAR_IRQSTS1_CCAIRQ
#define DAR_IRQSTS1_RXIRQ
#define DAR_IRQSTS1_TXIRQ
#define DAR_IRQSTS1_SEQIRQ

/* IRQSTS2 bits */
#define DAR_IRQSTS2_CRCVALID
#define DAR_IRQSTS2_CCA
#define DAR_IRQSTS2_SRCADDR
#define DAR_IRQSTS2_PI
#define DAR_IRQSTS2_TMRSTATUS
#define DAR_IRQSTS2_ASM_IRQ
#define DAR_IRQSTS2_PB_ERR_IRQ
#define DAR_IRQSTS2_WAKE_IRQ

/* IRQSTS3 bits */
#define DAR_IRQSTS3_TMR4MSK
#define DAR_IRQSTS3_TMR3MSK
#define DAR_IRQSTS3_TMR2MSK
#define DAR_IRQSTS3_TMR1MSK
#define DAR_IRQSTS3_TMR4IRQ
#define DAR_IRQSTS3_TMR3IRQ
#define DAR_IRQSTS3_TMR2IRQ
#define DAR_IRQSTS3_TMR1IRQ

/* PHY_CTRL1 bits */
#define DAR_PHY_CTRL1_TMRTRIGEN
#define DAR_PHY_CTRL1_SLOTTED
#define DAR_PHY_CTRL1_CCABFRTX
#define DAR_PHY_CTRL1_CCABFRTX_SHIFT
#define DAR_PHY_CTRL1_RXACKRQD
#define DAR_PHY_CTRL1_AUTOACK
#define DAR_PHY_CTRL1_XCVSEQ_MASK

/* PHY_CTRL2 bits */
#define DAR_PHY_CTRL2_CRC_MSK
#define DAR_PHY_CTRL2_PLL_UNLOCK_MSK
#define DAR_PHY_CTRL2_FILTERFAIL_MSK
#define DAR_PHY_CTRL2_RX_WMRK_MSK
#define DAR_PHY_CTRL2_CCAMSK
#define DAR_PHY_CTRL2_RXMSK
#define DAR_PHY_CTRL2_TXMSK
#define DAR_PHY_CTRL2_SEQMSK

/* PHY_CTRL3 bits */
#define DAR_PHY_CTRL3_TMR4CMP_EN
#define DAR_PHY_CTRL3_TMR3CMP_EN
#define DAR_PHY_CTRL3_TMR2CMP_EN
#define DAR_PHY_CTRL3_TMR1CMP_EN
#define DAR_PHY_CTRL3_ASM_MSK
#define DAR_PHY_CTRL3_PB_ERR_MSK
#define DAR_PHY_CTRL3_WAKE_MSK

/* RX_FRM_LEN bits */
#define DAR_RX_FRAME_LENGTH_MASK

/* PHY_CTRL4 bits */
#define DAR_PHY_CTRL4_TRCV_MSK
#define DAR_PHY_CTRL4_TC3TMOUT
#define DAR_PHY_CTRL4_PANCORDNTR0
#define DAR_PHY_CTRL4_CCATYPE
#define DAR_PHY_CTRL4_CCATYPE_SHIFT
#define DAR_PHY_CTRL4_CCATYPE_MASK
#define DAR_PHY_CTRL4_TMRLOAD
#define DAR_PHY_CTRL4_PROMISCUOUS
#define DAR_PHY_CTRL4_TC2PRIME_EN

/* SRC_CTRL bits */
#define DAR_SRC_CTRL_INDEX
#define DAR_SRC_CTRL_INDEX_SHIFT
#define DAR_SRC_CTRL_ACK_FRM_PND
#define DAR_SRC_CTRL_SRCADDR_EN
#define DAR_SRC_CTRL_INDEX_EN
#define DAR_SRC_CTRL_INDEX_DISABLE

/* DAR_ASM_CTRL1 bits */
#define DAR_ASM_CTRL1_CLEAR
#define DAR_ASM_CTRL1_START
#define DAR_ASM_CTRL1_SELFTST
#define DAR_ASM_CTRL1_CTR
#define DAR_ASM_CTRL1_CBC
#define DAR_ASM_CTRL1_AES
#define DAR_ASM_CTRL1_LOAD_MAC

/* DAR_ASM_CTRL2 bits */
#define DAR_ASM_CTRL2_DATA_REG_TYPE_SEL
#define DAR_ASM_CTRL2_DATA_REG_TYPE_SEL_SHIFT
#define DAR_ASM_CTRL2_TSTPAS

/* DAR_CLK_OUT_CTRL bits */
#define DAR_CLK_OUT_CTRL_EXTEND
#define DAR_CLK_OUT_CTRL_HIZ
#define DAR_CLK_OUT_CTRL_SR
#define DAR_CLK_OUT_CTRL_DS
#define DAR_CLK_OUT_CTRL_EN
#define DAR_CLK_OUT_CTRL_DIV

/* DAR_PWR_MODES bits */
#define DAR_PWR_MODES_XTAL_READY
#define DAR_PWR_MODES_XTALEN
#define DAR_PWR_MODES_ASM_CLK_EN
#define DAR_PWR_MODES_AUTODOZE
#define DAR_PWR_MODES_PMC_MODE

/* RX_FRAME_FILTER bits */
#define IAR_RX_FRAME_FLT_FRM_VER
#define IAR_RX_FRAME_FLT_FRM_VER_SHIFT
#define IAR_RX_FRAME_FLT_ACTIVE_PROMISCUOUS
#define IAR_RX_FRAME_FLT_NS_FT
#define IAR_RX_FRAME_FLT_CMD_FT
#define IAR_RX_FRAME_FLT_ACK_FT
#define IAR_RX_FRAME_FLT_DATA_FT
#define IAR_RX_FRAME_FLT_BEACON_FT

/* DUAL_PAN_CTRL bits */
#define IAR_DUAL_PAN_CTRL_DUAL_PAN_SAM_LVL_MSK
#define IAR_DUAL_PAN_CTRL_DUAL_PAN_SAM_LVL_SHIFT
#define IAR_DUAL_PAN_CTRL_CURRENT_NETWORK
#define IAR_DUAL_PAN_CTRL_PANCORDNTR1
#define IAR_DUAL_PAN_CTRL_DUAL_PAN_AUTO
#define IAR_DUAL_PAN_CTRL_ACTIVE_NETWORK

/* DUAL_PAN_STS bits */
#define IAR_DUAL_PAN_STS_RECD_ON_PAN1
#define IAR_DUAL_PAN_STS_RECD_ON_PAN0
#define IAR_DUAL_PAN_STS_DUAL_PAN_REMAIN

/* CCA_CTRL bits */
#define IAR_CCA_CTRL_AGC_FRZ_EN
#define IAR_CCA_CTRL_CONT_RSSI_EN
#define IAR_CCA_CTRL_LQI_RSSI_NOT_CORR
#define IAR_CCA_CTRL_CCA3_AND_NOT_OR
#define IAR_CCA_CTRL_POWER_COMP_EN_LQI
#define IAR_CCA_CTRL_POWER_COMP_EN_ED
#define IAR_CCA_CTRL_POWER_COMP_EN_CCA1

/* ANT_PAD_CTRL bits */
#define IAR_ANT_PAD_CTRL_ANTX_POL
#define IAR_ANT_PAD_CTRL_ANTX_POL_SHIFT
#define IAR_ANT_PAD_CTRL_ANTX_CTRLMODE
#define IAR_ANT_PAD_CTRL_ANTX_HZ
#define IAR_ANT_PAD_CTRL_ANTX_EN

/* MISC_PAD_CTRL bits */
#define IAR_MISC_PAD_CTRL_MISO_HIZ_EN
#define IAR_MISC_PAD_CTRL_IRQ_B_OD
#define IAR_MISC_PAD_CTRL_NON_GPIO_DS
#define IAR_MISC_PAD_CTRL_ANTX_CURR

/* ANT_AGC_CTRL bits */
#define IAR_ANT_AGC_CTRL_FAD_EN_SHIFT
#define IAR_ANT_AGC_CTRL_FAD_EN_MASK
#define IAR_ANT_AGC_CTRL_ANTX_SHIFT
#define IAR_ANT_AGC_CTRL_ANTX_MASK

/* BSM_CTRL bits */
#define BSM_CTRL_BSM_EN

/* SOFT_RESET bits */
#define IAR_SOFT_RESET_SOG_RST
#define IAR_SOFT_RESET_REGS_RST
#define IAR_SOFT_RESET_PLL_RST
#define IAR_SOFT_RESET_TX_RST
#define IAR_SOFT_RESET_RX_RST
#define IAR_SOFT_RESET_SEQ_MGR_RST

/* SEQ_MGR_CTRL bits */
#define IAR_SEQ_MGR_CTRL_SEQ_STATE_CTRL
#define IAR_SEQ_MGR_CTRL_SEQ_STATE_CTRL_SHIFT
#define IAR_SEQ_MGR_CTRL_NO_RX_RECYCLE
#define IAR_SEQ_MGR_CTRL_LATCH_PREAMBLE
#define IAR_SEQ_MGR_CTRL_EVENT_TMR_DO_NOT_LATCH
#define IAR_SEQ_MGR_CTRL_CLR_NEW_SEQ_INHIBIT
#define IAR_SEQ_MGR_CTRL_PSM_LOCK_DIS
#define IAR_SEQ_MGR_CTRL_PLL_ABORT_OVRD

/* SEQ_MGR_STS bits */
#define IAR_SEQ_MGR_STS_TMR2_SEQ_TRIG_ARMED
#define IAR_SEQ_MGR_STS_RX_MODE
#define IAR_SEQ_MGR_STS_RX_TIMEOUT_PENDING
#define IAR_SEQ_MGR_STS_NEW_SEQ_INHIBIT
#define IAR_SEQ_MGR_STS_SEQ_IDLE
#define IAR_SEQ_MGR_STS_XCVSEQ_ACTUAL

/* ABORT_STS bits */
#define IAR_ABORT_STS_PLL_ABORTED
#define IAR_ABORT_STS_TC3_ABORTED
#define IAR_ABORT_STS_SW_ABORTED

/* IAR_FILTERFAIL_CODE2 bits */
#define IAR_FILTERFAIL_CODE2_PAN_SEL
#define IAR_FILTERFAIL_CODE2_9_8

/* PHY_STS bits */
#define IAR_PHY_STS_PLL_UNLOCK
#define IAR_PHY_STS_PLL_LOCK_ERR
#define IAR_PHY_STS_PLL_LOCK
#define IAR_PHY_STS_CRCVALID
#define IAR_PHY_STS_FILTERFAIL_FLAG_SEL
#define IAR_PHY_STS_SFD_DET
#define IAR_PHY_STS_PREAMBLE_DET

/* TESTMODE_CTRL bits */
#define IAR_TEST_MODE_CTRL_HOT_ANT
#define IAR_TEST_MODE_CTRL_IDEAL_RSSI_EN
#define IAR_TEST_MODE_CTRL_IDEAL_PFC_EN
#define IAR_TEST_MODE_CTRL_CONTINUOUS_EN
#define IAR_TEST_MODE_CTRL_FPGA_EN

/* DTM_CTRL1 bits */
#define IAR_DTM_CTRL1_ATM_LOCKED
#define IAR_DTM_CTRL1_DTM_EN
#define IAR_DTM_CTRL1_PAGE5
#define IAR_DTM_CTRL1_PAGE4
#define IAR_DTM_CTRL1_PAGE3
#define IAR_DTM_CTRL1_PAGE2
#define IAR_DTM_CTRL1_PAGE1
#define IAR_DTM_CTRL1_PAGE0

/* TX_MODE_CTRL */
#define IAR_TX_MODE_CTRL_TX_INV
#define IAR_TX_MODE_CTRL_BT_EN
#define IAR_TX_MODE_CTRL_DTS2
#define IAR_TX_MODE_CTRL_DTS1
#define IAR_TX_MODE_CTRL_DTS0

#define TX_MODE_CTRL_DTS_MASK

#endif /* _MCR20A_H */