Add global uma_resource()
Like ram_resource(), but reserved and not cacheable.
Switch all AMD northbridges to use this one.
Change-Id: I88515c6a0f59f80fd8607c390d0d4a2a35d805f2
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1203
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
diff --git a/src/northbridge/amd/agesa/family14/northbridge.c b/src/northbridge/amd/agesa/family14/northbridge.c
index f7c3b8e..9e6b257 100644
--- a/src/northbridge/amd/agesa/family14/northbridge.c
+++ b/src/northbridge/amd/agesa/family14/northbridge.c
@@ -328,19 +328,6 @@
#if CONFIG_GFXUMA
extern uint64_t uma_memory_base, uma_memory_size;
-
-static void add_uma_resource(struct device *dev, int index)
-{
- struct resource *resource;
-
- printk(BIOS_DEBUG, "\nFam14h - Adding UMA memory.\n");
-
- resource = new_resource(dev, index);
- resource->base = (resource_t) uma_memory_base;
- resource->size = (resource_t) uma_memory_size;
- resource->flags = IORESOURCE_MEM | IORESOURCE_RESERVE |
- IORESOURCE_FIXED | IORESOURCE_STORED | IORESOURCE_ASSIGNED;
-}
#endif
static void read_resources(device_t dev)
@@ -733,8 +720,7 @@
high_tables_size);
#if CONFIG_GFXUMA
- printk(BIOS_DEBUG, "adsr - adding uma resource.\n");
- add_uma_resource(dev, 7);
+ uma_resource(dev, 7, uma_memory_base >> 10, uma_memory_size >> 10);
#endif
for (link = dev->link_list; link; link = link->next) {