Go to the documentation of this file.
34 #define PCI_VENDOR_ID 0x00
35 #define PCI_DEVICE_ID 0x02
36 #define PCI_COMMAND 0x04
37 #define PCI_STATUS 0x06
38 #define PCI_REV_ID 0x08
39 #define PCI_CLASS_CODE 0x09
40 #define PCI_CACHE_LSZ 0x0c
41 #define PCI_LAT_TIM 0x0d
42 #define PCI_HEADER_T 0x0e
44 #define PCI_BASE_1ST 0x10
45 #define PCI_BASE_2ND 0x14
47 #define PCI_SUB_VID 0x2c
48 #define PCI_SUB_ID 0x2e
49 #define PCI_BASE_ROM 0x30
51 #define PCI_CAP_PTR 0x34
53 #define PCI_IRQ_LINE 0x3c
54 #define PCI_IRQ_PIN 0x3d
55 #define PCI_MIN_GNT 0x3e
56 #define PCI_MAX_LAT 0x3f
58 #define PCI_OUR_REG 0x40
59 #define PCI_OUR_REG_1 0x40
60 #define PCI_OUR_REG_2 0x44
62 #define PCI_PM_CAP_ID 0x48
63 #define PCI_PM_NITEM 0x49
64 #define PCI_PM_CAP_REG 0x4a
65 #define PCI_PM_CTL_STS 0x4c
67 #define PCI_PM_DAT_REG 0x4f
69 #define PCI_VPD_CAP_ID 0x50
70 #define PCI_VPD_NITEM 0x51
71 #define PCI_VPD_ADR_REG 0x52
72 #define PCI_VPD_DAT_REG 0x54
81 #define I2C_ADDR_VPD 0xA0
90 #define PCI_FBTEN 0x0200
91 #define PCI_SERREN 0x0100
92 #define PCI_ADSTEP 0x0080
93 #define PCI_PERREN 0x0040
94 #define PCI_VGA_SNOOP 0x0020
95 #define PCI_MWIEN 0x0010
96 #define PCI_SCYCEN 0x0008
97 #define PCI_BMEN 0x0004
98 #define PCI_MEMEN 0x0002
99 #define PCI_IOEN 0x0001
102 #define PCI_PERR 0x8000
103 #define PCI_SERR 0x4000
104 #define PCI_RMABORT 0x2000
105 #define PCI_RTABORT 0x1000
106 #define PCI_STABORT 0x0800
107 #define PCI_DEVSEL 0x0600
108 #define PCI_DEV_FAST (0<<9)
109 #define PCI_DEV_MEDIUM (1<<9)
110 #define PCI_DEV_SLOW (2<<9)
111 #define PCI_DATAPERR 0x0100
112 #define PCI_FB2BCAP 0x0080
113 #define PCI_UDF 0x0040
114 #define PCI_66MHZCAP 0x0020
115 #define PCI_NEWCAP 0x0010
117 #define PCI_ERRBITS (PCI_PERR|PCI_SERR|PCI_RMABORT|PCI_STABORT|PCI_DATAPERR)
131 #define PCI_HD_MF_DEV 0x80
132 #define PCI_HD_TYPE 0x7f
135 #define PCI_BIST_CAP 0x80
136 #define PCI_BIST_ST 0x40
137 #define PCI_BIST_RET 0x0f
140 #define PCI_MEMSIZE 0x800L
141 #define PCI_MEMBASE_BITS 0xfffff800L
142 #define PCI_MEMSIZE_BIIS 0x000007f0L
143 #define PCI_PREFEN 0x00000008L
144 #define PCI_MEM_TYP 0x00000006L
145 #define PCI_MEM32BIT (0<<1)
146 #define PCI_MEM1M (1<<1)
147 #define PCI_MEM64BIT (2<<1)
148 #define PCI_MEMSPACE 0x00000001L
151 #define PCI_IOBASE 0xffffff00L
152 #define PCI_IOSIZE 0x000000fcL
153 #define PCI_IOSPACE 0x00000001L
159 #define PCI_ROMBASE 0xfffe0000L
160 #define PCI_ROMBASZ 0x0001c000L
161 #define PCI_ROMSIZE 0x00003800L
162 #define PCI_ROMEN 0x00000001L
173 #define PCI_PATCH_DIR (3L<<27)
174 #define PCI_PATCH_DIR_0 (1L<<27)
175 #define PCI_PATCH_DIR_1 (1L<<28)
177 #define PCI_EXT_PATCHS (3L<<25)
178 #define PCI_EXT_PATCH_0 (1L<<25)
179 #define PCI_EXT_PATCH_1 (1L<<26)
180 #define PCI_VIO (1L<<25)
181 #define PCI_EN_BOOT (1L<<24)
184 #define PCI_EN_IO (1L<<23)
185 #define PCI_EN_FPROM (1L<<22)
188 #define PCI_PAGESIZE (3L<<20)
189 #define PCI_PAGE_16 (0L<<20)
190 #define PCI_PAGE_32K (1L<<20)
191 #define PCI_PAGE_64K (2L<<20)
192 #define PCI_PAGE_128K (3L<<20)
194 #define PCI_PAGEREG (7L<<16)
196 #define PCI_FORCE_BE (1L<<14)
197 #define PCI_DIS_MRL (1L<<13)
198 #define PCI_DIS_MRM (1L<<12)
199 #define PCI_DIS_MWI (1L<<11)
200 #define PCI_DISC_CLS (1L<<10)
201 #define PCI_BURST_DIS (1L<<9)
202 #define PCI_BYTE_SWAP (1L<<8)
203 #define PCI_SKEW_DAS (0xfL<<4)
204 #define PCI_SKEW_BASE (0xfL<<0)
207 #define PCI_VPD_WR_TH (0xffL<<24)
208 #define PCI_DEV_SEL (0x7fL<<17)
209 #define PCI_VPD_ROM_SZ (7L<<14)
211 #define PCI_PATCH_DIR2 (0xfL<<8)
212 #define PCI_PATCH_DIR_2 (1L<<8)
213 #define PCI_PATCH_DIR_3 (1L<<9)
214 #define PCI_PATCH_DIR_4 (1L<<10)
215 #define PCI_PATCH_DIR_5 (1L<<11)
216 #define PCI_EXT_PATCHS2 (0xfL<<4)
217 #define PCI_EXT_PATCH_2 (1L<<4)
218 #define PCI_EXT_PATCH_3 (1L<<5)
219 #define PCI_EXT_PATCH_4 (1L<<6)
220 #define PCI_EXT_PATCH_5 (1L<<7)
221 #define PCI_EN_DUMMY_RD (1L<<3)
222 #define PCI_REV_DESC (1L<<2)
223 #define PCI_USEADDR64 (1L<<1)
224 #define PCI_USEDATA64 (1L<<0)
230 #define PCI_PME_SUP (0x1f<<11)
231 #define PCI_PM_D2_SUB (1<<10)
232 #define PCI_PM_D1_SUB (1<<9)
234 #define PCI_PM_DSI (1<<5)
235 #define PCI_PM_APS (1<<4)
236 #define PCI_PME_CLOCK (1<<3)
237 #define PCI_PM_VER (7<<0)
240 #define PCI_PME_STATUS (1<<15)
241 #define PCI_PM_DAT_SCL (3<<13)
242 #define PCI_PM_DAT_SEL (0xf<<9)
244 #define PCI_PM_STATE (3<<0)
245 #define PCI_PM_STATE_D0 (0<<0)
246 #define PCI_PM_STATE_D1 (1<<0)
247 #define PCI_PM_STATE_D2 (2<<0)
248 #define PCI_PM_STATE_D3 (3<<0)
255 #define PCI_VPD_FLAG (1<<15)
263 #define B0_RAP 0x0000
265 #define B0_CTRL 0x0004
266 #define B0_DAS 0x0005
267 #define B0_LED 0x0006
268 #define B0_TST_CTRL 0x0007
269 #define B0_ISRC 0x0008
270 #define B0_IMSK 0x000c
273 #define B0_CMDREG1 0x0010
274 #define B0_CMDREG2 0x0014
275 #define B0_ST1U 0x0010
276 #define B0_ST1L 0x0014
277 #define B0_ST2U 0x0018
278 #define B0_ST2L 0x001c
280 #define B0_MARR 0x0020
281 #define B0_MARW 0x0024
282 #define B0_MDRU 0x0028
283 #define B0_MDRL 0x002c
285 #define B0_MDREG3 0x0030
286 #define B0_ST3U 0x0034
287 #define B0_ST3L 0x0038
288 #define B0_IMSK3U 0x003c
289 #define B0_IMSK3L 0x0040
290 #define B0_IVR 0x0044
291 #define B0_IMR 0x0048
294 #define B0_CNTRL_A 0x0050
295 #define B0_CNTRL_B 0x0054
296 #define B0_INTR_MASK 0x0058
297 #define B0_XMIT_VECTOR 0x005c
299 #define B0_STATUS_A 0x0060
300 #define B0_STATUS_B 0x0064
301 #define B0_CNTRL_C 0x0068
302 #define B0_MDREG1 0x006c
304 #define B0_R1_CSR 0x0070
305 #define B0_R2_CSR 0x0074
306 #define B0_XA_CSR 0x0078
307 #define B0_XS_CSR 0x007c
318 #define B2_MAC_0 0x0100
319 #define B2_MAC_1 0x0101
320 #define B2_MAC_2 0x0102
321 #define B2_MAC_3 0x0103
322 #define B2_MAC_4 0x0104
323 #define B2_MAC_5 0x0105
324 #define B2_MAC_6 0x0106
325 #define B2_MAC_7 0x0107
327 #define B2_CONN_TYP 0x0108
328 #define B2_PMD_TYP 0x0109
331 #define B2_E_0 0x010c
332 #define B2_E_1 0x010d
333 #define B2_E_2 0x010e
334 #define B2_E_3 0x010f
335 #define B2_FAR 0x0110
336 #define B2_FDP 0x0114
338 #define B2_LD_CRTL 0x0118
339 #define B2_LD_TEST 0x0119
341 #define B2_TI_INI 0x0120
342 #define B2_TI_VAL 0x0124
343 #define B2_TI_CRTL 0x0128
344 #define B2_TI_TEST 0x0129
346 #define B2_WDOG_INI 0x0130
347 #define B2_WDOG_VAL 0x0134
348 #define B2_WDOG_CRTL 0x0138
349 #define B2_WDOG_TEST 0x0139
351 #define B2_RTM_INI 0x0140
352 #define B2_RTM_VAL 0x0144
353 #define B2_RTM_CRTL 0x0148
354 #define B2_RTM_TEST 0x0149
356 #define B2_TOK_COUNT 0x014c
357 #define B2_DESC_ADDR_H 0x0150
358 #define B2_CTRL_2 0x0154
359 #define B2_IFACE_REG 0x0155
361 #define B2_TST_CTRL_2 0x0157
362 #define B2_I2C_CTRL 0x0158
363 #define B2_I2C_DATA 0x015c
365 #define B2_IRQ_MOD_INI 0x0160
366 #define B2_IRQ_MOD_VAL 0x0164
367 #define B2_IRQ_MOD_CTRL 0x0168
368 #define B2_IRQ_MOD_TEST 0x0169
377 #define B3_CFG_SPC 0x180
382 #define B4_R1_D 0x0200
383 #define B4_R1_DA 0x0210
384 #define B4_R1_AC 0x0214
385 #define B4_R1_BC 0x0218
386 #define B4_R1_CSR 0x021c
387 #define B4_R1_F 0x0220
388 #define B4_R1_T1 0x0224
389 #define B4_R1_T1_TR 0x0224
390 #define B4_R1_T1_WR 0x0225
391 #define B4_R1_T1_RD 0x0226
392 #define B4_R1_T1_SV 0x0227
393 #define B4_R1_T2 0x0228
394 #define B4_R1_T3 0x022c
395 #define B4_R1_DA_H 0x0230
396 #define B4_R1_AC_H 0x0234
399 #define B4_R2_D 0x0240
400 #define B4_R2_DA 0x0250
401 #define B4_R2_AC 0x0254
402 #define B4_R2_BC 0x0258
403 #define B4_R2_CSR 0x025c
404 #define B4_R2_F 0x0260
405 #define B4_R2_T1 0x0264
406 #define B4_R2_T1_TR 0x0264
407 #define B4_R2_T1_WR 0x0265
408 #define B4_R2_T1_RD 0x0266
409 #define B4_R2_T1_SV 0x0267
410 #define B4_R2_T2 0x0268
411 #define B4_R2_T3 0x026c
417 #define B5_XA_D 0x0280
418 #define B5_XA_DA 0x0290
419 #define B5_XA_AC 0x0294
420 #define B5_XA_BC 0x0298
421 #define B5_XA_CSR 0x029c
422 #define B5_XA_F 0x02a0
423 #define B5_XA_T1 0x02a4
424 #define B5_XA_T1_TR 0x02a4
425 #define B5_XA_T1_WR 0x02a5
426 #define B5_XA_T1_RD 0x02a6
427 #define B5_XA_T1_SV 0x02a7
428 #define B5_XA_T2 0x02a8
429 #define B5_XA_T3 0x02ac
430 #define B5_XA_DA_H 0x02b0
431 #define B5_XA_AC_H 0x02b4
433 #define B5_XS_D 0x02c0
434 #define B5_XS_DA 0x02d0
435 #define B5_XS_AC 0x02d4
436 #define B5_XS_BC 0x02d8
437 #define B5_XS_CSR 0x02dc
438 #define B5_XS_F 0x02e0
439 #define B5_XS_T1 0x02e4
440 #define B5_XS_T1_TR 0x02e4
441 #define B5_XS_T1_WR 0x02e5
442 #define B5_XS_T1_RD 0x02e6
443 #define B5_XS_T1_SV 0x02e7
444 #define B5_XS_T2 0x02e8
445 #define B5_XS_T3 0x02ec
446 #define B5_XS_DA_H 0x02f0
447 #define B5_XS_AC_H 0x02f4
455 #define B6_EXT_REG 0x300
474 #define CTRL_FDDI_CLR (1<<7)
475 #define CTRL_FDDI_SET (1<<6)
476 #define CTRL_HPI_CLR (1<<5)
477 #define CTRL_HPI_SET (1<<4)
478 #define CTRL_MRST_CLR (1<<3)
479 #define CTRL_MRST_SET (1<<2)
480 #define CTRL_RST_CLR (1<<1)
481 #define CTRL_RST_SET (1<<0)
484 #define BUS_CLOCK (1<<7)
485 #define BUS_SLOT_SZ (1<<6)
487 #define DAS_AVAIL (1<<3)
488 #define DAS_BYP_ST (1<<2)
489 #define DAS_BYP_INS (1<<1)
490 #define DAS_BYP_RMV (1<<0)
494 #define LED_2_ON (1<<5)
495 #define LED_2_OFF (1<<4)
496 #define LED_1_ON (1<<3)
497 #define LED_1_OFF (1<<2)
498 #define LED_0_ON (1<<1)
499 #define LED_0_OFF (1<<0)
502 #define LED_GA_ON LED_2_ON
503 #define LED_GA_OFF LED_2_OFF
504 #define LED_MY_ON LED_1_ON
505 #define LED_MY_OFF LED_1_OFF
506 #define LED_GB_ON LED_0_ON
507 #define LED_GB_OFF LED_0_OFF
510 #define TST_FRC_DPERR_MR (1<<7)
511 #define TST_FRC_DPERR_MW (1<<6)
512 #define TST_FRC_DPERR_TR (1<<5)
513 #define TST_FRC_DPERR_TW (1<<4)
514 #define TST_FRC_APERR_M (1<<3)
515 #define TST_FRC_APERR_T (1<<2)
516 #define TST_CFG_WRITE_ON (1<<1)
517 #define TST_CFG_WRITE_OFF (1<<0)
521 #define IS_I2C_READY (1L<<27)
522 #define IS_IRQ_SW (1L<<26)
523 #define IS_EXT_REG (1L<<25)
524 #define IS_IRQ_STAT (1L<<24)
526 #define IS_IRQ_MST_ERR (1L<<23)
528 #define IS_TIMINT (1L<<22)
529 #define IS_TOKEN (1L<<21)
533 #define IS_PLINT1 (1L<<20)
534 #define IS_PLINT2 (1L<<19)
535 #define IS_MINTR3 (1L<<18)
536 #define IS_MINTR2 (1L<<17)
537 #define IS_MINTR1 (1L<<16)
539 #define IS_R1_P (1L<<15)
540 #define IS_R1_B (1L<<14)
541 #define IS_R1_F (1L<<13)
542 #define IS_R1_C (1L<<12)
544 #define IS_R2_P (1L<<11)
545 #define IS_R2_B (1L<<10)
546 #define IS_R2_F (1L<<9)
547 #define IS_R2_C (1L<<8)
550 #define IS_XA_B (1L<<6)
551 #define IS_XA_F (1L<<5)
552 #define IS_XA_C (1L<<4)
555 #define IS_XS_B (1L<<2)
556 #define IS_XS_F (1L<<1)
557 #define IS_XS_C (1L<<0)
562 #define ALL_IRSR 0x01ffff77L
563 #define ALL_IRSR_ML 0x0ffff077L
573 #define IRQ_I2C_READY (1L<<27)
574 #define IRQ_SW (1L<<26)
575 #define IRQ_EXT_REG (1L<<25)
576 #define IRQ_STAT (1L<<24)
578 #define IRQ_MST_ERR (1L<<23)
580 #define IRQ_TIMER (1L<<22)
581 #define IRQ_RTM (1L<<21)
582 #define IRQ_DAS (1L<<20)
583 #define IRQ_IFCP_4 (1L<<19)
584 #define IRQ_IFCP_3 (1L<<18)
585 #define IRQ_IFCP_2 (1L<<17)
586 #define IRQ_IFCP_1 (1L<<16)
588 #define IRQ_R1_P (1L<<15)
589 #define IRQ_R1_B (1L<<14)
590 #define IRQ_R1_F (1L<<13)
591 #define IRQ_R1_C (1L<<12)
593 #define IRQ_R2_P (1L<<11)
594 #define IRQ_R2_B (1L<<10)
595 #define IRQ_R2_F (1L<<9)
596 #define IRQ_R2_C (1L<<8)
599 #define IRQ_XA_B (1L<<6)
600 #define IRQ_XA_F (1L<<5)
601 #define IRQ_XA_C (1L<<4)
604 #define IRQ_XS_B (1L<<2)
605 #define IRQ_XS_F (1L<<1)
606 #define IRQ_XS_C (1L<<0)
635 #define FAR_ADDR 0x1ffffL
643 #define LD_T_ON (1<<3)
644 #define LD_T_OFF (1<<2)
645 #define LD_T_STEP (1<<1)
646 #define LD_START (1<<0)
665 #define GET_TOK_CT (1<<4)
666 #define TIM_RES_TOK (1<<3)
667 #define TIM_ALARM (1<<3)
668 #define TIM_START (1<<2)
669 #define TIM_STOP (1<<1)
670 #define TIM_CL_IRQ (1<<0)
672 #define TIM_T_ON (1<<2)
673 #define TIM_T_OFF (1<<1)
674 #define TIM_T_STEP (1<<0)
680 #define CTRL_CL_I2C_IRQ (1<<4)
681 #define CTRL_ST_SW_IRQ (1<<3)
682 #define CTRL_CL_SW_IRQ (1<<2)
683 #define CTRL_STOP_DONE (1<<1)
684 #define CTRL_STOP_MAST (1<<0)
688 #define IF_I2C_DATA_DIR (1<<2)
689 #define IF_I2C_DATA (1<<1)
690 #define IF_I2C_CLK (1<<0)
697 #define TST_FRC_DPERR_MR64 (1<<3)
698 #define TST_FRC_DPERR_MW64 (1<<2)
699 #define TST_FRC_APERR_1M64 (1<<1)
700 #define TST_FRC_APERR_2M64 (1<<0)
703 #define I2C_FLAG (1L<<31)
704 #define I2C_ADDR (0x7fffL<<16)
705 #define I2C_DEV_SEL (0x7fL<<9)
707 #define I2C_BURST_LEN (1L<<4)
708 #define I2C_DEV_SIZE (7L<<1)
709 #define I2C_025K_DEV (0L<<1)
710 #define I2C_05K_DEV (1L<<1)
711 #define I2C_1K_DEV (2L<<1)
712 #define I2C_2K_DEV (3L<<1)
713 #define I2C_4K_DEV (4L<<1)
714 #define I2C_8K_DEV (5L<<1)
715 #define I2C_16K_DEV (6L<<1)
716 #define I2C_32K_DEV (7L<<1)
717 #define I2C_STOP_BIT (1<<0)
726 #define I2C_ADDR_TEMP 0x90
767 #define CSR_DESC_CLEAR (1L<<21)
768 #define CSR_DESC_SET (1L<<20)
769 #define CSR_FIFO_CLEAR (1L<<19)
770 #define CSR_FIFO_SET (1L<<18)
771 #define CSR_HPI_RUN (1L<<17)
772 #define CSR_HPI_RST (1L<<16)
773 #define CSR_SV_RUN (1L<<15)
774 #define CSR_SV_RST (1L<<14)
775 #define CSR_DREAD_RUN (1L<<13)
776 #define CSR_DREAD_RST (1L<<12)
777 #define CSR_DWRITE_RUN (1L<<11)
778 #define CSR_DWRITE_RST (1L<<10)
779 #define CSR_TRANS_RUN (1L<<9)
780 #define CSR_TRANS_RST (1L<<8)
782 #define CSR_START (1L<<4)
783 #define CSR_IRQ_CL_P (1L<<3)
784 #define CSR_IRQ_CL_B (1L<<2)
785 #define CSR_IRQ_CL_F (1L<<1)
786 #define CSR_IRQ_CL_C (1L<<0)
788 #define CSR_SET_RESET (CSR_DESC_SET|CSR_FIFO_SET|CSR_HPI_RST|CSR_SV_RST|\
789 CSR_DREAD_RST|CSR_DWRITE_RST|CSR_TRANS_RST)
790 #define CSR_CLR_RESET (CSR_DESC_CLEAR|CSR_FIFO_CLEAR|CSR_HPI_RUN|CSR_SV_RUN|\
791 CSR_DREAD_RUN|CSR_DWRITE_RUN|CSR_TRANS_RUN)
796 #define F_ALM_FULL (1L<<27)
797 #define F_FIFO_EOF (1L<<26)
798 #define F_WM_REACHED (1L<<25)
799 #define F_UP_DW_USED (1L<<24)
801 #define F_FIFO_LEVEL (0x1fL<<16)
803 #define F_ML_WATER_M 0x0000ffL
804 #define FLAG_WATER 0x00001fL
808 #define SM_CRTL_SV (0xffL<<24)
809 #define SM_CRTL_RD (0xffL<<16)
810 #define SM_CRTL_WR (0xffL<<8)
811 #define SM_CRTL_TR (0xffL<<0)
818 #define SM_STATE 0xf0
820 #define SM_TEST_ON 0x04
821 #define SM_TEST_OFF 0x02
825 #define SM_SV_IDLE 0x0
826 #define SM_SV_RES_START 0x1
827 #define SM_SV_GET_DESC 0x3
828 #define SM_SV_CHECK 0x2
829 #define SM_SV_MOV_DATA 0x6
830 #define SM_SV_PUT_DESC 0x7
831 #define SM_SV_SET_IRQ 0x5
833 #define SM_RD_IDLE 0x0
834 #define SM_RD_LOAD 0x1
835 #define SM_RD_WAIT_TC 0x3
836 #define SM_RD_RST_EOF 0x6
837 #define SM_RD_WDONE_R 0x2
838 #define SM_RD_WDONE_T 0x4
840 #define SM_TR_IDLE 0x0
841 #define SM_TR_LOAD 0x3
842 #define SM_TR_LOAD_R_ML 0x1
843 #define SM_TR_WAIT_TC 0x2
844 #define SM_TR_WDONE 0x4
846 #define SM_WR_IDLE 0x0
847 #define SM_WR_ABLEN 0x1
848 #define SM_WR_LD_A4 0x2
849 #define SM_WR_RES_OWN 0x2
850 #define SM_WR_WAIT_EOF 0x3
851 #define SM_WR_LD_N2C_R 0x4
852 #define SM_WR_WAIT_TC_R 0x5
853 #define SM_WR_WAIT_TC4 0x6
854 #define SM_WR_LD_A_T 0x6
855 #define SM_WR_LD_A_R 0x7
856 #define SM_WR_WAIT_TC_T 0x7
857 #define SM_WR_LD_N2C_T 0xc
858 #define SM_WR_WDONE_T 0x9
859 #define SM_WR_WDONE_R 0xc
860 #define SM_WR_LD_D_AD 0xe
861 #define SM_WR_WAIT_D_TC 0xf
866 #define AC_TEST_ON (1<<7)
867 #define AC_TEST_OFF (1<<6)
868 #define BC_TEST_ON (1<<5)
869 #define BC_TEST_OFF (1<<4)
870 #define TEST_STEP04 (1<<3)
871 #define TEST_STEP03 (1<<2)
872 #define TEST_STEP02 (1<<1)
873 #define TEST_STEP01 (1<<0)
878 #define T3_MUX_2 (1<<7)
879 #define T3_VRAM_2 (1<<6)
880 #define T3_LOOP (1<<5)
881 #define T3_UNLOOP (1<<4)
882 #define T3_MUX (3<<2)
883 #define T3_VRAM (3<<0)
889 #define PCI_VEND_ID0 0x48
890 #define PCI_VEND_ID1 0x11
892 #define PCI_DEV_ID0 0x00
893 #define PCI_DEV_ID1 0x40
896 #define PCI_NW_CLASS 0x02
897 #define PCI_SUB_CLASS 0x02
898 #define PCI_PROG_INTFC 0x00
903 #define FMA(a) (0x0400|((a)<<2))
904 #define P1(a) (0x0380|((a)<<2))
905 #define P2(a) (0x0600|((a)<<2))
906 #define PRA(a) (B2_MAC_0 + (a))
911 #define MAX_PAGES 0x20000L
917 #define BMU_OWN (1UL<<31)
918 #define BMU_STF (1L<<30)
919 #define BMU_EOF (1L<<29)
920 #define BMU_EN_IRQ_EOB (1L<<28)
921 #define BMU_EN_IRQ_EOF (1L<<27)
922 #define BMU_DEV_0 (1L<<26)
923 #define BMU_SMT_TX (1L<<25)
924 #define BMU_ST_BUF (1L<<25)
925 #define BMU_UNUSED (1L<<24)
926 #define BMU_SW (3L<<24)
927 #define BMU_CHECK 0x00550000L
928 #define BMU_BBC 0x0000FFFFL
934 #define ADDR(a) (char far *) smc->hw.iop+(a)
935 #define ADDRS(smc,a) (char far *) (smc)->hw.iop+(a)
937 #define ADDR(a) (((a)>>7) ? (outp(smc->hw.iop+B0_RAP,(a)>>7), \
938 (smc->hw.iop+(((a)&0x7F)|((a)>>7 ? 0x80:0)))) : \
939 (smc->hw.iop+(((a)&0x7F)|((a)>>7 ? 0x80:0))))
940 #define ADDRS(smc,a) (((a)>>7) ? (outp((smc)->hw.iop+B0_RAP,(a)>>7), \
941 ((smc)->hw.iop+(((a)&0x7F)|((a)>>7 ? 0x80:0)))) : \
942 ((smc)->hw.iop+(((a)&0x7F)|((a)>>7 ? 0x80:0))))
948 #define PCI_C(a) ADDR(B3_CFG_SPC + (a))
950 #define EXT_R(a) ADDR(B6_EXT_REG + (a))
960 #define FM_A(a) ADDR(FMA(a))
961 #define P1_A(a) ADDR(P1(a))
962 #define P2_A(a) ADDR(P2(a))
963 #define PR_A(a) ADDR(PRA(a))
968 #define READ_PROM(a) ((u_char)inp(a))
970 #define GET_PAGE(bank) outpd(ADDR(B2_FAR),bank)
977 #define ISR_A ADDR(B0_ISRC)
978 #define GET_ISR() inpd(ISR_A)
979 #define GET_ISR_SMP(iop) inpd((iop)+B0_ISRC)
980 #define CHECK_ISR() (inpd(ISR_A) & inpd(ADDR(B0_IMSK)))
981 #define CHECK_ISR_SMP(iop) (inpd((iop)+B0_ISRC) & inpd((iop)+B0_IMSK))
990 #define CLI_FBI() outpd(ADDR(B0_IMSK),0)
992 #define CLI_FBI(smc) outpd(ADDRS((smc),B0_IMSK),0)
996 #define STI_FBI() outpd(ADDR(B0_IMSK),smc->hw.is_imask)
998 #define STI_FBI(smc) outpd(ADDRS((smc),B0_IMSK),(smc)->hw.is_imask)
1001 #define CLI_FBI_SMP(iop) outpd((iop)+B0_IMSK,0)
1002 #define STI_FBI_SMP(smc,iop) outpd((iop)+B0_IMSK,(smc)->hw.is_imask)
1013 #define MAX_TRANS (0x0fff)
1018 #define MST_8259 (0x20)
1019 #define SLV_8259 (0xA0)
1027 #define SNPPND_TIME (5)
1029 #define MAC_AD 0x405a0000
1031 #define MODR1 FM_A(FM_MDREG1)
1032 #define MODR2 FM_A(FM_MDREG2)
1034 #define CMDR1 FM_A(FM_CMDREG1)
1035 #define CMDR2 FM_A(FM_CMDREG2)
1041 #define CLEAR(io,mask) outpw((io),inpw(io)&(~(mask)))
1042 #define SET(io,mask) outpw((io),inpw(io)|(mask))
1043 #define GET(io,mask) (inpw(io)&(mask))
1044 #define SETMASK(io,val,mask) outpw((io),(inpw(io) & ~(mask)) | (val))
1050 #define PLC(np,reg) (((np) == PA) ? P2_A(reg) : P1_A(reg))
1055 #define MARW(ma) outpw(FM_A(FM_MARW),(unsigned int)(ma))
1056 #define MARR(ma) outpw(FM_A(FM_MARR),(unsigned int)(ma))
1062 #define MDRW(dd) outpw(FM_A(FM_MDRU),(unsigned int)((dd)>>16)) ;\
1063 outpw(FM_A(FM_MDRL),(unsigned int)(dd))
1067 #define MDRR() (((long)inpw(FM_A(FM_MDRU))<<16) + inpw(FM_A(FM_MDRL)))
1070 #define GET_ST1() (((long)inpw(FM_A(FM_ST1U))<<16) + inpw(FM_A(FM_ST1L)))
1071 #define GET_ST2() (((long)inpw(FM_A(FM_ST2U))<<16) + inpw(FM_A(FM_ST2L)))
1073 #define GET_ST3() (((long)inpw(FM_A(FM_ST3U))<<16) + inpw(FM_A(FM_ST3L)))
1077 #define MDRR() inp2w((FM_A(FM_MDRU)),(FM_A(FM_MDRL)))
1080 #define GET_ST1() inp2w((FM_A(FM_ST1U)),(FM_A(FM_ST1L)))
1081 #define GET_ST2() inp2w((FM_A(FM_ST2U)),(FM_A(FM_ST2L)))
1083 #define GET_ST3() inp2w((FM_A(FM_ST3U)),(FM_A(FM_ST3L)))
1089 #define OUT_82c54_TIMER(port,val) outpw(TI_A(port),(val)<<8)
1090 #define IN_82c54_TIMER(port) ((inpw(TI_A(port))>>8) & 0xff)
1094 #define DB_MAC(mac,st) {if (debug_mac & 0x1)\
1096 if (debug_mac & 0x2)\
1097 printf("\tMAC %d status 0x%08lx\n",mac,st) ;\
1098 if (debug_mac & 0x4)\
1102 #define DB_PLC(p,iev) { if (debug_plc & 0x1)\
1104 if (debug_plc & 0x2)\
1105 printf("\tPLC %s Int 0x%04x\n", \
1106 (p == PA) ? "A" : "B", iev) ;\
1107 if (debug_plc & 0x4)\
1111 #define DB_TIMER() { if (debug_timer & 0x1)\
1113 if (debug_timer & 0x2)\
1114 printf("\tTimer ISR\n") ;\
1119 #define DB_MAC(mac,st)
1120 #define DB_PLC(p,iev)
1125 #define INC_PTR(sp,cp,ep) if (++cp == ep) cp = sp
1129 #define COUNT(t) ((t)<<6)
1130 #define RW_OP(o) ((o)<<4)
1131 #define TMODE(m) ((m)<<1)