diff options
author | marcel <marcel@FreeBSD.org> | 2008-03-07 22:08:43 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2008-03-07 22:08:43 +0000 |
commit | df20e1735314eed9a226f7e24d8dc9de19712a24 (patch) | |
tree | 80505d438be8283796192dc2021565d9051007cb /sys/powerpc/mpc85xx | |
parent | cbff2d578240895a5d6eb03901077ee0d8e4765f (diff) | |
download | FreeBSD-src-df20e1735314eed9a226f7e24d8dc9de19712a24.zip FreeBSD-src-df20e1735314eed9a226f7e24d8dc9de19712a24.tar.gz |
Add support for the BUS_CONFIG_INTR() method to the platform and to
openpic(4). Make use of it in ocpbus(4). On the MPC85xxCDS, IRQ0:4
are active-low.
Diffstat (limited to 'sys/powerpc/mpc85xx')
-rw-r--r-- | sys/powerpc/mpc85xx/ocpbus.c | 16 | ||||
-rw-r--r-- | sys/powerpc/mpc85xx/opic.c | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/sys/powerpc/mpc85xx/ocpbus.c b/sys/powerpc/mpc85xx/ocpbus.c index 9099fa7..cc6c724 100644 --- a/sys/powerpc/mpc85xx/ocpbus.c +++ b/sys/powerpc/mpc85xx/ocpbus.c @@ -76,6 +76,8 @@ static int ocpbus_read_ivar(device_t, device_t, int, uintptr_t *); static int ocpbus_setup_intr(device_t, device_t, struct resource *, int, driver_filter_t *, driver_intr_t *, void *, void **); static int ocpbus_teardown_intr(device_t, device_t, struct resource *, void *); +static int ocpbus_config_intr(device_t, int, enum intr_trigger, + enum intr_polarity); /* * Bus interface definition @@ -91,6 +93,7 @@ static device_method_t ocpbus_methods[] = { DEVMETHOD(bus_read_ivar, ocpbus_read_ivar), DEVMETHOD(bus_setup_intr, ocpbus_setup_intr), DEVMETHOD(bus_teardown_intr, ocpbus_teardown_intr), + DEVMETHOD(bus_config_intr, ocpbus_config_intr), DEVMETHOD(bus_get_resource, ocpbus_get_resource), DEVMETHOD(bus_alloc_resource, ocpbus_alloc_resource), @@ -279,6 +282,9 @@ ocpbus_attach (device_t dev) device_printf(dev, "PORDEVSR=%08x, PORDEVSR2=%08x\n", in32(OCP85XX_PORDEVSR), in32(OCP85XX_PORDEVSR2)); + for (i = 0; i < 4; i++) + powerpc_config_intr(i, INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW); + return (bus_generic_attach(dev)); } @@ -594,3 +600,13 @@ ocpbus_teardown_intr(device_t dev, device_t child, struct resource *res, return (powerpc_teardown_intr(cookie)); } + +static int +ocpbus_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol) +{ + + if (irq < PIC_IRQ_START) + return (EINVAL); + return (powerpc_config_intr(irq - PIC_IRQ_START, trig, pol)); +} diff --git a/sys/powerpc/mpc85xx/opic.c b/sys/powerpc/mpc85xx/opic.c index aff8f36..529226a 100644 --- a/sys/powerpc/mpc85xx/opic.c +++ b/sys/powerpc/mpc85xx/opic.c @@ -56,6 +56,7 @@ static device_method_t openpic_ocpbus_methods[] = { DEVMETHOD(device_attach, openpic_attach), /* PIC interface */ + DEVMETHOD(pic_config, openpic_config), DEVMETHOD(pic_dispatch, openpic_dispatch), DEVMETHOD(pic_enable, openpic_enable), DEVMETHOD(pic_eoi, openpic_eoi), |