summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/mpc85xx/ocpbus.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2008-03-07 22:08:43 +0000
committermarcel <marcel@FreeBSD.org>2008-03-07 22:08:43 +0000
commitdf20e1735314eed9a226f7e24d8dc9de19712a24 (patch)
tree80505d438be8283796192dc2021565d9051007cb /sys/powerpc/mpc85xx/ocpbus.c
parentcbff2d578240895a5d6eb03901077ee0d8e4765f (diff)
downloadFreeBSD-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/ocpbus.c')
-rw-r--r--sys/powerpc/mpc85xx/ocpbus.c16
1 files changed, 16 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));
+}
OpenPOWER on IntegriCloud