typedef struct BD BD; typedef struct Ring Ring; /* * types of interrupts */ enum { /* some flags to change polarity and sensitivity */ IRQmask= 0xFF, /* actual vector address */ IRQactivelow= 0<<8, IRQactivehigh= 1<<8, IRQrising= 2<<8, IRQfalling= 4<<8, IRQmode= IRQactivelow | IRQactivehigh | IRQrising | IRQfalling, IRQsoft= 1<<11, /* configure ext0 to ext3 as GPIO output */ IRQ= 0, /* notional bus */ }; enum { IRQwmlc= 31, /* WAN link changed (edge) */ IRQwmts= 30, /* WAN MAC transmit status (edge) */ IRQwmrs= 29, /* WAN MAC receive status (edge) */ IRQwmtbu= 28, /* WAN MAC transmit buffer unavailable (edge) */ IRQwmrbu= 27, /* WAN MAC receive buffer unavailable (edge) */ IRQwmtps= 26, /* WAN MAC transmit process stopped (edge) */ IRQwmrps= 25, /* WAN MAC receive process stopped (edge) */ IRQaber= 24, /* AMBA bus error (level) */ IRQlmts= 17, /* LAN MAC transmit status (edge) */ IRQlmrs= 16, /* LAN MAC receive status (edge) */ IRQlmtbu= 15, /* LAN AMC transmit buffer unavailable (edge) */ IRQlmrbu= 14, /* LAN MAC receive buffer unavailable (edge) */ IRQlmtps= 13, /* LAN MAC transmit process stopped (edge) */ IRQlmrps= 12, /* LAN MAC receive process stopped (edge) */ IRQums= 11, /* UART modem status (level) */ IRQule= 10, /* UART line status (level) */ IRQurs= 9, /* UART receive status (level) */ IRQuts= 8, /* UART transmit status (level) */ IRQtm1= 7, /* timer 1 (edge) */ IRQtm0= 6, /* timer 0 (edge) */ IRQext3= 5, /* external interrupts (gpio control selects edge or level) */ IRQext2= 4, IRQext1= 3, IRQext0= 2, IRQccts= 1, /* comms channel transmit status (level) */ IRQccrs= 0, /* comms channel receive status (level) */ }; /* * these are defined to keep the interface compatible with other * architectures, but only BUSUNKNOWN is currently used */ #define MKBUS(t,b,d,f) (((t)<<24)|(((b)&0xFF)<<16)|(((d)&0x1F)<<11)|(((f)&0x07)<<8)) #define BUSFNO(tbdf) (((tbdf)>>8)&0x07) #define BUSDNO(tbdf) (((tbdf)>>11)&0x1F) #define BUSBNO(tbdf) (((tbdf)>>16)&0xFF) #define BUSTYPE(tbdf) ((tbdf)>>24) #define BUSBDF(tbdf) ((tbdf)&0x00FFFF00) #define BUSUNKNOWN (-1) enum { BusIRQ = IRQ, BusPCI, MaxBus }; #define INTRREG ((IntrReg*)PHYSINTR) typedef struct IntrReg IntrReg; struct IntrReg { ulong mc; /* mode control */ ulong en; /* enable */ ulong st; /* status */ ulong pw; /* priority for WAN */ ulong pad0; ulong pl; /* priority for LAN */ ulong pt; /* priority for timer */ ulong pu; /* priority for UART */ ulong pe; /* priority for external */ ulong pc; /* priority for comms channel */ ulong pbe; /* priority for bus error response */ ulong ms; /* mask status */ ulong hpf; /* highest priority for FIQ */ ulong hpi; /* highest priority for IRQ */ }; #define TIMERREG ((TimerReg*)PHYSTIMER) typedef struct TimerReg TimerReg; struct TimerReg { ulong enable; /* 1<