0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 #ifndef IPHASE_H
0044 #define IPHASE_H
0045
0046
0047
0048
0049 #define IF_IADBG_INIT_ADAPTER 0x00000001
0050 #define IF_IADBG_TX 0x00000002
0051 #define IF_IADBG_RX 0x00000004
0052 #define IF_IADBG_QUERY_INFO 0x00000008
0053 #define IF_IADBG_SHUTDOWN 0x00000010
0054 #define IF_IADBG_INTR 0x00000020
0055 #define IF_IADBG_TXPKT 0x00000040
0056 #define IF_IADBG_RXPKT 0x00000080
0057 #define IF_IADBG_ERR 0x00000100
0058 #define IF_IADBG_EVENT 0x00000200
0059 #define IF_IADBG_DIS_INTR 0x00001000
0060 #define IF_IADBG_EN_INTR 0x00002000
0061 #define IF_IADBG_LOUD 0x00004000
0062 #define IF_IADBG_VERY_LOUD 0x00008000
0063 #define IF_IADBG_CBR 0x00100000
0064 #define IF_IADBG_UBR 0x00200000
0065 #define IF_IADBG_ABR 0x00400000
0066 #define IF_IADBG_DESC 0x01000000
0067 #define IF_IADBG_SUNI_STAT 0x02000000
0068 #define IF_IADBG_RESET 0x04000000
0069
0070 #define IF_IADBG(f) if (IADebugFlag & (f))
0071
0072 #ifdef CONFIG_ATM_IA_DEBUG
0073
0074 #define IF_LOUD(A) IF_IADBG(IF_IADBG_LOUD) { A }
0075 #define IF_ERR(A) IF_IADBG(IF_IADBG_ERR) { A }
0076 #define IF_VERY_LOUD(A) IF_IADBG( IF_IADBG_VERY_LOUD ) { A }
0077
0078 #define IF_INIT_ADAPTER(A) IF_IADBG( IF_IADBG_INIT_ADAPTER ) { A }
0079 #define IF_INIT(A) IF_IADBG( IF_IADBG_INIT_ADAPTER ) { A }
0080 #define IF_SUNI_STAT(A) IF_IADBG( IF_IADBG_SUNI_STAT ) { A }
0081 #define IF_QUERY_INFO(A) IF_IADBG( IF_IADBG_QUERY_INFO ) { A }
0082 #define IF_COPY_OVER(A) IF_IADBG( IF_IADBG_COPY_OVER ) { A }
0083
0084 #define IF_INTR(A) IF_IADBG( IF_IADBG_INTR ) { A }
0085 #define IF_DIS_INTR(A) IF_IADBG( IF_IADBG_DIS_INTR ) { A }
0086 #define IF_EN_INTR(A) IF_IADBG( IF_IADBG_EN_INTR ) { A }
0087
0088 #define IF_TX(A) IF_IADBG( IF_IADBG_TX ) { A }
0089 #define IF_RX(A) IF_IADBG( IF_IADBG_RX ) { A }
0090 #define IF_TXPKT(A) IF_IADBG( IF_IADBG_TXPKT ) { A }
0091 #define IF_RXPKT(A) IF_IADBG( IF_IADBG_RXPKT ) { A }
0092
0093 #define IF_SHUTDOWN(A) IF_IADBG(IF_IADBG_SHUTDOWN) { A }
0094 #define IF_CBR(A) IF_IADBG( IF_IADBG_CBR ) { A }
0095 #define IF_UBR(A) IF_IADBG( IF_IADBG_UBR ) { A }
0096 #define IF_ABR(A) IF_IADBG( IF_IADBG_ABR ) { A }
0097 #define IF_EVENT(A) IF_IADBG( IF_IADBG_EVENT) { A }
0098
0099 #else
0100 #define IF_LOUD(A)
0101 #define IF_VERY_LOUD(A)
0102 #define IF_INIT_ADAPTER(A)
0103 #define IF_INIT(A)
0104 #define IF_SUNI_STAT(A)
0105 #define IF_PVC_CHKPKT(A)
0106 #define IF_QUERY_INFO(A)
0107 #define IF_COPY_OVER(A)
0108 #define IF_HANG(A)
0109 #define IF_INTR(A)
0110 #define IF_DIS_INTR(A)
0111 #define IF_EN_INTR(A)
0112 #define IF_TX(A)
0113 #define IF_RX(A)
0114 #define IF_TXDEBUG(A)
0115 #define IF_VC(A)
0116 #define IF_ERR(A)
0117 #define IF_CBR(A)
0118 #define IF_UBR(A)
0119 #define IF_ABR(A)
0120 #define IF_SHUTDOWN(A)
0121 #define DbgPrint(A)
0122 #define IF_EVENT(A)
0123 #define IF_TXPKT(A)
0124 #define IF_RXPKT(A)
0125 #endif
0126
0127 #define ATM_DESC(skb) (skb->protocol)
0128 #define IA_SKB_STATE(skb) (skb->protocol)
0129 #define IA_DLED 1
0130 #define IA_TX_DONE 2
0131
0132
0133 #define IA_CMD 0x7749
0134 typedef struct {
0135 int cmd;
0136 int sub_cmd;
0137 int len;
0138 u32 maddr;
0139 int status;
0140 void __user *buf;
0141 } IA_CMDBUF, *PIA_CMDBUF;
0142
0143
0144 #define MEMDUMP 0x01
0145
0146
0147 #define MEMDUMP_SEGREG 0x2
0148 #define MEMDUMP_DEV 0x1
0149 #define MEMDUMP_REASSREG 0x3
0150 #define MEMDUMP_FFL 0x4
0151 #define READ_REG 0x5
0152 #define WAKE_DBG_WAIT 0x6
0153
0154
0155
0156 #define Boolean(x) ((x) ? 1 : 0)
0157 #define NR_VCI 1024
0158 #define NR_VCI_LD 10
0159 #define NR_VCI_4K 4096
0160 #define NR_VCI_4K_LD 12
0161 #define MEM_VALID 0xfffffff0
0162
0163 #ifndef PCI_VENDOR_ID_IPHASE
0164 #define PCI_VENDOR_ID_IPHASE 0x107e
0165 #endif
0166 #ifndef PCI_DEVICE_ID_IPHASE_5575
0167 #define PCI_DEVICE_ID_IPHASE_5575 0x0008
0168 #endif
0169 #define DEV_LABEL "ia"
0170 #define PCR 207692
0171 #define ICR 100000
0172 #define MCR 0
0173 #define TBE 1000
0174 #define FRTT 1
0175 #define RIF 2
0176 #define RDF 4
0177 #define NRMCODE 5
0178 #define TRMCODE 3
0179 #define CDFCODE 6
0180 #define ATDFCODE 2
0181
0182
0183 #define TX_PACKET_RAM 0x00000
0184 #define DFL_TX_BUF_SZ 10240
0185 #define DFL_TX_BUFFERS 50
0186
0187 #define REASS_RAM_SIZE 0x10000
0188 #define RX_PACKET_RAM 0x80000
0189 #define DFL_RX_BUF_SZ 10240
0190 #define DFL_RX_BUFFERS 50
0191
0192
0193 struct cpcs_trailer
0194 {
0195 u_short control;
0196 u_short length;
0197 u_int crc32;
0198 };
0199
0200 struct cpcs_trailer_desc
0201 {
0202 struct cpcs_trailer *cpcs;
0203 dma_addr_t dma_addr;
0204 };
0205
0206 struct ia_vcc
0207 {
0208 int rxing;
0209 int txing;
0210 int NumCbrEntry;
0211 u32 pcr;
0212 u32 saved_tx_quota;
0213 int flow_inc;
0214 struct sk_buff_head txing_skb;
0215 int ltimeout;
0216 u8 vc_desc_cnt;
0217
0218 };
0219
0220 struct abr_vc_table
0221 {
0222 u_char status;
0223 u_char rdf;
0224 u_short air;
0225 u_int res[3];
0226 u_int req_rm_cell_data1;
0227 u_int req_rm_cell_data2;
0228 u_int add_rm_cell_data1;
0229 u_int add_rm_cell_data2;
0230 };
0231
0232
0233 struct main_vc
0234 {
0235 u_short type;
0236 #define ABR 0x8000
0237 #define UBR 0xc000
0238 #define CBR 0x0000
0239
0240 u_short nrm;
0241 u_short trm;
0242 u_short rm_timestamp_hi;
0243 u_short rm_timestamp_lo:8,
0244 crm:8;
0245 u_short remainder;
0246 u_short next_vc_sched;
0247 u_short present_desc;
0248 u_short last_cell_slot;
0249 u_short pcr;
0250 u_short fraction;
0251 u_short icr;
0252 u_short atdf;
0253 u_short mcr;
0254 u_short acr;
0255 u_short unack:8,
0256 status:8;
0257 #define UIOLI 0x80
0258 #define CRC_APPEND 0x40
0259 #define ABR_STATE 0x02
0260
0261 };
0262
0263
0264
0265 struct ext_vc
0266 {
0267 u_short atm_hdr1;
0268 u_short atm_hdr2;
0269 u_short last_desc;
0270 u_short out_of_rate_link;
0271 };
0272
0273
0274 #define DLE_ENTRIES 256
0275 #define DMA_INT_ENABLE 0x0002
0276 #define TX_DLE_PSI 0x0001
0277 #define DLE_TOTAL_SIZE (sizeof(struct dle)*DLE_ENTRIES)
0278
0279
0280 struct dle
0281 {
0282 u32 sys_pkt_addr;
0283 u32 local_pkt_addr;
0284 u32 bytes;
0285 u16 prq_wr_ptr_data;
0286 u16 mode;
0287 };
0288
0289 struct dle_q
0290 {
0291 struct dle *start;
0292 struct dle *end;
0293 struct dle *read;
0294 struct dle *write;
0295 };
0296
0297 struct free_desc_q
0298 {
0299 int desc;
0300 struct free_desc_q *next;
0301 };
0302
0303 struct tx_buf_desc {
0304 unsigned short desc_mode;
0305 unsigned short vc_index;
0306 unsigned short res1;
0307 unsigned short bytes;
0308 unsigned short buf_start_hi;
0309 unsigned short buf_start_lo;
0310 unsigned short res2[10];
0311 };
0312
0313
0314 struct rx_buf_desc {
0315 unsigned short desc_mode;
0316 unsigned short vc_index;
0317 unsigned short vpi;
0318 unsigned short bytes;
0319 unsigned short buf_start_hi;
0320 unsigned short buf_start_lo;
0321 unsigned short dma_start_hi;
0322 unsigned short dma_start_lo;
0323 unsigned short crc_upper;
0324 unsigned short crc_lower;
0325 unsigned short res:8, timeout:8;
0326 unsigned short res2[5];
0327 };
0328
0329
0330
0331 #define EPROM_SIZE 0x40000
0332 #define MAC1_LEN 4
0333 #define MAC2_LEN 2
0334
0335
0336 #define IPHASE5575_PCI_CONFIG_REG_BASE 0x0000
0337 #define IPHASE5575_BUS_CONTROL_REG_BASE 0x1000
0338 #define IPHASE5575_FRAG_CONTROL_REG_BASE 0x2000
0339 #define IPHASE5575_REASS_CONTROL_REG_BASE 0x3000
0340 #define IPHASE5575_DMA_CONTROL_REG_BASE 0x4000
0341 #define IPHASE5575_FRONT_END_REG_BASE IPHASE5575_DMA_CONTROL_REG_BASE
0342 #define IPHASE5575_FRAG_CONTROL_RAM_BASE 0x10000
0343 #define IPHASE5575_REASS_CONTROL_RAM_BASE 0x20000
0344
0345
0346 #define IPHASE5575_BUS_CONTROL_REG 0x00
0347 #define IPHASE5575_BUS_STATUS_REG 0x01
0348 #define IPHASE5575_MAC1 0x02
0349 #define IPHASE5575_REV 0x03
0350 #define IPHASE5575_MAC2 0x03
0351 #define IPHASE5575_EXT_RESET 0x04
0352 #define IPHASE5575_INT_RESET 0x05
0353 #define IPHASE5575_PCI_ADDR_PAGE 0x07
0354 #define IPHASE5575_EEPROM_ACCESS 0x0a
0355 #define IPHASE5575_CELL_FIFO_QUEUE_SZ 0x0b
0356 #define IPHASE5575_CELL_FIFO_MARK_STATE 0x0c
0357 #define IPHASE5575_CELL_FIFO_READ_PTR 0x0d
0358 #define IPHASE5575_CELL_FIFO_WRITE_PTR 0x0e
0359 #define IPHASE5575_CELL_FIFO_CELLS_AVL 0x0f
0360
0361
0362 #define CTRL_FE_RST 0x80000000
0363 #define CTRL_LED 0x40000000
0364 #define CTRL_25MBPHY 0x10000000
0365 #define CTRL_ENCMBMEM 0x08000000
0366 #define CTRL_ENOFFSEG 0x01000000
0367 #define CTRL_ERRMASK 0x00400000
0368 #define CTRL_DLETMASK 0x00100000
0369 #define CTRL_DLERMASK 0x00080000
0370 #define CTRL_FEMASK 0x00040000
0371 #define CTRL_SEGMASK 0x00020000
0372 #define CTRL_REASSMASK 0x00010000
0373 #define CTRL_CSPREEMPT 0x00002000
0374 #define CTRL_B128 0x00000200
0375 #define CTRL_B64 0x00000100
0376 #define CTRL_B48 0x00000080
0377 #define CTRL_B32 0x00000040
0378 #define CTRL_B16 0x00000020
0379 #define CTRL_B8 0x00000010
0380
0381
0382 #define STAT_CMEMSIZ 0xc0000000
0383 #define STAT_ADPARCK 0x20000000
0384 #define STAT_RESVD 0x1fffff80
0385 #define STAT_ERRINT 0x00000040
0386 #define STAT_MARKINT 0x00000020
0387 #define STAT_DLETINT 0x00000010
0388 #define STAT_DLERINT 0x00000008
0389 #define STAT_FEINT 0x00000004
0390 #define STAT_SEGINT 0x00000002
0391 #define STAT_REASSINT 0x00000001
0392
0393
0394
0395
0396
0397 #define IDLEHEADHI 0x00
0398 #define IDLEHEADLO 0x01
0399 #define MAXRATE 0x02
0400
0401 #define RATE155 0x64b1
0402 #define MAX_ATM_155 352768
0403 #define RATE25 0x5f9d
0404
0405 #define STPARMS 0x03
0406 #define STPARMS_1K 0x008c
0407 #define STPARMS_2K 0x0049
0408 #define STPARMS_4K 0x0026
0409 #define COMP_EN 0x4000
0410 #define CBR_EN 0x2000
0411 #define ABR_EN 0x0800
0412 #define UBR_EN 0x0400
0413
0414 #define ABRUBR_ARB 0x04
0415 #define RM_TYPE 0x05
0416
0417 #define RM_TYPE_4_0 0x0100
0418
0419 #define SEG_COMMAND_REG 0x17
0420
0421 #define RESET_SEG 0x0055
0422 #define RESET_SEG_STATE 0x00aa
0423 #define RESET_TX_CELL_CTR 0x00cc
0424
0425 #define CBR_PTR_BASE 0x20
0426 #define ABR_SBPTR_BASE 0x22
0427 #define UBR_SBPTR_BASE 0x23
0428 #define ABRWQ_BASE 0x26
0429 #define UBRWQ_BASE 0x27
0430 #define VCT_BASE 0x28
0431 #define VCTE_BASE 0x29
0432 #define CBR_TAB_BEG 0x2c
0433 #define CBR_TAB_END 0x2d
0434 #define PRQ_ST_ADR 0x30
0435 #define PRQ_ED_ADR 0x31
0436 #define PRQ_RD_PTR 0x32
0437 #define PRQ_WR_PTR 0x33
0438 #define TCQ_ST_ADR 0x34
0439 #define TCQ_ED_ADR 0x35
0440 #define TCQ_RD_PTR 0x36
0441 #define TCQ_WR_PTR 0x37
0442 #define SEG_QUEUE_BASE 0x40
0443 #define SEG_DESC_BASE 0x41
0444 #define MODE_REG_0 0x45
0445 #define T_ONLINE 0x0002
0446
0447 #define MODE_REG_1 0x46
0448 #define MODE_REG_1_VAL 0x0400
0449
0450 #define SEG_INTR_STATUS_REG 0x47
0451 #define SEG_MASK_REG 0x48
0452 #define TRANSMIT_DONE 0x0200
0453 #define TCQ_NOT_EMPTY 0x1000
0454
0455
0456 #define CELL_CTR_HIGH_AUTO 0x49
0457 #define CELL_CTR_HIGH_NOAUTO 0xc9
0458 #define CELL_CTR_LO_AUTO 0x4a
0459 #define CELL_CTR_LO_NOAUTO 0xca
0460
0461
0462 #define NEXTDESC 0x59
0463 #define NEXTVC 0x5a
0464 #define PSLOTCNT 0x5d
0465 #define NEWDN 0x6a
0466 #define NEWVC 0x6b
0467 #define SBPTR 0x6c
0468 #define ABRWQ_WRPTR 0x6f
0469 #define ABRWQ_RDPTR 0x70
0470 #define UBRWQ_WRPTR 0x71
0471 #define UBRWQ_RDPTR 0x72
0472 #define CBR_VC 0x73
0473 #define ABR_SBVC 0x75
0474 #define UBR_SBVC 0x76
0475 #define ABRNEXTLINK 0x78
0476 #define UBRNEXTLINK 0x79
0477
0478
0479
0480
0481
0482 #define MODE_REG 0x00
0483 #define R_ONLINE 0x0002
0484 #define IGN_RAW_FL 0x0004
0485
0486 #define PROTOCOL_ID 0x01
0487 #define REASS_MASK_REG 0x02
0488 #define REASS_INTR_STATUS_REG 0x03
0489
0490 #define RX_PKT_CTR_OF 0x8000
0491 #define RX_ERR_CTR_OF 0x4000
0492 #define RX_CELL_CTR_OF 0x1000
0493 #define RX_FREEQ_EMPT 0x0200
0494 #define RX_EXCPQ_FL 0x0080
0495 #define RX_RAWQ_FL 0x0010
0496 #define RX_EXCP_RCVD 0x0008
0497 #define RX_PKT_RCVD 0x0004
0498 #define RX_RAW_RCVD 0x0001
0499
0500 #define DRP_PKT_CNTR 0x04
0501 #define ERR_CNTR 0x05
0502 #define RAW_BASE_ADR 0x08
0503 #define CELL_CTR0 0x0c
0504 #define CELL_CTR1 0x0d
0505 #define REASS_COMMAND_REG 0x0f
0506
0507 #define RESET_REASS 0x0055
0508 #define RESET_REASS_STATE 0x00aa
0509 #define RESET_DRP_PKT_CNTR 0x00f1
0510 #define RESET_ERR_CNTR 0x00f2
0511 #define RESET_CELL_CNTR 0x00f8
0512 #define RESET_REASS_ALL_REGS 0x00ff
0513
0514 #define REASS_DESC_BASE 0x10
0515 #define VC_LKUP_BASE 0x11
0516 #define REASS_TABLE_BASE 0x12
0517 #define REASS_QUEUE_BASE 0x13
0518 #define PKT_TM_CNT 0x16
0519 #define TMOUT_RANGE 0x17
0520 #define INTRVL_CNTR 0x18
0521 #define TMOUT_INDX 0x19
0522 #define VP_LKUP_BASE 0x1c
0523 #define VP_FILTER 0x1d
0524 #define ABR_LKUP_BASE 0x1e
0525 #define FREEQ_ST_ADR 0x24
0526 #define FREEQ_ED_ADR 0x25
0527 #define FREEQ_RD_PTR 0x26
0528 #define FREEQ_WR_PTR 0x27
0529 #define PCQ_ST_ADR 0x28
0530 #define PCQ_ED_ADR 0x29
0531 #define PCQ_RD_PTR 0x2a
0532 #define PCQ_WR_PTR 0x2b
0533 #define EXCP_Q_ST_ADR 0x2c
0534 #define EXCP_Q_ED_ADR 0x2d
0535 #define EXCP_Q_RD_PTR 0x2e
0536 #define EXCP_Q_WR_PTR 0x2f
0537 #define CC_FIFO_ST_ADR 0x34
0538 #define CC_FIFO_ED_ADR 0x35
0539 #define CC_FIFO_RD_PTR 0x36
0540 #define CC_FIFO_WR_PTR 0x37
0541 #define STATE_REG 0x38
0542 #define BUF_SIZE 0x42
0543 #define XTRA_RM_OFFSET 0x44
0544 #define DRP_PKT_CNTR_NC 0x84
0545 #define ERR_CNTR_NC 0x85
0546 #define CELL_CNTR0_NC 0x8c
0547 #define CELL_CNTR1_NC 0x8d
0548
0549
0550 #define EXCPQ_EMPTY 0x0040
0551 #define PCQ_EMPTY 0x0010
0552 #define FREEQ_EMPTY 0x0004
0553
0554
0555
0556
0557
0558
0559
0560
0561
0562 #define IPHASE5575_TX_COUNTER 0x200
0563 #define IPHASE5575_RX_COUNTER 0x280
0564 #define IPHASE5575_TX_LIST_ADDR 0x300
0565 #define IPHASE5575_RX_LIST_ADDR 0x380
0566
0567
0568
0569
0570
0571 #define TX_DESC_BASE 0x0000
0572 #define TX_COMP_Q 0x1000
0573 #define PKT_RDY_Q 0x1400
0574 #define CBR_SCHED_TABLE 0x1800
0575 #define UBR_SCHED_TABLE 0x3000
0576 #define UBR_WAIT_Q 0x4000
0577 #define ABR_SCHED_TABLE 0x5000
0578 #define ABR_WAIT_Q 0x5800
0579 #define EXT_VC_TABLE 0x6000
0580 #define MAIN_VC_TABLE 0x8000
0581 #define SCHEDSZ 1024
0582 #define TX_DESC_TABLE_SZ 128
0583
0584
0585
0586 #define DESC_MODE 0x0
0587 #define VC_INDEX 0x1
0588 #define BYTE_CNT 0x3
0589 #define PKT_START_HI 0x4
0590 #define PKT_START_LO 0x5
0591
0592
0593 #define EOM_EN 0x0800
0594 #define AAL5 0x0100
0595 #define APP_CRC32 0x0400
0596 #define CMPL_INT 0x1000
0597
0598 #define TABLE_ADDRESS(db, dn, to) \
0599 (((unsigned long)(db & 0x04)) << 16) | (dn << 5) | (to << 1)
0600
0601
0602 #define RX_DESC_BASE 0x0000
0603 #define VP_TABLE 0x5c00
0604 #define EXCEPTION_Q 0x5e00
0605 #define FREE_BUF_DESC_Q 0x6000
0606 #define PKT_COMP_Q 0x6800
0607 #define REASS_TABLE 0x7000
0608 #define RX_VC_TABLE 0x7800
0609 #define ABR_VC_TABLE 0x8000
0610 #define RX_DESC_TABLE_SZ 736
0611
0612 #define VP_TABLE_SZ 256
0613 #define RX_VC_TABLE_SZ 1024
0614 #define REASS_TABLE_SZ 1024
0615
0616 #define RX_ACT 0x8000
0617 #define RX_VPVC 0x4000
0618 #define RX_CNG 0x0040
0619 #define RX_CER 0x0008
0620 #define RX_PTE 0x0004
0621 #define RX_OFL 0x0002
0622 #define NUM_RX_EXCP 32
0623
0624
0625 #define NO_AAL5_PKT 0x0000
0626 #define AAL5_PKT_REASSEMBLED 0x4000
0627 #define AAL5_PKT_TERMINATED 0x8000
0628 #define RAW_PKT 0xc000
0629 #define REASS_ABR 0x2000
0630
0631
0632 #define REG_BASE IPHASE5575_BUS_CONTROL_REG_BASE
0633 #define RAM_BASE IPHASE5575_FRAG_CONTROL_RAM_BASE
0634 #define PHY_BASE IPHASE5575_FRONT_END_REG_BASE
0635 #define SEG_BASE IPHASE5575_FRAG_CONTROL_REG_BASE
0636 #define REASS_BASE IPHASE5575_REASS_CONTROL_REG_BASE
0637
0638 typedef volatile u_int ffreg_t;
0639 typedef u_int rreg_t;
0640
0641 typedef struct _ffredn_t {
0642 ffreg_t idlehead_high;
0643 ffreg_t idlehead_low;
0644 ffreg_t maxrate;
0645 ffreg_t stparms;
0646 ffreg_t abrubr_abr;
0647 ffreg_t rm_type;
0648 u_int filler5[0x17 - 0x06];
0649 ffreg_t cmd_reg;
0650 u_int filler18[0x20 - 0x18];
0651 ffreg_t cbr_base;
0652 ffreg_t vbr_base;
0653 ffreg_t abr_base;
0654 ffreg_t ubr_base;
0655 u_int filler24;
0656 ffreg_t vbrwq_base;
0657 ffreg_t abrwq_base;
0658 ffreg_t ubrwq_base;
0659 ffreg_t vct_base;
0660 ffreg_t vcte_base;
0661 u_int filler2a[0x2C - 0x2A];
0662 ffreg_t cbr_tab_beg;
0663 ffreg_t cbr_tab_end;
0664 ffreg_t cbr_pointer;
0665 u_int filler2f[0x30 - 0x2F];
0666 ffreg_t prq_st_adr;
0667 ffreg_t prq_ed_adr;
0668 ffreg_t prq_rd_ptr;
0669 ffreg_t prq_wr_ptr;
0670 ffreg_t tcq_st_adr;
0671 ffreg_t tcq_ed_adr;
0672 ffreg_t tcq_rd_ptr;
0673 ffreg_t tcq_wr_ptr;
0674 u_int filler38[0x40 - 0x38];
0675 ffreg_t queue_base;
0676 ffreg_t desc_base;
0677 u_int filler42[0x45 - 0x42];
0678 ffreg_t mode_reg_0;
0679 ffreg_t mode_reg_1;
0680 ffreg_t intr_status_reg;
0681 ffreg_t mask_reg;
0682 ffreg_t cell_ctr_high1;
0683 ffreg_t cell_ctr_lo1;
0684 ffreg_t state_reg;
0685 u_int filler4c[0x58 - 0x4c];
0686 ffreg_t curr_desc_num;
0687 ffreg_t next_desc;
0688 ffreg_t next_vc;
0689 u_int filler5b[0x5d - 0x5b];
0690 ffreg_t present_slot_cnt;
0691 u_int filler5e[0x6a - 0x5e];
0692 ffreg_t new_desc_num;
0693 ffreg_t new_vc;
0694 ffreg_t sched_tbl_ptr;
0695 ffreg_t vbrwq_wptr;
0696 ffreg_t vbrwq_rptr;
0697 ffreg_t abrwq_wptr;
0698 ffreg_t abrwq_rptr;
0699 ffreg_t ubrwq_wptr;
0700 ffreg_t ubrwq_rptr;
0701 ffreg_t cbr_vc;
0702 ffreg_t vbr_sb_vc;
0703 ffreg_t abr_sb_vc;
0704 ffreg_t ubr_sb_vc;
0705 ffreg_t vbr_next_link;
0706 ffreg_t abr_next_link;
0707 ffreg_t ubr_next_link;
0708 u_int filler7a[0x7c-0x7a];
0709 ffreg_t out_rate_head;
0710 u_int filler7d[0xca-0x7d];
0711 ffreg_t cell_ctr_high1_nc;
0712 ffreg_t cell_ctr_lo1_nc;
0713 u_int fillercc[0x100-0xcc];
0714 } ffredn_t;
0715
0716 typedef struct _rfredn_t {
0717 rreg_t mode_reg_0;
0718 rreg_t protocol_id;
0719 rreg_t mask_reg;
0720 rreg_t intr_status_reg;
0721 rreg_t drp_pkt_cntr;
0722 rreg_t err_cntr;
0723 u_int filler6[0x08 - 0x06];
0724 rreg_t raw_base_adr;
0725 u_int filler2[0x0c - 0x09];
0726 rreg_t cell_ctr0;
0727 rreg_t cell_ctr1;
0728 u_int filler3[0x0f - 0x0e];
0729 rreg_t cmd_reg;
0730 rreg_t desc_base;
0731 rreg_t vc_lkup_base;
0732 rreg_t reass_base;
0733 rreg_t queue_base;
0734 u_int filler14[0x16 - 0x14];
0735 rreg_t pkt_tm_cnt;
0736 rreg_t tmout_range;
0737 rreg_t intrvl_cntr;
0738 rreg_t tmout_indx;
0739 u_int filler1a[0x1c - 0x1a];
0740 rreg_t vp_lkup_base;
0741 rreg_t vp_filter;
0742 rreg_t abr_lkup_base;
0743 u_int filler1f[0x24 - 0x1f];
0744 rreg_t fdq_st_adr;
0745 rreg_t fdq_ed_adr;
0746 rreg_t fdq_rd_ptr;
0747 rreg_t fdq_wr_ptr;
0748 rreg_t pcq_st_adr;
0749 rreg_t pcq_ed_adr;
0750 rreg_t pcq_rd_ptr;
0751 rreg_t pcq_wr_ptr;
0752 rreg_t excp_st_adr;
0753 rreg_t excp_ed_adr;
0754 rreg_t excp_rd_ptr;
0755 rreg_t excp_wr_ptr;
0756 u_int filler30[0x34 - 0x30];
0757 rreg_t raw_st_adr;
0758 rreg_t raw_ed_adr;
0759 rreg_t raw_rd_ptr;
0760 rreg_t raw_wr_ptr;
0761 rreg_t state_reg;
0762 u_int filler39[0x42 - 0x39];
0763 rreg_t buf_size;
0764 u_int filler43;
0765 rreg_t xtra_rm_offset;
0766 u_int filler45[0x84 - 0x45];
0767 rreg_t drp_pkt_cntr_nc;
0768 rreg_t err_cntr_nc;
0769 u_int filler86[0x8c - 0x86];
0770 rreg_t cell_ctr0_nc;
0771 rreg_t cell_ctr1_nc;
0772 u_int filler8e[0x100-0x8e];
0773 } rfredn_t;
0774
0775 typedef struct {
0776
0777 ffredn_t ffredn;
0778 rfredn_t rfredn;
0779 } ia_regs_t;
0780
0781 typedef struct {
0782 u_short f_vc_type;
0783 u_short f_nrm;
0784 u_short f_nrmexp;
0785 u_short reserved6;
0786 u_short f_crm;
0787 u_short reserved10;
0788 u_short reserved12;
0789 u_short reserved14;
0790 u_short last_cell_slot;
0791 u_short f_pcr;
0792 u_short fraction;
0793 u_short f_icr;
0794 u_short f_cdf;
0795 u_short f_mcr;
0796 u_short f_acr;
0797 u_short f_status;
0798 } f_vc_abr_entry;
0799
0800 typedef struct {
0801 u_short r_status_rdf;
0802 u_short r_air;
0803 u_short reserved4[14];
0804 } r_vc_abr_entry;
0805
0806 #define MRM 3
0807
0808 typedef struct srv_cls_param {
0809 u32 class_type;
0810 u32 pcr;
0811
0812 u32 scr;
0813 u32 max_burst_size;
0814
0815
0816 u32 mcr;
0817 u32 icr;
0818 u32 tbe;
0819 u32 frtt;
0820
0821 #if 0
0822 bits 31 30 29 28 27-25 24-22 21-19 18-9
0823 -----------------------------------------------------------------------------
0824 | NRM present | TRM prsnt | CDF prsnt | ADTF prsnt | NRM | TRM | CDF | ADTF |
0825 -----------------------------------------------------------------------------
0826 #endif
0827
0828 u8 nrm;
0829
0830 u8 trm;
0831 u16 adtf;
0832 u8 cdf;
0833 u8 rif;
0834 u8 rdf;
0835 u8 reserved;
0836 } srv_cls_param_t;
0837
0838 struct testTable_t {
0839 u16 lastTime;
0840 u16 fract;
0841 u8 vc_status;
0842 };
0843
0844 typedef struct {
0845 u16 vci;
0846 u16 error;
0847 } RX_ERROR_Q;
0848
0849 typedef struct {
0850 u8 active: 1;
0851 u8 abr: 1;
0852 u8 ubr: 1;
0853 u8 cnt: 5;
0854 #define VC_ACTIVE 0x01
0855 #define VC_ABR 0x02
0856 #define VC_UBR 0x04
0857 } vcstatus_t;
0858
0859 struct ia_rfL_t {
0860 u32 fdq_st;
0861 u32 fdq_ed;
0862 u32 fdq_rd;
0863 u32 fdq_wr;
0864 u32 pcq_st;
0865 u32 pcq_ed;
0866 u32 pcq_rd;
0867 u32 pcq_wr;
0868 };
0869
0870 struct ia_ffL_t {
0871 u32 prq_st;
0872 u32 prq_ed;
0873 u32 prq_wr;
0874 u32 tcq_st;
0875 u32 tcq_ed;
0876 u32 tcq_rd;
0877 };
0878
0879 struct desc_tbl_t {
0880 u32 timestamp;
0881 struct ia_vcc *iavcc;
0882 struct sk_buff *txskb;
0883 };
0884
0885 typedef struct ia_rtn_q {
0886 struct desc_tbl_t data;
0887 struct ia_rtn_q *next, *tail;
0888 } IARTN_Q;
0889
0890 #define SUNI_LOSV 0x04
0891 enum ia_suni {
0892 SUNI_MASTER_RESET = 0x000,
0893 SUNI_MASTER_CONFIG = 0x004,
0894 SUNI_MASTER_INTR_STAT = 0x008,
0895 SUNI_RESERVED1 = 0x00c,
0896 SUNI_MASTER_CLK_MONITOR = 0x010,
0897 SUNI_MASTER_CONTROL = 0x014,
0898
0899 SUNI_RSOP_CONTROL = 0x040,
0900 SUNI_RSOP_STATUS = 0x044,
0901 SUNI_RSOP_SECTION_BIP8L = 0x048,
0902 SUNI_RSOP_SECTION_BIP8M = 0x04c,
0903
0904 SUNI_TSOP_CONTROL = 0x050,
0905 SUNI_TSOP_DIAG = 0x054,
0906
0907 SUNI_RLOP_CS = 0x060,
0908 SUNI_RLOP_INTR = 0x064,
0909 SUNI_RLOP_LINE_BIP24L = 0x068,
0910 SUNI_RLOP_LINE_BIP24 = 0x06c,
0911 SUNI_RLOP_LINE_BIP24M = 0x070,
0912 SUNI_RLOP_LINE_FEBEL = 0x074,
0913 SUNI_RLOP_LINE_FEBE = 0x078,
0914 SUNI_RLOP_LINE_FEBEM = 0x07c,
0915
0916 SUNI_TLOP_CONTROL = 0x080,
0917 SUNI_TLOP_DISG = 0x084,
0918
0919 SUNI_RPOP_CS = 0x0c0,
0920 SUNI_RPOP_INTR = 0x0c4,
0921 SUNI_RPOP_RESERVED = 0x0c8,
0922 SUNI_RPOP_INTR_ENA = 0x0cc,
0923
0924 SUNI_RPOP_PATH_SIG = 0x0dc,
0925 SUNI_RPOP_BIP8L = 0x0e0,
0926 SUNI_RPOP_BIP8M = 0x0e4,
0927 SUNI_RPOP_FEBEL = 0x0e8,
0928 SUNI_RPOP_FEBEM = 0x0ec,
0929
0930 SUNI_TPOP_CNTRL_DAIG = 0x100,
0931 SUNI_TPOP_POINTER_CTRL = 0x104,
0932 SUNI_TPOP_SOURCER_CTRL = 0x108,
0933
0934 SUNI_TPOP_ARB_PRTL = 0x114,
0935 SUNI_TPOP_ARB_PRTM = 0x118,
0936 SUNI_TPOP_RESERVED2 = 0x11c,
0937 SUNI_TPOP_PATH_SIG = 0x120,
0938 SUNI_TPOP_PATH_STATUS = 0x124,
0939
0940 SUNI_RACP_CS = 0x140,
0941 SUNI_RACP_INTR = 0x144,
0942 SUNI_RACP_HDR_PATTERN = 0x148,
0943 SUNI_RACP_HDR_MASK = 0x14c,
0944 SUNI_RACP_CORR_HCS = 0x150,
0945 SUNI_RACP_UNCORR_HCS = 0x154,
0946
0947 SUNI_TACP_CONTROL = 0x180,
0948 SUNI_TACP_IDLE_HDR_PAT = 0x184,
0949 SUNI_TACP_IDLE_PAY_PAY = 0x188,
0950
0951
0952
0953
0954 SUNI_RESERVED_TEST = 0x204
0955 };
0956
0957 typedef struct _SUNI_STATS_
0958 {
0959 u32 valid;
0960 u32 carrier_detect;
0961
0962 u16 rsop_oof_state;
0963 u16 rsop_lof_state;
0964 u16 rsop_los_state;
0965 u32 rsop_los_count;
0966 u32 rsop_bse_count;
0967
0968 u16 rlop_ferf_state;
0969 u16 rlop_lais_state;
0970 u32 rlop_lbe_count;
0971 u32 rlop_febe_count;
0972
0973 u16 rpop_lop_state;
0974 u16 rpop_pais_state;
0975 u16 rpop_pyel_state;
0976 u32 rpop_bip_count;
0977 u32 rpop_febe_count;
0978 u16 rpop_psig;
0979
0980 u16 racp_hp_state;
0981 u32 racp_fu_count;
0982 u32 racp_fo_count;
0983 u32 racp_chcs_count;
0984 u32 racp_uchcs_count;
0985 } IA_SUNI_STATS;
0986
0987 typedef struct iadev_priv {
0988
0989 u32 __iomem *phy;
0990 u32 __iomem *dma;
0991 u32 __iomem *reg;
0992 u32 __iomem *seg_reg;
0993
0994 u32 __iomem *reass_reg;
0995
0996 u32 __iomem *ram;
0997 void __iomem *seg_ram;
0998 void __iomem *reass_ram;
0999 struct dle_q tx_dle_q;
1000 struct free_desc_q *tx_free_desc_qhead;
1001 struct sk_buff_head tx_dma_q, tx_backlog;
1002 spinlock_t tx_lock;
1003 IARTN_Q tx_return_q;
1004 u32 close_pending;
1005 wait_queue_head_t close_wait;
1006 wait_queue_head_t timeout_wait;
1007 struct cpcs_trailer_desc *tx_buf;
1008 u16 num_tx_desc, tx_buf_sz, rate_limit;
1009 u32 tx_cell_cnt, tx_pkt_cnt;
1010 void __iomem *MAIN_VC_TABLE_ADDR, *EXT_VC_TABLE_ADDR, *ABR_SCHED_TABLE_ADDR;
1011 struct dle_q rx_dle_q;
1012 struct free_desc_q *rx_free_desc_qhead;
1013 struct sk_buff_head rx_dma_q;
1014 spinlock_t rx_lock;
1015 struct atm_vcc **rx_open;
1016 u16 num_rx_desc, rx_buf_sz, rxing;
1017 u32 rx_pkt_ram, rx_tmp_cnt;
1018 unsigned long rx_tmp_jif;
1019 void __iomem *RX_DESC_BASE_ADDR;
1020 u32 drop_rxpkt, drop_rxcell, rx_cell_cnt, rx_pkt_cnt;
1021 struct atm_dev *next_board;
1022 struct pci_dev *pci;
1023 int mem;
1024 unsigned int real_base;
1025 void __iomem *base;
1026 unsigned int pci_map_size;
1027 unsigned char irq;
1028 unsigned char bus;
1029 unsigned char dev_fn;
1030 u_short phy_type;
1031 u_short num_vc, memSize, memType;
1032 struct ia_ffL_t ffL;
1033 struct ia_rfL_t rfL;
1034
1035
1036 unsigned char carrier_detect;
1037
1038
1039 unsigned int tx_dma_cnt;
1040 unsigned int rx_dma_cnt;
1041 unsigned int NumEnabledCBR;
1042
1043 unsigned int rx_mark_cnt;
1044 unsigned int CbrTotEntries;
1045 unsigned int CbrRemEntries;
1046 unsigned int CbrEntryPt;
1047 unsigned int Granularity;
1048
1049 unsigned int sum_mcr, sum_cbr, LineRate;
1050 unsigned int n_abr;
1051 struct desc_tbl_t *desc_tbl;
1052 u_short host_tcq_wr;
1053 struct testTable_t **testTable;
1054 dma_addr_t tx_dle_dma;
1055 dma_addr_t rx_dle_dma;
1056 } IADEV;
1057
1058
1059 #define INPH_IA_DEV(d) ((IADEV *) (d)->dev_data)
1060 #define INPH_IA_VCC(v) ((struct ia_vcc *) (v)->dev_data)
1061
1062
1063 enum ia_mb25 {
1064 MB25_MASTER_CTRL = 0x00,
1065 MB25_INTR_STATUS = 0x04,
1066 MB25_DIAG_CONTROL = 0x08,
1067 MB25_LED_HEC = 0x0c,
1068 MB25_LOW_BYTE_COUNTER = 0x10,
1069 MB25_HIGH_BYTE_COUNTER = 0x14
1070 };
1071
1072
1073
1074
1075 #define MB25_MC_UPLO 0x80
1076 #define MB25_MC_DREC 0x40
1077 #define MB25_MC_ECEIO 0x20
1078 #define MB25_MC_TDPC 0x10
1079 #define MB25_MC_DRIC 0x08
1080 #define MB25_MC_HALTTX 0x04
1081 #define MB25_MC_UMS 0x02
1082 #define MB25_MC_ENABLED 0x01
1083
1084
1085
1086
1087 #define MB25_IS_GSB 0x40
1088 #define MB25_IS_HECECR 0x20
1089 #define MB25_IS_SCR 0x10
1090 #define MB25_IS_TPE 0x08
1091 #define MB25_IS_RSCC 0x04
1092 #define MB25_IS_RCSE 0x02
1093 #define MB25_IS_RFIFOO 0x01
1094
1095
1096
1097
1098 #define MB25_DC_FTXCD 0x80
1099 #define MB25_DC_RXCOS 0x40
1100 #define MB25_DC_ECEIO 0x20
1101 #define MB25_DC_RLFLUSH 0x10
1102 #define MB25_DC_IXPE 0x08
1103 #define MB25_DC_IXHECE 0x04
1104 #define MB25_DC_LB_MASK 0x03
1105
1106 #define MB25_DC_LL 0x03
1107 #define MB25_DC_PL 0x02
1108 #define MB25_DC_NM 0x00
1109
1110 #define FE_MASK 0x00F0
1111 #define FE_MULTI_MODE 0x0000
1112 #define FE_SINGLE_MODE 0x0010
1113 #define FE_UTP_OPTION 0x0020
1114 #define FE_25MBIT_PHY 0x0040
1115 #define FE_DS3_PHY 0x0080
1116 #define FE_E3_PHY 0x0090
1117
1118
1119 enum suni_pm7345 {
1120 SUNI_CONFIG = 0x000,
1121 SUNI_INTR_ENBL = 0x004,
1122 SUNI_INTR_STAT = 0x008,
1123 SUNI_CONTROL = 0x00c,
1124 SUNI_ID_RESET = 0x010,
1125 SUNI_DATA_LINK_CTRL = 0x014,
1126 SUNI_RBOC_CONF_INTR_ENBL = 0x018,
1127 SUNI_RBOC_STAT = 0x01c,
1128 SUNI_DS3_FRM_CFG = 0x020,
1129 SUNI_DS3_FRM_INTR_ENBL = 0x024,
1130 SUNI_DS3_FRM_INTR_STAT = 0x028,
1131 SUNI_DS3_FRM_STAT = 0x02c,
1132 SUNI_RFDL_CFG = 0x030,
1133 SUNI_RFDL_ENBL_STAT = 0x034,
1134 SUNI_RFDL_STAT = 0x038,
1135 SUNI_RFDL_DATA = 0x03c,
1136 SUNI_PMON_CHNG = 0x040,
1137 SUNI_PMON_INTR_ENBL_STAT = 0x044,
1138
1139 SUNI_PMON_LCV_EVT_CNT_LSB = 0x050,
1140 SUNI_PMON_LCV_EVT_CNT_MSB = 0x054,
1141 SUNI_PMON_FBE_EVT_CNT_LSB = 0x058,
1142 SUNI_PMON_FBE_EVT_CNT_MSB = 0x05c,
1143 SUNI_PMON_SEZ_DET_CNT_LSB = 0x060,
1144 SUNI_PMON_SEZ_DET_CNT_MSB = 0x064,
1145 SUNI_PMON_PE_EVT_CNT_LSB = 0x068,
1146 SUNI_PMON_PE_EVT_CNT_MSB = 0x06c,
1147 SUNI_PMON_PPE_EVT_CNT_LSB = 0x070,
1148 SUNI_PMON_PPE_EVT_CNT_MSB = 0x074,
1149 SUNI_PMON_FEBE_EVT_CNT_LSB = 0x078,
1150 SUNI_PMON_FEBE_EVT_CNT_MSB = 0x07c,
1151 SUNI_DS3_TRAN_CFG = 0x080,
1152 SUNI_DS3_TRAN_DIAG = 0x084,
1153
1154 SUNI_XFDL_CFG = 0x090,
1155 SUNI_XFDL_INTR_ST = 0x094,
1156 SUNI_XFDL_XMIT_DATA = 0x098,
1157 SUNI_XBOC_CODE = 0x09c,
1158 SUNI_SPLR_CFG = 0x0a0,
1159 SUNI_SPLR_INTR_EN = 0x0a4,
1160 SUNI_SPLR_INTR_ST = 0x0a8,
1161 SUNI_SPLR_STATUS = 0x0ac,
1162 SUNI_SPLT_CFG = 0x0b0,
1163 SUNI_SPLT_CNTL = 0x0b4,
1164 SUNI_SPLT_DIAG_G1 = 0x0b8,
1165 SUNI_SPLT_F1 = 0x0bc,
1166 SUNI_CPPM_LOC_METERS = 0x0c0,
1167 SUNI_CPPM_CHG_OF_CPPM_PERF_METR = 0x0c4,
1168 SUNI_CPPM_B1_ERR_CNT_LSB = 0x0c8,
1169 SUNI_CPPM_B1_ERR_CNT_MSB = 0x0cc,
1170 SUNI_CPPM_FRAMING_ERR_CNT_LSB = 0x0d0,
1171 SUNI_CPPM_FRAMING_ERR_CNT_MSB = 0x0d4,
1172 SUNI_CPPM_FEBE_CNT_LSB = 0x0d8,
1173 SUNI_CPPM_FEBE_CNT_MSB = 0x0dc,
1174 SUNI_CPPM_HCS_ERR_CNT_LSB = 0x0e0,
1175 SUNI_CPPM_HCS_ERR_CNT_MSB = 0x0e4,
1176 SUNI_CPPM_IDLE_UN_CELL_CNT_LSB = 0x0e8,
1177 SUNI_CPPM_IDLE_UN_CELL_CNT_MSB = 0x0ec,
1178 SUNI_CPPM_RCV_CELL_CNT_LSB = 0x0f0,
1179 SUNI_CPPM_RCV_CELL_CNT_MSB = 0x0f4,
1180 SUNI_CPPM_XMIT_CELL_CNT_LSB = 0x0f8,
1181 SUNI_CPPM_XMIT_CELL_CNT_MSB = 0x0fc,
1182 SUNI_RXCP_CTRL = 0x100,
1183 SUNI_RXCP_FCTRL = 0x104,
1184 SUNI_RXCP_INTR_EN_STS = 0x108,
1185 SUNI_RXCP_IDLE_PAT_H1 = 0x10c,
1186 SUNI_RXCP_IDLE_PAT_H2 = 0x110,
1187 SUNI_RXCP_IDLE_PAT_H3 = 0x114,
1188 SUNI_RXCP_IDLE_PAT_H4 = 0x118,
1189 SUNI_RXCP_IDLE_MASK_H1 = 0x11c,
1190 SUNI_RXCP_IDLE_MASK_H2 = 0x120,
1191 SUNI_RXCP_IDLE_MASK_H3 = 0x124,
1192 SUNI_RXCP_IDLE_MASK_H4 = 0x128,
1193 SUNI_RXCP_CELL_PAT_H1 = 0x12c,
1194 SUNI_RXCP_CELL_PAT_H2 = 0x130,
1195 SUNI_RXCP_CELL_PAT_H3 = 0x134,
1196 SUNI_RXCP_CELL_PAT_H4 = 0x138,
1197 SUNI_RXCP_CELL_MASK_H1 = 0x13c,
1198 SUNI_RXCP_CELL_MASK_H2 = 0x140,
1199 SUNI_RXCP_CELL_MASK_H3 = 0x144,
1200 SUNI_RXCP_CELL_MASK_H4 = 0x148,
1201 SUNI_RXCP_HCS_CS = 0x14c,
1202 SUNI_RXCP_LCD_CNT_THRESHOLD = 0x150,
1203
1204 SUNI_TXCP_CTRL = 0x160,
1205 SUNI_TXCP_INTR_EN_STS = 0x164,
1206 SUNI_TXCP_IDLE_PAT_H1 = 0x168,
1207 SUNI_TXCP_IDLE_PAT_H2 = 0x16c,
1208 SUNI_TXCP_IDLE_PAT_H3 = 0x170,
1209 SUNI_TXCP_IDLE_PAT_H4 = 0x174,
1210 SUNI_TXCP_IDLE_PAT_H5 = 0x178,
1211 SUNI_TXCP_IDLE_PAYLOAD = 0x17c,
1212 SUNI_E3_FRM_FRAM_OPTIONS = 0x180,
1213 SUNI_E3_FRM_MAINT_OPTIONS = 0x184,
1214 SUNI_E3_FRM_FRAM_INTR_ENBL = 0x188,
1215 SUNI_E3_FRM_FRAM_INTR_IND_STAT = 0x18c,
1216 SUNI_E3_FRM_MAINT_INTR_ENBL = 0x190,
1217 SUNI_E3_FRM_MAINT_INTR_IND = 0x194,
1218 SUNI_E3_FRM_MAINT_STAT = 0x198,
1219 SUNI_RESERVED4 = 0x19c,
1220 SUNI_E3_TRAN_FRAM_OPTIONS = 0x1a0,
1221 SUNI_E3_TRAN_STAT_DIAG_OPTIONS = 0x1a4,
1222 SUNI_E3_TRAN_BIP_8_ERR_MASK = 0x1a8,
1223 SUNI_E3_TRAN_MAINT_ADAPT_OPTS = 0x1ac,
1224 SUNI_TTB_CTRL = 0x1b0,
1225 SUNI_TTB_TRAIL_TRACE_ID_STAT = 0x1b4,
1226 SUNI_TTB_IND_ADDR = 0x1b8,
1227 SUNI_TTB_IND_DATA = 0x1bc,
1228 SUNI_TTB_EXP_PAYLOAD_TYPE = 0x1c0,
1229 SUNI_TTB_PAYLOAD_TYPE_CTRL_STAT = 0x1c4,
1230
1231 SUNI_MASTER_TEST = 0x200,
1232
1233 };
1234
1235 #define SUNI_PM7345_T suni_pm7345_t
1236 #define SUNI_PM7345 0x20
1237 #define SUNI_PM5346 0x30
1238
1239
1240
1241 #define SUNI_PM7345_CLB 0x01
1242 #define SUNI_PM7345_PLB 0x02
1243 #define SUNI_PM7345_DLB 0x04
1244 #define SUNI_PM7345_LLB 0x80
1245 #define SUNI_PM7345_E3ENBL 0x40
1246 #define SUNI_PM7345_LOOPT 0x10
1247 #define SUNI_PM7345_FIFOBP 0x20
1248 #define SUNI_PM7345_FRMRBP 0x08
1249
1250
1251
1252 #define SUNI_DS3_COFAE 0x80
1253 #define SUNI_DS3_REDE 0x40
1254 #define SUNI_DS3_CBITE 0x20
1255 #define SUNI_DS3_FERFE 0x10
1256 #define SUNI_DS3_IDLE 0x08
1257 #define SUNI_DS3_AISE 0x04
1258 #define SUNI_DS3_OOFE 0x02
1259 #define SUNI_DS3_LOSE 0x01
1260
1261
1262
1263
1264 #define SUNI_DS3_ACE 0x80
1265 #define SUNI_DS3_REDV 0x40
1266 #define SUNI_DS3_CBITV 0x20
1267 #define SUNI_DS3_FERFV 0x10
1268 #define SUNI_DS3_IDLV 0x08
1269 #define SUNI_DS3_AISV 0x04
1270 #define SUNI_DS3_OOFV 0x02
1271 #define SUNI_DS3_LOSV 0x01
1272
1273
1274
1275
1276 #define SUNI_E3_CZDI 0x40
1277 #define SUNI_E3_LOSI 0x20
1278 #define SUNI_E3_LCVI 0x10
1279 #define SUNI_E3_COFAI 0x08
1280 #define SUNI_E3_OOFI 0x04
1281 #define SUNI_E3_LOS 0x02
1282 #define SUNI_E3_OOF 0x01
1283
1284
1285
1286
1287 #define SUNI_E3_AISD 0x80
1288 #define SUNI_E3_FERF_RAI 0x40
1289 #define SUNI_E3_FEBE 0x20
1290
1291
1292
1293
1294 #define SUNI_DS3_HCSPASS 0x80
1295 #define SUNI_DS3_HCSDQDB 0x40
1296 #define SUNI_DS3_HCSADD 0x20
1297 #define SUNI_DS3_HCK 0x10
1298 #define SUNI_DS3_BLOCK 0x08
1299 #define SUNI_DS3_DSCR 0x04
1300 #define SUNI_DS3_OOCDV 0x02
1301 #define SUNI_DS3_FIFORST 0x01
1302
1303
1304
1305
1306 #define SUNI_DS3_OOCDE 0x80
1307 #define SUNI_DS3_HCSE 0x40
1308 #define SUNI_DS3_FIFOE 0x20
1309 #define SUNI_DS3_OOCDI 0x10
1310 #define SUNI_DS3_UHCSI 0x08
1311 #define SUNI_DS3_COCAI 0x04
1312 #define SUNI_DS3_FOVRI 0x02
1313 #define SUNI_DS3_FUDRI 0x01
1314
1315
1316
1317
1318 #define MEM_SIZE_MASK 0x000F
1319 #define MEM_SIZE_128K 0x0000
1320 #define MEM_SIZE_512K 0x0001
1321 #define MEM_SIZE_1M 0x0002
1322
1323
1324 #define FE_MASK 0x00F0
1325 #define FE_MULTI_MODE 0x0000
1326 #define FE_SINGLE_MODE 0x0010
1327 #define FE_UTP_OPTION 0x0020
1328
1329 #define NOVRAM_SIZE 64
1330 #define CMD_LEN 10
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346 #define EXTEND 0x100
1347 #define IAWRITE 0x140
1348 #define IAREAD 0x180
1349 #define ERASE 0x1c0
1350
1351 #define EWDS 0x00
1352 #define WRAL 0x10
1353 #define ERAL 0x20
1354 #define EWEN 0x30
1355
1356
1357
1358
1359
1360
1361 #define NVCE 0x02
1362 #define NVSK 0x01
1363 #define NVDO 0x08
1364 #define NVDI 0x04
1365
1366
1367
1368
1369
1370
1371
1372 #define CFG_AND(val) { \
1373 u32 t; \
1374 t = readl(iadev->reg+IPHASE5575_EEPROM_ACCESS); \
1375 t &= (val); \
1376 writel(t, iadev->reg+IPHASE5575_EEPROM_ACCESS); \
1377 }
1378
1379
1380
1381
1382
1383
1384
1385
1386 #define CFG_OR(val) { \
1387 u32 t; \
1388 t = readl(iadev->reg+IPHASE5575_EEPROM_ACCESS); \
1389 t |= (val); \
1390 writel(t, iadev->reg+IPHASE5575_EEPROM_ACCESS); \
1391 }
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403 #define NVRAM_CMD(cmd) { \
1404 int i; \
1405 u_short c = cmd; \
1406 CFG_AND(~(NVCE|NVSK)); \
1407 CFG_OR(NVCE); \
1408 for (i=0; i<CMD_LEN; i++) { \
1409 NVRAM_CLKOUT((c & (1 << (CMD_LEN - 1))) ? 1 : 0); \
1410 c <<= 1; \
1411 } \
1412 }
1413
1414
1415
1416
1417
1418
1419
1420 #define NVRAM_CLR_CE {CFG_AND(~NVCE)}
1421
1422
1423
1424
1425
1426
1427
1428
1429 #define NVRAM_CLKOUT(bitval) { \
1430 CFG_AND(~NVDI); \
1431 CFG_OR((bitval) ? NVDI : 0); \
1432 CFG_OR(NVSK); \
1433 CFG_AND( ~NVSK); \
1434 }
1435
1436
1437
1438
1439
1440
1441
1442
1443 #define NVRAM_CLKIN(value) { \
1444 u32 _t; \
1445 CFG_OR(NVSK); \
1446 CFG_AND(~NVSK); \
1447 _t = readl(iadev->reg+IPHASE5575_EEPROM_ACCESS); \
1448 value = (_t & NVDO) ? 1 : 0; \
1449 }
1450
1451
1452 #endif