From patchwork Fri Sep 10 18:16:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Add support for Asus M4A785-M, with build instructions Date: Fri, 10 Sep 2010 18:16:37 -0000 From: Myles Watson X-Patchwork-Id: 1909 Message-Id: To: Juhana Helovuo Cc: coreboot@coreboot.org Would you mind applying these and testing too? Signed-off-by: Myles Watson Thanks, Myles Index: svn/src/mainboard/asus/m4a785-m/mainboard.c =================================================================== --- svn.orig/src/mainboard/asus/m4a785-m/mainboard.c +++ svn/src/mainboard/asus/m4a785-m/mainboard.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -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, Index: svn/src/northbridge/amd/amdfam10/northbridge.c =================================================================== --- svn.orig/src/northbridge/amd/amdfam10/northbridge.c +++ svn/src/northbridge/amd/amdfam10/northbridge.c @@ -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); Index: svn/src/mainboard/asus/m4a785-m/Kconfig =================================================================== --- svn.orig/src/mainboard/asus/m4a785-m/Kconfig +++ svn/src/mainboard/asus/m4a785-m/Kconfig @@ -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