PERFORCE change 152642 for review

Nathan Whitehorn nwhitehorn at FreeBSD.org
Fri Nov 7 21:33:01 PST 2008


http://perforce.freebsd.org/chv.cgi?CH=152642

Change 152642 by nwhitehorn at 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);


More information about the p4-projects mailing list