summaryrefslogtreecommitdiffstats
path: root/sys/sparc64/ebus/ebus.c
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2003-05-30 20:48:05 +0000
committertmm <tmm@FreeBSD.org>2003-05-30 20:48:05 +0000
commiteb82b142f6d42d9f687e455b8122c5bbb26233d9 (patch)
treeb3748dbbeeb2759bf1814445e13fe3f7a6e03800 /sys/sparc64/ebus/ebus.c
parentd48f3818ad991429ac22904f641e2aaa48eeb89a (diff)
downloadFreeBSD-src-eb82b142f6d42d9f687e455b8122c5bbb26233d9.zip
FreeBSD-src-eb82b142f6d42d9f687e455b8122c5bbb26233d9.tar.gz
Fix interrupt assignment for non-builtin PCI devices on e450s.
This machine uses a non-standard scheme to specify the interrupts to be assigned for devices in PCI slots; instead of giving the INO or full interrupt number (which is done for the other devices in this box), the firmware interrupt properties contain intpin numbers, which have to be swizzled as usual on PCI-PCI bridges; however, the PCI host bridge nodes have no interrupt map, so we need to guess the correct INO by slot number of the device or the closest PCI-PCI bridge leading to it, and the intpin. To do this, this fix makes the following changes: - Add a newbus method for sparc64 PCI host bridges to guess the INO, and glue code in ofw_pci_orb_callback() to invoke it based on a new quirk entry. The guessing is only done for interrupt numbers too low to contain any IGN found on e450s. - Create another new quirk entry was created to prevent mapping of EBus interrupts at PCI level; the e450 has full INOs in the interrupt properties of EBus devices, so trying to remap them could cause problems. - Set both quirk entries for e450s; remove the no-swizzle entry. - Determine the psycho half (bus A or B) a driver instance manages in psycho_attach() - Implement the new guessing method for psycho, using the slot number, psycho half and property value (intpin). Thanks go to the testers, especially Brian Denehy, who tested many kernels for me until I had found the right workaround. Tested by: Brian Denehy <B.Denehy@90east.com>, jake, fenner, Marius Strobl <marius@alchemy.franken.de>, Marian Dobre <mari@onix.ro> Approved by: re (scottl)
Diffstat (limited to 'sys/sparc64/ebus/ebus.c')
-rw-r--r--sys/sparc64/ebus/ebus.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/sparc64/ebus/ebus.c b/sys/sparc64/ebus/ebus.c
index 42d78c8..6c71e02 100644
--- a/sys/sparc64/ebus/ebus.c
+++ b/sys/sparc64/ebus/ebus.c
@@ -112,7 +112,7 @@ static struct resource *ebus_alloc_resource(device_t, device_t, int, int *,
u_long, u_long, u_long, u_int);
static struct resource_list *ebus_get_resource_list(device_t, device_t);
-static struct ebus_devinfo *ebus_setup_dinfo(struct ebus_softc *,
+static struct ebus_devinfo *ebus_setup_dinfo(device_t, struct ebus_softc *,
phandle_t, char *);
static void ebus_destroy_dinfo(struct ebus_devinfo *);
static int ebus_print_res(struct ebus_devinfo *);
@@ -200,7 +200,7 @@ ebus_probe(device_t dev)
if ((OF_getprop_alloc(node, "name", 1, (void **)&cname)) == -1)
continue;
- if ((edi = ebus_setup_dinfo(sc, node, cname)) == NULL) {
+ if ((edi = ebus_setup_dinfo(dev, sc, node, cname)) == NULL) {
device_printf(dev, "<%s>: incomplete\n", cname);
free(cname, M_OFWPROP);
continue;
@@ -363,7 +363,8 @@ ebus_get_resource_list(device_t dev, device_t child)
}
static struct ebus_devinfo *
-ebus_setup_dinfo(struct ebus_softc *sc, phandle_t node, char *name)
+ebus_setup_dinfo(device_t dev, struct ebus_softc *sc, phandle_t node,
+ char *name)
{
struct ebus_devinfo *edi;
struct isa_regs *reg;
@@ -398,7 +399,8 @@ ebus_setup_dinfo(struct ebus_softc *sc, phandle_t node, char *name)
nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intrs),
(void **)&intrs);
for (i = 0; i < nintr; i++) {
- intr = ofw_bus_route_intr(node, intrs[i], ofw_pci_orb_callback);
+ intr = ofw_bus_route_intr(node, intrs[i], ofw_pci_orb_callback,
+ dev);
if (intr == ORIR_NOTFOUND) {
panic("ebus_setup_dinfo: could not map ebus "
"interrupt %d", intrs[i]);
OpenPOWER on IntegriCloud