Path: blob/master/drivers/isdn/hardware/mISDN/hfc_pci.h
15111 views
/*1* specific defines for CCD's HFC 2BDS0 PCI chips2*3* Author Werner Cornelius ([email protected])4*5* Copyright 1999 by Werner Cornelius ([email protected])6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License as published by9* the Free Software Foundation; either version 2, or (at your option)10* any later version.11*12* This program is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15* GNU General Public License for more details.16*17* You should have received a copy of the GNU General Public License18* along with this program; if not, write to the Free Software19* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.20*21*/2223/*24* thresholds for transparent B-channel mode25* change mask and threshold simultaneously26*/27#define HFCPCI_BTRANS_THRESHOLD 12828#define HFCPCI_FILLEMPTY 6429#define HFCPCI_BTRANS_THRESMASK 0x003031/* defines for PCI config */32#define PCI_ENA_MEMIO 0x0233#define PCI_ENA_MASTER 0x043435/* GCI/IOM bus monitor registers */36#define HCFPCI_C_I 0x0837#define HFCPCI_TRxR 0x0C38#define HFCPCI_MON1_D 0x2839#define HFCPCI_MON2_D 0x2C4041/* GCI/IOM bus timeslot registers */42#define HFCPCI_B1_SSL 0x8043#define HFCPCI_B2_SSL 0x8444#define HFCPCI_AUX1_SSL 0x8845#define HFCPCI_AUX2_SSL 0x8C46#define HFCPCI_B1_RSL 0x9047#define HFCPCI_B2_RSL 0x9448#define HFCPCI_AUX1_RSL 0x9849#define HFCPCI_AUX2_RSL 0x9C5051/* GCI/IOM bus data registers */52#define HFCPCI_B1_D 0xA053#define HFCPCI_B2_D 0xA454#define HFCPCI_AUX1_D 0xA855#define HFCPCI_AUX2_D 0xAC5657/* GCI/IOM bus configuration registers */58#define HFCPCI_MST_EMOD 0xB459#define HFCPCI_MST_MODE 0xB860#define HFCPCI_CONNECT 0xBC616263/* Interrupt and status registers */64#define HFCPCI_FIFO_EN 0x4465#define HFCPCI_TRM 0x4866#define HFCPCI_B_MODE 0x4C67#define HFCPCI_CHIP_ID 0x5868#define HFCPCI_CIRM 0x6069#define HFCPCI_CTMT 0x6470#define HFCPCI_INT_M1 0x6871#define HFCPCI_INT_M2 0x6C72#define HFCPCI_INT_S1 0x7873#define HFCPCI_INT_S2 0x7C74#define HFCPCI_STATUS 0x707576/* S/T section registers */77#define HFCPCI_STATES 0xC078#define HFCPCI_SCTRL 0xC479#define HFCPCI_SCTRL_E 0xC880#define HFCPCI_SCTRL_R 0xCC81#define HFCPCI_SQ 0xD082#define HFCPCI_CLKDEL 0xDC83#define HFCPCI_B1_REC 0xF084#define HFCPCI_B1_SEND 0xF085#define HFCPCI_B2_REC 0xF486#define HFCPCI_B2_SEND 0xF487#define HFCPCI_D_REC 0xF888#define HFCPCI_D_SEND 0xF889#define HFCPCI_E_REC 0xFC909192/* bits in status register (READ) */93#define HFCPCI_PCI_PROC 0x0294#define HFCPCI_NBUSY 0x0495#define HFCPCI_TIMER_ELAP 0x1096#define HFCPCI_STATINT 0x2097#define HFCPCI_FRAMEINT 0x4098#define HFCPCI_ANYINT 0x8099100/* bits in CTMT (Write) */101#define HFCPCI_CLTIMER 0x80102#define HFCPCI_TIM3_125 0x04103#define HFCPCI_TIM25 0x10104#define HFCPCI_TIM50 0x14105#define HFCPCI_TIM400 0x18106#define HFCPCI_TIM800 0x1C107#define HFCPCI_AUTO_TIMER 0x20108#define HFCPCI_TRANSB2 0x02109#define HFCPCI_TRANSB1 0x01110111/* bits in CIRM (Write) */112#define HFCPCI_AUX_MSK 0x07113#define HFCPCI_RESET 0x08114#define HFCPCI_B1_REV 0x40115#define HFCPCI_B2_REV 0x80116117/* bits in INT_M1 and INT_S1 */118#define HFCPCI_INTS_B1TRANS 0x01119#define HFCPCI_INTS_B2TRANS 0x02120#define HFCPCI_INTS_DTRANS 0x04121#define HFCPCI_INTS_B1REC 0x08122#define HFCPCI_INTS_B2REC 0x10123#define HFCPCI_INTS_DREC 0x20124#define HFCPCI_INTS_L1STATE 0x40125#define HFCPCI_INTS_TIMER 0x80126127/* bits in INT_M2 */128#define HFCPCI_PROC_TRANS 0x01129#define HFCPCI_GCI_I_CHG 0x02130#define HFCPCI_GCI_MON_REC 0x04131#define HFCPCI_IRQ_ENABLE 0x08132#define HFCPCI_PMESEL 0x80133134/* bits in STATES */135#define HFCPCI_STATE_MSK 0x0F136#define HFCPCI_LOAD_STATE 0x10137#define HFCPCI_ACTIVATE 0x20138#define HFCPCI_DO_ACTION 0x40139#define HFCPCI_NT_G2_G3 0x80140141/* bits in HFCD_MST_MODE */142#define HFCPCI_MASTER 0x01143#define HFCPCI_SLAVE 0x00144#define HFCPCI_F0IO_POSITIV 0x02145#define HFCPCI_F0_NEGATIV 0x04146#define HFCPCI_F0_2C4 0x08147/* remaining bits are for codecs control */148149/* bits in HFCD_SCTRL */150#define SCTRL_B1_ENA 0x01151#define SCTRL_B2_ENA 0x02152#define SCTRL_MODE_TE 0x00153#define SCTRL_MODE_NT 0x04154#define SCTRL_LOW_PRIO 0x08155#define SCTRL_SQ_ENA 0x10156#define SCTRL_TEST 0x20157#define SCTRL_NONE_CAP 0x40158#define SCTRL_PWR_DOWN 0x80159160/* bits in SCTRL_E */161#define HFCPCI_AUTO_AWAKE 0x01162#define HFCPCI_DBIT_1 0x04163#define HFCPCI_IGNORE_COL 0x08164#define HFCPCI_CHG_B1_B2 0x80165166/* bits in FIFO_EN register */167#define HFCPCI_FIFOEN_B1 0x03168#define HFCPCI_FIFOEN_B2 0x0C169#define HFCPCI_FIFOEN_DTX 0x10170#define HFCPCI_FIFOEN_B1TX 0x01171#define HFCPCI_FIFOEN_B1RX 0x02172#define HFCPCI_FIFOEN_B2TX 0x04173#define HFCPCI_FIFOEN_B2RX 0x08174175176/* definitions of fifo memory area */177#define MAX_D_FRAMES 15178#define MAX_B_FRAMES 31179#define B_SUB_VAL 0x200180#define B_FIFO_SIZE (0x2000 - B_SUB_VAL)181#define D_FIFO_SIZE 512182#define D_FREG_MASK 0xF183184struct zt {185__le16 z1; /* Z1 pointer 16 Bit */186__le16 z2; /* Z2 pointer 16 Bit */187};188189struct dfifo {190u_char data[D_FIFO_SIZE]; /* FIFO data space */191u_char fill1[0x20A0-D_FIFO_SIZE]; /* reserved, do not use */192u_char f1, f2; /* f pointers */193u_char fill2[0x20C0-0x20A2]; /* reserved, do not use */194/* mask index with D_FREG_MASK for access */195struct zt za[MAX_D_FRAMES+1];196u_char fill3[0x4000-0x2100]; /* align 16K */197};198199struct bzfifo {200struct zt za[MAX_B_FRAMES+1]; /* only range 0x0..0x1F allowed */201u_char f1, f2; /* f pointers */202u_char fill[0x2100-0x2082]; /* alignment */203};204205206union fifo_area {207struct {208struct dfifo d_tx; /* D-send channel */209struct dfifo d_rx; /* D-receive channel */210} d_chan;211struct {212u_char fill1[0x200];213u_char txdat_b1[B_FIFO_SIZE];214struct bzfifo txbz_b1;215struct bzfifo txbz_b2;216u_char txdat_b2[B_FIFO_SIZE];217u_char fill2[D_FIFO_SIZE];218u_char rxdat_b1[B_FIFO_SIZE];219struct bzfifo rxbz_b1;220struct bzfifo rxbz_b2;221u_char rxdat_b2[B_FIFO_SIZE];222} b_chans;223u_char fill[32768];224};225226#define Write_hfc(a, b, c) (writeb(c, (a->hw.pci_io)+b))227#define Read_hfc(a, b) (readb((a->hw.pci_io)+b))228229230