summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/powermac/hrowpic.c
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2010-06-18 14:06:27 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2010-06-18 14:06:27 +0000
commitc757ee90aefd19aff23dfb5e938e8e1e8576dbd4 (patch)
tree28ab8d6b3802ae7f1a631f84f71839a5baa6a137 /sys/powerpc/powermac/hrowpic.c
parentf26dfb440a0d48a874435768ee94475ddbe496a2 (diff)
downloadFreeBSD-src-c757ee90aefd19aff23dfb5e938e8e1e8576dbd4.zip
FreeBSD-src-c757ee90aefd19aff23dfb5e938e8e1e8576dbd4.tar.gz
Provide for multiple, cascaded PICs on PowerPC systems, and extend the
OFW interrupt map interface to also return the device's interrupt parent. MFC after: 8.1-RELEASE
Diffstat (limited to 'sys/powerpc/powermac/hrowpic.c')
-rw-r--r--sys/powerpc/powermac/hrowpic.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/powerpc/powermac/hrowpic.c b/sys/powerpc/powermac/hrowpic.c
index ce35d46..f2d8d89 100644
--- a/sys/powerpc/powermac/hrowpic.c
+++ b/sys/powerpc/powermac/hrowpic.c
@@ -70,6 +70,7 @@ static void hrowpic_eoi(device_t, u_int);
static void hrowpic_ipi(device_t, u_int);
static void hrowpic_mask(device_t, u_int);
static void hrowpic_unmask(device_t, u_int);
+static uint32_t hrowpic_id(device_t dev);
static device_method_t hrowpic_methods[] = {
/* Device interface */
@@ -80,6 +81,7 @@ static device_method_t hrowpic_methods[] = {
DEVMETHOD(pic_dispatch, hrowpic_dispatch),
DEVMETHOD(pic_enable, hrowpic_enable),
DEVMETHOD(pic_eoi, hrowpic_eoi),
+ DEVMETHOD(pic_id, hrowpic_id),
DEVMETHOD(pic_ipi, hrowpic_ipi),
DEVMETHOD(pic_mask, hrowpic_mask),
DEVMETHOD(pic_unmask, hrowpic_unmask),
@@ -169,6 +171,8 @@ hrowpic_attach(device_t dev)
hrowpic_write_reg(sc, HPIC_CLEAR, HPIC_SECONDARY, 0xffffffff);
powerpc_register_pic(dev, 64);
+ root_pic = dev; /* Heathrow systems have only one PIC */
+
return (0);
}
@@ -282,3 +286,10 @@ hrowpic_unmask(device_t dev, u_int irq)
sc = device_get_softc(dev);
hrowpic_toggle_irq(sc, irq, 1);
}
+
+static uint32_t
+hrowpic_id(device_t dev)
+{
+ return (ofw_bus_get_node(dev));
+}
+
OpenPOWER on IntegriCloud