Date: Sat, 8 Nov 2008 05:33:00 GMT From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 152642 for review Message-ID: <200811080533.mA85X0iZ016969@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=152642 Change 152642 by nwhitehorn@nwhitehorn_trantor on 2008/11/08 05:32:43 Spent too much time with the emulator: fix PCI interrupt setup on real hardware. Affected files ... .. //depot/projects/ppc-g5/sys/dev/ofw/ofw_imap.c#2 edit .. //depot/projects/ppc-g5/sys/powerpc/powermac/cpcht.c#8 edit .. //depot/projects/ppc-g5/sys/powerpc/powermac/grackle.c#5 edit .. //depot/projects/ppc-g5/sys/powerpc/powermac/uninorth.c#6 edit Differences ... ==== //depot/projects/ppc-g5/sys/dev/ofw/ofw_imap.c#2 (text+ko) ==== @@ -182,9 +182,16 @@ &pintrsz, sizeof(pintrsz)) == -1) pintrsz = 1; /* default */ pintrsz *= sizeof(pcell_t); - if (pintrsz != rintrsz) + if (pintrsz < rintrsz) panic("ofw_bus_search_intrmap: expected interrupt cell " - "size incorrect: %d != %d", rintrsz, pintrsz); + "size incorrect: %d > %d", rintrsz, pintrsz); + + /* + * XXX: Apple hardware used a second cell to set information + * on the interrupt trigger type. This information should + * be used. + */ + if (bcmp(ref, mptr, physsz + intrsz) == 0) { bcopy(mptr + physsz + intrsz + sizeof(parent), result, rintrsz); ==== //depot/projects/ppc-g5/sys/powerpc/powermac/cpcht.c#8 (text+ko) ==== @@ -615,6 +615,10 @@ sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), maskbuf)) return (mintr); + /* Maybe it's a real interrupt, not an intpin */ + if (pin > 4) + return (pin); + device_printf(bus, "could not route pin %d for device %d.%d\n", pin, pci_get_slot(dev), pci_get_function(dev)); return (PCI_INVALID_IRQ); ==== //depot/projects/ppc-g5/sys/powerpc/powermac/grackle.c#5 (text+ko) ==== @@ -349,6 +349,10 @@ sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), maskbuf)) return (mintr); + /* Maybe it's a real interrupt, not an intpin */ + if (pin > 4) + return (pin); + device_printf(bus, "could not route pin %d for device %d.%d\n", pin, pci_get_slot(dev), pci_get_function(dev)); return (PCI_INVALID_IRQ); ==== //depot/projects/ppc-g5/sys/powerpc/powermac/uninorth.c#6 (text+ko) ==== @@ -374,6 +374,10 @@ sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), maskbuf)) return (mintr); + /* Maybe it's a real interrupt, not an intpin */ + if (pin > 4) + return (pin); + device_printf(bus, "could not route pin %d for device %d.%d\n", pin, pci_get_slot(dev), pci_get_function(dev)); return (PCI_INVALID_IRQ);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811080533.mA85X0iZ016969>