changeset 10548:e1a70121b226

6566633 pci_pci:ppb_create_ranges_prop overwrites the IO range with the MEM range
author Pavel Potoplyak <Pavel.Potoplyak@Sun.COM>
date Tue, 15 Sep 2009 11:25:54 -0700
parents 1a61a72b11d5
children bb77cedc0815
files usr/src/uts/sun4u/io/pci/pci_pci.c
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/sun4u/io/pci/pci_pci.c	Tue Sep 15 20:20:20 2009 +0200
+++ b/usr/src/uts/sun4u/io/pci/pci_pci.c	Tue Sep 15 11:25:54 2009 -0700
@@ -1471,16 +1471,23 @@
 	base = PPB_16bit_IOADDR(io_base_lo);
 	limit = PPB_16bit_IOADDR(io_limit_lo);
 
+	/*
+	 * Check for 32-bit I/O support as per PCI-to-PCI Bridge Arch Spec
+	 */
 	if ((io_base_lo & 0xf) == PPB_32BIT_IO) {
 		base = PPB_LADDR(base, io_base_hi);
-	}
-	if ((io_limit_lo & 0xf) == PPB_32BIT_IO) {
 		limit = PPB_LADDR(limit, io_limit_hi);
 	}
 
-	if ((io_base_lo & PPB_32BIT_IO) && (io_limit_hi > 0)) {
-		base = PPB_LADDR(base, io_base_hi);
-		limit = PPB_LADDR(limit, io_limit_hi);
+	/*
+	 * Check if the bridge implements an I/O address range as per
+	 * PCI-to-PCI Bridge Arch Spec
+	 */
+	if ((io_base_lo != 0 || io_limit_lo != 0) && limit >= base) {
+		ranges[i].parent_low = ranges[i].child_low =
+		    base;
+		ranges[i].size_low = limit - base + PPB_IOGRAIN;
+		i++;
 	}
 
 	/*