[coreboot] [commit] r5795 - in trunk/src: arch/i386/boot include/device

repository service svn at coreboot.org
Thu Sep 9 16:51:19 CEST 2010


Author: myles
Date: Thu Sep  9 16:51:17 2010
New Revision: 5795
URL: https://tracker.coreboot.org/trac/coreboot/changeset/5795

Log:
Add support for reserved regions to resources and coreboot tables.

Signed-off-by: Myles Watson <mylesgw at gmail.com>
Acked-by: Myles Watson <mylesgw at gmail.com>

Modified:
   trunk/src/arch/i386/boot/coreboot_table.c
   trunk/src/include/device/resource.h

Modified: trunk/src/arch/i386/boot/coreboot_table.c
==============================================================================
--- trunk/src/arch/i386/boot/coreboot_table.c	Thu Sep  9 16:44:51 2010	(r5794)
+++ trunk/src/arch/i386/boot/coreboot_table.c	Thu Sep  9 16:51:17 2010	(r5795)
@@ -488,6 +488,20 @@
 	return mem;
 }
 
+static void lb_add_rsvd_range(void *gp, struct device *dev, struct resource *res)
+{
+	struct lb_memory *mem = gp;
+	lb_add_memory_range(mem, LB_MEM_RESERVED, res->base, res->size);
+}
+
+static void add_lb_reserved(struct lb_memory *mem)
+{
+	/* Add reserved ranges */
+	search_global_resources(
+		IORESOURCE_MEM | IORESOURCE_RESERVE, IORESOURCE_MEM | IORESOURCE_RESERVE,
+		lb_add_rsvd_range, mem);
+}
+
 #if CONFIG_WRITE_HIGH_TABLES == 1
 extern uint64_t high_tables_base, high_tables_size;
 #endif
@@ -562,6 +576,9 @@
 		high_tables_base, high_tables_size);
 #endif
 
+	/* Add reserved regions */
+	add_lb_reserved(mem);
+
 #if (CONFIG_HAVE_MAINBOARD_RESOURCES == 1)
 	add_mainboard_resources(mem);
 #endif

Modified: trunk/src/include/device/resource.h
==============================================================================
--- trunk/src/include/device/resource.h	Thu Sep  9 16:44:51 2010	(r5794)
+++ trunk/src/include/device/resource.h	Thu Sep  9 16:51:17 2010	(r5795)
@@ -20,6 +20,7 @@
 						 * to the bus below.
 						 */
 #define IORESOURCE_BRIDGE	0x00080000	/* The IO resource has a bus below it. */
+#define IORESOURCE_RESERVE	0x10000000	/* The resource needs to be reserved in the Coreboot table */
 #define IORESOURCE_STORED	0x20000000	/* The IO resource assignment has been stored in the device */
 #define IORESOURCE_ASSIGNED	0x40000000	/* An IO resource that has been assigned a value */
 #define IORESOURCE_FIXED	0x80000000	/* An IO resource the allocator must not change */




More information about the coreboot mailing list