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

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 *
 * ipac.h	Defines for the Infineon (former Siemens) ISDN
 *		chip series
 *
 * Author       Karsten Keil <[email protected]>
 *
 * Copyright 2009  by Karsten Keil <[email protected]>
 */

#include "iohelper.h"

struct isac_hw {};

struct ipac_hw;

struct hscx_hw {};

struct ipac_hw {};

#define IPAC_TYPE_ISAC
#define IPAC_TYPE_IPAC
#define IPAC_TYPE_ISACX
#define IPAC_TYPE_IPACX
#define IPAC_TYPE_HSCX

#define ISAC_USE_ARCOFI

/* Monitor functions */
#define MONITOR_RX_0
#define MONITOR_RX_1
#define MONITOR_TX_0
#define MONITOR_TX_1

/* All registers original Siemens Spec  */
/* IPAC/ISAC registers */
#define ISAC_ISTA
#define ISAC_MASK
#define ISAC_CMDR
#define ISAC_STAR
#define ISAC_MODE
#define ISAC_TIMR
#define ISAC_EXIR
#define ISAC_RBCL
#define ISAC_RSTA
#define ISAC_RBCH
#define ISAC_SPCR
#define ISAC_CIR0
#define ISAC_CIX0
#define ISAC_MOR0
#define ISAC_MOX0
#define ISAC_CIR1
#define ISAC_CIX1
#define ISAC_MOR1
#define ISAC_MOX1
#define ISAC_STCR
#define ISAC_ADF1
#define ISAC_ADF2
#define ISAC_MOCR
#define ISAC_MOSR
#define ISAC_SQRR
#define ISAC_SQXR

#define ISAC_RBCH_XAC

#define IPAC_D_TIN2

/* IPAC/HSCX */
#define IPAC_ISTAB
#define IPAC_MASKB
#define IPAC_STARB
#define IPAC_CMDRB
#define IPAC_MODEB
#define IPAC_EXIRB
#define IPAC_RBCLB
#define IPAC_RAH1
#define IPAC_RAH2
#define IPAC_RSTAB
#define IPAC_RAL1
#define IPAC_RAL2
#define IPAC_RHCRB
#define IPAC_XBCL
#define IPAC_CCR2
#define IPAC_RBCHB
#define IPAC_XBCH
#define HSCX_VSTR
#define IPAC_RLCR
#define IPAC_CCR1
#define IPAC_TSAX
#define IPAC_TSAR
#define IPAC_XCCR
#define IPAC_RCCR

/* IPAC_ISTAB/IPAC_MASKB bits */
#define IPAC_B_XPR
#define IPAC_B_RPF
#define IPAC_B_RME
#define IPAC_B_ON

/* IPAC_EXIRB bits */
#define IPAC_B_RFS
#define IPAC_B_RFO
#define IPAC_B_XDU
#define IPAC_B_XMR

/* IPAC special registers */
#define IPAC_CONF
#define IPAC_ISTA
#define IPAC_MASK
#define IPAC_ID
#define IPAC_ACFG
#define IPAC_AOE
#define IPAC_ARX
#define IPAC_ATX
#define IPAC_PITA1
#define IPAC_PITA2
#define IPAC_POTA1
#define IPAC_POTA2
#define IPAC_PCFG
#define IPAC_SCFG
#define IPAC_TIMR2

/* IPAC_ISTA/_MASK bits */
#define IPAC__EXB
#define IPAC__ICB
#define IPAC__EXA
#define IPAC__ICA
#define IPAC__EXD
#define IPAC__ICD
#define IPAC__INT0
#define IPAC__INT1
#define IPAC__ON

/* HSCX ISTA/MASK bits */
#define HSCX__EXB
#define HSCX__EXA
#define HSCX__ICA

/* ISAC/ISACX/IPAC/IPACX L1 commands */
#define ISAC_CMD_TIM
#define ISAC_CMD_RS
#define ISAC_CMD_SCZ
#define ISAC_CMD_SSZ
#define ISAC_CMD_AR8
#define ISAC_CMD_AR10
#define ISAC_CMD_ARL
#define ISAC_CMD_DUI

/* ISAC/ISACX/IPAC/IPACX L1 indications */
#define ISAC_IND_DR
#define ISAC_IND_RS
#define ISAC_IND_SD
#define ISAC_IND_DIS
#define ISAC_IND_RSY
#define ISAC_IND_DR6
#define ISAC_IND_EI
#define ISAC_IND_PU
#define ISAC_IND_ARD
#define ISAC_IND_TI
#define ISAC_IND_ATI
#define ISAC_IND_AI8
#define ISAC_IND_AI10
#define ISAC_IND_DID

/* the new ISACX / IPACX */
/* D-channel registers   */
#define ISACX_RFIFOD
#define ISACX_XFIFOD
#define ISACX_ISTAD
#define ISACX_MASKD
#define ISACX_STARD
#define ISACX_CMDRD
#define ISACX_MODED
#define ISACX_EXMD1
#define ISACX_TIMR1
#define ISACX_SAP1
#define ISACX_SAP2
#define ISACX_RBCLD
#define ISACX_RBCHD
#define ISACX_TEI1
#define ISACX_TEI2
#define ISACX_RSTAD
#define ISACX_TMD
#define ISACX_CIR0
#define ISACX_CIX0
#define ISACX_CIR1
#define ISACX_CIX1

/* Transceiver registers  */
#define ISACX_TR_CONF0
#define ISACX_TR_CONF1
#define ISACX_TR_CONF2
#define ISACX_TR_STA
#define ISACX_TR_CMD
#define ISACX_SQRR1
#define ISACX_SQXR1
#define ISACX_SQRR2
#define ISACX_SQXR2
#define ISACX_SQRR3
#define ISACX_SQXR3
#define ISACX_ISTATR
#define ISACX_MASKTR
#define ISACX_TR_MODE
#define ISACX_ACFG1
#define ISACX_ACFG2
#define ISACX_AOE
#define ISACX_ARX
#define ISACX_ATX

/* IOM: Timeslot, DPS, CDA  */
#define ISACX_CDA10
#define ISACX_CDA11
#define ISACX_CDA20
#define ISACX_CDA21
#define ISACX_CDA_TSDP10
#define ISACX_CDA_TSDP11
#define ISACX_CDA_TSDP20
#define ISACX_CDA_TSDP21
#define ISACX_BCHA_TSDP_BC1
#define ISACX_BCHA_TSDP_BC2
#define ISACX_BCHB_TSDP_BC1
#define ISACX_BCHB_TSDP_BC2
#define ISACX_TR_TSDP_BC1
#define ISACX_TR_TSDP_BC2
#define ISACX_CDA1_CR
#define ISACX_CDA2_CR

/* IOM: Contol, Sync transfer, Monitor    */
#define ISACX_TR_CR
#define ISACX_TRC_CR
#define ISACX_BCHA_CR
#define ISACX_BCHB_CR
#define ISACX_DCI_CR
#define ISACX_DCIC_CR
#define ISACX_MON_CR
#define ISACX_SDS1_CR
#define ISACX_SDS2_CR
#define ISACX_IOM_CR
#define ISACX_STI
#define ISACX_ASTI
#define ISACX_MSTI
#define ISACX_SDS_CONF
#define ISACX_MCDA
#define ISACX_MOR
#define ISACX_MOX
#define ISACX_MOSR
#define ISACX_MOCR
#define ISACX_MSTA
#define ISACX_MCONF

/* Interrupt and general registers */
#define ISACX_ISTA
#define ISACX_MASK
#define ISACX_AUXI
#define ISACX_AUXM
#define ISACX_MODE1
#define ISACX_MODE2
#define ISACX_ID
#define ISACX_SRES
#define ISACX_TIMR2

/* Register Bits */
/* ISACX/IPACX _ISTAD (R) and _MASKD (W) */
#define ISACX_D_XDU
#define ISACX_D_XMR
#define ISACX_D_XPR
#define ISACX_D_RFO
#define ISACX_D_RPF
#define ISACX_D_RME

/* ISACX/IPACX _ISTA (R) and _MASK (W) */
#define ISACX__ICD
#define ISACX__MOS
#define ISACX__TRAN
#define ISACX__AUX
#define ISACX__CIC
#define ISACX__ST
#define IPACX__ON
#define IPACX__ICB
#define IPACX__ICA

/* ISACX/IPACX _CMDRD (W) */
#define ISACX_CMDRD_XRES
#define ISACX_CMDRD_XME
#define ISACX_CMDRD_XTF
#define ISACX_CMDRD_STI
#define ISACX_CMDRD_RRES
#define ISACX_CMDRD_RMC

/* ISACX/IPACX _RSTAD (R) */
#define ISACX_RSTAD_TA
#define ISACX_RSTAD_CR
#define ISACX_RSTAD_SA0
#define ISACX_RSTAD_SA1
#define ISACX_RSTAD_RAB
#define ISACX_RSTAD_CRC
#define ISACX_RSTAD_RDO
#define ISACX_RSTAD_VFR

/* ISACX/IPACX _CIR0 (R) */
#define ISACX_CIR0_BAS
#define ISACX_CIR0_SG
#define ISACX_CIR0_CIC1
#define ISACX_CIR0_CIC0

/* B-channel registers */
#define IPACX_OFF_ICA
#define IPACX_OFF_ICB

/* ICA: IPACX_OFF_ICA + Reg ICB: IPACX_OFF_ICB + Reg */

#define IPACX_ISTAB
#define IPACX_MASKB
#define IPACX_STARB
#define IPACX_CMDRB
#define IPACX_MODEB
#define IPACX_EXMB
#define IPACX_RAH1
#define IPACX_RAH2
#define IPACX_RBCLB
#define IPACX_RBCHB
#define IPACX_RAL1
#define IPACX_RAL2
#define IPACX_RSTAB
#define IPACX_TMB
#define IPACX_RFIFOB
#define IPACX_XFIFOB

/* IPACX_ISTAB / IPACX_MASKB bits */
#define IPACX_B_XDU
#define IPACX_B_XPR
#define IPACX_B_RFO
#define IPACX_B_RPF
#define IPACX_B_RME

#define IPACX_B_ON

extern int mISDNisac_init(struct isac_hw *, void *);
extern irqreturn_t mISDNisac_irq(struct isac_hw *, u8);
extern u32 mISDNipac_init(struct ipac_hw *, void *);
extern irqreturn_t mISDNipac_irq(struct ipac_hw *, int);