Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/mpc85xx/atpic.c
Context not available. | |||||
}; | }; | ||||
static int atpic_isa_attach(device_t); | static int atpic_isa_attach(device_t); | ||||
static void atpic_isa_new_pass(device_t); | |||||
static void atpic_isa_identify(driver_t *, device_t); | static void atpic_isa_identify(driver_t *, device_t); | ||||
static int atpic_isa_probe(device_t); | static int atpic_isa_probe(device_t); | ||||
Context not available. | |||||
DEVMETHOD(device_identify, atpic_isa_identify), | DEVMETHOD(device_identify, atpic_isa_identify), | ||||
DEVMETHOD(device_probe, atpic_isa_probe), | DEVMETHOD(device_probe, atpic_isa_probe), | ||||
DEVMETHOD(device_attach, atpic_isa_attach), | DEVMETHOD(device_attach, atpic_isa_attach), | ||||
DEVMETHOD(bus_new_pass, atpic_isa_new_pass), | |||||
/* PIC interface */ | /* PIC interface */ | ||||
DEVMETHOD(pic_config, atpic_config), | DEVMETHOD(pic_config, atpic_config), | ||||
Context not available. | |||||
static devclass_t atpic_devclass; | static devclass_t atpic_devclass; | ||||
DRIVER_MODULE(atpic, isa, atpic_isa_driver, atpic_devclass, 0, 0); | EARLY_DRIVER_MODULE(atpic, isa, atpic_isa_driver, atpic_devclass, 0, 0, | ||||
BUS_PASS_INTERRUPT); | |||||
static struct isa_pnp_id atpic_ids[] = { | static struct isa_pnp_id atpic_ids[] = { | ||||
{ 0x0000d041 /* PNP0000 */, "AT interrupt controller" }, | { 0x0000d041 /* PNP0000 */, "AT interrupt controller" }, | ||||
Context not available. | |||||
sc->sc_irid = 0; | sc->sc_irid = 0; | ||||
sc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irid, | sc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irid, | ||||
RF_ACTIVE); | 0 /* later */); | ||||
if (sc->sc_ires == NULL) | if (sc->sc_ires == NULL) | ||||
goto fail; | goto fail; | ||||
error = bus_setup_intr(dev, sc->sc_ires, INTR_TYPE_MISC | INTR_MPSAFE, | |||||
NULL, atpic_intr, dev, &sc->sc_icookie); | |||||
if (error) | |||||
goto fail; | |||||
atpic_init(sc, ATPIC_SLAVE); | atpic_init(sc, ATPIC_SLAVE); | ||||
atpic_init(sc, ATPIC_MASTER); | atpic_init(sc, ATPIC_MASTER); | ||||
Context not available. | |||||
return (error); | return (error); | ||||
} | } | ||||
void | |||||
atpic_new_pass(device_t dev) | |||||
{ | |||||
struct atpic_softc *sc; | |||||
int error; | |||||
if (bus_current_pass <= BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST) | |||||
return; | |||||
sc = device_get_softc(dev); | |||||
if (rman_get_flags(sc->sc_ires) & RF_ACTIVE) | |||||
return; | |||||
bus_activate_resource(dev, SYS_RES_IRQ, sc->sc_irid, sc->sc_ires); | |||||
error = bus_setup_intr(dev, sc->sc_ires, INTR_TYPE_MISC | INTR_MPSAFE, | |||||
NULL, atpic_intr, dev, &sc->sc_icookie); | |||||
if (error != 0) | |||||
panic("atpic_new_pass: could not set up parent interrupt (%d)", | |||||
error); | |||||
} | |||||
/* | /* | ||||
* PIC interface. | * PIC interface. | ||||
*/ | */ | ||||
Context not available. |