xref: /kernel/linux/linux-6.6/drivers/atm/iphase.h (revision 62306a36)
162306a36Sopenharmony_ci/******************************************************************************
262306a36Sopenharmony_ci             Device driver for Interphase ATM PCI adapter cards
362306a36Sopenharmony_ci                    Author: Peter Wang  <pwang@iphase.com>
462306a36Sopenharmony_ci                   Interphase Corporation  <www.iphase.com>
562306a36Sopenharmony_ci                               Version: 1.0
662306a36Sopenharmony_ci               iphase.h:  This is the header file for iphase.c.
762306a36Sopenharmony_ci*******************************************************************************
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci      This software may be used and distributed according to the terms
1062306a36Sopenharmony_ci      of the GNU General Public License (GPL), incorporated herein by reference.
1162306a36Sopenharmony_ci      Drivers based on this skeleton fall under the GPL and must retain
1262306a36Sopenharmony_ci      the authorship (implicit copyright) notice.
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci      This program is distributed in the hope that it will be useful, but
1562306a36Sopenharmony_ci      WITHOUT ANY WARRANTY; without even the implied warranty of
1662306a36Sopenharmony_ci      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1762306a36Sopenharmony_ci      General Public License for more details.
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci      Modified from an incomplete driver for Interphase 5575 1KVC 1M card which
2062306a36Sopenharmony_ci      was originally written by Monalisa Agrawal at UNH. Now this driver
2162306a36Sopenharmony_ci      supports a variety of varients of Interphase ATM PCI (i)Chip adapter
2262306a36Sopenharmony_ci      card family (See www.iphase.com/products/ClassSheet.cfm?ClassID=ATM)
2362306a36Sopenharmony_ci      in terms of PHY type, the size of control memory and the size of
2462306a36Sopenharmony_ci      packet memory. The following are the change log and history:
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci          Bugfix the Mona's UBR driver.
2762306a36Sopenharmony_ci          Modify the basic memory allocation and dma logic.
2862306a36Sopenharmony_ci          Port the driver to the latest kernel from 2.0.46.
2962306a36Sopenharmony_ci          Complete the ABR logic of the driver, and added the ABR work-
3062306a36Sopenharmony_ci              around for the hardware anormalies.
3162306a36Sopenharmony_ci          Add the CBR support.
3262306a36Sopenharmony_ci	  Add the flow control logic to the driver to allow rate-limit VC.
3362306a36Sopenharmony_ci          Add 4K VC support to the board with 512K control memory.
3462306a36Sopenharmony_ci          Add the support of all the variants of the Interphase ATM PCI
3562306a36Sopenharmony_ci          (i)Chip adapter cards including x575 (155M OC3 and UTP155), x525
3662306a36Sopenharmony_ci          (25M UTP25) and x531 (DS3 and E3).
3762306a36Sopenharmony_ci          Add SMP support.
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci      Support and updates available at: ftp://ftp.iphase.com/pub/atm
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci*******************************************************************************/
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci#ifndef IPHASE_H
4462306a36Sopenharmony_ci#define IPHASE_H
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci/************************ IADBG DEFINE *********************************/
4862306a36Sopenharmony_ci/* IADebugFlag Bit Map */
4962306a36Sopenharmony_ci#define IF_IADBG_INIT_ADAPTER   0x00000001        // init adapter info
5062306a36Sopenharmony_ci#define IF_IADBG_TX             0x00000002        // debug TX
5162306a36Sopenharmony_ci#define IF_IADBG_RX             0x00000004        // debug RX
5262306a36Sopenharmony_ci#define IF_IADBG_QUERY_INFO     0x00000008        // debug Request call
5362306a36Sopenharmony_ci#define IF_IADBG_SHUTDOWN       0x00000010        // debug shutdown event
5462306a36Sopenharmony_ci#define IF_IADBG_INTR           0x00000020        // debug interrupt DPC
5562306a36Sopenharmony_ci#define IF_IADBG_TXPKT          0x00000040  	  // debug TX PKT
5662306a36Sopenharmony_ci#define IF_IADBG_RXPKT          0x00000080  	  // debug RX PKT
5762306a36Sopenharmony_ci#define IF_IADBG_ERR            0x00000100        // debug system error
5862306a36Sopenharmony_ci#define IF_IADBG_EVENT          0x00000200        // debug event
5962306a36Sopenharmony_ci#define IF_IADBG_DIS_INTR       0x00001000        // debug disable interrupt
6062306a36Sopenharmony_ci#define IF_IADBG_EN_INTR        0x00002000        // debug enable interrupt
6162306a36Sopenharmony_ci#define IF_IADBG_LOUD           0x00004000        // debugging info
6262306a36Sopenharmony_ci#define IF_IADBG_VERY_LOUD      0x00008000        // excessive debugging info
6362306a36Sopenharmony_ci#define IF_IADBG_CBR            0x00100000  	  //
6462306a36Sopenharmony_ci#define IF_IADBG_UBR            0x00200000  	  //
6562306a36Sopenharmony_ci#define IF_IADBG_ABR            0x00400000        //
6662306a36Sopenharmony_ci#define IF_IADBG_DESC           0x01000000        //
6762306a36Sopenharmony_ci#define IF_IADBG_SUNI_STAT      0x02000000        // suni statistics
6862306a36Sopenharmony_ci#define IF_IADBG_RESET          0x04000000
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ci#define IF_IADBG(f) if (IADebugFlag & (f))
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci#ifdef  CONFIG_ATM_IA_DEBUG   /* Debug build */
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci#define IF_LOUD(A) IF_IADBG(IF_IADBG_LOUD) { A }
7562306a36Sopenharmony_ci#define IF_ERR(A) IF_IADBG(IF_IADBG_ERR) { A }
7662306a36Sopenharmony_ci#define IF_VERY_LOUD(A) IF_IADBG( IF_IADBG_VERY_LOUD ) { A }
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ci#define IF_INIT_ADAPTER(A) IF_IADBG( IF_IADBG_INIT_ADAPTER ) { A }
7962306a36Sopenharmony_ci#define IF_INIT(A) IF_IADBG( IF_IADBG_INIT_ADAPTER ) { A }
8062306a36Sopenharmony_ci#define IF_SUNI_STAT(A) IF_IADBG( IF_IADBG_SUNI_STAT ) { A }
8162306a36Sopenharmony_ci#define IF_QUERY_INFO(A) IF_IADBG( IF_IADBG_QUERY_INFO ) { A }
8262306a36Sopenharmony_ci#define IF_COPY_OVER(A) IF_IADBG( IF_IADBG_COPY_OVER ) { A }
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci#define IF_INTR(A) IF_IADBG( IF_IADBG_INTR ) { A }
8562306a36Sopenharmony_ci#define IF_DIS_INTR(A) IF_IADBG( IF_IADBG_DIS_INTR ) { A }
8662306a36Sopenharmony_ci#define IF_EN_INTR(A) IF_IADBG( IF_IADBG_EN_INTR ) { A }
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci#define IF_TX(A) IF_IADBG( IF_IADBG_TX ) { A }
8962306a36Sopenharmony_ci#define IF_RX(A) IF_IADBG( IF_IADBG_RX ) { A }
9062306a36Sopenharmony_ci#define IF_TXPKT(A) IF_IADBG( IF_IADBG_TXPKT ) { A }
9162306a36Sopenharmony_ci#define IF_RXPKT(A) IF_IADBG( IF_IADBG_RXPKT ) { A }
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci#define IF_SHUTDOWN(A) IF_IADBG(IF_IADBG_SHUTDOWN) { A }
9462306a36Sopenharmony_ci#define IF_CBR(A) IF_IADBG( IF_IADBG_CBR ) { A }
9562306a36Sopenharmony_ci#define IF_UBR(A) IF_IADBG( IF_IADBG_UBR ) { A }
9662306a36Sopenharmony_ci#define IF_ABR(A) IF_IADBG( IF_IADBG_ABR ) { A }
9762306a36Sopenharmony_ci#define IF_EVENT(A) IF_IADBG( IF_IADBG_EVENT) { A }
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ci#else /* free build */
10062306a36Sopenharmony_ci#define IF_LOUD(A)
10162306a36Sopenharmony_ci#define IF_VERY_LOUD(A)
10262306a36Sopenharmony_ci#define IF_INIT_ADAPTER(A)
10362306a36Sopenharmony_ci#define IF_INIT(A)
10462306a36Sopenharmony_ci#define IF_SUNI_STAT(A)
10562306a36Sopenharmony_ci#define IF_PVC_CHKPKT(A)
10662306a36Sopenharmony_ci#define IF_QUERY_INFO(A)
10762306a36Sopenharmony_ci#define IF_COPY_OVER(A)
10862306a36Sopenharmony_ci#define IF_HANG(A)
10962306a36Sopenharmony_ci#define IF_INTR(A)
11062306a36Sopenharmony_ci#define IF_DIS_INTR(A)
11162306a36Sopenharmony_ci#define IF_EN_INTR(A)
11262306a36Sopenharmony_ci#define IF_TX(A)
11362306a36Sopenharmony_ci#define IF_RX(A)
11462306a36Sopenharmony_ci#define IF_TXDEBUG(A)
11562306a36Sopenharmony_ci#define IF_VC(A)
11662306a36Sopenharmony_ci#define IF_ERR(A)
11762306a36Sopenharmony_ci#define IF_CBR(A)
11862306a36Sopenharmony_ci#define IF_UBR(A)
11962306a36Sopenharmony_ci#define IF_ABR(A)
12062306a36Sopenharmony_ci#define IF_SHUTDOWN(A)
12162306a36Sopenharmony_ci#define DbgPrint(A)
12262306a36Sopenharmony_ci#define IF_EVENT(A)
12362306a36Sopenharmony_ci#define IF_TXPKT(A)
12462306a36Sopenharmony_ci#define IF_RXPKT(A)
12562306a36Sopenharmony_ci#endif /* CONFIG_ATM_IA_DEBUG */
12662306a36Sopenharmony_ci
12762306a36Sopenharmony_ci#define ATM_DESC(skb) (skb->protocol)
12862306a36Sopenharmony_ci#define IA_SKB_STATE(skb) (skb->protocol)
12962306a36Sopenharmony_ci#define IA_DLED   1
13062306a36Sopenharmony_ci#define IA_TX_DONE 2
13162306a36Sopenharmony_ci
13262306a36Sopenharmony_ci/* iadbg defines */
13362306a36Sopenharmony_ci#define IA_CMD   0x7749
13462306a36Sopenharmony_citypedef struct {
13562306a36Sopenharmony_ci	int cmd;
13662306a36Sopenharmony_ci        int sub_cmd;
13762306a36Sopenharmony_ci        int len;
13862306a36Sopenharmony_ci        u32 maddr;
13962306a36Sopenharmony_ci        int status;
14062306a36Sopenharmony_ci        void __user *buf;
14162306a36Sopenharmony_ci} IA_CMDBUF, *PIA_CMDBUF;
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_ci/* cmds */
14462306a36Sopenharmony_ci#define MEMDUMP     		0x01
14562306a36Sopenharmony_ci
14662306a36Sopenharmony_ci/* sub_cmds */
14762306a36Sopenharmony_ci#define MEMDUMP_SEGREG          0x2
14862306a36Sopenharmony_ci#define MEMDUMP_DEV  		0x1
14962306a36Sopenharmony_ci#define MEMDUMP_REASSREG        0x3
15062306a36Sopenharmony_ci#define MEMDUMP_FFL             0x4
15162306a36Sopenharmony_ci#define READ_REG                0x5
15262306a36Sopenharmony_ci#define WAKE_DBG_WAIT           0x6
15362306a36Sopenharmony_ci
15462306a36Sopenharmony_ci/************************ IADBG DEFINE END ***************************/
15562306a36Sopenharmony_ci
15662306a36Sopenharmony_ci#define Boolean(x)    	((x) ? 1 : 0)
15762306a36Sopenharmony_ci#define NR_VCI 1024		/* number of VCIs */
15862306a36Sopenharmony_ci#define NR_VCI_LD 10		/* log2(NR_VCI) */
15962306a36Sopenharmony_ci#define NR_VCI_4K 4096 		/* number of VCIs */
16062306a36Sopenharmony_ci#define NR_VCI_4K_LD 12		/* log2(NR_VCI) */
16162306a36Sopenharmony_ci#define MEM_VALID 0xfffffff0	/* mask base address with this */
16262306a36Sopenharmony_ci
16362306a36Sopenharmony_ci#ifndef PCI_VENDOR_ID_IPHASE
16462306a36Sopenharmony_ci#define PCI_VENDOR_ID_IPHASE 0x107e
16562306a36Sopenharmony_ci#endif
16662306a36Sopenharmony_ci#ifndef PCI_DEVICE_ID_IPHASE_5575
16762306a36Sopenharmony_ci#define PCI_DEVICE_ID_IPHASE_5575 0x0008
16862306a36Sopenharmony_ci#endif
16962306a36Sopenharmony_ci#define DEV_LABEL 	"ia"
17062306a36Sopenharmony_ci#define PCR	207692
17162306a36Sopenharmony_ci#define ICR	100000
17262306a36Sopenharmony_ci#define MCR	0
17362306a36Sopenharmony_ci#define TBE	1000
17462306a36Sopenharmony_ci#define FRTT	1
17562306a36Sopenharmony_ci#define RIF	2
17662306a36Sopenharmony_ci#define RDF	4
17762306a36Sopenharmony_ci#define NRMCODE 5	/* 0 - 7 */
17862306a36Sopenharmony_ci#define TRMCODE	3	/* 0 - 7 */
17962306a36Sopenharmony_ci#define CDFCODE	6
18062306a36Sopenharmony_ci#define ATDFCODE 2	/* 0 - 15 */
18162306a36Sopenharmony_ci
18262306a36Sopenharmony_ci/*---------------------- Packet/Cell Memory ------------------------*/
18362306a36Sopenharmony_ci#define TX_PACKET_RAM 	0x00000 /* start of Trasnmit Packet memory - 0 */
18462306a36Sopenharmony_ci#define DFL_TX_BUF_SZ	10240	/* 10 K buffers */
18562306a36Sopenharmony_ci#define DFL_TX_BUFFERS     50 	/* number of packet buffers for Tx
18662306a36Sopenharmony_ci					- descriptor 0 unused */
18762306a36Sopenharmony_ci#define REASS_RAM_SIZE 0x10000  /* for 64K 1K VC board */
18862306a36Sopenharmony_ci#define RX_PACKET_RAM 	0x80000 /* start of Receive Packet memory - 512K */
18962306a36Sopenharmony_ci#define DFL_RX_BUF_SZ	10240	/* 10k buffers */
19062306a36Sopenharmony_ci#define DFL_RX_BUFFERS      50	/* number of packet buffers for Rx
19162306a36Sopenharmony_ci					- descriptor 0 unused */
19262306a36Sopenharmony_ci
19362306a36Sopenharmony_cistruct cpcs_trailer
19462306a36Sopenharmony_ci{
19562306a36Sopenharmony_ci	u_short control;
19662306a36Sopenharmony_ci	u_short length;
19762306a36Sopenharmony_ci	u_int	crc32;
19862306a36Sopenharmony_ci};
19962306a36Sopenharmony_ci
20062306a36Sopenharmony_cistruct cpcs_trailer_desc
20162306a36Sopenharmony_ci{
20262306a36Sopenharmony_ci	struct cpcs_trailer *cpcs;
20362306a36Sopenharmony_ci	dma_addr_t dma_addr;
20462306a36Sopenharmony_ci};
20562306a36Sopenharmony_ci
20662306a36Sopenharmony_cistruct ia_vcc
20762306a36Sopenharmony_ci{
20862306a36Sopenharmony_ci	int rxing;
20962306a36Sopenharmony_ci	int txing;
21062306a36Sopenharmony_ci        int NumCbrEntry;
21162306a36Sopenharmony_ci        u32 pcr;
21262306a36Sopenharmony_ci        u32 saved_tx_quota;
21362306a36Sopenharmony_ci        int flow_inc;
21462306a36Sopenharmony_ci        struct sk_buff_head txing_skb;
21562306a36Sopenharmony_ci        int  ltimeout;
21662306a36Sopenharmony_ci        u8  vc_desc_cnt;
21762306a36Sopenharmony_ci
21862306a36Sopenharmony_ci};
21962306a36Sopenharmony_ci
22062306a36Sopenharmony_cistruct abr_vc_table
22162306a36Sopenharmony_ci{
22262306a36Sopenharmony_ci	u_char status;
22362306a36Sopenharmony_ci	u_char rdf;
22462306a36Sopenharmony_ci	u_short air;
22562306a36Sopenharmony_ci	u_int res[3];
22662306a36Sopenharmony_ci	u_int req_rm_cell_data1;
22762306a36Sopenharmony_ci	u_int req_rm_cell_data2;
22862306a36Sopenharmony_ci	u_int add_rm_cell_data1;
22962306a36Sopenharmony_ci	u_int add_rm_cell_data2;
23062306a36Sopenharmony_ci};
23162306a36Sopenharmony_ci
23262306a36Sopenharmony_ci/* 32 byte entries */
23362306a36Sopenharmony_cistruct main_vc
23462306a36Sopenharmony_ci{
23562306a36Sopenharmony_ci	u_short 	type;
23662306a36Sopenharmony_ci#define ABR	0x8000
23762306a36Sopenharmony_ci#define UBR 	0xc000
23862306a36Sopenharmony_ci#define CBR	0x0000
23962306a36Sopenharmony_ci	/* ABR fields */
24062306a36Sopenharmony_ci	u_short 	nrm;
24162306a36Sopenharmony_ci 	u_short 	trm;
24262306a36Sopenharmony_ci	u_short 	rm_timestamp_hi;
24362306a36Sopenharmony_ci	u_short 	rm_timestamp_lo:8,
24462306a36Sopenharmony_ci			crm:8;
24562306a36Sopenharmony_ci	u_short 	remainder; 	/* ABR and UBR fields - last 10 bits*/
24662306a36Sopenharmony_ci	u_short 	next_vc_sched;
24762306a36Sopenharmony_ci	u_short 	present_desc;	/* all classes */
24862306a36Sopenharmony_ci	u_short 	last_cell_slot;	/* ABR and UBR */
24962306a36Sopenharmony_ci	u_short 	pcr;
25062306a36Sopenharmony_ci	u_short 	fraction;
25162306a36Sopenharmony_ci	u_short 	icr;
25262306a36Sopenharmony_ci	u_short 	atdf;
25362306a36Sopenharmony_ci	u_short 	mcr;
25462306a36Sopenharmony_ci	u_short 	acr;
25562306a36Sopenharmony_ci	u_short 	unack:8,
25662306a36Sopenharmony_ci			status:8;	/* all classes */
25762306a36Sopenharmony_ci#define UIOLI 0x80
25862306a36Sopenharmony_ci#define CRC_APPEND 0x40			/* for status field - CRC-32 append */
25962306a36Sopenharmony_ci#define ABR_STATE 0x02
26062306a36Sopenharmony_ci
26162306a36Sopenharmony_ci};
26262306a36Sopenharmony_ci
26362306a36Sopenharmony_ci
26462306a36Sopenharmony_ci/* 8 byte entries */
26562306a36Sopenharmony_cistruct ext_vc
26662306a36Sopenharmony_ci{
26762306a36Sopenharmony_ci	u_short 	atm_hdr1;
26862306a36Sopenharmony_ci	u_short 	atm_hdr2;
26962306a36Sopenharmony_ci	u_short 	last_desc;
27062306a36Sopenharmony_ci      	u_short 	out_of_rate_link;   /* reserved for UBR and CBR */
27162306a36Sopenharmony_ci};
27262306a36Sopenharmony_ci
27362306a36Sopenharmony_ci
27462306a36Sopenharmony_ci#define DLE_ENTRIES 256
27562306a36Sopenharmony_ci#define DMA_INT_ENABLE 0x0002	/* use for both Tx and Rx */
27662306a36Sopenharmony_ci#define TX_DLE_PSI 0x0001
27762306a36Sopenharmony_ci#define DLE_TOTAL_SIZE (sizeof(struct dle)*DLE_ENTRIES)
27862306a36Sopenharmony_ci
27962306a36Sopenharmony_ci/* Descriptor List Entries (DLE) */
28062306a36Sopenharmony_cistruct dle
28162306a36Sopenharmony_ci{
28262306a36Sopenharmony_ci	u32 	sys_pkt_addr;
28362306a36Sopenharmony_ci	u32 	local_pkt_addr;
28462306a36Sopenharmony_ci	u32 	bytes;
28562306a36Sopenharmony_ci	u16 	prq_wr_ptr_data;
28662306a36Sopenharmony_ci	u16 	mode;
28762306a36Sopenharmony_ci};
28862306a36Sopenharmony_ci
28962306a36Sopenharmony_cistruct dle_q
29062306a36Sopenharmony_ci{
29162306a36Sopenharmony_ci	struct dle 	*start;
29262306a36Sopenharmony_ci	struct dle 	*end;
29362306a36Sopenharmony_ci	struct dle 	*read;
29462306a36Sopenharmony_ci	struct dle 	*write;
29562306a36Sopenharmony_ci};
29662306a36Sopenharmony_ci
29762306a36Sopenharmony_cistruct free_desc_q
29862306a36Sopenharmony_ci{
29962306a36Sopenharmony_ci	int 	desc;	/* Descriptor number */
30062306a36Sopenharmony_ci	struct free_desc_q *next;
30162306a36Sopenharmony_ci};
30262306a36Sopenharmony_ci
30362306a36Sopenharmony_cistruct tx_buf_desc {
30462306a36Sopenharmony_ci	unsigned short desc_mode;
30562306a36Sopenharmony_ci	unsigned short vc_index;
30662306a36Sopenharmony_ci	unsigned short res1;		/* reserved field */
30762306a36Sopenharmony_ci	unsigned short bytes;
30862306a36Sopenharmony_ci	unsigned short buf_start_hi;
30962306a36Sopenharmony_ci	unsigned short buf_start_lo;
31062306a36Sopenharmony_ci	unsigned short res2[10];	/* reserved field */
31162306a36Sopenharmony_ci};
31262306a36Sopenharmony_ci
31362306a36Sopenharmony_ci
31462306a36Sopenharmony_cistruct rx_buf_desc {
31562306a36Sopenharmony_ci	unsigned short desc_mode;
31662306a36Sopenharmony_ci	unsigned short vc_index;
31762306a36Sopenharmony_ci	unsigned short vpi;
31862306a36Sopenharmony_ci	unsigned short bytes;
31962306a36Sopenharmony_ci	unsigned short buf_start_hi;
32062306a36Sopenharmony_ci	unsigned short buf_start_lo;
32162306a36Sopenharmony_ci	unsigned short dma_start_hi;
32262306a36Sopenharmony_ci	unsigned short dma_start_lo;
32362306a36Sopenharmony_ci	unsigned short crc_upper;
32462306a36Sopenharmony_ci	unsigned short crc_lower;
32562306a36Sopenharmony_ci	unsigned short res:8, timeout:8;
32662306a36Sopenharmony_ci	unsigned short res2[5];	/* reserved field */
32762306a36Sopenharmony_ci};
32862306a36Sopenharmony_ci
32962306a36Sopenharmony_ci/*--------SAR stuff ---------------------*/
33062306a36Sopenharmony_ci
33162306a36Sopenharmony_ci#define EPROM_SIZE 0x40000	/* says 64K in the docs ??? */
33262306a36Sopenharmony_ci#define MAC1_LEN	4
33362306a36Sopenharmony_ci#define MAC2_LEN	2
33462306a36Sopenharmony_ci
33562306a36Sopenharmony_ci/*------------ PCI Memory Space Map, 128K SAR memory ----------------*/
33662306a36Sopenharmony_ci#define IPHASE5575_PCI_CONFIG_REG_BASE	0x0000
33762306a36Sopenharmony_ci#define IPHASE5575_BUS_CONTROL_REG_BASE 0x1000	/* offsets 0x00 - 0x3c */
33862306a36Sopenharmony_ci#define IPHASE5575_FRAG_CONTROL_REG_BASE 0x2000
33962306a36Sopenharmony_ci#define IPHASE5575_REASS_CONTROL_REG_BASE 0x3000
34062306a36Sopenharmony_ci#define IPHASE5575_DMA_CONTROL_REG_BASE	0x4000
34162306a36Sopenharmony_ci#define IPHASE5575_FRONT_END_REG_BASE IPHASE5575_DMA_CONTROL_REG_BASE
34262306a36Sopenharmony_ci#define IPHASE5575_FRAG_CONTROL_RAM_BASE 0x10000
34362306a36Sopenharmony_ci#define IPHASE5575_REASS_CONTROL_RAM_BASE 0x20000
34462306a36Sopenharmony_ci
34562306a36Sopenharmony_ci/*------------ Bus interface control registers -----------------*/
34662306a36Sopenharmony_ci#define IPHASE5575_BUS_CONTROL_REG	0x00
34762306a36Sopenharmony_ci#define IPHASE5575_BUS_STATUS_REG	0x01	/* actual offset 0x04 */
34862306a36Sopenharmony_ci#define IPHASE5575_MAC1			0x02
34962306a36Sopenharmony_ci#define IPHASE5575_REV			0x03
35062306a36Sopenharmony_ci#define IPHASE5575_MAC2			0x03	/*actual offset 0x0e-reg 0x0c*/
35162306a36Sopenharmony_ci#define IPHASE5575_EXT_RESET		0x04
35262306a36Sopenharmony_ci#define IPHASE5575_INT_RESET		0x05	/* addr 1c ?? reg 0x06 */
35362306a36Sopenharmony_ci#define IPHASE5575_PCI_ADDR_PAGE	0x07	/* reg 0x08, 0x09 ?? */
35462306a36Sopenharmony_ci#define IPHASE5575_EEPROM_ACCESS	0x0a	/* actual offset 0x28 */
35562306a36Sopenharmony_ci#define IPHASE5575_CELL_FIFO_QUEUE_SZ	0x0b
35662306a36Sopenharmony_ci#define IPHASE5575_CELL_FIFO_MARK_STATE	0x0c
35762306a36Sopenharmony_ci#define IPHASE5575_CELL_FIFO_READ_PTR	0x0d
35862306a36Sopenharmony_ci#define IPHASE5575_CELL_FIFO_WRITE_PTR	0x0e
35962306a36Sopenharmony_ci#define IPHASE5575_CELL_FIFO_CELLS_AVL	0x0f	/* actual offset 0x3c */
36062306a36Sopenharmony_ci
36162306a36Sopenharmony_ci/* Bus Interface Control Register bits */
36262306a36Sopenharmony_ci#define CTRL_FE_RST	0x80000000
36362306a36Sopenharmony_ci#define CTRL_LED	0x40000000
36462306a36Sopenharmony_ci#define CTRL_25MBPHY	0x10000000
36562306a36Sopenharmony_ci#define CTRL_ENCMBMEM	0x08000000
36662306a36Sopenharmony_ci#define CTRL_ENOFFSEG	0x01000000
36762306a36Sopenharmony_ci#define CTRL_ERRMASK	0x00400000
36862306a36Sopenharmony_ci#define CTRL_DLETMASK	0x00100000
36962306a36Sopenharmony_ci#define CTRL_DLERMASK	0x00080000
37062306a36Sopenharmony_ci#define CTRL_FEMASK	0x00040000
37162306a36Sopenharmony_ci#define CTRL_SEGMASK	0x00020000
37262306a36Sopenharmony_ci#define CTRL_REASSMASK	0x00010000
37362306a36Sopenharmony_ci#define CTRL_CSPREEMPT	0x00002000
37462306a36Sopenharmony_ci#define CTRL_B128	0x00000200
37562306a36Sopenharmony_ci#define CTRL_B64	0x00000100
37662306a36Sopenharmony_ci#define CTRL_B48	0x00000080
37762306a36Sopenharmony_ci#define CTRL_B32	0x00000040
37862306a36Sopenharmony_ci#define CTRL_B16	0x00000020
37962306a36Sopenharmony_ci#define CTRL_B8		0x00000010
38062306a36Sopenharmony_ci
38162306a36Sopenharmony_ci/* Bus Interface Status Register bits */
38262306a36Sopenharmony_ci#define STAT_CMEMSIZ	0xc0000000
38362306a36Sopenharmony_ci#define STAT_ADPARCK	0x20000000
38462306a36Sopenharmony_ci#define STAT_RESVD	0x1fffff80
38562306a36Sopenharmony_ci#define STAT_ERRINT	0x00000040
38662306a36Sopenharmony_ci#define STAT_MARKINT	0x00000020
38762306a36Sopenharmony_ci#define STAT_DLETINT	0x00000010
38862306a36Sopenharmony_ci#define STAT_DLERINT	0x00000008
38962306a36Sopenharmony_ci#define STAT_FEINT	0x00000004
39062306a36Sopenharmony_ci#define STAT_SEGINT	0x00000002
39162306a36Sopenharmony_ci#define STAT_REASSINT	0x00000001
39262306a36Sopenharmony_ci
39362306a36Sopenharmony_ci
39462306a36Sopenharmony_ci/*--------------- Segmentation control registers -----------------*/
39562306a36Sopenharmony_ci/* The segmentation registers are 16 bits access and the addresses
39662306a36Sopenharmony_ci	are defined as such so the addresses are the actual "offsets" */
39762306a36Sopenharmony_ci#define IDLEHEADHI	0x00
39862306a36Sopenharmony_ci#define IDLEHEADLO	0x01
39962306a36Sopenharmony_ci#define MAXRATE		0x02
40062306a36Sopenharmony_ci/* Values for MAXRATE register for 155Mbps and 25.6 Mbps operation */
40162306a36Sopenharmony_ci#define RATE155		0x64b1 // 16 bits float format
40262306a36Sopenharmony_ci#define MAX_ATM_155     352768 // Cells/second p.118
40362306a36Sopenharmony_ci#define RATE25		0x5f9d
40462306a36Sopenharmony_ci
40562306a36Sopenharmony_ci#define STPARMS		0x03
40662306a36Sopenharmony_ci#define STPARMS_1K	0x008c
40762306a36Sopenharmony_ci#define STPARMS_2K	0x0049
40862306a36Sopenharmony_ci#define STPARMS_4K	0x0026
40962306a36Sopenharmony_ci#define COMP_EN		0x4000
41062306a36Sopenharmony_ci#define CBR_EN		0x2000
41162306a36Sopenharmony_ci#define ABR_EN		0x0800
41262306a36Sopenharmony_ci#define UBR_EN		0x0400
41362306a36Sopenharmony_ci
41462306a36Sopenharmony_ci#define ABRUBR_ARB	0x04
41562306a36Sopenharmony_ci#define RM_TYPE		0x05
41662306a36Sopenharmony_ci/*Value for RM_TYPE register for ATM Forum Traffic Mangement4.0 support*/
41762306a36Sopenharmony_ci#define RM_TYPE_4_0	0x0100
41862306a36Sopenharmony_ci
41962306a36Sopenharmony_ci#define SEG_COMMAND_REG		0x17
42062306a36Sopenharmony_ci/* Values for the command register */
42162306a36Sopenharmony_ci#define RESET_SEG 0x0055
42262306a36Sopenharmony_ci#define RESET_SEG_STATE	0x00aa
42362306a36Sopenharmony_ci#define RESET_TX_CELL_CTR 0x00cc
42462306a36Sopenharmony_ci
42562306a36Sopenharmony_ci#define CBR_PTR_BASE	0x20
42662306a36Sopenharmony_ci#define ABR_SBPTR_BASE	0x22
42762306a36Sopenharmony_ci#define UBR_SBPTR_BASE  0x23
42862306a36Sopenharmony_ci#define ABRWQ_BASE	0x26
42962306a36Sopenharmony_ci#define UBRWQ_BASE	0x27
43062306a36Sopenharmony_ci#define VCT_BASE	0x28
43162306a36Sopenharmony_ci#define VCTE_BASE	0x29
43262306a36Sopenharmony_ci#define CBR_TAB_BEG	0x2c
43362306a36Sopenharmony_ci#define CBR_TAB_END	0x2d
43462306a36Sopenharmony_ci#define PRQ_ST_ADR	0x30
43562306a36Sopenharmony_ci#define PRQ_ED_ADR	0x31
43662306a36Sopenharmony_ci#define PRQ_RD_PTR	0x32
43762306a36Sopenharmony_ci#define PRQ_WR_PTR	0x33
43862306a36Sopenharmony_ci#define TCQ_ST_ADR	0x34
43962306a36Sopenharmony_ci#define TCQ_ED_ADR 	0x35
44062306a36Sopenharmony_ci#define TCQ_RD_PTR	0x36
44162306a36Sopenharmony_ci#define TCQ_WR_PTR	0x37
44262306a36Sopenharmony_ci#define SEG_QUEUE_BASE	0x40
44362306a36Sopenharmony_ci#define SEG_DESC_BASE	0x41
44462306a36Sopenharmony_ci#define MODE_REG_0	0x45
44562306a36Sopenharmony_ci#define T_ONLINE	0x0002		/* (i)chipSAR is online */
44662306a36Sopenharmony_ci
44762306a36Sopenharmony_ci#define MODE_REG_1	0x46
44862306a36Sopenharmony_ci#define MODE_REG_1_VAL	0x0400		/*for propoer device operation*/
44962306a36Sopenharmony_ci
45062306a36Sopenharmony_ci#define SEG_INTR_STATUS_REG 0x47
45162306a36Sopenharmony_ci#define SEG_MASK_REG	0x48
45262306a36Sopenharmony_ci#define TRANSMIT_DONE 0x0200
45362306a36Sopenharmony_ci#define TCQ_NOT_EMPTY 0x1000	/* this can be used for both the interrupt
45462306a36Sopenharmony_ci				status registers as well as the mask register */
45562306a36Sopenharmony_ci
45662306a36Sopenharmony_ci#define CELL_CTR_HIGH_AUTO 0x49
45762306a36Sopenharmony_ci#define CELL_CTR_HIGH_NOAUTO 0xc9
45862306a36Sopenharmony_ci#define CELL_CTR_LO_AUTO 0x4a
45962306a36Sopenharmony_ci#define CELL_CTR_LO_NOAUTO 0xca
46062306a36Sopenharmony_ci
46162306a36Sopenharmony_ci/* Diagnostic registers */
46262306a36Sopenharmony_ci#define NEXTDESC 	0x59
46362306a36Sopenharmony_ci#define NEXTVC		0x5a
46462306a36Sopenharmony_ci#define PSLOTCNT	0x5d
46562306a36Sopenharmony_ci#define NEWDN		0x6a
46662306a36Sopenharmony_ci#define NEWVC		0x6b
46762306a36Sopenharmony_ci#define SBPTR		0x6c
46862306a36Sopenharmony_ci#define ABRWQ_WRPTR	0x6f
46962306a36Sopenharmony_ci#define ABRWQ_RDPTR	0x70
47062306a36Sopenharmony_ci#define UBRWQ_WRPTR	0x71
47162306a36Sopenharmony_ci#define UBRWQ_RDPTR	0x72
47262306a36Sopenharmony_ci#define CBR_VC		0x73
47362306a36Sopenharmony_ci#define ABR_SBVC	0x75
47462306a36Sopenharmony_ci#define UBR_SBVC	0x76
47562306a36Sopenharmony_ci#define ABRNEXTLINK	0x78
47662306a36Sopenharmony_ci#define UBRNEXTLINK	0x79
47762306a36Sopenharmony_ci
47862306a36Sopenharmony_ci
47962306a36Sopenharmony_ci/*----------------- Reassembly control registers ---------------------*/
48062306a36Sopenharmony_ci/* The reassembly registers are 16 bits access and the addresses
48162306a36Sopenharmony_ci	are defined as such so the addresses are the actual "offsets" */
48262306a36Sopenharmony_ci#define MODE_REG	0x00
48362306a36Sopenharmony_ci#define R_ONLINE	0x0002		/* (i)chip is online */
48462306a36Sopenharmony_ci#define IGN_RAW_FL     	0x0004
48562306a36Sopenharmony_ci
48662306a36Sopenharmony_ci#define PROTOCOL_ID	0x01
48762306a36Sopenharmony_ci#define REASS_MASK_REG	0x02
48862306a36Sopenharmony_ci#define REASS_INTR_STATUS_REG	0x03
48962306a36Sopenharmony_ci/* Interrupt Status register bits */
49062306a36Sopenharmony_ci#define RX_PKT_CTR_OF	0x8000
49162306a36Sopenharmony_ci#define RX_ERR_CTR_OF	0x4000
49262306a36Sopenharmony_ci#define RX_CELL_CTR_OF	0x1000
49362306a36Sopenharmony_ci#define RX_FREEQ_EMPT	0x0200
49462306a36Sopenharmony_ci#define RX_EXCPQ_FL	0x0080
49562306a36Sopenharmony_ci#define	RX_RAWQ_FL	0x0010
49662306a36Sopenharmony_ci#define RX_EXCP_RCVD	0x0008
49762306a36Sopenharmony_ci#define RX_PKT_RCVD	0x0004
49862306a36Sopenharmony_ci#define RX_RAW_RCVD	0x0001
49962306a36Sopenharmony_ci
50062306a36Sopenharmony_ci#define DRP_PKT_CNTR	0x04
50162306a36Sopenharmony_ci#define ERR_CNTR	0x05
50262306a36Sopenharmony_ci#define RAW_BASE_ADR	0x08
50362306a36Sopenharmony_ci#define CELL_CTR0	0x0c
50462306a36Sopenharmony_ci#define CELL_CTR1	0x0d
50562306a36Sopenharmony_ci#define REASS_COMMAND_REG	0x0f
50662306a36Sopenharmony_ci/* Values for command register */
50762306a36Sopenharmony_ci#define RESET_REASS	0x0055
50862306a36Sopenharmony_ci#define RESET_REASS_STATE 0x00aa
50962306a36Sopenharmony_ci#define RESET_DRP_PKT_CNTR 0x00f1
51062306a36Sopenharmony_ci#define RESET_ERR_CNTR	0x00f2
51162306a36Sopenharmony_ci#define RESET_CELL_CNTR 0x00f8
51262306a36Sopenharmony_ci#define RESET_REASS_ALL_REGS 0x00ff
51362306a36Sopenharmony_ci
51462306a36Sopenharmony_ci#define REASS_DESC_BASE	0x10
51562306a36Sopenharmony_ci#define VC_LKUP_BASE	0x11
51662306a36Sopenharmony_ci#define REASS_TABLE_BASE 0x12
51762306a36Sopenharmony_ci#define REASS_QUEUE_BASE 0x13
51862306a36Sopenharmony_ci#define PKT_TM_CNT	0x16
51962306a36Sopenharmony_ci#define TMOUT_RANGE	0x17
52062306a36Sopenharmony_ci#define INTRVL_CNTR	0x18
52162306a36Sopenharmony_ci#define TMOUT_INDX	0x19
52262306a36Sopenharmony_ci#define VP_LKUP_BASE	0x1c
52362306a36Sopenharmony_ci#define VP_FILTER	0x1d
52462306a36Sopenharmony_ci#define ABR_LKUP_BASE	0x1e
52562306a36Sopenharmony_ci#define FREEQ_ST_ADR	0x24
52662306a36Sopenharmony_ci#define FREEQ_ED_ADR	0x25
52762306a36Sopenharmony_ci#define FREEQ_RD_PTR	0x26
52862306a36Sopenharmony_ci#define FREEQ_WR_PTR	0x27
52962306a36Sopenharmony_ci#define PCQ_ST_ADR	0x28
53062306a36Sopenharmony_ci#define PCQ_ED_ADR	0x29
53162306a36Sopenharmony_ci#define PCQ_RD_PTR	0x2a
53262306a36Sopenharmony_ci#define PCQ_WR_PTR	0x2b
53362306a36Sopenharmony_ci#define EXCP_Q_ST_ADR	0x2c
53462306a36Sopenharmony_ci#define EXCP_Q_ED_ADR	0x2d
53562306a36Sopenharmony_ci#define EXCP_Q_RD_PTR	0x2e
53662306a36Sopenharmony_ci#define EXCP_Q_WR_PTR	0x2f
53762306a36Sopenharmony_ci#define CC_FIFO_ST_ADR	0x34
53862306a36Sopenharmony_ci#define CC_FIFO_ED_ADR	0x35
53962306a36Sopenharmony_ci#define CC_FIFO_RD_PTR	0x36
54062306a36Sopenharmony_ci#define CC_FIFO_WR_PTR	0x37
54162306a36Sopenharmony_ci#define STATE_REG	0x38
54262306a36Sopenharmony_ci#define BUF_SIZE	0x42
54362306a36Sopenharmony_ci#define XTRA_RM_OFFSET	0x44
54462306a36Sopenharmony_ci#define DRP_PKT_CNTR_NC	0x84
54562306a36Sopenharmony_ci#define ERR_CNTR_NC	0x85
54662306a36Sopenharmony_ci#define CELL_CNTR0_NC	0x8c
54762306a36Sopenharmony_ci#define CELL_CNTR1_NC	0x8d
54862306a36Sopenharmony_ci
54962306a36Sopenharmony_ci/* State Register bits */
55062306a36Sopenharmony_ci#define EXCPQ_EMPTY	0x0040
55162306a36Sopenharmony_ci#define PCQ_EMPTY	0x0010
55262306a36Sopenharmony_ci#define FREEQ_EMPTY	0x0004
55362306a36Sopenharmony_ci
55462306a36Sopenharmony_ci
55562306a36Sopenharmony_ci/*----------------- Front End registers/ DMA control --------------*/
55662306a36Sopenharmony_ci/* There is a lot of documentation error regarding these offsets ???
55762306a36Sopenharmony_ci	eg:- 2 offsets given 800, a00 for rx counter
55862306a36Sopenharmony_ci	similarly many others
55962306a36Sopenharmony_ci   Remember again that the offsets are to be 4*register number, so
56062306a36Sopenharmony_ci	correct the #defines here
56162306a36Sopenharmony_ci*/
56262306a36Sopenharmony_ci#define IPHASE5575_TX_COUNTER		0x200	/* offset - 0x800 */
56362306a36Sopenharmony_ci#define IPHASE5575_RX_COUNTER		0x280	/* offset - 0xa00 */
56462306a36Sopenharmony_ci#define IPHASE5575_TX_LIST_ADDR		0x300	/* offset - 0xc00 */
56562306a36Sopenharmony_ci#define IPHASE5575_RX_LIST_ADDR		0x380	/* offset - 0xe00 */
56662306a36Sopenharmony_ci
56762306a36Sopenharmony_ci/*--------------------------- RAM ---------------------------*/
56862306a36Sopenharmony_ci/* These memory maps are actually offsets from the segmentation and reassembly  RAM base addresses */
56962306a36Sopenharmony_ci
57062306a36Sopenharmony_ci/* Segmentation Control Memory map */
57162306a36Sopenharmony_ci#define TX_DESC_BASE	0x0000	/* Buffer Decriptor Table */
57262306a36Sopenharmony_ci#define TX_COMP_Q	0x1000	/* Transmit Complete Queue */
57362306a36Sopenharmony_ci#define PKT_RDY_Q	0x1400	/* Packet Ready Queue */
57462306a36Sopenharmony_ci#define CBR_SCHED_TABLE	0x1800	/* CBR Table */
57562306a36Sopenharmony_ci#define UBR_SCHED_TABLE	0x3000	/* UBR Table */
57662306a36Sopenharmony_ci#define UBR_WAIT_Q	0x4000	/* UBR Wait Queue */
57762306a36Sopenharmony_ci#define ABR_SCHED_TABLE	0x5000	/* ABR Table */
57862306a36Sopenharmony_ci#define ABR_WAIT_Q	0x5800	/* ABR Wait Queue */
57962306a36Sopenharmony_ci#define EXT_VC_TABLE	0x6000	/* Extended VC Table */
58062306a36Sopenharmony_ci#define MAIN_VC_TABLE	0x8000	/* Main VC Table */
58162306a36Sopenharmony_ci#define SCHEDSZ		1024	/* ABR and UBR Scheduling Table size */
58262306a36Sopenharmony_ci#define TX_DESC_TABLE_SZ 128	/* Number of entries in the Transmit
58362306a36Sopenharmony_ci					Buffer Descriptor Table */
58462306a36Sopenharmony_ci
58562306a36Sopenharmony_ci/* These are used as table offsets in Descriptor Table address generation */
58662306a36Sopenharmony_ci#define DESC_MODE	0x0
58762306a36Sopenharmony_ci#define VC_INDEX	0x1
58862306a36Sopenharmony_ci#define BYTE_CNT	0x3
58962306a36Sopenharmony_ci#define PKT_START_HI	0x4
59062306a36Sopenharmony_ci#define PKT_START_LO	0x5
59162306a36Sopenharmony_ci
59262306a36Sopenharmony_ci/* Descriptor Mode Word Bits */
59362306a36Sopenharmony_ci#define EOM_EN	0x0800
59462306a36Sopenharmony_ci#define AAL5	0x0100
59562306a36Sopenharmony_ci#define APP_CRC32 0x0400
59662306a36Sopenharmony_ci#define CMPL_INT  0x1000
59762306a36Sopenharmony_ci
59862306a36Sopenharmony_ci#define TABLE_ADDRESS(db, dn, to) \
59962306a36Sopenharmony_ci	(((unsigned long)(db & 0x04)) << 16) | (dn << 5) | (to << 1)
60062306a36Sopenharmony_ci
60162306a36Sopenharmony_ci/* Reassembly Control Memory Map */
60262306a36Sopenharmony_ci#define RX_DESC_BASE	0x0000	/* Buffer Descriptor Table */
60362306a36Sopenharmony_ci#define VP_TABLE	0x5c00	/* VP Table */
60462306a36Sopenharmony_ci#define EXCEPTION_Q	0x5e00	/* Exception Queue */
60562306a36Sopenharmony_ci#define FREE_BUF_DESC_Q	0x6000	/* Free Buffer Descriptor Queue */
60662306a36Sopenharmony_ci#define PKT_COMP_Q	0x6800	/* Packet Complete Queue */
60762306a36Sopenharmony_ci#define REASS_TABLE	0x7000	/* Reassembly Table */
60862306a36Sopenharmony_ci#define RX_VC_TABLE	0x7800	/* VC Table */
60962306a36Sopenharmony_ci#define ABR_VC_TABLE	0x8000	/* ABR VC Table */
61062306a36Sopenharmony_ci#define RX_DESC_TABLE_SZ 736	/* Number of entries in the Receive
61162306a36Sopenharmony_ci					Buffer Descriptor Table */
61262306a36Sopenharmony_ci#define VP_TABLE_SZ	256	 /* Number of entries in VPTable */
61362306a36Sopenharmony_ci#define RX_VC_TABLE_SZ 	1024	/* Number of entries in VC Table */
61462306a36Sopenharmony_ci#define REASS_TABLE_SZ 	1024	/* Number of entries in Reassembly Table */
61562306a36Sopenharmony_ci /* Buffer Descriptor Table */
61662306a36Sopenharmony_ci#define RX_ACT	0x8000
61762306a36Sopenharmony_ci#define RX_VPVC	0x4000
61862306a36Sopenharmony_ci#define RX_CNG	0x0040
61962306a36Sopenharmony_ci#define RX_CER	0x0008
62062306a36Sopenharmony_ci#define RX_PTE	0x0004
62162306a36Sopenharmony_ci#define RX_OFL	0x0002
62262306a36Sopenharmony_ci#define NUM_RX_EXCP   32
62362306a36Sopenharmony_ci
62462306a36Sopenharmony_ci/* Reassembly Table */
62562306a36Sopenharmony_ci#define NO_AAL5_PKT	0x0000
62662306a36Sopenharmony_ci#define AAL5_PKT_REASSEMBLED 0x4000
62762306a36Sopenharmony_ci#define AAL5_PKT_TERMINATED 0x8000
62862306a36Sopenharmony_ci#define RAW_PKT		0xc000
62962306a36Sopenharmony_ci#define REASS_ABR	0x2000
63062306a36Sopenharmony_ci
63162306a36Sopenharmony_ci/*-------------------- Base Registers --------------------*/
63262306a36Sopenharmony_ci#define REG_BASE IPHASE5575_BUS_CONTROL_REG_BASE
63362306a36Sopenharmony_ci#define RAM_BASE IPHASE5575_FRAG_CONTROL_RAM_BASE
63462306a36Sopenharmony_ci#define PHY_BASE IPHASE5575_FRONT_END_REG_BASE
63562306a36Sopenharmony_ci#define SEG_BASE IPHASE5575_FRAG_CONTROL_REG_BASE
63662306a36Sopenharmony_ci#define REASS_BASE IPHASE5575_REASS_CONTROL_REG_BASE
63762306a36Sopenharmony_ci
63862306a36Sopenharmony_citypedef volatile u_int	ffreg_t;
63962306a36Sopenharmony_citypedef u_int   rreg_t;
64062306a36Sopenharmony_ci
64162306a36Sopenharmony_citypedef struct _ffredn_t {
64262306a36Sopenharmony_ci	ffreg_t	idlehead_high;	/* Idle cell header (high)		*/
64362306a36Sopenharmony_ci	ffreg_t	idlehead_low;	/* Idle cell header (low)		*/
64462306a36Sopenharmony_ci	ffreg_t	maxrate;	/* Maximum rate				*/
64562306a36Sopenharmony_ci	ffreg_t	stparms;	/* Traffic Management Parameters	*/
64662306a36Sopenharmony_ci	ffreg_t	abrubr_abr;	/* ABRUBR Priority Byte 1, TCR Byte 0	*/
64762306a36Sopenharmony_ci	ffreg_t	rm_type;	/*					*/
64862306a36Sopenharmony_ci	u_int	filler5[0x17 - 0x06];
64962306a36Sopenharmony_ci	ffreg_t	cmd_reg;	/* Command register			*/
65062306a36Sopenharmony_ci	u_int	filler18[0x20 - 0x18];
65162306a36Sopenharmony_ci	ffreg_t	cbr_base;	/* CBR Pointer Base			*/
65262306a36Sopenharmony_ci	ffreg_t	vbr_base;	/* VBR Pointer Base			*/
65362306a36Sopenharmony_ci	ffreg_t	abr_base;	/* ABR Pointer Base			*/
65462306a36Sopenharmony_ci	ffreg_t	ubr_base;	/* UBR Pointer Base			*/
65562306a36Sopenharmony_ci	u_int	filler24;
65662306a36Sopenharmony_ci	ffreg_t	vbrwq_base;	/* VBR Wait Queue Base			*/
65762306a36Sopenharmony_ci	ffreg_t	abrwq_base;	/* ABR Wait Queue Base			*/
65862306a36Sopenharmony_ci	ffreg_t	ubrwq_base;	/* UBR Wait Queue Base			*/
65962306a36Sopenharmony_ci	ffreg_t	vct_base;	/* Main VC Table Base			*/
66062306a36Sopenharmony_ci	ffreg_t	vcte_base;	/* Extended Main VC Table Base		*/
66162306a36Sopenharmony_ci	u_int	filler2a[0x2C - 0x2A];
66262306a36Sopenharmony_ci	ffreg_t	cbr_tab_beg;	/* CBR Table Begin			*/
66362306a36Sopenharmony_ci	ffreg_t	cbr_tab_end;	/* CBR Table End			*/
66462306a36Sopenharmony_ci	ffreg_t	cbr_pointer;	/* CBR Pointer				*/
66562306a36Sopenharmony_ci	u_int	filler2f[0x30 - 0x2F];
66662306a36Sopenharmony_ci	ffreg_t	prq_st_adr;	/* Packet Ready Queue Start Address	*/
66762306a36Sopenharmony_ci	ffreg_t	prq_ed_adr;	/* Packet Ready Queue End Address	*/
66862306a36Sopenharmony_ci	ffreg_t	prq_rd_ptr;	/* Packet Ready Queue read pointer	*/
66962306a36Sopenharmony_ci	ffreg_t	prq_wr_ptr;	/* Packet Ready Queue write pointer	*/
67062306a36Sopenharmony_ci	ffreg_t	tcq_st_adr;	/* Transmit Complete Queue Start Address*/
67162306a36Sopenharmony_ci	ffreg_t	tcq_ed_adr;	/* Transmit Complete Queue End Address	*/
67262306a36Sopenharmony_ci	ffreg_t	tcq_rd_ptr;	/* Transmit Complete Queue read pointer */
67362306a36Sopenharmony_ci	ffreg_t	tcq_wr_ptr;	/* Transmit Complete Queue write pointer*/
67462306a36Sopenharmony_ci	u_int	filler38[0x40 - 0x38];
67562306a36Sopenharmony_ci	ffreg_t	queue_base;	/* Base address for PRQ and TCQ		*/
67662306a36Sopenharmony_ci	ffreg_t	desc_base;	/* Base address of descriptor table	*/
67762306a36Sopenharmony_ci	u_int	filler42[0x45 - 0x42];
67862306a36Sopenharmony_ci	ffreg_t	mode_reg_0;	/* Mode register 0			*/
67962306a36Sopenharmony_ci	ffreg_t	mode_reg_1;	/* Mode register 1			*/
68062306a36Sopenharmony_ci	ffreg_t	intr_status_reg;/* Interrupt Status register		*/
68162306a36Sopenharmony_ci	ffreg_t	mask_reg;	/* Mask Register			*/
68262306a36Sopenharmony_ci	ffreg_t	cell_ctr_high1; /* Total cell transfer count (high)	*/
68362306a36Sopenharmony_ci	ffreg_t	cell_ctr_lo1;	/* Total cell transfer count (low)	*/
68462306a36Sopenharmony_ci	ffreg_t	state_reg;	/* Status register			*/
68562306a36Sopenharmony_ci	u_int	filler4c[0x58 - 0x4c];
68662306a36Sopenharmony_ci	ffreg_t	curr_desc_num;	/* Contains the current descriptor num	*/
68762306a36Sopenharmony_ci	ffreg_t	next_desc;	/* Next descriptor			*/
68862306a36Sopenharmony_ci	ffreg_t	next_vc;	/* Next VC				*/
68962306a36Sopenharmony_ci	u_int	filler5b[0x5d - 0x5b];
69062306a36Sopenharmony_ci	ffreg_t	present_slot_cnt;/* Present slot count			*/
69162306a36Sopenharmony_ci	u_int	filler5e[0x6a - 0x5e];
69262306a36Sopenharmony_ci	ffreg_t	new_desc_num;	/* New descriptor number		*/
69362306a36Sopenharmony_ci	ffreg_t	new_vc;		/* New VC				*/
69462306a36Sopenharmony_ci	ffreg_t	sched_tbl_ptr;	/* Schedule table pointer		*/
69562306a36Sopenharmony_ci	ffreg_t	vbrwq_wptr;	/* VBR wait queue write pointer		*/
69662306a36Sopenharmony_ci	ffreg_t	vbrwq_rptr;	/* VBR wait queue read pointer		*/
69762306a36Sopenharmony_ci	ffreg_t	abrwq_wptr;	/* ABR wait queue write pointer		*/
69862306a36Sopenharmony_ci	ffreg_t	abrwq_rptr;	/* ABR wait queue read pointer		*/
69962306a36Sopenharmony_ci	ffreg_t	ubrwq_wptr;	/* UBR wait queue write pointer		*/
70062306a36Sopenharmony_ci	ffreg_t	ubrwq_rptr;	/* UBR wait queue read pointer		*/
70162306a36Sopenharmony_ci	ffreg_t	cbr_vc;		/* CBR VC				*/
70262306a36Sopenharmony_ci	ffreg_t	vbr_sb_vc;	/* VBR SB VC				*/
70362306a36Sopenharmony_ci	ffreg_t	abr_sb_vc;	/* ABR SB VC				*/
70462306a36Sopenharmony_ci	ffreg_t	ubr_sb_vc;	/* UBR SB VC				*/
70562306a36Sopenharmony_ci	ffreg_t	vbr_next_link;	/* VBR next link			*/
70662306a36Sopenharmony_ci	ffreg_t	abr_next_link;	/* ABR next link			*/
70762306a36Sopenharmony_ci	ffreg_t	ubr_next_link;	/* UBR next link			*/
70862306a36Sopenharmony_ci	u_int	filler7a[0x7c-0x7a];
70962306a36Sopenharmony_ci	ffreg_t	out_rate_head;	/* Out of rate head			*/
71062306a36Sopenharmony_ci	u_int	filler7d[0xca-0x7d]; /* pad out to full address space	*/
71162306a36Sopenharmony_ci	ffreg_t	cell_ctr_high1_nc;/* Total cell transfer count (high)	*/
71262306a36Sopenharmony_ci	ffreg_t	cell_ctr_lo1_nc;/* Total cell transfer count (low)	*/
71362306a36Sopenharmony_ci	u_int	fillercc[0x100-0xcc]; /* pad out to full address space	 */
71462306a36Sopenharmony_ci} ffredn_t;
71562306a36Sopenharmony_ci
71662306a36Sopenharmony_citypedef struct _rfredn_t {
71762306a36Sopenharmony_ci        rreg_t  mode_reg_0;     /* Mode register 0                      */
71862306a36Sopenharmony_ci        rreg_t  protocol_id;    /* Protocol ID                          */
71962306a36Sopenharmony_ci        rreg_t  mask_reg;       /* Mask Register                        */
72062306a36Sopenharmony_ci        rreg_t  intr_status_reg;/* Interrupt status register            */
72162306a36Sopenharmony_ci        rreg_t  drp_pkt_cntr;   /* Dropped packet cntr (clear on read)  */
72262306a36Sopenharmony_ci        rreg_t  err_cntr;       /* Error Counter (cleared on read)      */
72362306a36Sopenharmony_ci        u_int   filler6[0x08 - 0x06];
72462306a36Sopenharmony_ci        rreg_t  raw_base_adr;   /* Base addr for raw cell Q             */
72562306a36Sopenharmony_ci        u_int   filler2[0x0c - 0x09];
72662306a36Sopenharmony_ci        rreg_t  cell_ctr0;      /* Cell Counter 0 (cleared when read)   */
72762306a36Sopenharmony_ci        rreg_t  cell_ctr1;      /* Cell Counter 1 (cleared when read)   */
72862306a36Sopenharmony_ci        u_int   filler3[0x0f - 0x0e];
72962306a36Sopenharmony_ci        rreg_t  cmd_reg;        /* Command register                     */
73062306a36Sopenharmony_ci        rreg_t  desc_base;      /* Base address for description table   */
73162306a36Sopenharmony_ci        rreg_t  vc_lkup_base;   /* Base address for VC lookup table     */
73262306a36Sopenharmony_ci        rreg_t  reass_base;     /* Base address for reassembler table   */
73362306a36Sopenharmony_ci        rreg_t  queue_base;     /* Base address for Communication queue */
73462306a36Sopenharmony_ci        u_int   filler14[0x16 - 0x14];
73562306a36Sopenharmony_ci        rreg_t  pkt_tm_cnt;     /* Packet Timeout and count register    */
73662306a36Sopenharmony_ci        rreg_t  tmout_range;    /* Range of reassembley IDs for timeout */
73762306a36Sopenharmony_ci        rreg_t  intrvl_cntr;    /* Packet aging interval counter        */
73862306a36Sopenharmony_ci        rreg_t  tmout_indx;     /* index of pkt being tested for aging  */
73962306a36Sopenharmony_ci        u_int   filler1a[0x1c - 0x1a];
74062306a36Sopenharmony_ci        rreg_t  vp_lkup_base;   /* Base address for VP lookup table     */
74162306a36Sopenharmony_ci        rreg_t  vp_filter;      /* VP filter register                   */
74262306a36Sopenharmony_ci        rreg_t  abr_lkup_base;  /* Base address of ABR VC Table         */
74362306a36Sopenharmony_ci        u_int   filler1f[0x24 - 0x1f];
74462306a36Sopenharmony_ci        rreg_t  fdq_st_adr;     /* Free desc queue start address        */
74562306a36Sopenharmony_ci        rreg_t  fdq_ed_adr;     /* Free desc queue end address          */
74662306a36Sopenharmony_ci        rreg_t  fdq_rd_ptr;     /* Free desc queue read pointer         */
74762306a36Sopenharmony_ci        rreg_t  fdq_wr_ptr;     /* Free desc queue write pointer        */
74862306a36Sopenharmony_ci        rreg_t  pcq_st_adr;     /* Packet Complete queue start address  */
74962306a36Sopenharmony_ci        rreg_t  pcq_ed_adr;     /* Packet Complete queue end address    */
75062306a36Sopenharmony_ci        rreg_t  pcq_rd_ptr;     /* Packet Complete queue read pointer   */
75162306a36Sopenharmony_ci        rreg_t  pcq_wr_ptr;     /* Packet Complete queue write pointer  */
75262306a36Sopenharmony_ci        rreg_t  excp_st_adr;    /* Exception queue start address        */
75362306a36Sopenharmony_ci        rreg_t  excp_ed_adr;    /* Exception queue end address          */
75462306a36Sopenharmony_ci        rreg_t  excp_rd_ptr;    /* Exception queue read pointer         */
75562306a36Sopenharmony_ci        rreg_t  excp_wr_ptr;    /* Exception queue write pointer        */
75662306a36Sopenharmony_ci        u_int   filler30[0x34 - 0x30];
75762306a36Sopenharmony_ci        rreg_t  raw_st_adr;     /* Raw Cell start address               */
75862306a36Sopenharmony_ci        rreg_t  raw_ed_adr;     /* Raw Cell end address                 */
75962306a36Sopenharmony_ci        rreg_t  raw_rd_ptr;     /* Raw Cell read pointer                */
76062306a36Sopenharmony_ci        rreg_t  raw_wr_ptr;     /* Raw Cell write pointer               */
76162306a36Sopenharmony_ci        rreg_t  state_reg;      /* State Register                       */
76262306a36Sopenharmony_ci        u_int   filler39[0x42 - 0x39];
76362306a36Sopenharmony_ci        rreg_t  buf_size;       /* Buffer size                          */
76462306a36Sopenharmony_ci        u_int   filler43;
76562306a36Sopenharmony_ci        rreg_t  xtra_rm_offset; /* Offset of the additional turnaround RM */
76662306a36Sopenharmony_ci        u_int   filler45[0x84 - 0x45];
76762306a36Sopenharmony_ci        rreg_t  drp_pkt_cntr_nc;/* Dropped Packet cntr, Not clear on rd */
76862306a36Sopenharmony_ci        rreg_t  err_cntr_nc;    /* Error Counter, Not clear on read     */
76962306a36Sopenharmony_ci        u_int   filler86[0x8c - 0x86];
77062306a36Sopenharmony_ci        rreg_t  cell_ctr0_nc;   /* Cell Counter 0,  Not clear on read   */
77162306a36Sopenharmony_ci        rreg_t  cell_ctr1_nc;   /* Cell Counter 1, Not clear on read    */
77262306a36Sopenharmony_ci        u_int   filler8e[0x100-0x8e]; /* pad out to full address space   */
77362306a36Sopenharmony_ci} rfredn_t;
77462306a36Sopenharmony_ci
77562306a36Sopenharmony_citypedef struct {
77662306a36Sopenharmony_ci        /* Atlantic */
77762306a36Sopenharmony_ci        ffredn_t        ffredn;         /* F FRED                       */
77862306a36Sopenharmony_ci        rfredn_t        rfredn;         /* R FRED                       */
77962306a36Sopenharmony_ci} ia_regs_t;
78062306a36Sopenharmony_ci
78162306a36Sopenharmony_citypedef struct {
78262306a36Sopenharmony_ci	u_short		f_vc_type;	/* VC type              */
78362306a36Sopenharmony_ci	u_short		f_nrm;		/* Nrm			*/
78462306a36Sopenharmony_ci	u_short		f_nrmexp;	/* Nrm Exp              */
78562306a36Sopenharmony_ci	u_short		reserved6;	/* 			*/
78662306a36Sopenharmony_ci	u_short		f_crm;		/* Crm			*/
78762306a36Sopenharmony_ci	u_short		reserved10;	/* Reserved		*/
78862306a36Sopenharmony_ci	u_short		reserved12;	/* Reserved		*/
78962306a36Sopenharmony_ci	u_short		reserved14;	/* Reserved		*/
79062306a36Sopenharmony_ci	u_short		last_cell_slot;	/* last_cell_slot_count	*/
79162306a36Sopenharmony_ci	u_short		f_pcr;		/* Peak Cell Rate	*/
79262306a36Sopenharmony_ci	u_short		fraction;	/* fraction		*/
79362306a36Sopenharmony_ci	u_short		f_icr;		/* Initial Cell Rate	*/
79462306a36Sopenharmony_ci	u_short		f_cdf;		/* */
79562306a36Sopenharmony_ci	u_short		f_mcr;		/* Minimum Cell Rate	*/
79662306a36Sopenharmony_ci	u_short		f_acr;		/* Allowed Cell Rate	*/
79762306a36Sopenharmony_ci	u_short		f_status;	/* */
79862306a36Sopenharmony_ci} f_vc_abr_entry;
79962306a36Sopenharmony_ci
80062306a36Sopenharmony_citypedef struct {
80162306a36Sopenharmony_ci        u_short         r_status_rdf;   /* status + RDF         */
80262306a36Sopenharmony_ci        u_short         r_air;          /* AIR                  */
80362306a36Sopenharmony_ci        u_short         reserved4[14];  /* Reserved             */
80462306a36Sopenharmony_ci} r_vc_abr_entry;
80562306a36Sopenharmony_ci
80662306a36Sopenharmony_ci#define MRM 3
80762306a36Sopenharmony_ci
80862306a36Sopenharmony_citypedef struct srv_cls_param {
80962306a36Sopenharmony_ci        u32 class_type;         /* CBR/VBR/ABR/UBR; use the enum above */
81062306a36Sopenharmony_ci        u32 pcr;                /* Peak Cell Rate (24-bit) */
81162306a36Sopenharmony_ci        /* VBR parameters */
81262306a36Sopenharmony_ci        u32 scr;                /* sustainable cell rate */
81362306a36Sopenharmony_ci        u32 max_burst_size;     /* ?? cell rate or data rate */
81462306a36Sopenharmony_ci
81562306a36Sopenharmony_ci        /* ABR only UNI 4.0 Parameters */
81662306a36Sopenharmony_ci        u32 mcr;                /* Min Cell Rate (24-bit) */
81762306a36Sopenharmony_ci        u32 icr;                /* Initial Cell Rate (24-bit) */
81862306a36Sopenharmony_ci        u32 tbe;                /* Transient Buffer Exposure (24-bit) */
81962306a36Sopenharmony_ci        u32 frtt;               /* Fixed Round Trip Time (24-bit) */
82062306a36Sopenharmony_ci
82162306a36Sopenharmony_ci#if 0   /* Additional Parameters of TM 4.0 */
82262306a36Sopenharmony_cibits  31          30           29          28       27-25 24-22 21-19  18-9
82362306a36Sopenharmony_ci-----------------------------------------------------------------------------
82462306a36Sopenharmony_ci| NRM present | TRM prsnt | CDF prsnt | ADTF prsnt | NRM | TRM | CDF | ADTF |
82562306a36Sopenharmony_ci-----------------------------------------------------------------------------
82662306a36Sopenharmony_ci#endif /* 0 */
82762306a36Sopenharmony_ci
82862306a36Sopenharmony_ci        u8 nrm;                 /* Max # of Cells for each forward RM
82962306a36Sopenharmony_ci                                        cell (3-bit) */
83062306a36Sopenharmony_ci        u8 trm;                 /* Time between forward RM cells (3-bit) */
83162306a36Sopenharmony_ci        u16 adtf;               /* ACR Decrease Time Factor (10-bit) */
83262306a36Sopenharmony_ci        u8 cdf;                 /* Cutoff Decrease Factor (3-bit) */
83362306a36Sopenharmony_ci        u8 rif;                 /* Rate Increment Factor (4-bit) */
83462306a36Sopenharmony_ci        u8 rdf;                 /* Rate Decrease Factor (4-bit) */
83562306a36Sopenharmony_ci        u8 reserved;            /* 8 bits to keep structure word aligned */
83662306a36Sopenharmony_ci} srv_cls_param_t;
83762306a36Sopenharmony_ci
83862306a36Sopenharmony_cistruct testTable_t {
83962306a36Sopenharmony_ci	u16 lastTime;
84062306a36Sopenharmony_ci	u16 fract;
84162306a36Sopenharmony_ci	u8 vc_status;
84262306a36Sopenharmony_ci};
84362306a36Sopenharmony_ci
84462306a36Sopenharmony_citypedef struct {
84562306a36Sopenharmony_ci	u16 vci;
84662306a36Sopenharmony_ci	u16 error;
84762306a36Sopenharmony_ci} RX_ERROR_Q;
84862306a36Sopenharmony_ci
84962306a36Sopenharmony_citypedef struct {
85062306a36Sopenharmony_ci	u8 active: 1;
85162306a36Sopenharmony_ci	u8 abr: 1;
85262306a36Sopenharmony_ci	u8 ubr: 1;
85362306a36Sopenharmony_ci	u8 cnt: 5;
85462306a36Sopenharmony_ci#define VC_ACTIVE 	0x01
85562306a36Sopenharmony_ci#define VC_ABR		0x02
85662306a36Sopenharmony_ci#define VC_UBR		0x04
85762306a36Sopenharmony_ci} vcstatus_t;
85862306a36Sopenharmony_ci
85962306a36Sopenharmony_cistruct ia_rfL_t {
86062306a36Sopenharmony_ci    	u32  fdq_st;     /* Free desc queue start address        */
86162306a36Sopenharmony_ci        u32  fdq_ed;     /* Free desc queue end address          */
86262306a36Sopenharmony_ci        u32  fdq_rd;     /* Free desc queue read pointer         */
86362306a36Sopenharmony_ci        u32  fdq_wr;     /* Free desc queue write pointer        */
86462306a36Sopenharmony_ci        u32  pcq_st;     /* Packet Complete queue start address  */
86562306a36Sopenharmony_ci        u32  pcq_ed;     /* Packet Complete queue end address    */
86662306a36Sopenharmony_ci        u32  pcq_rd;     /* Packet Complete queue read pointer   */
86762306a36Sopenharmony_ci        u32  pcq_wr;     /* Packet Complete queue write pointer  */
86862306a36Sopenharmony_ci};
86962306a36Sopenharmony_ci
87062306a36Sopenharmony_cistruct ia_ffL_t {
87162306a36Sopenharmony_ci	u32  prq_st;     /* Packet Ready Queue Start Address     */
87262306a36Sopenharmony_ci        u32  prq_ed;     /* Packet Ready Queue End Address       */
87362306a36Sopenharmony_ci        u32  prq_wr;     /* Packet Ready Queue write pointer     */
87462306a36Sopenharmony_ci        u32  tcq_st;     /* Transmit Complete Queue Start Address*/
87562306a36Sopenharmony_ci        u32  tcq_ed;     /* Transmit Complete Queue End Address  */
87662306a36Sopenharmony_ci        u32  tcq_rd;     /* Transmit Complete Queue read pointer */
87762306a36Sopenharmony_ci};
87862306a36Sopenharmony_ci
87962306a36Sopenharmony_cistruct desc_tbl_t {
88062306a36Sopenharmony_ci        u32 timestamp;
88162306a36Sopenharmony_ci        struct ia_vcc *iavcc;
88262306a36Sopenharmony_ci        struct sk_buff *txskb;
88362306a36Sopenharmony_ci};
88462306a36Sopenharmony_ci
88562306a36Sopenharmony_citypedef struct ia_rtn_q {
88662306a36Sopenharmony_ci   struct desc_tbl_t data;
88762306a36Sopenharmony_ci   struct ia_rtn_q *next, *tail;
88862306a36Sopenharmony_ci} IARTN_Q;
88962306a36Sopenharmony_ci
89062306a36Sopenharmony_ci#define SUNI_LOSV   	0x04
89162306a36Sopenharmony_cienum ia_suni {
89262306a36Sopenharmony_ci	SUNI_MASTER_RESET	= 0x000, /* SUNI Master Reset and Identity   */
89362306a36Sopenharmony_ci	SUNI_MASTER_CONFIG	= 0x004, /* SUNI Master Configuration        */
89462306a36Sopenharmony_ci	SUNI_MASTER_INTR_STAT	= 0x008, /* SUNI Master Interrupt Status     */
89562306a36Sopenharmony_ci	SUNI_RESERVED1		= 0x00c, /* Reserved                         */
89662306a36Sopenharmony_ci	SUNI_MASTER_CLK_MONITOR	= 0x010, /* SUNI Master Clock Monitor        */
89762306a36Sopenharmony_ci	SUNI_MASTER_CONTROL	= 0x014, /* SUNI Master Clock Monitor        */
89862306a36Sopenharmony_ci					 /* Reserved (10)                    */
89962306a36Sopenharmony_ci	SUNI_RSOP_CONTROL	= 0x040, /* RSOP Control/Interrupt Enable    */
90062306a36Sopenharmony_ci	SUNI_RSOP_STATUS	= 0x044, /* RSOP Status/Interrupt States     */
90162306a36Sopenharmony_ci	SUNI_RSOP_SECTION_BIP8L	= 0x048, /* RSOP Section BIP-8 LSB           */
90262306a36Sopenharmony_ci	SUNI_RSOP_SECTION_BIP8M	= 0x04c, /* RSOP Section BIP-8 MSB           */
90362306a36Sopenharmony_ci
90462306a36Sopenharmony_ci	SUNI_TSOP_CONTROL	= 0x050, /* TSOP Control                     */
90562306a36Sopenharmony_ci	SUNI_TSOP_DIAG		= 0x054, /* TSOP Disgnostics                 */
90662306a36Sopenharmony_ci					 /* Reserved (2)                     */
90762306a36Sopenharmony_ci	SUNI_RLOP_CS		= 0x060, /* RLOP Control/Status              */
90862306a36Sopenharmony_ci	SUNI_RLOP_INTR		= 0x064, /* RLOP Interrupt Enable/Status     */
90962306a36Sopenharmony_ci	SUNI_RLOP_LINE_BIP24L	= 0x068, /* RLOP Line BIP-24 LSB             */
91062306a36Sopenharmony_ci	SUNI_RLOP_LINE_BIP24	= 0x06c, /* RLOP Line BIP-24                 */
91162306a36Sopenharmony_ci	SUNI_RLOP_LINE_BIP24M	= 0x070, /* RLOP Line BIP-24 MSB             */
91262306a36Sopenharmony_ci	SUNI_RLOP_LINE_FEBEL	= 0x074, /* RLOP Line FEBE LSB               */
91362306a36Sopenharmony_ci	SUNI_RLOP_LINE_FEBE	= 0x078, /* RLOP Line FEBE                   */
91462306a36Sopenharmony_ci	SUNI_RLOP_LINE_FEBEM	= 0x07c, /* RLOP Line FEBE MSB               */
91562306a36Sopenharmony_ci
91662306a36Sopenharmony_ci	SUNI_TLOP_CONTROL	= 0x080, /* TLOP Control                     */
91762306a36Sopenharmony_ci	SUNI_TLOP_DISG		= 0x084, /* TLOP Disgnostics                 */
91862306a36Sopenharmony_ci					 /* Reserved (14)                    */
91962306a36Sopenharmony_ci	SUNI_RPOP_CS		= 0x0c0, /* RPOP Status/Control              */
92062306a36Sopenharmony_ci	SUNI_RPOP_INTR		= 0x0c4, /* RPOP Interrupt/Status            */
92162306a36Sopenharmony_ci	SUNI_RPOP_RESERVED	= 0x0c8, /* RPOP Reserved                    */
92262306a36Sopenharmony_ci	SUNI_RPOP_INTR_ENA	= 0x0cc, /* RPOP Interrupt Enable            */
92362306a36Sopenharmony_ci					 /* Reserved (3)                     */
92462306a36Sopenharmony_ci	SUNI_RPOP_PATH_SIG	= 0x0dc, /* RPOP Path Signal Label           */
92562306a36Sopenharmony_ci	SUNI_RPOP_BIP8L		= 0x0e0, /* RPOP Path BIP-8 LSB              */
92662306a36Sopenharmony_ci	SUNI_RPOP_BIP8M		= 0x0e4, /* RPOP Path BIP-8 MSB              */
92762306a36Sopenharmony_ci	SUNI_RPOP_FEBEL		= 0x0e8, /* RPOP Path FEBE LSB               */
92862306a36Sopenharmony_ci	SUNI_RPOP_FEBEM		= 0x0ec, /* RPOP Path FEBE MSB               */
92962306a36Sopenharmony_ci					 /* Reserved (4)                     */
93062306a36Sopenharmony_ci	SUNI_TPOP_CNTRL_DAIG	= 0x100, /* TPOP Control/Disgnostics         */
93162306a36Sopenharmony_ci	SUNI_TPOP_POINTER_CTRL	= 0x104, /* TPOP Pointer Control             */
93262306a36Sopenharmony_ci	SUNI_TPOP_SOURCER_CTRL	= 0x108, /* TPOP Source Control              */
93362306a36Sopenharmony_ci					 /* Reserved (2)                     */
93462306a36Sopenharmony_ci	SUNI_TPOP_ARB_PRTL	= 0x114, /* TPOP Arbitrary Pointer LSB       */
93562306a36Sopenharmony_ci	SUNI_TPOP_ARB_PRTM	= 0x118, /* TPOP Arbitrary Pointer MSB       */
93662306a36Sopenharmony_ci	SUNI_TPOP_RESERVED2	= 0x11c, /* TPOP Reserved                    */
93762306a36Sopenharmony_ci	SUNI_TPOP_PATH_SIG	= 0x120, /* TPOP Path Signal Lable           */
93862306a36Sopenharmony_ci	SUNI_TPOP_PATH_STATUS	= 0x124, /* TPOP Path Status                 */
93962306a36Sopenharmony_ci					 /* Reserved (6)                     */
94062306a36Sopenharmony_ci	SUNI_RACP_CS		= 0x140, /* RACP Control/Status              */
94162306a36Sopenharmony_ci	SUNI_RACP_INTR		= 0x144, /* RACP Interrupt Enable/Status     */
94262306a36Sopenharmony_ci	SUNI_RACP_HDR_PATTERN	= 0x148, /* RACP Match Header Pattern        */
94362306a36Sopenharmony_ci	SUNI_RACP_HDR_MASK	= 0x14c, /* RACP Match Header Mask           */
94462306a36Sopenharmony_ci	SUNI_RACP_CORR_HCS	= 0x150, /* RACP Correctable HCS Error Count */
94562306a36Sopenharmony_ci	SUNI_RACP_UNCORR_HCS	= 0x154, /* RACP Uncorrectable HCS Err Count */
94662306a36Sopenharmony_ci					 /* Reserved (10)                    */
94762306a36Sopenharmony_ci	SUNI_TACP_CONTROL	= 0x180, /* TACP Control                     */
94862306a36Sopenharmony_ci	SUNI_TACP_IDLE_HDR_PAT	= 0x184, /* TACP Idle Cell Header Pattern    */
94962306a36Sopenharmony_ci	SUNI_TACP_IDLE_PAY_PAY	= 0x188, /* TACP Idle Cell Payld Octet Patrn */
95062306a36Sopenharmony_ci					 /* Reserved (5)                     */
95162306a36Sopenharmony_ci					 /* Reserved (24)                    */
95262306a36Sopenharmony_ci	/* FIXME: unused but name conflicts.
95362306a36Sopenharmony_ci	 * SUNI_MASTER_TEST	= 0x200,    SUNI Master Test                 */
95462306a36Sopenharmony_ci	SUNI_RESERVED_TEST	= 0x204  /* SUNI Reserved for Test           */
95562306a36Sopenharmony_ci};
95662306a36Sopenharmony_ci
95762306a36Sopenharmony_citypedef struct _SUNI_STATS_
95862306a36Sopenharmony_ci{
95962306a36Sopenharmony_ci   u32 valid;                       // 1 = oc3 PHY card
96062306a36Sopenharmony_ci   u32 carrier_detect;              // GPIN input
96162306a36Sopenharmony_ci   // RSOP: receive section overhead processor
96262306a36Sopenharmony_ci   u16 rsop_oof_state;              // 1 = out of frame
96362306a36Sopenharmony_ci   u16 rsop_lof_state;              // 1 = loss of frame
96462306a36Sopenharmony_ci   u16 rsop_los_state;              // 1 = loss of signal
96562306a36Sopenharmony_ci   u32 rsop_los_count;              // loss of signal count
96662306a36Sopenharmony_ci   u32 rsop_bse_count;              // section BIP-8 error count
96762306a36Sopenharmony_ci   // RLOP: receive line overhead processor
96862306a36Sopenharmony_ci   u16 rlop_ferf_state;             // 1 = far end receive failure
96962306a36Sopenharmony_ci   u16 rlop_lais_state;             // 1 = line AIS
97062306a36Sopenharmony_ci   u32 rlop_lbe_count;              // BIP-24 count
97162306a36Sopenharmony_ci   u32 rlop_febe_count;             // FEBE count;
97262306a36Sopenharmony_ci   // RPOP: receive path overhead processor
97362306a36Sopenharmony_ci   u16 rpop_lop_state;              // 1 = LOP
97462306a36Sopenharmony_ci   u16 rpop_pais_state;             // 1 = path AIS
97562306a36Sopenharmony_ci   u16 rpop_pyel_state;             // 1 = path yellow alert
97662306a36Sopenharmony_ci   u32 rpop_bip_count;              // path BIP-8 error count
97762306a36Sopenharmony_ci   u32 rpop_febe_count;             // path FEBE error count
97862306a36Sopenharmony_ci   u16 rpop_psig;                   // path signal label value
97962306a36Sopenharmony_ci   // RACP: receive ATM cell processor
98062306a36Sopenharmony_ci   u16 racp_hp_state;               // hunt/presync state
98162306a36Sopenharmony_ci   u32 racp_fu_count;               // FIFO underrun count
98262306a36Sopenharmony_ci   u32 racp_fo_count;               // FIFO overrun count
98362306a36Sopenharmony_ci   u32 racp_chcs_count;             // correctable HCS error count
98462306a36Sopenharmony_ci   u32 racp_uchcs_count;            // uncorrectable HCS error count
98562306a36Sopenharmony_ci} IA_SUNI_STATS;
98662306a36Sopenharmony_ci
98762306a36Sopenharmony_citypedef struct iadev_priv {
98862306a36Sopenharmony_ci	/*-----base pointers into (i)chipSAR+ address space */
98962306a36Sopenharmony_ci	u32 __iomem *phy;	/* Base pointer into phy (SUNI). */
99062306a36Sopenharmony_ci	u32 __iomem *dma;	/* Base pointer into DMA control registers. */
99162306a36Sopenharmony_ci	u32 __iomem *reg;	/* Base pointer to SAR registers. */
99262306a36Sopenharmony_ci	u32 __iomem *seg_reg;		/* base pointer to segmentation engine
99362306a36Sopenharmony_ci						internal registers */
99462306a36Sopenharmony_ci	u32 __iomem *reass_reg;		/* base pointer to reassemble engine
99562306a36Sopenharmony_ci						internal registers */
99662306a36Sopenharmony_ci	u32 __iomem *ram;		/* base pointer to SAR RAM */
99762306a36Sopenharmony_ci	void __iomem *seg_ram;
99862306a36Sopenharmony_ci	void __iomem *reass_ram;
99962306a36Sopenharmony_ci	struct dle_q tx_dle_q;
100062306a36Sopenharmony_ci	struct free_desc_q *tx_free_desc_qhead;
100162306a36Sopenharmony_ci	struct sk_buff_head tx_dma_q, tx_backlog;
100262306a36Sopenharmony_ci        spinlock_t            tx_lock;
100362306a36Sopenharmony_ci        IARTN_Q               tx_return_q;
100462306a36Sopenharmony_ci        u32                   close_pending;
100562306a36Sopenharmony_ci        wait_queue_head_t    close_wait;
100662306a36Sopenharmony_ci        wait_queue_head_t    timeout_wait;
100762306a36Sopenharmony_ci	struct cpcs_trailer_desc *tx_buf;
100862306a36Sopenharmony_ci        u16 num_tx_desc, tx_buf_sz, rate_limit;
100962306a36Sopenharmony_ci        u32 tx_cell_cnt, tx_pkt_cnt;
101062306a36Sopenharmony_ci        void __iomem *MAIN_VC_TABLE_ADDR, *EXT_VC_TABLE_ADDR, *ABR_SCHED_TABLE_ADDR;
101162306a36Sopenharmony_ci	struct dle_q rx_dle_q;
101262306a36Sopenharmony_ci	struct free_desc_q *rx_free_desc_qhead;
101362306a36Sopenharmony_ci	struct sk_buff_head rx_dma_q;
101462306a36Sopenharmony_ci	spinlock_t rx_lock;
101562306a36Sopenharmony_ci	struct atm_vcc **rx_open;	/* list of all open VCs */
101662306a36Sopenharmony_ci        u16 num_rx_desc, rx_buf_sz, rxing;
101762306a36Sopenharmony_ci        u32 rx_pkt_ram, rx_tmp_cnt;
101862306a36Sopenharmony_ci        unsigned long rx_tmp_jif;
101962306a36Sopenharmony_ci        void __iomem *RX_DESC_BASE_ADDR;
102062306a36Sopenharmony_ci        u32 drop_rxpkt, drop_rxcell, rx_cell_cnt, rx_pkt_cnt;
102162306a36Sopenharmony_ci	struct atm_dev *next_board;	/* other iphase devices */
102262306a36Sopenharmony_ci	struct pci_dev *pci;
102362306a36Sopenharmony_ci	int mem;
102462306a36Sopenharmony_ci	unsigned int real_base;	/* real and virtual base address */
102562306a36Sopenharmony_ci	void __iomem *base;
102662306a36Sopenharmony_ci	unsigned int pci_map_size;	/*pci map size of board */
102762306a36Sopenharmony_ci	unsigned char irq;
102862306a36Sopenharmony_ci	unsigned char bus;
102962306a36Sopenharmony_ci	unsigned char dev_fn;
103062306a36Sopenharmony_ci        u_short  phy_type;
103162306a36Sopenharmony_ci        u_short  num_vc, memSize, memType;
103262306a36Sopenharmony_ci        struct ia_ffL_t ffL;
103362306a36Sopenharmony_ci        struct ia_rfL_t rfL;
103462306a36Sopenharmony_ci        /* Suni stat */
103562306a36Sopenharmony_ci        // IA_SUNI_STATS suni_stats;
103662306a36Sopenharmony_ci        unsigned char carrier_detect;
103762306a36Sopenharmony_ci        /* CBR related */
103862306a36Sopenharmony_ci        // transmit DMA & Receive
103962306a36Sopenharmony_ci        unsigned int tx_dma_cnt;     // number of elements on dma queue
104062306a36Sopenharmony_ci        unsigned int rx_dma_cnt;     // number of elements on rx dma queue
104162306a36Sopenharmony_ci        unsigned int NumEnabledCBR;  // number of CBR VCI's enabled.     CBR
104262306a36Sopenharmony_ci        // receive MARK  for Cell FIFO
104362306a36Sopenharmony_ci        unsigned int rx_mark_cnt;    // number of elements on mark queue
104462306a36Sopenharmony_ci        unsigned int CbrTotEntries;  // Total CBR Entries in Scheduling Table.
104562306a36Sopenharmony_ci        unsigned int CbrRemEntries;  // Remaining CBR Entries in Scheduling Table.
104662306a36Sopenharmony_ci        unsigned int CbrEntryPt;     // CBR Sched Table Entry Point.
104762306a36Sopenharmony_ci        unsigned int Granularity;    // CBR Granularity given Table Size.
104862306a36Sopenharmony_ci        /* ABR related */
104962306a36Sopenharmony_ci	unsigned int  sum_mcr, sum_cbr, LineRate;
105062306a36Sopenharmony_ci	unsigned int  n_abr;
105162306a36Sopenharmony_ci        struct desc_tbl_t *desc_tbl;
105262306a36Sopenharmony_ci        u_short host_tcq_wr;
105362306a36Sopenharmony_ci        struct testTable_t **testTable;
105462306a36Sopenharmony_ci	dma_addr_t tx_dle_dma;
105562306a36Sopenharmony_ci	dma_addr_t rx_dle_dma;
105662306a36Sopenharmony_ci} IADEV;
105762306a36Sopenharmony_ci
105862306a36Sopenharmony_ci
105962306a36Sopenharmony_ci#define INPH_IA_DEV(d) ((IADEV *) (d)->dev_data)
106062306a36Sopenharmony_ci#define INPH_IA_VCC(v) ((struct ia_vcc *) (v)->dev_data)
106162306a36Sopenharmony_ci
106262306a36Sopenharmony_ci/******************* IDT77105 25MB/s PHY DEFINE *****************************/
106362306a36Sopenharmony_cienum ia_mb25 {
106462306a36Sopenharmony_ci	MB25_MASTER_CTRL	= 0x00, /* Master control		     */
106562306a36Sopenharmony_ci	MB25_INTR_STATUS	= 0x04,	/* Interrupt status		     */
106662306a36Sopenharmony_ci	MB25_DIAG_CONTROL	= 0x08,	/* Diagnostic control		     */
106762306a36Sopenharmony_ci	MB25_LED_HEC		= 0x0c,	/* LED driver and HEC status/control */
106862306a36Sopenharmony_ci	MB25_LOW_BYTE_COUNTER	= 0x10,
106962306a36Sopenharmony_ci	MB25_HIGH_BYTE_COUNTER	= 0x14
107062306a36Sopenharmony_ci};
107162306a36Sopenharmony_ci
107262306a36Sopenharmony_ci/*
107362306a36Sopenharmony_ci * Master Control
107462306a36Sopenharmony_ci */
107562306a36Sopenharmony_ci#define	MB25_MC_UPLO	0x80		/* UPLO				     */
107662306a36Sopenharmony_ci#define	MB25_MC_DREC	0x40		/* Discard receive cell errors	     */
107762306a36Sopenharmony_ci#define	MB25_MC_ECEIO	0x20		/* Enable Cell Error Interrupts Only */
107862306a36Sopenharmony_ci#define	MB25_MC_TDPC	0x10		/* Transmit data parity check	     */
107962306a36Sopenharmony_ci#define	MB25_MC_DRIC	0x08		/* Discard receive idle cells	     */
108062306a36Sopenharmony_ci#define	MB25_MC_HALTTX	0x04		/* Halt Tx			     */
108162306a36Sopenharmony_ci#define	MB25_MC_UMS	0x02		/* UTOPIA mode select		     */
108262306a36Sopenharmony_ci#define	MB25_MC_ENABLED	0x01		/* Enable interrupt		     */
108362306a36Sopenharmony_ci
108462306a36Sopenharmony_ci/*
108562306a36Sopenharmony_ci * Interrupt Status
108662306a36Sopenharmony_ci */
108762306a36Sopenharmony_ci#define	MB25_IS_GSB	0x40		/* GOOD Symbol Bit		     */
108862306a36Sopenharmony_ci#define	MB25_IS_HECECR	0x20		/* HEC error cell received	     */
108962306a36Sopenharmony_ci#define	MB25_IS_SCR	0x10		/* "Short Cell" Received	     */
109062306a36Sopenharmony_ci#define	MB25_IS_TPE	0x08		/* Trnamsit Parity Error	     */
109162306a36Sopenharmony_ci#define	MB25_IS_RSCC	0x04		/* Receive Signal Condition change   */
109262306a36Sopenharmony_ci#define	MB25_IS_RCSE	0x02		/* Received Cell Symbol Error	     */
109362306a36Sopenharmony_ci#define	MB25_IS_RFIFOO	0x01		/* Received FIFO Overrun	     */
109462306a36Sopenharmony_ci
109562306a36Sopenharmony_ci/*
109662306a36Sopenharmony_ci * Diagnostic Control
109762306a36Sopenharmony_ci */
109862306a36Sopenharmony_ci#define	MB25_DC_FTXCD	0x80		/* Force TxClav deassert	     */
109962306a36Sopenharmony_ci#define	MB25_DC_RXCOS	0x40		/* RxClav operation select	     */
110062306a36Sopenharmony_ci#define	MB25_DC_ECEIO	0x20		/* Single/Multi-PHY config select    */
110162306a36Sopenharmony_ci#define	MB25_DC_RLFLUSH	0x10		/* Clear receive FIFO		     */
110262306a36Sopenharmony_ci#define	MB25_DC_IXPE	0x08		/* Insert xmit payload error	     */
110362306a36Sopenharmony_ci#define	MB25_DC_IXHECE	0x04		/* Insert Xmit HEC Error	     */
110462306a36Sopenharmony_ci#define	MB25_DC_LB_MASK	0x03		/* Loopback control mask	     */
110562306a36Sopenharmony_ci
110662306a36Sopenharmony_ci#define	MB25_DC_LL	0x03		/* Line Loopback		     */
110762306a36Sopenharmony_ci#define	MB25_DC_PL	0x02		/* PHY Loopback			     */
110862306a36Sopenharmony_ci#define	MB25_DC_NM	0x00
110962306a36Sopenharmony_ci
111062306a36Sopenharmony_ci#define FE_MASK 	0x00F0
111162306a36Sopenharmony_ci#define FE_MULTI_MODE	0x0000
111262306a36Sopenharmony_ci#define FE_SINGLE_MODE  0x0010
111362306a36Sopenharmony_ci#define FE_UTP_OPTION  	0x0020
111462306a36Sopenharmony_ci#define FE_25MBIT_PHY	0x0040
111562306a36Sopenharmony_ci#define FE_DS3_PHY      0x0080          /* DS3 */
111662306a36Sopenharmony_ci#define FE_E3_PHY       0x0090          /* E3 */
111762306a36Sopenharmony_ci
111862306a36Sopenharmony_ci/*********************** SUNI_PM7345 PHY DEFINE HERE *********************/
111962306a36Sopenharmony_cienum suni_pm7345 {
112062306a36Sopenharmony_ci	SUNI_CONFIG			= 0x000, /* SUNI Configuration */
112162306a36Sopenharmony_ci	SUNI_INTR_ENBL			= 0x004, /* SUNI Interrupt Enable */
112262306a36Sopenharmony_ci	SUNI_INTR_STAT			= 0x008, /* SUNI Interrupt Status */
112362306a36Sopenharmony_ci	SUNI_CONTROL			= 0x00c, /* SUNI Control */
112462306a36Sopenharmony_ci	SUNI_ID_RESET			= 0x010, /* SUNI Reset and Identity */
112562306a36Sopenharmony_ci	SUNI_DATA_LINK_CTRL		= 0x014,
112662306a36Sopenharmony_ci	SUNI_RBOC_CONF_INTR_ENBL	= 0x018,
112762306a36Sopenharmony_ci	SUNI_RBOC_STAT			= 0x01c,
112862306a36Sopenharmony_ci	SUNI_DS3_FRM_CFG		= 0x020,
112962306a36Sopenharmony_ci	SUNI_DS3_FRM_INTR_ENBL		= 0x024,
113062306a36Sopenharmony_ci	SUNI_DS3_FRM_INTR_STAT		= 0x028,
113162306a36Sopenharmony_ci	SUNI_DS3_FRM_STAT		= 0x02c,
113262306a36Sopenharmony_ci	SUNI_RFDL_CFG			= 0x030,
113362306a36Sopenharmony_ci	SUNI_RFDL_ENBL_STAT		= 0x034,
113462306a36Sopenharmony_ci	SUNI_RFDL_STAT			= 0x038,
113562306a36Sopenharmony_ci	SUNI_RFDL_DATA			= 0x03c,
113662306a36Sopenharmony_ci	SUNI_PMON_CHNG			= 0x040,
113762306a36Sopenharmony_ci	SUNI_PMON_INTR_ENBL_STAT	= 0x044,
113862306a36Sopenharmony_ci	/* SUNI_RESERVED1 (0x13 - 0x11) */
113962306a36Sopenharmony_ci	SUNI_PMON_LCV_EVT_CNT_LSB	= 0x050,
114062306a36Sopenharmony_ci	SUNI_PMON_LCV_EVT_CNT_MSB	= 0x054,
114162306a36Sopenharmony_ci	SUNI_PMON_FBE_EVT_CNT_LSB	= 0x058,
114262306a36Sopenharmony_ci	SUNI_PMON_FBE_EVT_CNT_MSB	= 0x05c,
114362306a36Sopenharmony_ci	SUNI_PMON_SEZ_DET_CNT_LSB	= 0x060,
114462306a36Sopenharmony_ci	SUNI_PMON_SEZ_DET_CNT_MSB	= 0x064,
114562306a36Sopenharmony_ci	SUNI_PMON_PE_EVT_CNT_LSB	= 0x068,
114662306a36Sopenharmony_ci	SUNI_PMON_PE_EVT_CNT_MSB	= 0x06c,
114762306a36Sopenharmony_ci	SUNI_PMON_PPE_EVT_CNT_LSB	= 0x070,
114862306a36Sopenharmony_ci	SUNI_PMON_PPE_EVT_CNT_MSB	= 0x074,
114962306a36Sopenharmony_ci	SUNI_PMON_FEBE_EVT_CNT_LSB	= 0x078,
115062306a36Sopenharmony_ci	SUNI_PMON_FEBE_EVT_CNT_MSB	= 0x07c,
115162306a36Sopenharmony_ci	SUNI_DS3_TRAN_CFG		= 0x080,
115262306a36Sopenharmony_ci	SUNI_DS3_TRAN_DIAG		= 0x084,
115362306a36Sopenharmony_ci	/* SUNI_RESERVED2 (0x23 - 0x21) */
115462306a36Sopenharmony_ci	SUNI_XFDL_CFG			= 0x090,
115562306a36Sopenharmony_ci	SUNI_XFDL_INTR_ST		= 0x094,
115662306a36Sopenharmony_ci	SUNI_XFDL_XMIT_DATA		= 0x098,
115762306a36Sopenharmony_ci	SUNI_XBOC_CODE			= 0x09c,
115862306a36Sopenharmony_ci	SUNI_SPLR_CFG			= 0x0a0,
115962306a36Sopenharmony_ci	SUNI_SPLR_INTR_EN		= 0x0a4,
116062306a36Sopenharmony_ci	SUNI_SPLR_INTR_ST		= 0x0a8,
116162306a36Sopenharmony_ci	SUNI_SPLR_STATUS		= 0x0ac,
116262306a36Sopenharmony_ci	SUNI_SPLT_CFG			= 0x0b0,
116362306a36Sopenharmony_ci	SUNI_SPLT_CNTL			= 0x0b4,
116462306a36Sopenharmony_ci	SUNI_SPLT_DIAG_G1		= 0x0b8,
116562306a36Sopenharmony_ci	SUNI_SPLT_F1			= 0x0bc,
116662306a36Sopenharmony_ci	SUNI_CPPM_LOC_METERS		= 0x0c0,
116762306a36Sopenharmony_ci	SUNI_CPPM_CHG_OF_CPPM_PERF_METR	= 0x0c4,
116862306a36Sopenharmony_ci	SUNI_CPPM_B1_ERR_CNT_LSB	= 0x0c8,
116962306a36Sopenharmony_ci	SUNI_CPPM_B1_ERR_CNT_MSB	= 0x0cc,
117062306a36Sopenharmony_ci	SUNI_CPPM_FRAMING_ERR_CNT_LSB	= 0x0d0,
117162306a36Sopenharmony_ci	SUNI_CPPM_FRAMING_ERR_CNT_MSB	= 0x0d4,
117262306a36Sopenharmony_ci	SUNI_CPPM_FEBE_CNT_LSB		= 0x0d8,
117362306a36Sopenharmony_ci	SUNI_CPPM_FEBE_CNT_MSB		= 0x0dc,
117462306a36Sopenharmony_ci	SUNI_CPPM_HCS_ERR_CNT_LSB	= 0x0e0,
117562306a36Sopenharmony_ci	SUNI_CPPM_HCS_ERR_CNT_MSB	= 0x0e4,
117662306a36Sopenharmony_ci	SUNI_CPPM_IDLE_UN_CELL_CNT_LSB	= 0x0e8,
117762306a36Sopenharmony_ci	SUNI_CPPM_IDLE_UN_CELL_CNT_MSB	= 0x0ec,
117862306a36Sopenharmony_ci	SUNI_CPPM_RCV_CELL_CNT_LSB	= 0x0f0,
117962306a36Sopenharmony_ci	SUNI_CPPM_RCV_CELL_CNT_MSB	= 0x0f4,
118062306a36Sopenharmony_ci	SUNI_CPPM_XMIT_CELL_CNT_LSB	= 0x0f8,
118162306a36Sopenharmony_ci	SUNI_CPPM_XMIT_CELL_CNT_MSB	= 0x0fc,
118262306a36Sopenharmony_ci	SUNI_RXCP_CTRL			= 0x100,
118362306a36Sopenharmony_ci	SUNI_RXCP_FCTRL			= 0x104,
118462306a36Sopenharmony_ci	SUNI_RXCP_INTR_EN_STS		= 0x108,
118562306a36Sopenharmony_ci	SUNI_RXCP_IDLE_PAT_H1		= 0x10c,
118662306a36Sopenharmony_ci	SUNI_RXCP_IDLE_PAT_H2		= 0x110,
118762306a36Sopenharmony_ci	SUNI_RXCP_IDLE_PAT_H3		= 0x114,
118862306a36Sopenharmony_ci	SUNI_RXCP_IDLE_PAT_H4		= 0x118,
118962306a36Sopenharmony_ci	SUNI_RXCP_IDLE_MASK_H1		= 0x11c,
119062306a36Sopenharmony_ci	SUNI_RXCP_IDLE_MASK_H2		= 0x120,
119162306a36Sopenharmony_ci	SUNI_RXCP_IDLE_MASK_H3		= 0x124,
119262306a36Sopenharmony_ci	SUNI_RXCP_IDLE_MASK_H4		= 0x128,
119362306a36Sopenharmony_ci	SUNI_RXCP_CELL_PAT_H1		= 0x12c,
119462306a36Sopenharmony_ci	SUNI_RXCP_CELL_PAT_H2		= 0x130,
119562306a36Sopenharmony_ci	SUNI_RXCP_CELL_PAT_H3		= 0x134,
119662306a36Sopenharmony_ci	SUNI_RXCP_CELL_PAT_H4		= 0x138,
119762306a36Sopenharmony_ci	SUNI_RXCP_CELL_MASK_H1		= 0x13c,
119862306a36Sopenharmony_ci	SUNI_RXCP_CELL_MASK_H2		= 0x140,
119962306a36Sopenharmony_ci	SUNI_RXCP_CELL_MASK_H3		= 0x144,
120062306a36Sopenharmony_ci	SUNI_RXCP_CELL_MASK_H4		= 0x148,
120162306a36Sopenharmony_ci	SUNI_RXCP_HCS_CS		= 0x14c,
120262306a36Sopenharmony_ci	SUNI_RXCP_LCD_CNT_THRESHOLD	= 0x150,
120362306a36Sopenharmony_ci	/* SUNI_RESERVED3 (0x57 - 0x54) */
120462306a36Sopenharmony_ci	SUNI_TXCP_CTRL			= 0x160,
120562306a36Sopenharmony_ci	SUNI_TXCP_INTR_EN_STS		= 0x164,
120662306a36Sopenharmony_ci	SUNI_TXCP_IDLE_PAT_H1		= 0x168,
120762306a36Sopenharmony_ci	SUNI_TXCP_IDLE_PAT_H2		= 0x16c,
120862306a36Sopenharmony_ci	SUNI_TXCP_IDLE_PAT_H3		= 0x170,
120962306a36Sopenharmony_ci	SUNI_TXCP_IDLE_PAT_H4		= 0x174,
121062306a36Sopenharmony_ci	SUNI_TXCP_IDLE_PAT_H5		= 0x178,
121162306a36Sopenharmony_ci	SUNI_TXCP_IDLE_PAYLOAD		= 0x17c,
121262306a36Sopenharmony_ci	SUNI_E3_FRM_FRAM_OPTIONS	= 0x180,
121362306a36Sopenharmony_ci	SUNI_E3_FRM_MAINT_OPTIONS	= 0x184,
121462306a36Sopenharmony_ci	SUNI_E3_FRM_FRAM_INTR_ENBL	= 0x188,
121562306a36Sopenharmony_ci	SUNI_E3_FRM_FRAM_INTR_IND_STAT	= 0x18c,
121662306a36Sopenharmony_ci	SUNI_E3_FRM_MAINT_INTR_ENBL	= 0x190,
121762306a36Sopenharmony_ci	SUNI_E3_FRM_MAINT_INTR_IND	= 0x194,
121862306a36Sopenharmony_ci	SUNI_E3_FRM_MAINT_STAT		= 0x198,
121962306a36Sopenharmony_ci	SUNI_RESERVED4			= 0x19c,
122062306a36Sopenharmony_ci	SUNI_E3_TRAN_FRAM_OPTIONS	= 0x1a0,
122162306a36Sopenharmony_ci	SUNI_E3_TRAN_STAT_DIAG_OPTIONS	= 0x1a4,
122262306a36Sopenharmony_ci	SUNI_E3_TRAN_BIP_8_ERR_MASK	= 0x1a8,
122362306a36Sopenharmony_ci	SUNI_E3_TRAN_MAINT_ADAPT_OPTS	= 0x1ac,
122462306a36Sopenharmony_ci	SUNI_TTB_CTRL			= 0x1b0,
122562306a36Sopenharmony_ci	SUNI_TTB_TRAIL_TRACE_ID_STAT	= 0x1b4,
122662306a36Sopenharmony_ci	SUNI_TTB_IND_ADDR		= 0x1b8,
122762306a36Sopenharmony_ci	SUNI_TTB_IND_DATA		= 0x1bc,
122862306a36Sopenharmony_ci	SUNI_TTB_EXP_PAYLOAD_TYPE	= 0x1c0,
122962306a36Sopenharmony_ci	SUNI_TTB_PAYLOAD_TYPE_CTRL_STAT	= 0x1c4,
123062306a36Sopenharmony_ci	/* SUNI_PAD5 (0x7f - 0x71) */
123162306a36Sopenharmony_ci	SUNI_MASTER_TEST		= 0x200,
123262306a36Sopenharmony_ci	/* SUNI_PAD6 (0xff - 0x80) */
123362306a36Sopenharmony_ci};
123462306a36Sopenharmony_ci
123562306a36Sopenharmony_ci#define SUNI_PM7345_T suni_pm7345_t
123662306a36Sopenharmony_ci#define SUNI_PM7345     0x20            /* Suni chip type */
123762306a36Sopenharmony_ci#define SUNI_PM5346     0x30            /* Suni chip type */
123862306a36Sopenharmony_ci/*
123962306a36Sopenharmony_ci * SUNI_PM7345 Configuration
124062306a36Sopenharmony_ci */
124162306a36Sopenharmony_ci#define SUNI_PM7345_CLB         0x01    /* Cell loopback        */
124262306a36Sopenharmony_ci#define SUNI_PM7345_PLB         0x02    /* Payload loopback     */
124362306a36Sopenharmony_ci#define SUNI_PM7345_DLB         0x04    /* Diagnostic loopback  */
124462306a36Sopenharmony_ci#define SUNI_PM7345_LLB         0x80    /* Line loopback        */
124562306a36Sopenharmony_ci#define SUNI_PM7345_E3ENBL      0x40    /* E3 enable bit        */
124662306a36Sopenharmony_ci#define SUNI_PM7345_LOOPT       0x10    /* LOOPT enable bit     */
124762306a36Sopenharmony_ci#define SUNI_PM7345_FIFOBP      0x20    /* FIFO bypass          */
124862306a36Sopenharmony_ci#define SUNI_PM7345_FRMRBP      0x08    /* Framer bypass        */
124962306a36Sopenharmony_ci/*
125062306a36Sopenharmony_ci * DS3 FRMR Interrupt Enable
125162306a36Sopenharmony_ci */
125262306a36Sopenharmony_ci#define SUNI_DS3_COFAE  0x80            /* Enable change of frame align */
125362306a36Sopenharmony_ci#define SUNI_DS3_REDE   0x40            /* Enable DS3 RED state intr    */
125462306a36Sopenharmony_ci#define SUNI_DS3_CBITE  0x20            /* Enable Appl ID channel intr  */
125562306a36Sopenharmony_ci#define SUNI_DS3_FERFE  0x10            /* Enable Far End Receive Failure intr*/
125662306a36Sopenharmony_ci#define SUNI_DS3_IDLE   0x08            /* Enable Idle signal intr      */
125762306a36Sopenharmony_ci#define SUNI_DS3_AISE   0x04            /* Enable Alarm Indication signal intr*/
125862306a36Sopenharmony_ci#define SUNI_DS3_OOFE   0x02            /* Enable Out of frame intr     */
125962306a36Sopenharmony_ci#define SUNI_DS3_LOSE   0x01            /* Enable Loss of signal intr   */
126062306a36Sopenharmony_ci
126162306a36Sopenharmony_ci/*
126262306a36Sopenharmony_ci * DS3 FRMR Status
126362306a36Sopenharmony_ci */
126462306a36Sopenharmony_ci#define SUNI_DS3_ACE    0x80            /* Additional Configuration Reg */
126562306a36Sopenharmony_ci#define SUNI_DS3_REDV   0x40            /* DS3 RED state                */
126662306a36Sopenharmony_ci#define SUNI_DS3_CBITV  0x20            /* Application ID channel state */
126762306a36Sopenharmony_ci#define SUNI_DS3_FERFV  0x10            /* Far End Receive Failure state*/
126862306a36Sopenharmony_ci#define SUNI_DS3_IDLV   0x08            /* Idle signal state            */
126962306a36Sopenharmony_ci#define SUNI_DS3_AISV   0x04            /* Alarm Indication signal state*/
127062306a36Sopenharmony_ci#define SUNI_DS3_OOFV   0x02            /* Out of frame state           */
127162306a36Sopenharmony_ci#define SUNI_DS3_LOSV   0x01            /* Loss of signal state         */
127262306a36Sopenharmony_ci
127362306a36Sopenharmony_ci/*
127462306a36Sopenharmony_ci * E3 FRMR Interrupt/Status
127562306a36Sopenharmony_ci */
127662306a36Sopenharmony_ci#define SUNI_E3_CZDI    0x40            /* Consecutive Zeros indicator  */
127762306a36Sopenharmony_ci#define SUNI_E3_LOSI    0x20            /* Loss of signal intr status   */
127862306a36Sopenharmony_ci#define SUNI_E3_LCVI    0x10            /* Line code violation intr     */
127962306a36Sopenharmony_ci#define SUNI_E3_COFAI   0x08            /* Change of frame align intr   */
128062306a36Sopenharmony_ci#define SUNI_E3_OOFI    0x04            /* Out of frame intr status     */
128162306a36Sopenharmony_ci#define SUNI_E3_LOS     0x02            /* Loss of signal state         */
128262306a36Sopenharmony_ci#define SUNI_E3_OOF     0x01            /* Out of frame state           */
128362306a36Sopenharmony_ci
128462306a36Sopenharmony_ci/*
128562306a36Sopenharmony_ci * E3 FRMR Maintenance Status
128662306a36Sopenharmony_ci */
128762306a36Sopenharmony_ci#define SUNI_E3_AISD    0x80            /* Alarm Indication signal state*/
128862306a36Sopenharmony_ci#define SUNI_E3_FERF_RAI        0x40    /* FERF/RAI indicator           */
128962306a36Sopenharmony_ci#define SUNI_E3_FEBE    0x20            /* Far End Block Error indicator*/
129062306a36Sopenharmony_ci
129162306a36Sopenharmony_ci/*
129262306a36Sopenharmony_ci * RXCP Control/Status
129362306a36Sopenharmony_ci */
129462306a36Sopenharmony_ci#define SUNI_DS3_HCSPASS        0x80    /* Pass cell with HEC errors    */
129562306a36Sopenharmony_ci#define SUNI_DS3_HCSDQDB        0x40    /* Control octets in HCS calc   */
129662306a36Sopenharmony_ci#define SUNI_DS3_HCSADD         0x20    /* Add coset poly               */
129762306a36Sopenharmony_ci#define SUNI_DS3_HCK            0x10    /* Control FIFO data path integ chk*/
129862306a36Sopenharmony_ci#define SUNI_DS3_BLOCK          0x08    /* Enable cell filtering        */
129962306a36Sopenharmony_ci#define SUNI_DS3_DSCR           0x04    /* Disable payload descrambling */
130062306a36Sopenharmony_ci#define SUNI_DS3_OOCDV          0x02    /* Cell delineation state       */
130162306a36Sopenharmony_ci#define SUNI_DS3_FIFORST        0x01    /* Cell FIFO reset              */
130262306a36Sopenharmony_ci
130362306a36Sopenharmony_ci/*
130462306a36Sopenharmony_ci * RXCP Interrupt Enable/Status
130562306a36Sopenharmony_ci */
130662306a36Sopenharmony_ci#define SUNI_DS3_OOCDE  0x80            /* Intr enable, change in CDS   */
130762306a36Sopenharmony_ci#define SUNI_DS3_HCSE   0x40            /* Intr enable, corr HCS errors */
130862306a36Sopenharmony_ci#define SUNI_DS3_FIFOE  0x20            /* Intr enable, unco HCS errors */
130962306a36Sopenharmony_ci#define SUNI_DS3_OOCDI  0x10            /* SYNC state                   */
131062306a36Sopenharmony_ci#define SUNI_DS3_UHCSI  0x08            /* Uncorr. HCS errors detected  */
131162306a36Sopenharmony_ci#define SUNI_DS3_COCAI  0x04            /* Corr. HCS errors detected    */
131262306a36Sopenharmony_ci#define SUNI_DS3_FOVRI  0x02            /* FIFO overrun                 */
131362306a36Sopenharmony_ci#define SUNI_DS3_FUDRI  0x01            /* FIFO underrun                */
131462306a36Sopenharmony_ci
131562306a36Sopenharmony_ci///////////////////SUNI_PM7345 PHY DEFINE END /////////////////////////////
131662306a36Sopenharmony_ci
131762306a36Sopenharmony_ci/* ia_eeprom define*/
131862306a36Sopenharmony_ci#define MEM_SIZE_MASK   0x000F          /* mask of 4 bits defining memory size*/
131962306a36Sopenharmony_ci#define MEM_SIZE_128K   0x0000          /* board has 128k buffer */
132062306a36Sopenharmony_ci#define MEM_SIZE_512K   0x0001          /* board has 512K of buffer */
132162306a36Sopenharmony_ci#define MEM_SIZE_1M     0x0002          /* board has 1M of buffer */
132262306a36Sopenharmony_ci                                        /* 0x3 to 0xF are reserved for future */
132362306a36Sopenharmony_ci
132462306a36Sopenharmony_ci#define FE_MASK         0x00F0          /* mask of 4 bits defining FE type */
132562306a36Sopenharmony_ci#define FE_MULTI_MODE   0x0000          /* 155 MBit multimode fiber */
132662306a36Sopenharmony_ci#define FE_SINGLE_MODE  0x0010          /* 155 MBit single mode laser */
132762306a36Sopenharmony_ci#define FE_UTP_OPTION   0x0020          /* 155 MBit UTP front end */
132862306a36Sopenharmony_ci
132962306a36Sopenharmony_ci#define	NOVRAM_SIZE	64
133062306a36Sopenharmony_ci#define	CMD_LEN		10
133162306a36Sopenharmony_ci
133262306a36Sopenharmony_ci/***********
133362306a36Sopenharmony_ci *
133462306a36Sopenharmony_ci *	Switches and defines for header files.
133562306a36Sopenharmony_ci *
133662306a36Sopenharmony_ci *	The following defines are used to turn on and off
133762306a36Sopenharmony_ci *	various options in the header files. Primarily useful
133862306a36Sopenharmony_ci *	for debugging.
133962306a36Sopenharmony_ci *
134062306a36Sopenharmony_ci ***********/
134162306a36Sopenharmony_ci
134262306a36Sopenharmony_ci/*
134362306a36Sopenharmony_ci * a list of the commands that can be sent to the NOVRAM
134462306a36Sopenharmony_ci */
134562306a36Sopenharmony_ci
134662306a36Sopenharmony_ci#define	EXTEND	0x100
134762306a36Sopenharmony_ci#define	IAWRITE	0x140
134862306a36Sopenharmony_ci#define	IAREAD	0x180
134962306a36Sopenharmony_ci#define	ERASE	0x1c0
135062306a36Sopenharmony_ci
135162306a36Sopenharmony_ci#define	EWDS	0x00
135262306a36Sopenharmony_ci#define	WRAL	0x10
135362306a36Sopenharmony_ci#define	ERAL	0x20
135462306a36Sopenharmony_ci#define	EWEN	0x30
135562306a36Sopenharmony_ci
135662306a36Sopenharmony_ci/*
135762306a36Sopenharmony_ci * these bits duplicate the hw_flip.h register settings
135862306a36Sopenharmony_ci * note: how the data in / out bits are defined in the flipper specification
135962306a36Sopenharmony_ci */
136062306a36Sopenharmony_ci
136162306a36Sopenharmony_ci#define	NVCE	0x02
136262306a36Sopenharmony_ci#define	NVSK	0x01
136362306a36Sopenharmony_ci#define	NVDO	0x08
136462306a36Sopenharmony_ci#define NVDI	0x04
136562306a36Sopenharmony_ci/***********************
136662306a36Sopenharmony_ci *
136762306a36Sopenharmony_ci * This define ands the value and the current config register and puts
136862306a36Sopenharmony_ci * the result in the config register
136962306a36Sopenharmony_ci *
137062306a36Sopenharmony_ci ***********************/
137162306a36Sopenharmony_ci
137262306a36Sopenharmony_ci#define	CFG_AND(val) { \
137362306a36Sopenharmony_ci		u32 t; \
137462306a36Sopenharmony_ci		t = readl(iadev->reg+IPHASE5575_EEPROM_ACCESS); \
137562306a36Sopenharmony_ci		t &= (val); \
137662306a36Sopenharmony_ci		writel(t, iadev->reg+IPHASE5575_EEPROM_ACCESS); \
137762306a36Sopenharmony_ci	}
137862306a36Sopenharmony_ci
137962306a36Sopenharmony_ci/***********************
138062306a36Sopenharmony_ci *
138162306a36Sopenharmony_ci * This define ors the value and the current config register and puts
138262306a36Sopenharmony_ci * the result in the config register
138362306a36Sopenharmony_ci *
138462306a36Sopenharmony_ci ***********************/
138562306a36Sopenharmony_ci
138662306a36Sopenharmony_ci#define	CFG_OR(val) { \
138762306a36Sopenharmony_ci		u32 t; \
138862306a36Sopenharmony_ci		t =  readl(iadev->reg+IPHASE5575_EEPROM_ACCESS); \
138962306a36Sopenharmony_ci		t |= (val); \
139062306a36Sopenharmony_ci		writel(t, iadev->reg+IPHASE5575_EEPROM_ACCESS); \
139162306a36Sopenharmony_ci	}
139262306a36Sopenharmony_ci
139362306a36Sopenharmony_ci/***********************
139462306a36Sopenharmony_ci *
139562306a36Sopenharmony_ci * Send a command to the NOVRAM, the command is in cmd.
139662306a36Sopenharmony_ci *
139762306a36Sopenharmony_ci * clear CE and SK. Then assert CE.
139862306a36Sopenharmony_ci * Clock each of the command bits out in the correct order with SK
139962306a36Sopenharmony_ci * exit with CE still asserted
140062306a36Sopenharmony_ci *
140162306a36Sopenharmony_ci ***********************/
140262306a36Sopenharmony_ci
140362306a36Sopenharmony_ci#define	NVRAM_CMD(cmd) { \
140462306a36Sopenharmony_ci		int	i; \
140562306a36Sopenharmony_ci		u_short c = cmd; \
140662306a36Sopenharmony_ci		CFG_AND(~(NVCE|NVSK)); \
140762306a36Sopenharmony_ci		CFG_OR(NVCE); \
140862306a36Sopenharmony_ci		for (i=0; i<CMD_LEN; i++) { \
140962306a36Sopenharmony_ci			NVRAM_CLKOUT((c & (1 << (CMD_LEN - 1))) ? 1 : 0); \
141062306a36Sopenharmony_ci			c <<= 1; \
141162306a36Sopenharmony_ci		} \
141262306a36Sopenharmony_ci	}
141362306a36Sopenharmony_ci
141462306a36Sopenharmony_ci/***********************
141562306a36Sopenharmony_ci *
141662306a36Sopenharmony_ci * clear the CE, this must be used after each command is complete
141762306a36Sopenharmony_ci *
141862306a36Sopenharmony_ci ***********************/
141962306a36Sopenharmony_ci
142062306a36Sopenharmony_ci#define	NVRAM_CLR_CE	{CFG_AND(~NVCE)}
142162306a36Sopenharmony_ci
142262306a36Sopenharmony_ci/***********************
142362306a36Sopenharmony_ci *
142462306a36Sopenharmony_ci * clock the data bit in bitval out to the NOVRAM.  The bitval must be
142562306a36Sopenharmony_ci * a 1 or 0, or the clockout operation is undefined
142662306a36Sopenharmony_ci *
142762306a36Sopenharmony_ci ***********************/
142862306a36Sopenharmony_ci
142962306a36Sopenharmony_ci#define	NVRAM_CLKOUT(bitval) { \
143062306a36Sopenharmony_ci		CFG_AND(~NVDI); \
143162306a36Sopenharmony_ci		CFG_OR((bitval) ? NVDI : 0); \
143262306a36Sopenharmony_ci		CFG_OR(NVSK); \
143362306a36Sopenharmony_ci		CFG_AND( ~NVSK); \
143462306a36Sopenharmony_ci	}
143562306a36Sopenharmony_ci
143662306a36Sopenharmony_ci/***********************
143762306a36Sopenharmony_ci *
143862306a36Sopenharmony_ci * clock the data bit in and return a 1 or 0, depending on the value
143962306a36Sopenharmony_ci * that was received from the NOVRAM
144062306a36Sopenharmony_ci *
144162306a36Sopenharmony_ci ***********************/
144262306a36Sopenharmony_ci
144362306a36Sopenharmony_ci#define	NVRAM_CLKIN(value) { \
144462306a36Sopenharmony_ci		u32 _t; \
144562306a36Sopenharmony_ci		CFG_OR(NVSK); \
144662306a36Sopenharmony_ci		CFG_AND(~NVSK); \
144762306a36Sopenharmony_ci		_t = readl(iadev->reg+IPHASE5575_EEPROM_ACCESS); \
144862306a36Sopenharmony_ci		value = (_t & NVDO) ? 1 : 0; \
144962306a36Sopenharmony_ci	}
145062306a36Sopenharmony_ci
145162306a36Sopenharmony_ci
145262306a36Sopenharmony_ci#endif /* IPHASE_H */
1453