diff options
| author | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2010-06-11 14:10:20 +0000 |
|---|---|---|
| committer | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2010-06-11 14:10:20 +0000 |
| commit | f19e4a24de40622ff4708e0a4be660bc61a1d50d (patch) | |
| tree | e5ab5d3744ae8ac2b377a3341878d91bbac12c0f | |
| parent | 972b06a770fc8c9fc965fd9ec117597090649cf5 (diff) | |
Notes
| -rw-r--r-- | sys/dev/ata/chipsets/ata-serverworks.c | 4 | ||||
| -rw-r--r-- | sys/powerpc/ofw/ofw_pcibus.c | 33 |
2 files changed, 27 insertions, 10 deletions
diff --git a/sys/dev/ata/chipsets/ata-serverworks.c b/sys/dev/ata/chipsets/ata-serverworks.c index e741a0a2a1f8..cee56e3681ee 100644 --- a/sys/dev/ata/chipsets/ata-serverworks.c +++ b/sys/dev/ata/chipsets/ata-serverworks.c @@ -221,9 +221,9 @@ ata_serverworks_ch_attach(device_t dev) #ifdef __powerpc__ ch->hw.status = ata_serverworks_status; - /* Make sure that our interrupt is edge triggered */ + /* Make sure that our interrupt is level low */ powerpc_config_intr(bus_get_resource_start(device_get_parent(dev), - SYS_RES_IRQ, 0), INTR_TRIGGER_EDGE, INTR_POLARITY_HIGH); + SYS_RES_IRQ, 0), INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW); #endif if (ctlr->chip->chipid == ATA_K2) { diff --git a/sys/powerpc/ofw/ofw_pcibus.c b/sys/powerpc/ofw/ofw_pcibus.c index 6ec2da60ea3d..a87890fdad8f 100644 --- a/sys/powerpc/ofw/ofw_pcibus.c +++ b/sys/powerpc/ofw/ofw_pcibus.c @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include <dev/ofw/openfirm.h> #include <machine/bus.h> +#include <machine/intr_machdep.h> #include <machine/resource.h> #include <dev/pci/pcireg.h> @@ -192,20 +193,36 @@ ofw_pcibus_enum_devtree(device_t dev, u_int domain, u_int busno) pci_add_child(dev, (struct pci_devinfo *)dinfo); /* - * Some devices don't have an intpin set, but do have - * interrupts. These are fully specified, and set in the + * Some devices don't have an intpin set, but do have + * interrupts. These are fully specified, and set in the * interrupts property, so add that value to the device's * resource list. - */ - if (dinfo->opd_dinfo.cfg.intpin == 0) { - ofw_pci_intr_t intr; + */ + if (dinfo->opd_dinfo.cfg.intpin == 0) { + ofw_pci_intr_t intr[2]; + phandle_t iparent; + int icells; if (OF_getprop(child, "interrupts", &intr, sizeof(intr)) > 0) { - resource_list_add(&dinfo->opd_dinfo.resources, - SYS_RES_IRQ, 0, intr, intr, 1); + iparent = 0; + icells = 1; + OF_getprop(child, "interrupt-parent", &iparent, + sizeof(iparent)); + OF_getprop(iparent, "#interrupt-cells", &icells, + sizeof(icells)); + + if (iparent != 0 && icells > 1) { + powerpc_config_intr(intr[0], + (intr[1] & 1) ? INTR_TRIGGER_LEVEL : + INTR_TRIGGER_EDGE, + INTR_POLARITY_HIGH); + } + + resource_list_add(&dinfo->opd_dinfo.resources, + SYS_RES_IRQ, 0, intr[0], intr[0], 1); } - } + } } } |
