IO_ICU1
if (bus_space_map(sc->sc_iot, IO_ICU1, 2, 0, &sc->sc_ioh_icu1) != 0)
static const int picaddr[2] = { IO_ICU1, IO_ICU2 };
if (bus_space_map(sio_iot, IO_ICU1, 2, 0, &sio_ioh_icu1) ||
isa_outb(IO_ICU1, 0x0f); /* Poll */
vector = isa_inb(IO_ICU1);
isa_outb(IO_ICU1 + PIC_OCW1, imen);
isa_outb(IO_ICU1,
isa_inb(IO_ICU1 + PIC_OCW1);
isa_outb(IO_ICU1 + PIC_OCW1, imen);
isa_outb(IO_ICU1 + PIC_OCW2,
isa_inb(IO_ICU1 + PIC_OCW1);
isa_outb(IO_ICU1 + PIC_OCW1, imen);
isa_outb(IO_ICU1 + PIC_ICW1, ICW1_SELECT | ICW1_IC4);
isa_outb(IO_ICU1 + PIC_ICW2, 0);
isa_outb(IO_ICU1 + PIC_ICW3, ICW3_CASCADE(IRQ_SLAVE));
isa_outb(IO_ICU1 + PIC_ICW4, ICW4_8086);
isa_outb(IO_ICU1 + PIC_OCW1, 0xff);
isa_outb(IO_ICU1 + PIC_OCW3, OCW3_SELECT | OCW3_SSMM | OCW3_SMM);
isa_outb(IO_ICU1 + PIC_OCW3, OCW3_SELECT | OCW3_RR);
isa_outb(IO_ICU1 + PIC_OCW2,
outb(IO_ICU1 + 1, imen); \
outb(IO_ICU1, 0x11); /* reset; program device, four bytes */
outb(IO_ICU1+1, ICU_OFFSET); /* starting at this vector index */
outb(IO_ICU1+1, 1 << IRQ_SLAVE); /* slave on line 2 */
outb(IO_ICU1+1, 2 | 1); /* auto EOI, 8086 mode */
outb(IO_ICU1+1, 1); /* 8086 mode */
outb(IO_ICU1+1, 0xff); /* leave interrupts masked */
outb(IO_ICU1, 0x68); /* special mask mode (if available) */
outb(IO_ICU1, 0x0a); /* Read IRR by default. */
outb(IO_ICU1, 0xc0 | (3 - 1)); /* pri order 3-7, 0-2 (com2 first) */
bus_space_map(icu_bst, PCIB_BASE + IO_ICU1, IO_ICUSIZE, 0, &icu1_bsh);
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_OCW3) =
ocw1 = REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_OCW3);
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_ICW1) =
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_ICW2) = ICW2_VECTOR(0);
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_ICW3) = ICW3_CASCADE(2);
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_ICW4) = ICW4_8086;
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_OCW1) = 0xff;
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_OCW3) =
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_OCW3) = OCW3_SELECT | OCW3_RR;
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + 1) = imr1;
(void)REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + 1);
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + 1) =
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_OCW2) =
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_OCW1) = 0xff;
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_ICW1) =
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_ICW2) = ICW2_VECTOR(0);
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_ICW3) = ICW3_CASCADE(2);
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_ICW4) = ICW4_8086;
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_OCW1) = 0xff;
REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_OCW3) = OCW3_SELECT | OCW3_RR;
(void)REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_OCW3);
imr1 = 0xff & ~REGVAL8(BONITO_PCIIO_BASE + IO_ICU1 + PIC_OCW1);
isr1 = REGVAL8(BONITO_PCIIO_BASE + IO_ICU1);
if (bus_space_map(sc->sc_iot, IO_ICU1, 2, 0, &sc->sc_ioh_icu1) != 0)
err = bus_space_map(&genppc_isa_io_space_tag, IO_ICU1, 2, 0,
if (addr == IO_ICU1 || addr == IO_ICU1+1)
addr-IO_ICU1);
if (addr == IO_ICU1 || addr == IO_ICU1+1)
addr-IO_ICU1, val);
isa_outb(IO_ICU1, 0x0c);
irq = isa_inb(IO_ICU1) & 0x07;
isa_outb(IO_ICU1, 0x11); /* program device, four bytes */
isa_outb(IO_ICU1+1, 0); /* starting at this vector */
isa_outb(IO_ICU1+1, 1 << IRQ_SLAVE); /* slave on line 2 */
isa_outb(IO_ICU1+1, 1); /* 8086 mode */
isa_outb(IO_ICU1+1, 0xff); /* leave interrupts masked */
isa_outb(IO_ICU1+1, i8259->enable_mask);
isa_outb(IO_ICU1+1, i8259->enable_mask);
isa_outb(IO_ICU1, 0xe0 | irq);
isa_outb(IO_ICU1, 0xe0 | IRQ_SLAVE);
outb(IO_ICU1 + 1, imen); \
outb(IO_ICU1, 0x19); /* reset; four bytes, level triggered */
outb(IO_ICU1+1, ICU_OFFSET); /* int base: not used */
outb(IO_ICU1+1, 1 << IRQ_SLAVE); /* slave on line 2 */
outb(IO_ICU1+1, 2 | 1); /* auto EOI, 8086 mode */
outb(IO_ICU1+1, 0xff); /* disable all interrupts */
outb(IO_ICU1, 0x68); /* special mask mode (if available) */
outb(IO_ICU1, 0x0a); /* Read IRR, not ISR */
outb %al,$IO_ICU1
outb %al,$IO_ICU1
#define SET_ICUS() (outb(IO_ICU1 + 1, imen), outb(IO_ICU2 + 1, imen >> 8))
outb %al,$IO_ICU1
outb(IO_ICU1 + PIC_ICW1, ICW1_SELECT | ICW1_LTIM | ICW1_IC4);
outb(IO_ICU1 + PIC_ICW1, ICW1_SELECT | ICW1_IC4);
outb(IO_ICU1 + PIC_ICW2, ICU_OFFSET);
outb(IO_ICU1 + PIC_ICW3, ICW3_CASCADE(IRQ_SLAVE));
outb(IO_ICU1 + PIC_ICW4, ICW4_AEOI | ICW4_8086);
outb(IO_ICU1 + PIC_ICW4, ICW4_8086);
outb(IO_ICU1 + PIC_OCW1, 0xff);
outb(IO_ICU1 + PIC_OCW3, OCW3_SELECT | OCW3_SSMM | OCW3_SMM);
outb(IO_ICU1 + PIC_OCW3, OCW3_SELECT | OCW3_RR);
outb(IO_ICU1 + PIC_OCW2, OCW2_SELECT | OCW2_R | OCW2_SL |
port = IO_ICU1 + PIC_OCW1;
port = IO_ICU1 + PIC_OCW1;
outb(IO_ICU1 + PIC_OCW1, i8259_imen);
outb(IO_ICU1 + PIC_OCW1, i8259_imen);