[OpenBIOS] [commit] r1374 - trunk/openbios-devel/drivers

repository service svn at openbios.org
Fri Jan 8 13:09:42 CET 2016


Author: mcayland
Date: Fri Jan  8 13:09:41 2016
New Revision: 1374
URL: http://tracker.coreboot.org/trac/openbios/changeset/1374

Log:
pci: fix AAPL,address property for IO space mappings

According to "Designing PCI Cards and Drivers for Power Macintosh Computers" the
AAPL,address property should be an array of virtual addresses representing the
bus addresses in the assigned-addresses array.

While this works for PCI memory addresses, IO addresses are incorrect because
the calculated address is still the PCI bus address. Switch over to using the
new space-aware pci_bus_addr_to_host_addr() so that addresses in both memory
and IO space are correctly calculated.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
Reviewed-by: Alexander Graf <agraf at suse.de>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>

Modified:
   trunk/openbios-devel/drivers/pci.c

Modified: trunk/openbios-devel/drivers/pci.c
==============================================================================
--- trunk/openbios-devel/drivers/pci.c	Fri Jan  8 13:09:38 2016	(r1373)
+++ trunk/openbios-devel/drivers/pci.c	Fri Jan  8 13:09:41 2016	(r1374)
@@ -597,13 +597,18 @@
 {
 	phandle_t dev = get_cur_dev();
 	cell props[7];
-	int ncells, i;
+	uint32_t mask;
+	int ncells, i, flags, space_code;
 
 	ncells = 0;
 	for (i = 0; i < 6; i++) {
 		if (!config->assigned[i] || !config->sizes[i])
 			continue;
-		props[ncells++] = config->assigned[i] & ~0x0000000F;
+		pci_decode_pci_addr(config->assigned[i],
+				    &flags, &space_code, &mask);
+
+		props[ncells++] = pci_bus_addr_to_host_addr(space_code,
+					config->assigned[i] & ~mask);
 	}
 	if (ncells)
 		set_property(dev, "AAPL,address", (char *)props,



More information about the OpenBIOS mailing list