[PATCH] PPC64 Addresses from OF getting truncated to 32-bits

Paul Mackerras paulus at samba.org
Mon Mar 7 19:57:50 EST 2005


This patch is from Jake Moilanen <moilanen at austin.ibm.com>,
reformatted by me.

Signed-off-by: Jake Moilanen <moilanen at austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus at samba.org>

The `assigned-addresses' property in the Open Firmware device tree
nodes for PCI devices has 64 bits of PCI bus address, but we were only
using 32.  This patch fixes it so we use all 64.

diff -urN linux-2.5/arch/ppc64/kernel/prom.c test/arch/ppc64/kernel/prom.c
--- linux-2.5/arch/ppc64/kernel/prom.c	2005-03-07 08:21:53.000000000 +1100
+++ test/arch/ppc64/kernel/prom.c	2005-03-07 19:49:13.000000000 +1100
@@ -335,7 +335,8 @@
 		while ((l -= sizeof(struct pci_reg_property)) >= 0) {
 			if (!measure_only) {
 				adr[i].space = pci_addrs[i].addr.a_hi;
-				adr[i].address = pci_addrs[i].addr.a_lo;
+				adr[i].address = pci_addrs[i].addr.a_lo |
+					((u64)pci_addrs[i].addr.a_mid << 32);
 				adr[i].size = pci_addrs[i].size_lo;
 			}
 			++i;
@@ -1721,7 +1722,8 @@
 			}
 			while ((l -= sizeof(struct pci_reg_property)) >= 0) {
 				adr[i].space = pci_addrs[i].addr.a_hi;
-				adr[i].address = pci_addrs[i].addr.a_lo;
+				adr[i].address = pci_addrs[i].addr.a_lo |
+					((u64)pci_addrs[i].addr.a_mid << 32);
 				adr[i].size = pci_addrs[i].size_lo;
 				++i;
 			}



More information about the Linuxppc64-dev mailing list