[coreboot] [v2] r4557 - trunk/coreboot-v2/src/devices

svn at coreboot.org svn at coreboot.org
Wed Aug 19 21:12:39 CEST 2009


Author: myles
Date: 2009-08-19 21:12:39 +0200 (Wed, 19 Aug 2009)
New Revision: 4557

Modified:
   trunk/coreboot-v2/src/devices/device.c
   trunk/coreboot-v2/src/devices/pci_device.c
Log:
Add an error message if there is a zero-sized fixed resource.  Fix the existing
example of one.

Signed-off-by: Myles Watson <mylesgw at gmail.com>
Acked-by: Patrick Georgi <patrick.georgi at coresystems.de>


Modified: trunk/coreboot-v2/src/devices/device.c
===================================================================
--- trunk/coreboot-v2/src/devices/device.c	2009-08-19 17:29:41 UTC (rev 4556)
+++ trunk/coreboot-v2/src/devices/device.c	2009-08-19 19:12:39 UTC (rev 4557)
@@ -556,8 +556,12 @@
 	/* Constrain limits based on the fixed resources of this device. */
 	for (i = 0; i < dev->resources; i++) {
 		res = &dev->resource[i];
-		if (!res->size)
+		if (!res->size) {
+			/* It makes no sense to have 0-sized, fixed resources.*/
+			printk_err("skipping %s@%lx fixed resource, size=0!\n",
+				   dev_path(dev), res->index);
 			continue;
+		}
 		if (!(res->flags & IORESOURCE_FIXED))
 			continue;
 

Modified: trunk/coreboot-v2/src/devices/pci_device.c
===================================================================
--- trunk/coreboot-v2/src/devices/pci_device.c	2009-08-19 17:29:41 UTC (rev 4556)
+++ trunk/coreboot-v2/src/devices/pci_device.c	2009-08-19 19:12:39 UTC (rev 4557)
@@ -332,6 +332,8 @@
 	 * inited by driver_pci_onboard_ops::enable_dev() */
 	if ((dev->on_mainboard) && (dev->rom_address != 0)) {
 		resource->base = dev->rom_address;
+		/* The resource allocator needs the size to be non-zero. */
+		resource->size = 0x100;
 		resource->flags |= IORESOURCE_MEM | IORESOURCE_READONLY |
 		    IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
 	}





More information about the coreboot mailing list