IO_ICU2
if (bus_space_map(sc->sc_iot, IO_ICU2, 2, 0, &sc->sc_ioh_icu2) != 0)
static const int picaddr[2] = { IO_ICU1, IO_ICU2 };
bus_space_map(sio_iot, IO_ICU2, 2, 0, &sio_ioh_icu2))
isa_outb(IO_ICU2, 0x0f);
vector = isa_inb(IO_ICU2);
isa_outb(IO_ICU2 + PIC_OCW1, imen >> 8);
isa_inb(IO_ICU2 + PIC_OCW1);
isa_outb(IO_ICU2 + PIC_OCW1, imen >> 8);
isa_outb(IO_ICU2 + PIC_OCW2,
isa_inb(IO_ICU2 + PIC_OCW1);
isa_outb(IO_ICU2 + PIC_OCW1, imen >> 8);
isa_outb(IO_ICU2 + PIC_ICW1, ICW1_SELECT | ICW1_IC4);
isa_outb(IO_ICU2 + PIC_ICW2, 8);
isa_outb(IO_ICU2 + PIC_ICW3, ICW3_SIC(IRQ_SLAVE));
isa_outb(IO_ICU2 + PIC_ICW4, ICW4_8086);
isa_outb(IO_ICU2 + PIC_OCW1, 0xff);
isa_outb(IO_ICU2 + PIC_OCW3, OCW3_SELECT | OCW3_SSMM | OCW3_SMM);
isa_outb(IO_ICU2 + PIC_OCW3, OCW3_SELECT | OCW3_RR);
outb(IO_ICU2 + 1, imen >> 8); \
outb(IO_ICU2, 0x11); /* reset; program device, four bytes */
outb(IO_ICU2+1, ICU_OFFSET+8); /* staring at this vector index */
outb(IO_ICU2+1, IRQ_SLAVE);
outb(IO_ICU2+1, 2 | 1); /* auto EOI, 8086 mode */
outb(IO_ICU2+1, 1); /* 8086 mode */
outb(IO_ICU2+1, 0xff); /* leave interrupts masked */
outb(IO_ICU2, 0x68); /* special mask mode (if available) */
outb(IO_ICU2, 0x0a); /* Read IRR by default. */
bus_space_map(icu_bst, PCIB_BASE + IO_ICU2, IO_ICUSIZE, 0, &icu2_bsh);
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_OCW3) =
ocw2 = REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_OCW3);
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_ICW1) =
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_ICW2) = ICW2_VECTOR(8);
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_ICW3) = ICW3_SIC(2);
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_ICW4) = ICW4_8086;
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_OCW1) = 0xff;
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_OCW3) =
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_OCW3) = OCW3_SELECT | OCW3_RR;
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + 1) = imr2;
(void)REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + 1);
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + 1) =
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_OCW2) =
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_OCW1) = 0xff;
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_ICW1) =
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_ICW2) = ICW2_VECTOR(8);
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_ICW3) = ICW3_SIC(2);
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_ICW4) = ICW4_8086;
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_OCW1) = 0xff;
REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_OCW3) = OCW3_SELECT | OCW3_RR;
(void)REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_OCW3);
imr2 = 0xff & ~REGVAL8(BONITO_PCIIO_BASE + IO_ICU2 + PIC_OCW1);
isr2 = REGVAL8(BONITO_PCIIO_BASE + IO_ICU2);
if (bus_space_map(sc->sc_iot, IO_ICU2, 2, 0, &sc->sc_ioh_icu2) != 0)
if (addr == IO_ICU2 || addr == IO_ICU2+1)
addr-IO_ICU2, val);
err = bus_space_map(&genppc_isa_io_space_tag, IO_ICU2, 2, 0,
if (addr == IO_ICU2 || addr == IO_ICU2+1)
addr-IO_ICU2);
isa_outb(IO_ICU2, 0x0c);
irq = (isa_inb(IO_ICU2) & 0x07) + 8;
isa_outb(IO_ICU2, 0x11); /* program device, four bytes */
isa_outb(IO_ICU2+1, 8); /* starting at this vector */
isa_outb(IO_ICU2+1, IRQ_SLAVE);
isa_outb(IO_ICU2+1, 1); /* 8086 mode */
isa_outb(IO_ICU2+1, 0xff); /* leave interrupts masked */
isa_outb(IO_ICU2+1, i8259->enable_mask >> 8);
isa_outb(IO_ICU2+1, i8259->enable_mask >> 8);
isa_outb(IO_ICU2, 0xe0 | (irq & 7));
outb(IO_ICU2 + 1, imen >> 8); \
outb(IO_ICU2, 0x19); /* reset; four bytes, level triggered */
outb(IO_ICU2+1, ICU_OFFSET+8); /* int base + offset for master: not used */
outb(IO_ICU2+1, IRQ_SLAVE); /* who ami i? */
outb(IO_ICU2+1, 2 | 1); /* auto EOI, 8086 mode */
outb(IO_ICU2+1, 0xff); /* disable all interrupts */
outb(IO_ICU2, 0x68); /* special mask mode (if available) */
outb(IO_ICU2, 0x0a); /* Read IRR by default. */
outb %al,$IO_ICU2 /* do the second ICU first */ ;\
#define SET_ICUS() (outb(IO_ICU1 + 1, imen), outb(IO_ICU2 + 1, imen >> 8))
outb(IO_ICU2 + PIC_ICW1, ICW1_SELECT | ICW1_LTIM | ICW1_IC4);
outb(IO_ICU2 + PIC_ICW1, ICW1_SELECT | ICW1_IC4);
outb(IO_ICU2 + PIC_ICW2, ICU_OFFSET + 8);
outb(IO_ICU2 + PIC_ICW3, ICW3_SIC(IRQ_SLAVE));
outb(IO_ICU2 + PIC_ICW4, ICW4_AEOI | ICW4_8086);
outb(IO_ICU2 + PIC_ICW4, ICW4_8086);
outb(IO_ICU2 + PIC_OCW1, 0xff);
outb(IO_ICU2 + PIC_OCW3, OCW3_SELECT | OCW3_SSMM | OCW3_SMM);
outb(IO_ICU2 + PIC_OCW3, OCW3_SELECT | OCW3_RR);
port = IO_ICU2 + PIC_OCW1;
port = IO_ICU2 + PIC_OCW1;
outb(IO_ICU2 + PIC_OCW1, i8259_imen >> 8);
outb(IO_ICU2 + PIC_OCW1, i8259_imen >> 8);