diff options
author | Myles Watson <mylesgw@gmail.com> | 2010-09-09 14:51:17 +0000 |
---|---|---|
committer | Myles Watson <mylesgw@gmail.com> | 2010-09-09 14:51:17 +0000 |
commit | e0a000cc12984700c87fea6b153fa4221a125e19 (patch) | |
tree | 97cc835b6985c40abae72532063d6491b57eb25b | |
parent | 6b247d3ef866704108d7f30a3195db0a72db2095 (diff) | |
download | coreboot-e0a000cc12984700c87fea6b153fa4221a125e19.tar.xz |
Add support for reserved regions to resources and coreboot tables.
Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Myles Watson <mylesgw@gmail.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5795 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r-- | src/arch/i386/boot/coreboot_table.c | 17 | ||||
-rw-r--r-- | src/include/device/resource.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/arch/i386/boot/coreboot_table.c b/src/arch/i386/boot/coreboot_table.c index f44e3dd500..65510e5471 100644 --- a/src/arch/i386/boot/coreboot_table.c +++ b/src/arch/i386/boot/coreboot_table.c @@ -488,6 +488,20 @@ static struct lb_memory *build_lb_mem(struct lb_header *head) 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 @@ unsigned long write_coreboot_table( 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 diff --git a/src/include/device/resource.h b/src/include/device/resource.h index 49e218531c..b2e3e995b5 100644 --- a/src/include/device/resource.h +++ b/src/include/device/resource.h @@ -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 */ |