linux/drivers/isdn/hardware/mISDN/hfc_multi.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * see notice in hfc_multi.c
 */

#define DEBUG_HFCMULTI_FIFO
#define DEBUG_HFCMULTI_CRC
#define DEBUG_HFCMULTI_INIT
#define DEBUG_HFCMULTI_PLXSD
#define DEBUG_HFCMULTI_MODE
#define DEBUG_HFCMULTI_MSG
#define DEBUG_HFCMULTI_STATE
#define DEBUG_HFCMULTI_FILL
#define DEBUG_HFCMULTI_SYNC
#define DEBUG_HFCMULTI_DTMF
#define DEBUG_HFCMULTI_LOCK

#define PCI_ENA_REGIO
#define PCI_ENA_MEMIO

#define XHFC_IRQ
#define XHFC_MEMBASE
#define XHFC_MEMSIZE
#define XHFC_OFFSET
#define PA_XHFC_A0
#define PB_XHFC_IRQ1
#define PB_XHFC_IRQ2
#define PB_XHFC_IRQ3
#define PB_XHFC_IRQ4

/*
 * NOTE: some registers are assigned multiple times due to different modes
 *       also registers are assigned differen for HFC-4s/8s and HFC-E1
 */

/*
  #define MAX_FRAME_SIZE	2048
*/

struct hfc_chan {};


struct hfcm_hw {};


/* for each stack these flags are used (cfg) */
#define HFC_CFG_NONCAP_TX
#define HFC_CFG_DIS_ECHANNEL
#define HFC_CFG_REG_ECHANNEL
#define HFC_CFG_OPTICAL
#define HFC_CFG_REPORT_LOS
#define HFC_CFG_REPORT_AIS
#define HFC_CFG_REPORT_SLIP
#define HFC_CFG_REPORT_RDI
#define HFC_CFG_DTMF
#define HFC_CFG_CRC4
/* use double frame instead. */

#define HFC_TYPE_E1
#define HFC_TYPE_4S
#define HFC_TYPE_8S
#define HFC_TYPE_XHFC

#define HFC_CHIP_EXRAM_128
#define HFC_CHIP_EXRAM_512
#define HFC_CHIP_REVISION0
#define HFC_CHIP_PCM_SLAVE
#define HFC_CHIP_PCM_MASTER
#define HFC_CHIP_RX_SYNC
#define HFC_CHIP_DTMF
#define HFC_CHIP_CONF
#define HFC_CHIP_ULAW
#define HFC_CHIP_CLOCK2
#define HFC_CHIP_E1CLOCK_GET
#define HFC_CHIP_E1CLOCK_PUT
#define HFC_CHIP_WATCHDOG
/* to the watchdog */
#define HFC_CHIP_B410P
/* hw */
#define HFC_CHIP_PLXSD
#define HFC_CHIP_EMBSD

#define HFC_IO_MODE_PCIMEM
#define HFC_IO_MODE_REGIO
#define HFC_IO_MODE_PLXSD
#define HFC_IO_MODE_EMBSD

/* table entry in the PCI devices list */
struct hm_map {};

struct hfc_multi {};

/* PLX GPIOs */
#define PLX_GPIO4_DIR_BIT
#define PLX_GPIO4_BIT
#define PLX_GPIO5_DIR_BIT
#define PLX_GPIO5_BIT
#define PLX_GPIO6_DIR_BIT
#define PLX_GPIO6_BIT
#define PLX_GPIO7_DIR_BIT
#define PLX_GPIO7_BIT
#define PLX_GPIO8_DIR_BIT
#define PLX_GPIO8_BIT

#define PLX_GPIO4
#define PLX_GPIO5
#define PLX_GPIO6
#define PLX_GPIO7
#define PLX_GPIO8

#define PLX_GPIO4_DIR
#define PLX_GPIO5_DIR
#define PLX_GPIO6_DIR
#define PLX_GPIO7_DIR
#define PLX_GPIO8_DIR

#define PLX_TERM_ON
#define PLX_SLAVE_EN_N
#define PLX_MASTER_EN
#define PLX_SYNC_O_EN
#define PLX_DSP_RES_N
/* GPIO4..8 Enable & Set to OUT, SLAVE_EN_N = 1 */
#define PLX_GPIOC_INIT

/* PLX Interrupt Control/STATUS */
#define PLX_INTCSR_LINTI1_ENABLE
#define PLX_INTCSR_LINTI1_STATUS
#define PLX_INTCSR_LINTI2_ENABLE
#define PLX_INTCSR_LINTI2_STATUS
#define PLX_INTCSR_PCIINT_ENABLE

/* PLX Registers */
#define PLX_INTCSR
#define PLX_CNTRL
#define PLX_GPIOC


/*
 * REGISTER SETTING FOR HFC-4S/8S AND HFC-E1
 */

/* write only registers */
#define R_CIRM
#define R_CTRL
#define R_BRG_PCM_CFG
#define R_RAM_ADDR0
#define R_RAM_ADDR1
#define R_RAM_ADDR2
#define R_FIRST_FIFO
#define R_RAM_SZ
#define R_FIFO_MD
#define R_INC_RES_FIFO
#define R_FSM_IDX
#define R_FIFO
#define R_SLOT
#define R_IRQMSK_MISC
#define R_SCI_MSK
#define R_IRQ_CTRL
#define R_PCM_MD0
#define R_PCM_MD1
#define R_PCM_MD2
#define R_SH0H
#define R_SH1H
#define R_SH0L
#define R_SH1L
#define R_SL_SEL0
#define R_SL_SEL1
#define R_SL_SEL2
#define R_SL_SEL3
#define R_SL_SEL4
#define R_SL_SEL5
#define R_SL_SEL6
#define R_SL_SEL7
#define R_ST_SEL
#define R_ST_SYNC
#define R_CONF_EN
#define R_TI_WD
#define R_BERT_WD_MD
#define R_DTMF
#define R_DTMF_N
#define R_E1_WR_STA
#define R_E1_RD_STA
#define R_LOS0
#define R_LOS1
#define R_RX0
#define R_RX_FR0
#define R_RX_FR1
#define R_TX0
#define R_TX1
#define R_TX_FR0

#define R_TX_FR1
#define R_TX_FR2
#define R_JATT_ATT
#define A_ST_RD_STATE
#define A_ST_WR_STATE
#define R_RX_OFF
#define A_ST_CTRL0
#define R_SYNC_OUT
#define A_ST_CTRL1
#define A_ST_CTRL2
#define A_ST_SQ_WR
#define R_TX_OFF
#define R_SYNC_CTRL
#define A_ST_CLK_DLY
#define R_PWM0
#define R_PWM1
#define A_ST_B1_TX
#define A_ST_B2_TX
#define A_ST_D_TX
#define R_GPIO_OUT0
#define R_GPIO_OUT1
#define R_GPIO_EN0
#define R_GPIO_EN1
#define R_GPIO_SEL
#define R_BRG_CTRL
#define R_PWM_MD
#define R_BRG_MD
#define R_BRG_TIM0
#define R_BRG_TIM1
#define R_BRG_TIM2
#define R_BRG_TIM3
#define R_BRG_TIM_SEL01
#define R_BRG_TIM_SEL23
#define R_BRG_TIM_SEL45
#define R_BRG_TIM_SEL67
#define A_SL_CFG
#define A_CONF
#define A_CH_MSK
#define A_CON_HDLC
#define A_SUBCH_CFG
#define A_CHANNEL
#define A_FIFO_SEQ
#define A_IRQ_MSK

/* read only registers */
#define A_Z12
#define A_Z1L
#define A_Z1
#define A_Z1H
#define A_Z2L
#define A_Z2
#define A_Z2H
#define A_F1
#define A_F12
#define A_F2
#define R_IRQ_OVIEW
#define R_IRQ_MISC
#define R_IRQ_STATECH
#define R_CONF_OFLOW
#define R_RAM_USE
#define R_CHIP_ID
#define R_BERT_STA
#define R_F0_CNTL
#define R_F0_CNTH
#define R_BERT_EC
#define R_BERT_ECL
#define R_BERT_ECH
#define R_STATUS
#define R_CHIP_RV
#define R_STATE
#define R_SYNC_STA
#define R_RX_SL0_0
#define R_RX_SL0_1
#define R_RX_SL0_2
#define R_JATT_DIR
#define R_SLIP
#define A_ST_RD_STA
#define R_FAS_EC
#define R_FAS_ECL
#define R_FAS_ECH
#define R_VIO_EC
#define R_VIO_ECL
#define R_VIO_ECH
#define A_ST_SQ_RD
#define R_CRC_EC
#define R_CRC_ECL
#define R_CRC_ECH
#define R_E_EC
#define R_E_ECL
#define R_E_ECH
#define R_SA6_SA13_EC
#define R_SA6_SA13_ECL
#define R_SA6_SA13_ECH
#define R_SA6_SA23_EC
#define R_SA6_SA23_ECL
#define R_SA6_SA23_ECH
#define A_ST_B1_RX
#define A_ST_B2_RX
#define A_ST_D_RX
#define A_ST_E_RX
#define R_GPIO_IN0
#define R_GPIO_IN1
#define R_GPI_IN0
#define R_GPI_IN1
#define R_GPI_IN2
#define R_GPI_IN3
#define R_INT_DATA
#define R_IRQ_FIFO_BL0
#define R_IRQ_FIFO_BL1
#define R_IRQ_FIFO_BL2
#define R_IRQ_FIFO_BL3
#define R_IRQ_FIFO_BL4
#define R_IRQ_FIFO_BL5
#define R_IRQ_FIFO_BL6
#define R_IRQ_FIFO_BL7

/* read and write registers */
#define A_FIFO_DATA0
#define A_FIFO_DATA1
#define A_FIFO_DATA2
#define A_FIFO_DATA0_NOINC
#define A_FIFO_DATA1_NOINC
#define A_FIFO_DATA2_NOINC
#define R_RAM_DATA


/*
 * BIT SETTING FOR HFC-4S/8S AND HFC-E1
 */

/* chapter 2: universal bus interface */
/* R_CIRM */
#define V_IRQ_SEL
#define V_SRES
#define V_HFCRES
#define V_PCMRES
#define V_STRES
#define V_ETRES
#define V_RLD_EPR
/* R_CTRL */
#define V_FIFO_LPRIO
#define V_SLOW_RD
#define V_EXT_RAM
#define V_CLK_OFF
#define V_ST_CLK
/* R_RAM_ADDR0 */
#define V_RAM_ADDR2
#define V_ADDR_RES
#define V_ADDR_INC
/* R_RAM_SZ */
#define V_RAM_SZ
#define V_PWM0_16KHZ
#define V_PWM1_16KHZ
#define V_FZ_MD
/* R_CHIP_ID */
#define V_PNP_IRQ
#define V_CHIP_ID

/* chapter 3: data flow */
/* R_FIRST_FIFO */
#define V_FIRST_FIRO_DIR
#define V_FIRST_FIFO_NUM
/* R_FIFO_MD */
#define V_FIFO_MD
#define V_CSM_MD
#define V_FSM_MD
#define V_FIFO_SZ
/* R_FIFO */
#define V_FIFO_DIR
#define V_FIFO_NUM
#define V_REV
/* R_SLOT */
#define V_SL_DIR
#define V_SL_NUM
/* A_SL_CFG */
#define V_CH_DIR
#define V_CH_SEL
#define V_ROUTING
/* A_CON_HDLC */
#define V_IFF
#define V_HDLC_TRP
#define V_TRP_IRQ
#define V_DATA_FLOW
/* A_SUBCH_CFG */
#define V_BIT_CNT
#define V_START_BIT
#define V_LOOP_FIFO
#define V_INV_DATA
/* A_CHANNEL */
#define V_CH_DIR0
#define V_CH_NUM0
/* A_FIFO_SEQ */
#define V_NEXT_FIFO_DIR
#define V_NEXT_FIFO_NUM
#define V_SEQ_END

/* chapter 4: FIFO handling and HDLC controller */
/* R_INC_RES_FIFO */
#define V_INC_F
#define V_RES_F
#define V_RES_LOST

/* chapter 5: S/T interface */
/* R_SCI_MSK */
#define V_SCI_MSK_ST0
#define V_SCI_MSK_ST1
#define V_SCI_MSK_ST2
#define V_SCI_MSK_ST3
#define V_SCI_MSK_ST4
#define V_SCI_MSK_ST5
#define V_SCI_MSK_ST6
#define V_SCI_MSK_ST7
/* R_ST_SEL */
#define V_ST_SEL
#define V_MULT_ST
/* R_ST_SYNC */
#define V_SYNC_SEL
#define V_AUTO_SYNC
/* A_ST_WR_STA */
#define V_ST_SET_STA
#define V_ST_LD_STA
#define V_ST_ACT
#define V_SET_G2_G3
/* A_ST_CTRL0 */
#define V_B1_EN
#define V_B2_EN
#define V_ST_MD
#define V_D_PRIO
#define V_SQ_EN
#define V_96KHZ
#define V_TX_LI
#define V_ST_STOP
/* A_ST_CTRL1 */
#define V_G2_G3_EN
#define V_D_HI
#define V_E_IGNO
#define V_E_LO
#define V_B12_SWAP
/* A_ST_CTRL2 */
#define V_B1_RX_EN
#define V_B2_RX_EN
#define V_ST_TRIS
/* A_ST_CLK_DLY */
#define V_ST_CK_DLY
#define V_ST_SMPL
/* A_ST_D_TX */
#define V_ST_D_TX
/* R_IRQ_STATECH */
#define V_SCI_ST0
#define V_SCI_ST1
#define V_SCI_ST2
#define V_SCI_ST3
#define V_SCI_ST4
#define V_SCI_ST5
#define V_SCI_ST6
#define V_SCI_ST7
/* A_ST_RD_STA */
#define V_ST_STA
#define V_FR_SYNC_ST
#define V_TI2_EXP
#define V_INFO0
#define V_G2_G3
/* A_ST_SQ_RD */
#define V_ST_SQ
#define V_MF_RX_RDY
#define V_MF_TX_RDY
/* A_ST_D_RX */
#define V_ST_D_RX
/* A_ST_E_RX */
#define V_ST_E_RX

/* chapter 5: E1 interface */
/* R_E1_WR_STA */
/* R_E1_RD_STA */
#define V_E1_SET_STA
#define V_E1_LD_STA
/* R_RX0 */
#define V_RX_CODE
#define V_RX_FBAUD
#define V_RX_CMI
#define V_RX_INV_CMI
#define V_RX_INV_CLK
#define V_RX_INV_DATA
#define V_AIS_ITU
/* R_RX_FR0 */
#define V_NO_INSYNC
#define V_AUTO_RESYNC
#define V_AUTO_RECO
#define V_SWORD_COND
#define V_SYNC_LOSS
#define V_XCRC_SYNC
#define V_MF_RESYNC
#define V_RESYNC
/* R_RX_FR1 */
#define V_RX_MF
#define V_RX_MF_SYNC
#define V_RX_SL0_RAM
#define V_ERR_SIM
#define V_RES_NMF
/* R_TX0 */
#define V_TX_CODE
#define V_TX_FBAUD
#define V_TX_CMI_CODE
#define V_TX_INV_CMI_CODE
#define V_TX_INV_CLK
#define V_TX_INV_DATA
#define V_OUT_EN
/* R_TX1 */
#define V_INV_CLK
#define V_EXCHG_DATA_LI
#define V_AIS_OUT
#define V_ATX
#define V_NTRI
#define V_AUTO_ERR_RES
/* R_TX_FR0 */
#define V_TRP_FAS
#define V_TRP_NFAS
#define V_TRP_RAL
#define V_TRP_SA
/* R_TX_FR1 */
#define V_TX_FAS
#define V_TX_NFAS
#define V_TX_RAL
#define V_TX_SA
/* R_TX_FR2 */
#define V_TX_MF
#define V_TRP_SL0
#define V_TX_SL0_RAM
#define V_TX_E
#define V_NEG_E
#define V_XS12_ON
#define V_XS15_ON
/* R_RX_OFF */
#define V_RX_SZ
#define V_RX_INIT
/* R_SYNC_OUT */
#define V_SYNC_E1_RX
#define V_IPATS0
#define V_IPATS1
#define V_IPATS2
/* R_TX_OFF */
#define V_TX_SZ
#define V_TX_INIT
/* R_SYNC_CTRL */
#define V_EXT_CLK_SYNC
#define V_SYNC_OFFS
#define V_PCM_SYNC
#define V_NEG_CLK
#define V_HCLK
/*
  #define V_JATT_AUTO_DEL		0x20
  #define V_JATT_AUTO		0x40
*/
#define V_JATT_OFF
/* R_STATE */
#define V_E1_STA
#define V_ALT_FR_RX
#define V_ALT_FR_TX
/* R_SYNC_STA */
#define V_RX_STA
#define V_FR_SYNC_E1
#define V_SIG_LOS
#define V_MFA_STA
#define V_AIS
#define V_NO_MF_SYNC
/* R_RX_SL0_0 */
#define V_SI_FAS
#define V_SI_NFAS
#define V_A
#define V_CRC_OK
#define V_TX_E1
#define V_TX_E2
#define V_RX_E1
#define V_RX_E2
/* R_SLIP */
#define V_SLIP_RX
#define V_FOSLIP_RX
#define V_SLIP_TX
#define V_FOSLIP_TX

/* chapter 6: PCM interface */
/* R_PCM_MD0 */
#define V_PCM_MD
#define V_C4_POL
#define V_F0_NEG
#define V_F0_LEN
#define V_PCM_ADDR
/* R_SL_SEL0 */
#define V_SL_SEL0
#define V_SH_SEL0
/* R_SL_SEL1 */
#define V_SL_SEL1
#define V_SH_SEL1
/* R_SL_SEL2 */
#define V_SL_SEL2
#define V_SH_SEL2
/* R_SL_SEL3 */
#define V_SL_SEL3
#define V_SH_SEL3
/* R_SL_SEL4 */
#define V_SL_SEL4
#define V_SH_SEL4
/* R_SL_SEL5 */
#define V_SL_SEL5
#define V_SH_SEL5
/* R_SL_SEL6 */
#define V_SL_SEL6
#define V_SH_SEL6
/* R_SL_SEL7 */
#define V_SL_SEL7
#define V_SH_SEL7
/* R_PCM_MD1 */
#define V_ODEC_CON
#define V_PLL_ADJ
#define V_PCM_DR
#define V_PCM_LOOP
/* R_PCM_MD2 */
#define V_SYNC_PLL
#define V_SYNC_SRC
#define V_SYNC_OUT
#define V_ICR_FR_TIME
#define V_EN_PLL

/* chapter 7: pulse width modulation */
/* R_PWM_MD */
#define V_EXT_IRQ_EN
#define V_PWM0_MD
#define V_PWM1_MD

/* chapter 8: multiparty audio conferences */
/* R_CONF_EN */
#define V_CONF_EN
#define V_ULAW
/* A_CONF */
#define V_CONF_NUM
#define V_NOISE_SUPPR
#define V_ATT_LEV
#define V_CONF_SL
/* R_CONF_OFLOW */
#define V_CONF_OFLOW0
#define V_CONF_OFLOW1
#define V_CONF_OFLOW2
#define V_CONF_OFLOW3
#define V_CONF_OFLOW4
#define V_CONF_OFLOW5
#define V_CONF_OFLOW6
#define V_CONF_OFLOW7

/* chapter 9: DTMF contoller */
/* R_DTMF0 */
#define V_DTMF_EN
#define V_HARM_SEL
#define V_DTMF_RX_CH
#define V_DTMF_STOP
#define V_CHBL_SEL
#define V_RST_DTMF
#define V_ULAW_SEL

/* chapter 10: BERT */
/* R_BERT_WD_MD */
#define V_PAT_SEQ
#define V_BERT_ERR
#define V_AUTO_WD_RES
#define V_WD_RES
/* R_BERT_STA */
#define V_BERT_SYNC_SRC
#define V_BERT_SYNC
#define V_BERT_INV_DATA

/* chapter 11: auxiliary interface */
/* R_BRG_PCM_CFG */
#define V_BRG_EN
#define V_BRG_MD
#define V_PCM_CLK
#define V_ADDR_WRDLY
/* R_BRG_CTRL */
#define V_BRG_CS
#define V_BRG_ADDR
#define V_BRG_CS_SRC
/* R_BRG_MD */
#define V_BRG_MD0
#define V_BRG_MD1
#define V_BRG_MD2
#define V_BRG_MD3
#define V_BRG_MD4
#define V_BRG_MD5
#define V_BRG_MD6
#define V_BRG_MD7
/* R_BRG_TIM0 */
#define V_BRG_TIM0_IDLE
#define V_BRG_TIM0_CLK
/* R_BRG_TIM1 */
#define V_BRG_TIM1_IDLE
#define V_BRG_TIM1_CLK
/* R_BRG_TIM2 */
#define V_BRG_TIM2_IDLE
#define V_BRG_TIM2_CLK
/* R_BRG_TIM3 */
#define V_BRG_TIM3_IDLE
#define V_BRG_TIM3_CLK
/* R_BRG_TIM_SEL01 */
#define V_BRG_WR_SEL0
#define V_BRG_RD_SEL0
#define V_BRG_WR_SEL1
#define V_BRG_RD_SEL1
/* R_BRG_TIM_SEL23 */
#define V_BRG_WR_SEL2
#define V_BRG_RD_SEL2
#define V_BRG_WR_SEL3
#define V_BRG_RD_SEL3
/* R_BRG_TIM_SEL45 */
#define V_BRG_WR_SEL4
#define V_BRG_RD_SEL4
#define V_BRG_WR_SEL5
#define V_BRG_RD_SEL5
/* R_BRG_TIM_SEL67 */
#define V_BRG_WR_SEL6
#define V_BRG_RD_SEL6
#define V_BRG_WR_SEL7
#define V_BRG_RD_SEL7

/* chapter 12: clock, reset, interrupt, timer and watchdog */
/* R_IRQMSK_MISC */
#define V_STA_IRQMSK
#define V_TI_IRQMSK
#define V_PROC_IRQMSK
#define V_DTMF_IRQMSK
#define V_IRQ1S_MSK
#define V_SA6_IRQMSK
#define V_RX_EOMF_MSK
#define V_TX_EOMF_MSK
/* R_IRQ_CTRL */
#define V_FIFO_IRQ
#define V_GLOB_IRQ_EN
#define V_IRQ_POL
/* R_TI_WD */
#define V_EV_TS
#define V_WD_TS
/* A_IRQ_MSK */
#define V_IRQ
#define V_BERT_EN
#define V_MIX_IRQ
/* R_IRQ_OVIEW */
#define V_IRQ_FIFO_BL0
#define V_IRQ_FIFO_BL1
#define V_IRQ_FIFO_BL2
#define V_IRQ_FIFO_BL3
#define V_IRQ_FIFO_BL4
#define V_IRQ_FIFO_BL5
#define V_IRQ_FIFO_BL6
#define V_IRQ_FIFO_BL7
/* R_IRQ_MISC */
#define V_STA_IRQ
#define V_TI_IRQ
#define V_IRQ_PROC
#define V_DTMF_IRQ
#define V_IRQ1S
#define V_SA6_IRQ
#define V_RX_EOMF
#define V_TX_EOMF
/* R_STATUS */
#define V_BUSY
#define V_PROC
#define V_DTMF_STA
#define V_LOST_STA
#define V_SYNC_IN
#define V_EXT_IRQSTA
#define V_MISC_IRQSTA
#define V_FR_IRQSTA
/* R_IRQ_FIFO_BL0 */
#define V_IRQ_FIFO0_TX
#define V_IRQ_FIFO0_RX
#define V_IRQ_FIFO1_TX
#define V_IRQ_FIFO1_RX
#define V_IRQ_FIFO2_TX
#define V_IRQ_FIFO2_RX
#define V_IRQ_FIFO3_TX
#define V_IRQ_FIFO3_RX
/* R_IRQ_FIFO_BL1 */
#define V_IRQ_FIFO4_TX
#define V_IRQ_FIFO4_RX
#define V_IRQ_FIFO5_TX
#define V_IRQ_FIFO5_RX
#define V_IRQ_FIFO6_TX
#define V_IRQ_FIFO6_RX
#define V_IRQ_FIFO7_TX
#define V_IRQ_FIFO7_RX
/* R_IRQ_FIFO_BL2 */
#define V_IRQ_FIFO8_TX
#define V_IRQ_FIFO8_RX
#define V_IRQ_FIFO9_TX
#define V_IRQ_FIFO9_RX
#define V_IRQ_FIFO10_TX
#define V_IRQ_FIFO10_RX
#define V_IRQ_FIFO11_TX
#define V_IRQ_FIFO11_RX
/* R_IRQ_FIFO_BL3 */
#define V_IRQ_FIFO12_TX
#define V_IRQ_FIFO12_RX
#define V_IRQ_FIFO13_TX
#define V_IRQ_FIFO13_RX
#define V_IRQ_FIFO14_TX
#define V_IRQ_FIFO14_RX
#define V_IRQ_FIFO15_TX
#define V_IRQ_FIFO15_RX
/* R_IRQ_FIFO_BL4 */
#define V_IRQ_FIFO16_TX
#define V_IRQ_FIFO16_RX
#define V_IRQ_FIFO17_TX
#define V_IRQ_FIFO17_RX
#define V_IRQ_FIFO18_TX
#define V_IRQ_FIFO18_RX
#define V_IRQ_FIFO19_TX
#define V_IRQ_FIFO19_RX
/* R_IRQ_FIFO_BL5 */
#define V_IRQ_FIFO20_TX
#define V_IRQ_FIFO20_RX
#define V_IRQ_FIFO21_TX
#define V_IRQ_FIFO21_RX
#define V_IRQ_FIFO22_TX
#define V_IRQ_FIFO22_RX
#define V_IRQ_FIFO23_TX
#define V_IRQ_FIFO23_RX
/* R_IRQ_FIFO_BL6 */
#define V_IRQ_FIFO24_TX
#define V_IRQ_FIFO24_RX
#define V_IRQ_FIFO25_TX
#define V_IRQ_FIFO25_RX
#define V_IRQ_FIFO26_TX
#define V_IRQ_FIFO26_RX
#define V_IRQ_FIFO27_TX
#define V_IRQ_FIFO27_RX
/* R_IRQ_FIFO_BL7 */
#define V_IRQ_FIFO28_TX
#define V_IRQ_FIFO28_RX
#define V_IRQ_FIFO29_TX
#define V_IRQ_FIFO29_RX
#define V_IRQ_FIFO30_TX
#define V_IRQ_FIFO30_RX
#define V_IRQ_FIFO31_TX
#define V_IRQ_FIFO31_RX

/* chapter 13: general purpose I/O pins (GPIO) and input pins (GPI) */
/* R_GPIO_OUT0 */
#define V_GPIO_OUT0
#define V_GPIO_OUT1
#define V_GPIO_OUT2
#define V_GPIO_OUT3
#define V_GPIO_OUT4
#define V_GPIO_OUT5
#define V_GPIO_OUT6
#define V_GPIO_OUT7
/* R_GPIO_OUT1 */
#define V_GPIO_OUT8
#define V_GPIO_OUT9
#define V_GPIO_OUT10
#define V_GPIO_OUT11
#define V_GPIO_OUT12
#define V_GPIO_OUT13
#define V_GPIO_OUT14
#define V_GPIO_OUT15
/* R_GPIO_EN0 */
#define V_GPIO_EN0
#define V_GPIO_EN1
#define V_GPIO_EN2
#define V_GPIO_EN3
#define V_GPIO_EN4
#define V_GPIO_EN5
#define V_GPIO_EN6
#define V_GPIO_EN7
/* R_GPIO_EN1 */
#define V_GPIO_EN8
#define V_GPIO_EN9
#define V_GPIO_EN10
#define V_GPIO_EN11
#define V_GPIO_EN12
#define V_GPIO_EN13
#define V_GPIO_EN14
#define V_GPIO_EN15
/* R_GPIO_SEL */
#define V_GPIO_SEL0
#define V_GPIO_SEL1
#define V_GPIO_SEL2
#define V_GPIO_SEL3
#define V_GPIO_SEL4
#define V_GPIO_SEL5
#define V_GPIO_SEL6
#define V_GPIO_SEL7
/* R_GPIO_IN0 */
#define V_GPIO_IN0
#define V_GPIO_IN1
#define V_GPIO_IN2
#define V_GPIO_IN3
#define V_GPIO_IN4
#define V_GPIO_IN5
#define V_GPIO_IN6
#define V_GPIO_IN7
/* R_GPIO_IN1 */
#define V_GPIO_IN8
#define V_GPIO_IN9
#define V_GPIO_IN10
#define V_GPIO_IN11
#define V_GPIO_IN12
#define V_GPIO_IN13
#define V_GPIO_IN14
#define V_GPIO_IN15
/* R_GPI_IN0 */
#define V_GPI_IN0
#define V_GPI_IN1
#define V_GPI_IN2
#define V_GPI_IN3
#define V_GPI_IN4
#define V_GPI_IN5
#define V_GPI_IN6
#define V_GPI_IN7
/* R_GPI_IN1 */
#define V_GPI_IN8
#define V_GPI_IN9
#define V_GPI_IN10
#define V_GPI_IN11
#define V_GPI_IN12
#define V_GPI_IN13
#define V_GPI_IN14
#define V_GPI_IN15
/* R_GPI_IN2 */
#define V_GPI_IN16
#define V_GPI_IN17
#define V_GPI_IN18
#define V_GPI_IN19
#define V_GPI_IN20
#define V_GPI_IN21
#define V_GPI_IN22
#define V_GPI_IN23
/* R_GPI_IN3 */
#define V_GPI_IN24
#define V_GPI_IN25
#define V_GPI_IN26
#define V_GPI_IN27
#define V_GPI_IN28
#define V_GPI_IN29
#define V_GPI_IN30
#define V_GPI_IN31

/* map of all registers, used for debugging */

#ifdef HFC_REGISTER_DEBUG
struct hfc_register_names {
	char *name;
	u_char reg;
} hfc_register_names[] = {
	/* write registers */
	{"R_CIRM",		0x00},
	{"R_CTRL",		0x01},
	{"R_BRG_PCM_CFG ",	0x02},
	{"R_RAM_ADDR0",		0x08},
	{"R_RAM_ADDR1",		0x09},
	{"R_RAM_ADDR2",		0x0A},
	{"R_FIRST_FIFO",	0x0B},
	{"R_RAM_SZ",		0x0C},
	{"R_FIFO_MD",		0x0D},
	{"R_INC_RES_FIFO",	0x0E},
	{"R_FIFO / R_FSM_IDX",	0x0F},
	{"R_SLOT",		0x10},
	{"R_IRQMSK_MISC",	0x11},
	{"R_SCI_MSK",		0x12},
	{"R_IRQ_CTRL",		0x13},
	{"R_PCM_MD0",		0x14},
	{"R_0x15",		0x15},
	{"R_ST_SEL",		0x16},
	{"R_ST_SYNC",		0x17},
	{"R_CONF_EN",		0x18},
	{"R_TI_WD",		0x1A},
	{"R_BERT_WD_MD",	0x1B},
	{"R_DTMF",		0x1C},
	{"R_DTMF_N",		0x1D},
	{"R_E1_XX_STA",		0x20},
	{"R_LOS0",		0x22},
	{"R_LOS1",		0x23},
	{"R_RX0",		0x24},
	{"R_RX_FR0",		0x25},
	{"R_RX_FR1",		0x26},
	{"R_TX0",		0x28},
	{"R_TX1",		0x29},
	{"R_TX_FR0",		0x2C},
	{"R_TX_FR1",		0x2D},
	{"R_TX_FR2",		0x2E},
	{"R_JATT_ATT",		0x2F},
	{"A_ST_xx_STA/R_RX_OFF", 0x30},
	{"A_ST_CTRL0/R_SYNC_OUT", 0x31},
	{"A_ST_CTRL1",		0x32},
	{"A_ST_CTRL2",		0x33},
	{"A_ST_SQ_WR",		0x34},
	{"R_TX_OFF",		0x34},
	{"R_SYNC_CTRL",		0x35},
	{"A_ST_CLK_DLY",	0x37},
	{"R_PWM0",		0x38},
	{"R_PWM1",		0x39},
	{"A_ST_B1_TX",		0x3C},
	{"A_ST_B2_TX",		0x3D},
	{"A_ST_D_TX",		0x3E},
	{"R_GPIO_OUT0",		0x40},
	{"R_GPIO_OUT1",		0x41},
	{"R_GPIO_EN0",		0x42},
	{"R_GPIO_EN1",		0x43},
	{"R_GPIO_SEL",		0x44},
	{"R_BRG_CTRL",		0x45},
	{"R_PWM_MD",		0x46},
	{"R_BRG_MD",		0x47},
	{"R_BRG_TIM0",		0x48},
	{"R_BRG_TIM1",		0x49},
	{"R_BRG_TIM2",		0x4A},
	{"R_BRG_TIM3",		0x4B},
	{"R_BRG_TIM_SEL01",	0x4C},
	{"R_BRG_TIM_SEL23",	0x4D},
	{"R_BRG_TIM_SEL45",	0x4E},
	{"R_BRG_TIM_SEL67",	0x4F},
	{"A_FIFO_DATA0-2",	0x80},
	{"A_FIFO_DATA0-2_NOINC", 0x84},
	{"R_RAM_DATA",		0xC0},
	{"A_SL_CFG",		0xD0},
	{"A_CONF",		0xD1},
	{"A_CH_MSK",		0xF4},
	{"A_CON_HDLC",		0xFA},
	{"A_SUBCH_CFG",		0xFB},
	{"A_CHANNEL",		0xFC},
	{"A_FIFO_SEQ",		0xFD},
	{"A_IRQ_MSK",		0xFF},
	{NULL, 0},

	/* read registers */
	{"A_Z1",		0x04},
	{"A_Z1H",		0x05},
	{"A_Z2",		0x06},
	{"A_Z2H",		0x07},
	{"A_F1",		0x0C},
	{"A_F2",		0x0D},
	{"R_IRQ_OVIEW",		0x10},
	{"R_IRQ_MISC",		0x11},
	{"R_IRQ_STATECH",	0x12},
	{"R_CONF_OFLOW",	0x14},
	{"R_RAM_USE",		0x15},
	{"R_CHIP_ID",		0x16},
	{"R_BERT_STA",		0x17},
	{"R_F0_CNTL",		0x18},
	{"R_F0_CNTH",		0x19},
	{"R_BERT_ECL",		0x1A},
	{"R_BERT_ECH",		0x1B},
	{"R_STATUS",		0x1C},
	{"R_CHIP_RV",		0x1F},
	{"R_STATE",		0x20},
	{"R_SYNC_STA",		0x24},
	{"R_RX_SL0_0",		0x25},
	{"R_RX_SL0_1",		0x26},
	{"R_RX_SL0_2",		0x27},
	{"R_JATT_DIR",		0x2b},
	{"R_SLIP",		0x2c},
	{"A_ST_RD_STA",		0x30},
	{"R_FAS_ECL",		0x30},
	{"R_FAS_ECH",		0x31},
	{"R_VIO_ECL",		0x32},
	{"R_VIO_ECH",		0x33},
	{"R_CRC_ECL / A_ST_SQ_RD", 0x34},
	{"R_CRC_ECH",		0x35},
	{"R_E_ECL",		0x36},
	{"R_E_ECH",		0x37},
	{"R_SA6_SA13_ECL",	0x38},
	{"R_SA6_SA13_ECH",	0x39},
	{"R_SA6_SA23_ECL",	0x3A},
	{"R_SA6_SA23_ECH",	0x3B},
	{"A_ST_B1_RX",		0x3C},
	{"A_ST_B2_RX",		0x3D},
	{"A_ST_D_RX",		0x3E},
	{"A_ST_E_RX",		0x3F},
	{"R_GPIO_IN0",		0x40},
	{"R_GPIO_IN1",		0x41},
	{"R_GPI_IN0",		0x44},
	{"R_GPI_IN1",		0x45},
	{"R_GPI_IN2",		0x46},
	{"R_GPI_IN3",		0x47},
	{"A_FIFO_DATA0-2",	0x80},
	{"A_FIFO_DATA0-2_NOINC", 0x84},
	{"R_INT_DATA",		0x88},
	{"R_RAM_DATA",		0xC0},
	{"R_IRQ_FIFO_BL0",	0xC8},
	{"R_IRQ_FIFO_BL1",	0xC9},
	{"R_IRQ_FIFO_BL2",	0xCA},
	{"R_IRQ_FIFO_BL3",	0xCB},
	{"R_IRQ_FIFO_BL4",	0xCC},
	{"R_IRQ_FIFO_BL5",	0xCD},
	{"R_IRQ_FIFO_BL6",	0xCE},
	{"R_IRQ_FIFO_BL7",	0xCF},
};
#endif /* HFC_REGISTER_DEBUG */