Date: Sat, 20 Jul 2002 20:40:52 -0700 (PDT) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 14574 for review Message-ID: <200207210340.g6L3eqgR069731@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=14574 Change 14574 by peter@peter_ia64 on 2002/07/20 20:40:44 Beware of grossness. Hardwire the itanium2 tiger4 box's irq configuration for the devices I know about. Each slot/pin has a fixed configuration, but these are the only ones I know. No, this stuff is not intended for commit. :) Affected files ... .. //depot/projects/ia64/sys/conf/options#23 edit .. //depot/projects/ia64/sys/dev/acpica/acpi_pcib.c#5 edit .. //depot/projects/ia64/sys/dev/pci/pci_pci.c#5 edit Differences ... ==== //depot/projects/ia64/sys/conf/options#23 (text+ko) ==== @@ -556,3 +556,6 @@ # Log SYSINIT() execution SYSINIT_TRACE opt_sysinit.h + +# MD hacks +TIGER4 opt_tiger4.h ==== //depot/projects/ia64/sys/dev/acpica/acpi_pcib.c#5 (text+ko) ==== @@ -27,6 +27,7 @@ * $FreeBSD: src/sys/dev/acpica/acpi_pcib.c,v 1.21 2002/05/19 06:16:45 peter Exp $ */ #include "opt_acpi.h" +#include "opt_tiger4.h" #include <sys/param.h> #include <sys/bus.h> #include <sys/malloc.h> @@ -170,18 +171,19 @@ * XXX invoke _REG on this for the PCI config space address space? */ if (ACPI_FAILURE(status = acpi_EvaluateInteger(sc->ap_handle, "_BBN", &sc->ap_bus))) { + device_printf(dev, "could not evaluate _BBN - %s\n", AcpiFormatException(status)); if (status != AE_NOT_FOUND) { - device_printf(dev, "could not evaluate _BBN - %s\n", AcpiFormatException(status)); return_VALUE(ENXIO); } if (ACPI_FAILURE(status = acpi_EvaluateInteger(sc->ap_handle, "_ADR", &sc->ap_bus))) { + device_printf(dev, "could not evaluate _ADR - %s\n", AcpiFormatException(status)); if (status != AE_NOT_FOUND) { - device_printf(dev, "could not evaluate _ADR - %s\n", AcpiFormatException(status)); return_VALUE(ENXIO); } } else { /* if it's not found, assume 0 */ sc->ap_bus = 0; +device_printf(dev, "defaulting to ap_bus = 0\n"); } } @@ -198,7 +200,7 @@ */ sc->ap_prt.Length = ACPI_ALLOCATE_BUFFER; if (ACPI_FAILURE(status = AcpiGetIrqRoutingTable(sc->ap_handle, &sc->ap_prt))) { - device_printf(dev, "could not get PCI interrupt routing table - %s\n", AcpiFormatException(status)); + device_printf(dev, "could not get PCI interrupt routing table for %s - %s\n", acpi_name(sc->ap_handle), AcpiFormatException(status)); /* this is not an error, but it may reduce functionality */ } @@ -309,6 +311,7 @@ int interrupt; int i; uintptr_t up; + int slot; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -334,6 +337,25 @@ } if (sc == NULL) /* not one of ours */ goto out; + + slot = pci_get_slot(dev); + +#ifdef TIGER4 + device_printf(sc->ap_dev, "acpi_pcib_route_interrupt: %s pci%d:%d:%d\n", acpi_name(sc->ap_handle), bus, slot, pin); + if (bus == 0 && slot == 29 && pin == 0) { + interrupt = 50; /* usb0 */ + device_printf(sc->ap_dev, "IRQ ROUTING KLUDGE %s bus %d slot %d pin %d -> %d\n", + acpi_name(sc->ap_handle), bus, slot, pin, interrupt); + goto out; + } + if (bus == 0 && slot == 29 && pin == 1) { + interrupt = 49; /* usb1 */ + device_printf(sc->ap_dev, "IRQ ROUTING KLUDGE %s bus %d slot %d pin %d -> %d\n", + acpi_name(sc->ap_handle), bus, slot, pin, interrupt); + goto out; + } +#endif + prtp = sc->ap_prt.Pointer; if (prtp == NULL) /* didn't get routing table */ goto out; ==== //depot/projects/ia64/sys/dev/pci/pci_pci.c#5 (text+ko) ==== @@ -46,6 +46,7 @@ #include "pcib_if.h" #include "opt_pci.h" +#include "opt_tiger4.h" /* * Bridge-specific data. @@ -424,6 +425,57 @@ int parent_intpin; int intnum; +#ifdef TIGER4 +int childslot = pci_get_slot(dev); +int childpin = pin - 1; +int childbus = pci_get_bus(dev); +device_printf(dev, "pcib_route_interrupt: pci%d:%d:%d\n", childbus, childslot, childpin); +intnum = 255; +/* +em0: pcib_route_interrupt: pci1:0:0 +fxp0: pcib_route_interrupt: pci3:2:0 +fxp1: pcib_route_interrupt: pci5:1:0 +isp0: pcib_route_interrupt: pci10:2:0 +fxp2: pcib_route_interrupt: pci13:1:0 +*/ +#if 0 /* XXX need to hack this at acpi level */ + if (childbus == 1 && childslot == 29 && childpin == 0) + intnum = 50; /* usb */ + if (childbus == 1 && childslot == 29 && childpin == 1) + intnum = 49; /* usb */ +#endif + if (childbus == 1 && childslot == 0 && childpin == 0) + intnum = 51; /* em */ + if (childbus == 3 && childslot == 2 && childpin == 0) + intnum = 63; /* fxp0 */ + if (childbus == 3 && childslot == 31 && childpin == 0) + intnum = 67; /* hotplug */ + if (childbus == 5 && childslot == 1 && childpin == 0) + intnum = 52; /* fxp1 */ + if (childbus == 5 && childslot == 2 && childpin == 0) + intnum = 56; /* mpt0 */ + if (childbus == 5 && childslot == 2 && childpin == 1) + intnum = 57; /* mpt1 */ + if (childbus == 5 && childslot == 31 && childpin == 0) + intnum = 58; /* hotplug */ + if (childbus == 8 && childslot == 31 && childpin == 0) + intnum = 80; /* hotplug */ + if (childbus == 10 && childslot == 2 && childpin == 0) + intnum = 72; /* isp0 */ + if (childbus == 10 && childslot == 31 && childpin == 0) + intnum = 75; /* hotplug */ + if (childbus == 13 && childslot == 1 && childpin == 0) + intnum = 86; /* fxp2 */ + if (childbus == 13 && childslot == 31 && childpin == 0) + intnum = 90; /* hotplug */ + if (childbus == 14 && childslot == 31 && childpin == 0) + intnum = 85; /* hotplug */ +if (intnum != 255) { +device_printf(dev, "Hardwiring IRQ to %d\n", intnum); +return intnum; +} +#endif + /* * * The PCI standard defines a swizzle of the child-side device/intpin to To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207210340.g6L3eqgR069731>