[coreboot] [flashrom] r518 - trunk

svn at coreboot.org svn at coreboot.org
Sat May 16 03:30:48 CEST 2009


Author: uwe
Date: 2009-05-16 03:30:48 +0200 (Sat, 16 May 2009)
New Revision: 518

Modified:
   trunk/pcidev.c
Log:
Older libpci versions (e.g. 2.2.8, as it's default on current FreeBSD 7.2)
don't properly fill the base_addr[0] struct member, so revert back to
an explicit pci_read_long() call, otherwise detection of PCI devices and
their base address will fail with strange error messages.

Thanks Idwer Vollering <vidwer at gmail.com> for reporting and testing.

Signed-off-by: Uwe Hermann <uwe at hermann-uwe.de>
Acked-by: Uwe Hermann <uwe at hermann-uwe.de>



Modified: trunk/pcidev.c
===================================================================
--- trunk/pcidev.c	2009-05-16 01:23:55 UTC (rev 517)
+++ trunk/pcidev.c	2009-05-16 01:30:48 UTC (rev 518)
@@ -26,6 +26,8 @@
 #include <errno.h>
 #include "flash.h"
 
+#define PCI_IO_BASE_ADDRESS 0x10
+
 uint32_t io_base_addr;
 struct pci_access *pacc;
 struct pci_filter filter;
@@ -40,7 +42,8 @@
 		if (dev->device_id != devs[i].device_id)
 			continue;
 
-		addr = (uint32_t)(dev->base_addr[0] & ~0x03);
+		/* Don't use dev->base_addr[0], won't work on older libpci. */
+		addr = pci_read_long(dev, PCI_IO_BASE_ADDRESS) & ~0x03;
 
 		printf("Found \"%s %s\" (%04x:%04x, BDF %02x:%02x.%x)\n",
 		       devs[i].vendor_name, devs[i].device_name, dev->vendor_id,





More information about the coreboot mailing list