8 #include <linux/types.h>
190 #define ERXBUF_IPCKSUM_MASK 0x0000ffff
191 #define ERXBUF_BYTECNT_MASK 0x07ff0000
192 #define ERXBUF_BYTECNT_SHIFT 16
193 #define ERXBUF_V 0x80000000
195 #define ERXBUF_CRCERR 0x00000001
196 #define ERXBUF_FRAMERR 0x00000002
197 #define ERXBUF_CODERR 0x00000004
198 #define ERXBUF_INVPREAMB 0x00000008
199 #define ERXBUF_LOLEN 0x00007000
200 #define ERXBUF_HILEN 0x03ff0000
201 #define ERXBUF_MULTICAST 0x04000000
202 #define ERXBUF_BROADCAST 0x08000000
203 #define ERXBUF_LONGEVENT 0x10000000
204 #define ERXBUF_BADPKT 0x20000000
205 #define ERXBUF_GOODPKT 0x40000000
206 #define ERXBUF_CARRIER 0x80000000
211 #define ETXD_DATALEN 104
220 #define ETXD_BYTECNT_MASK 0x000007ff
221 #define ETXD_INTWHENDONE 0x00001000
222 #define ETXD_D0V 0x00010000
223 #define ETXD_B1V 0x00020000
224 #define ETXD_B2V 0x00040000
225 #define ETXD_DOCHECKSUM 0x00080000
226 #define ETXD_CHKOFF_MASK 0x07f00000
227 #define ETXD_CHKOFF_SHIFT 20
229 #define ETXD_D0CNT_MASK 0x0000007f
230 #define ETXD_B1CNT_MASK 0x0007ff00
231 #define ETXD_B1CNT_SHIFT 8
232 #define ETXD_B2CNT_MASK 0x7ff00000
233 #define ETXD_B2CNT_SHIFT 20
238 #define IOC3_BYTEBUS_DEV0 0x80000L
239 #define IOC3_BYTEBUS_DEV1 0xa0000L
240 #define IOC3_BYTEBUS_DEV2 0xc0000L
241 #define IOC3_BYTEBUS_DEV3 0xe0000L
246 #define IOC3_SIO_BASE 0x20000
247 #define IOC3_SIO_UARTC (IOC3_SIO_BASE+0x141)
248 #define IOC3_SIO_KBDCG (IOC3_SIO_BASE+0x142)
249 #define IOC3_SIO_PP_BASE (IOC3_SIO_BASE+PP_BASE)
250 #define IOC3_SIO_RTC_BASE (IOC3_SIO_BASE+0x168)
251 #define IOC3_SIO_UB_BASE (IOC3_SIO_BASE+UARTB_BASE)
252 #define IOC3_SIO_UA_BASE (IOC3_SIO_BASE+UARTA_BASE)
255 #define IOC3_SSRAM IOC3_RAM_OFF
256 #define IOC3_SSRAM_LEN 0x40000
257 #define IOC3_SSRAM_DM 0x0000ffff
258 #define IOC3_SSRAM_PM 0x00010000
261 #define PCI_SCR_PAR_RESP_EN 0x00000040
262 #define PCI_SCR_SERR_EN 0x00000100
263 #define PCI_SCR_DROP_MODE_EN 0x00008000
264 #define PCI_SCR_RX_SERR (0x1 << 16)
265 #define PCI_SCR_DROP_MODE (0x1 << 17)
266 #define PCI_SCR_SIG_PAR_ERR (0x1 << 24)
267 #define PCI_SCR_SIG_TAR_ABRT (0x1 << 27)
268 #define PCI_SCR_RX_TAR_ABRT (0x1 << 28)
269 #define PCI_SCR_SIG_MST_ABRT (0x1 << 29)
270 #define PCI_SCR_SIG_SERR (0x1 << 30)
271 #define PCI_SCR_PAR_ERR (0x1 << 31)
274 #define KM_CSR_K_WRT_PEND 0x00000001
275 #define KM_CSR_M_WRT_PEND 0x00000002
276 #define KM_CSR_K_LCB 0x00000004
277 #define KM_CSR_M_LCB 0x00000008
278 #define KM_CSR_K_DATA 0x00000010
279 #define KM_CSR_K_CLK 0x00000020
280 #define KM_CSR_K_PULL_DATA 0x00000040
281 #define KM_CSR_K_PULL_CLK 0x00000080
282 #define KM_CSR_M_DATA 0x00000100
283 #define KM_CSR_M_CLK 0x00000200
284 #define KM_CSR_M_PULL_DATA 0x00000400
285 #define KM_CSR_M_PULL_CLK 0x00000800
286 #define KM_CSR_EMM_MODE 0x00001000
287 #define KM_CSR_SIM_MODE 0x00002000
288 #define KM_CSR_K_SM_IDLE 0x00004000
289 #define KM_CSR_M_SM_IDLE 0x00008000
290 #define KM_CSR_K_TO 0x00010000
291 #define KM_CSR_M_TO 0x00020000
292 #define KM_CSR_K_TO_EN 0x00040000
294 #define KM_CSR_M_TO_EN 0x00080000
296 #define KM_CSR_K_CLAMP_ONE 0x00100000
297 #define KM_CSR_M_CLAMP_ONE 0x00200000
298 #define KM_CSR_K_CLAMP_THREE 0x00400000
299 #define KM_CSR_M_CLAMP_THREE 0x00800000
302 #define KM_RD_DATA_2 0x000000ff
303 #define KM_RD_DATA_2_SHIFT 0
304 #define KM_RD_DATA_1 0x0000ff00
305 #define KM_RD_DATA_1_SHIFT 8
306 #define KM_RD_DATA_0 0x00ff0000
307 #define KM_RD_DATA_0_SHIFT 16
308 #define KM_RD_FRAME_ERR_2 0x01000000
309 #define KM_RD_FRAME_ERR_1 0x02000000
310 #define KM_RD_FRAME_ERR_0 0x04000000
312 #define KM_RD_KBD_MSE 0x08000000
313 #define KM_RD_OFLO 0x10000000
314 #define KM_RD_VALID_2 0x20000000
315 #define KM_RD_VALID_1 0x40000000
316 #define KM_RD_VALID_0 0x80000000
317 #define KM_RD_VALID_ALL (KM_RD_VALID_0|KM_RD_VALID_1|KM_RD_VALID_2)
320 #define KM_WD_WRT_DATA 0x000000ff
321 #define KM_WD_WRT_DATA_SHIFT 0
324 #define RXSB_OVERRUN 0x01
325 #define RXSB_PAR_ERR 0x02
326 #define RXSB_FRAME_ERR 0x04
327 #define RXSB_BREAK 0x08
328 #define RXSB_CTS 0x10
329 #define RXSB_DCD 0x20
330 #define RXSB_MODEM_VALID 0x40
331 #define RXSB_DATA_VALID 0x80
334 #define TXCB_INT_WHEN_DONE 0x20
335 #define TXCB_INVALID 0x00
336 #define TXCB_VALID 0x40
337 #define TXCB_MCR 0x80
338 #define TXCB_DELAY 0xc0
341 #define SBBR_L_SIZE 0x00000001
342 #define SBBR_L_BASE 0xfffff000
345 #define SSCR_RX_THRESHOLD 0x000001ff
346 #define SSCR_TX_TIMER_BUSY 0x00010000
347 #define SSCR_HFC_EN 0x00020000
348 #define SSCR_RX_RING_DCD 0x00040000
349 #define SSCR_RX_RING_CTS 0x00080000
350 #define SSCR_HIGH_SPD 0x00100000
351 #define SSCR_DIAG 0x00200000
352 #define SSCR_RX_DRAIN 0x08000000
353 #define SSCR_DMA_EN 0x10000000
354 #define SSCR_DMA_PAUSE 0x20000000
355 #define SSCR_PAUSE_STATE 0x40000000
356 #define SSCR_RESET 0x80000000
359 #define PROD_CONS_PTR_4K 0x00000ff8
360 #define PROD_CONS_PTR_1K 0x000003f8
361 #define PROD_CONS_PTR_OFF 3
364 #define SRCIR_ARM 0x80000000
367 #define SRPIR_BYTE_CNT 0x07000000
368 #define SRPIR_BYTE_CNT_SHIFT 24
371 #define STCIR_BYTE_CNT 0x0f000000
372 #define STCIR_BYTE_CNT_SHIFT 24
375 #define SHADOW_DR 0x00000001
376 #define SHADOW_OE 0x00000002
377 #define SHADOW_PE 0x00000004
378 #define SHADOW_FE 0x00000008
379 #define SHADOW_BI 0x00000010
380 #define SHADOW_THRE 0x00000020
381 #define SHADOW_TEMT 0x00000040
382 #define SHADOW_RFCE 0x00000080
383 #define SHADOW_DCTS 0x00010000
384 #define SHADOW_DDCD 0x00080000
385 #define SHADOW_CTS 0x00100000
386 #define SHADOW_DCD 0x00800000
387 #define SHADOW_DTR 0x01000000
388 #define SHADOW_RTS 0x02000000
389 #define SHADOW_OUT1 0x04000000
390 #define SHADOW_OUT2 0x08000000
391 #define SHADOW_LOOP 0x10000000
394 #define SRTR_CNT 0x00000fff
395 #define SRTR_CNT_VAL 0x0fff0000
396 #define SRTR_CNT_VAL_SHIFT 16
397 #define SRTR_HZ 16000
400 #define SIO_IR_SA_TX_MT 0x00000001
401 #define SIO_IR_SA_RX_FULL 0x00000002
402 #define SIO_IR_SA_RX_HIGH 0x00000004
403 #define SIO_IR_SA_RX_TIMER 0x00000008
404 #define SIO_IR_SA_DELTA_DCD 0x00000010
405 #define SIO_IR_SA_DELTA_CTS 0x00000020
406 #define SIO_IR_SA_INT 0x00000040
407 #define SIO_IR_SA_TX_EXPLICIT 0x00000080
408 #define SIO_IR_SA_MEMERR 0x00000100
409 #define SIO_IR_SB_TX_MT 0x00000200
410 #define SIO_IR_SB_RX_FULL 0x00000400
411 #define SIO_IR_SB_RX_HIGH 0x00000800
412 #define SIO_IR_SB_RX_TIMER 0x00001000
413 #define SIO_IR_SB_DELTA_DCD 0x00002000
414 #define SIO_IR_SB_DELTA_CTS 0x00004000
415 #define SIO_IR_SB_INT 0x00008000
416 #define SIO_IR_SB_TX_EXPLICIT 0x00010000
417 #define SIO_IR_SB_MEMERR 0x00020000
418 #define SIO_IR_PP_INT 0x00040000
419 #define SIO_IR_PP_INTA 0x00080000
420 #define SIO_IR_PP_INTB 0x00100000
421 #define SIO_IR_PP_MEMERR 0x00200000
422 #define SIO_IR_KBD_INT 0x00400000
423 #define SIO_IR_RT_INT 0x08000000
424 #define SIO_IR_GEN_INT1 0x10000000
425 #define SIO_IR_GEN_INT_SHIFT 28
428 #define SIO_IR_SA (SIO_IR_SA_TX_MT | SIO_IR_SA_RX_FULL | \
429 SIO_IR_SA_RX_HIGH | SIO_IR_SA_RX_TIMER | \
430 SIO_IR_SA_DELTA_DCD | SIO_IR_SA_DELTA_CTS | \
431 SIO_IR_SA_INT | SIO_IR_SA_TX_EXPLICIT | \
433 #define SIO_IR_SB (SIO_IR_SB_TX_MT | SIO_IR_SB_RX_FULL | \
434 SIO_IR_SB_RX_HIGH | SIO_IR_SB_RX_TIMER | \
435 SIO_IR_SB_DELTA_DCD | SIO_IR_SB_DELTA_CTS | \
436 SIO_IR_SB_INT | SIO_IR_SB_TX_EXPLICIT | \
438 #define SIO_IR_PP (SIO_IR_PP_INT | SIO_IR_PP_INTA | \
439 SIO_IR_PP_INTB | SIO_IR_PP_MEMERR)
440 #define SIO_IR_RT (SIO_IR_RT_INT | SIO_IR_GEN_INT1)
443 #define IOC3_PENDING_INTRS(mem) (PCI_INW(&((mem)->sio_ir)) & \
444 PCI_INW(&((mem)->sio_ies_ro)))
447 #define SIO_CR_SIO_RESET 0x00000001
448 #define SIO_CR_SER_A_BASE 0x000000fe
449 #define SIO_CR_SER_A_BASE_SHIFT 1
450 #define SIO_CR_SER_B_BASE 0x00007f00
451 #define SIO_CR_SER_B_BASE_SHIFT 8
452 #define SIO_SR_CMD_PULSE 0x00078000
453 #define SIO_CR_CMD_PULSE_SHIFT 15
454 #define SIO_CR_ARB_DIAG 0x00380000
455 #define SIO_CR_ARB_DIAG_TXA 0x00000000
456 #define SIO_CR_ARB_DIAG_RXA 0x00080000
457 #define SIO_CR_ARB_DIAG_TXB 0x00100000
458 #define SIO_CR_ARB_DIAG_RXB 0x00180000
459 #define SIO_CR_ARB_DIAG_PP 0x00200000
460 #define SIO_CR_ARB_DIAG_IDLE 0x00400000
463 #define INT_OUT_COUNT 0x0000ffff
464 #define INT_OUT_MODE 0x00070000
465 #define INT_OUT_MODE_0 0x00000000
466 #define INT_OUT_MODE_1 0x00040000
467 #define INT_OUT_MODE_1PULSE 0x00050000
468 #define INT_OUT_MODE_PULSES 0x00060000
469 #define INT_OUT_MODE_SQW 0x00070000
470 #define INT_OUT_DIAG 0x40000000
471 #define INT_OUT_INT_OUT 0x80000000
474 #define INT_OUT_NS_PER_TICK (30 * 260)
475 #define INT_OUT_TICKS_PER_PULSE 3
476 #define INT_OUT_US_TO_COUNT(x) \
477 (((x) * 10 + INT_OUT_NS_PER_TICK / 200) * \
478 100 / INT_OUT_NS_PER_TICK - 1)
479 #define INT_OUT_COUNT_TO_US(x) \
480 (((x) + 1) * INT_OUT_NS_PER_TICK / 1000)
481 #define INT_OUT_MIN_TICKS 3
482 #define INT_OUT_MAX_TICKS INT_OUT_COUNT
485 #define GPCR_DIR 0x000000ff
486 #define GPCR_DIR_PIN(x) (1<<(x))
487 #define GPCR_EDGE 0x000f0000
488 #define GPCR_EDGE_PIN(x) (1<<((x)+15))
491 #define GPCR_INT_OUT_EN 0x00100000
492 #define GPCR_MLAN_EN 0x00200000
493 #define GPCR_DIR_SERA_XCVR 0x00000080
494 #define GPCR_DIR_SERB_XCVR 0x00000040
495 #define GPCR_DIR_PHY_RST 0x00000020
498 #define GPCR_PHY_RESET 0x20
499 #define GPCR_UARTB_MODESEL 0x40
500 #define GPCR_UARTA_MODESEL 0x80
502 #define GPPR_PHY_RESET_PIN 5
503 #define GPPR_UARTB_MODESEL_PIN 6
504 #define GPPR_UARTA_MODESEL_PIN 7
506 #define EMCR_DUPLEX 0x00000001
507 #define EMCR_PROMISC 0x00000002
508 #define EMCR_PADEN 0x00000004
509 #define EMCR_RXOFF_MASK 0x000001f8
510 #define EMCR_RXOFF_SHIFT 3
511 #define EMCR_RAMPAR 0x00000200
512 #define EMCR_BADPAR 0x00000800
513 #define EMCR_BUFSIZ 0x00001000
514 #define EMCR_TXDMAEN 0x00002000
515 #define EMCR_TXEN 0x00004000
516 #define EMCR_RXDMAEN 0x00008000
517 #define EMCR_RXEN 0x00010000
518 #define EMCR_LOOPBACK 0x00020000
519 #define EMCR_ARB_DIAG 0x001c0000
520 #define EMCR_ARB_DIAG_IDLE 0x00200000
521 #define EMCR_RST 0x80000000
523 #define EISR_RXTIMERINT 0x00000001
524 #define EISR_RXTHRESHINT 0x00000002
525 #define EISR_RXOFLO 0x00000004
526 #define EISR_RXBUFOFLO 0x00000008
527 #define EISR_RXMEMERR 0x00000010
528 #define EISR_RXPARERR 0x00000020
529 #define EISR_TXEMPTY 0x00010000
530 #define EISR_TXRTRY 0x00020000
531 #define EISR_TXEXDEF 0x00040000
532 #define EISR_TXLCOL 0x00080000
533 #define EISR_TXGIANT 0x00100000
534 #define EISR_TXBUFUFLO 0x00200000
535 #define EISR_TXEXPLICIT 0x00400000
536 #define EISR_TXCOLLWRAP 0x00800000
537 #define EISR_TXDEFERWRAP 0x01000000
538 #define EISR_TXMEMERR 0x02000000
539 #define EISR_TXPARERR 0x04000000
541 #define ERCSR_THRESH_MASK 0x000001ff
542 #define ERCSR_RX_TMR 0x40000000
543 #define ERCSR_DIAG_OFLO 0x80000000
545 #define ERBR_ALIGNMENT 4096
546 #define ERBR_L_RXRINGBASE_MASK 0xfffff000
548 #define ERBAR_BARRIER_BIT 0x0100
549 #define ERBAR_RXBARR_MASK 0xffff0000
550 #define ERBAR_RXBARR_SHIFT 16
552 #define ERCIR_RXCONSUME_MASK 0x00000fff
554 #define ERPIR_RXPRODUCE_MASK 0x00000fff
555 #define ERPIR_ARM 0x80000000
557 #define ERTR_CNT_MASK 0x000007ff
559 #define ETCSR_IPGT_MASK 0x0000007f
560 #define ETCSR_IPGR1_MASK 0x00007f00
561 #define ETCSR_IPGR1_SHIFT 8
562 #define ETCSR_IPGR2_MASK 0x007f0000
563 #define ETCSR_IPGR2_SHIFT 16
564 #define ETCSR_NOTXCLK 0x80000000
566 #define ETCDC_COLLCNT_MASK 0x0000ffff
567 #define ETCDC_DEFERCNT_MASK 0xffff0000
568 #define ETCDC_DEFERCNT_SHIFT 16
570 #define ETBR_ALIGNMENT (64*1024)
571 #define ETBR_L_RINGSZ_MASK 0x00000001
572 #define ETBR_L_RINGSZ128 0
573 #define ETBR_L_RINGSZ512 1
574 #define ETBR_L_TXRINGBASE_MASK 0xffffc000
576 #define ETCIR_TXCONSUME_MASK 0x0000ffff
577 #define ETCIR_IDLE 0x80000000
579 #define ETPIR_TXPRODUCE_MASK 0x0000ffff
581 #define EBIR_TXBUFPROD_MASK 0x0000001f
582 #define EBIR_TXBUFCONS_MASK 0x00001f00
583 #define EBIR_TXBUFCONS_SHIFT 8
584 #define EBIR_RXBUFPROD_MASK 0x007fc000
585 #define EBIR_RXBUFPROD_SHIFT 14
586 #define EBIR_RXBUFCONS_MASK 0xff800000
587 #define EBIR_RXBUFCONS_SHIFT 23
589 #define MICR_REGADDR_MASK 0x0000001f
590 #define MICR_PHYADDR_MASK 0x000003e0
591 #define MICR_PHYADDR_SHIFT 5
592 #define MICR_READTRIG 0x00000400
593 #define MICR_BUSY 0x00000800
595 #define MIDR_DATA_MASK 0x0000ffff
597 #define ERXBUF_IPCKSUM_MASK 0x0000ffff
598 #define ERXBUF_BYTECNT_MASK 0x07ff0000
599 #define ERXBUF_BYTECNT_SHIFT 16
600 #define ERXBUF_V 0x80000000
602 #define ERXBUF_CRCERR 0x00000001
603 #define ERXBUF_FRAMERR 0x00000002
604 #define ERXBUF_CODERR 0x00000004
605 #define ERXBUF_INVPREAMB 0x00000008
606 #define ERXBUF_LOLEN 0x00007000
607 #define ERXBUF_HILEN 0x03ff0000
608 #define ERXBUF_MULTICAST 0x04000000
609 #define ERXBUF_BROADCAST 0x08000000
610 #define ERXBUF_LONGEVENT 0x10000000
611 #define ERXBUF_BADPKT 0x20000000
612 #define ERXBUF_GOODPKT 0x40000000
613 #define ERXBUF_CARRIER 0x80000000
615 #define ETXD_BYTECNT_MASK 0x000007ff
616 #define ETXD_INTWHENDONE 0x00001000
617 #define ETXD_D0V 0x00010000
618 #define ETXD_B1V 0x00020000
619 #define ETXD_B2V 0x00040000
620 #define ETXD_DOCHECKSUM 0x00080000
621 #define ETXD_CHKOFF_MASK 0x07f00000
622 #define ETXD_CHKOFF_SHIFT 20
624 #define ETXD_D0CNT_MASK 0x0000007f
625 #define ETXD_B1CNT_MASK 0x0007ff00
626 #define ETXD_B1CNT_SHIFT 8
627 #define ETXD_B2CNT_MASK 0x7ff00000
628 #define ETXD_B2CNT_SHIFT 20
645 #define IOC3_SDB_ETHER (1<<ioc3_subdev_ether)
646 #define IOC3_SDB_GENERIC (1<<ioc3_subdev_generic)
647 #define IOC3_SDB_NIC (1<<ioc3_subdev_nic)
648 #define IOC3_SDB_KBMS (1<<ioc3_subdev_kbms)
649 #define IOC3_SDB_TTYA (1<<ioc3_subdev_ttya)
650 #define IOC3_SDB_TTYB (1<<ioc3_subdev_ttyb)
651 #define IOC3_SDB_ECPP (1<<ioc3_subdev_ecpp)
652 #define IOC3_SDB_RT (1<<ioc3_subdev_rt)
654 #define IOC3_ALL_SUBDEVS ((1<<ioc3_nsubdevs)-1)
656 #define IOC3_SDB_SERIAL (IOC3_SDB_TTYA|IOC3_SDB_TTYB)
658 #define IOC3_STD_SUBDEVS IOC3_ALL_SUBDEVS
660 #define IOC3_INTA_SUBDEVS IOC3_SDB_ETHER
661 #define IOC3_INTB_SUBDEVS (IOC3_SDB_GENERIC|IOC3_SDB_KBMS|IOC3_SDB_SERIAL|IOC3_SDB_ECPP|IOC3_SDB_RT)