Comments
Patch
===================================================================
@@ -21,7 +21,6 @@
#include <device/device.h>
#include <device/pci.h>
#include <arch/io.h>
-#include <boot/tables.h>
#include <cpu/x86/msr.h>
#include <cpu/amd/mtrr.h>
#include <device/pci_def.h>
@@ -276,20 +275,6 @@ static void m4a785m_enable(device_t dev)
set_thermal_config();
}
-int add_mainboard_resources(struct lb_memory *mem)
-{
- /* UMA is removed from system memory in the northbridge code, but
- * in some circumstances we want the memory mentioned as reserved.
- */
-#if (CONFIG_GFXUMA == 1)
- printk(BIOS_INFO, "uma_memory_start=0x%llx, uma_memory_size=0x%llx \n",
- uma_memory_base, uma_memory_size);
- lb_add_memory_range(mem, LB_MEM_RESERVED, uma_memory_base,
- uma_memory_size);
-#endif
- return 0;
-}
-
struct chip_operations mainboard_ops = {
CHIP_NAME("AMD M4A785M Mainboard")
.enable_dev = m4a785m_enable,
===================================================================
@@ -865,9 +865,22 @@ static void disable_hoist_memory(unsigne
#if CONFIG_WRITE_HIGH_TABLES==1
#define HIGH_TABLES_SIZE 64 // maximum size of high tables in KB
extern uint64_t high_tables_base, high_tables_size;
+#endif
+
#if CONFIG_GFXUMA == 1
extern uint64_t uma_memory_base, uma_memory_size;
-#endif
+
+static void add_uma_resource(struct device *dev, int index)
+{
+ struct resource *resource;
+
+ printk(BIOS_DEBUG, "Adding UMA memory area\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 amdfam10_domain_set_resources(device_t dev)
@@ -1090,6 +1103,10 @@ static void amdfam10_domain_set_resource
#endif
}
+#if CONFIG_GFXUMA == 1
+ add_uma_resource(dev, 7);
+#endif
+
for(link = dev->link_list; link; link = link->next) {
if (link->children) {
assign_resources(link);
===================================================================
@@ -15,7 +15,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_OPTION_TABLE
select GENERATE_PIRQ_TABLE
select GENERATE_MP_TABLE
- select HAVE_MAINBOARD_RESOURCES
select CACHE_AS_RAM
select HAVE_HARD_RESET
select SB_HT_CHAIN_UNITID_OFFSET_ONLY
Would you mind applying these and testing too? Signed-off-by: Myles Watson <mylesgw@gmail.com> Thanks, Myles