See patch...
--
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: [email protected] • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866Move mainboard specific changes to the coreboot memory table into the mainboard specific code. (And add a hook to allow other mainboards do a similar thing if required) Signed-off-by: Stefan Reinauer <[email protected]> Index: src/southbridge/amd/rs690/rs690_cmn.c =================================================================== --- src/southbridge/amd/rs690/rs690_cmn.c (revision 916) +++ src/southbridge/amd/rs690/rs690_cmn.c (working copy) @@ -307,6 +307,8 @@ */ void rs690_set_tom(device_t nb_dev) { + extern unsigned long uma_memory_start; + /* set TOM */ pci_write_config32(nb_dev, 0x90, uma_memory_start); nbmc_write_index(nb_dev, 0x1e, uma_memory_start); Index: src/include/boot/coreboot_tables.h =================================================================== --- src/include/boot/coreboot_tables.h (revision 916) +++ src/include/boot/coreboot_tables.h (working copy) @@ -43,12 +43,6 @@ * See also: util/lbtdump/lbtdump.c */ -/* AMD rs690 chip, declare global variables. */ -#if (CONFIG_GFXUMA == 1) - unsigned long uma_memory_start, uma_memory_size; -#endif - - struct lb_uint64 { uint32_t lo; uint32_t hi; Index: src/mainboard/amd/dbm690t/Options.lb =================================================================== --- src/mainboard/amd/dbm690t/Options.lb (revision 916) +++ src/mainboard/amd/dbm690t/Options.lb (working copy) @@ -91,6 +91,7 @@ uses CONFIG_VIDEO_MB uses CONFIG_GFXUMA +uses HAVE_MAINBOARD_RESOURCES ### ### Build options @@ -296,6 +297,7 @@ default CONFIG_VIDEO_MB=1 default CONFIG_GFXUMA=1 +default HAVE_MAINBOARD_RESOURCES=1 ### End Options.lb end Index: src/mainboard/amd/dbm690t/mainboard.c =================================================================== --- src/mainboard/amd/dbm690t/mainboard.c (revision 916) +++ src/mainboard/amd/dbm690t/mainboard.c (working copy) @@ -25,6 +25,8 @@ #include <cpu/amd/mtrr.h> #include "chip.h" +unsigned long uma_memory_start, uma_memory_size; + /******************************************************** * dbm690t uses a BCM5789 as on-board NIC. * It has a pin named LOW_POWER to enable it into LOW POWER state. @@ -115,12 +117,25 @@ enable_onboard_nic(); } + +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_info("uma_memory_start=0x%x, uma_memory_size=0x%x \n", + uma_memory_start, uma_memory_size); + lb_add_memory_range(mem, LB_MEM_RESERVED, + uma_memory_start, uma_memory_size); +#endif +} + + /* * CONFIG_CHIP_NAME defined in Option.lb. */ struct chip_operations mainboard_amd_dbm690t_ops = { -#if CONFIG_CHIP_NAME == 1 - CHIP_NAME("AMD Dbm690t Mainboard") -#endif + CHIP_NAME("AMD DBM690T Mainboard") .enable_dev = dbm690t_enable, }; Index: src/config/Options.lb =================================================================== --- src/config/Options.lb (revision 916) +++ src/config/Options.lb (working copy) @@ -1096,6 +1096,12 @@ comment "GFX UMA" end +define HAVE_MAINBOARD_RESOURCES + default 0 + export always + comment "Enable if the mainboard/chipset requires extra entries in the memory map" +end + define CONFIG_SPLASH_GRAPHIC default 0 export used Index: src/arch/i386/boot/coreboot_table.c =================================================================== --- src/arch/i386/boot/coreboot_table.c (revision 916) +++ src/arch/i386/boot/coreboot_table.c (working copy) @@ -357,7 +357,8 @@ } } -static void lb_add_memory_range(struct lb_memory *mem, +/* This function is used in mainboard specific code, too */ +void lb_add_memory_range(struct lb_memory *mem, uint32_t type, uint64_t start, uint64_t size) { lb_remove_memory_range(mem, start, size); @@ -447,15 +448,10 @@ lb_add_memory_range(mem, LB_MEM_TABLE, rom_table_start, rom_table_end-rom_table_start); - /* AMD rs690 chip, we should remove the UMA from system memory. */ -#if (CONFIG_GFXUMA == 1) - printk_info("uma_memory_start=0x%x, uma_memory_size=0x%x \n", - uma_memory_start, uma_memory_size); - lb_add_memory_range(mem, LB_MEM_TABLE, - uma_memory_start, uma_memory_size); +#if (HAVE_MAINBOARD_RESOURCES == 1) + add_mainboard_resources(mem); #endif - /* Note: * I assume that there is always memory at immediately after * the low_table_end. This means that after I setup the coreboot table. Index: src/arch/i386/boot/coreboot_table.h =================================================================== --- src/arch/i386/boot/coreboot_table.h (revision 916) +++ src/arch/i386/boot/coreboot_table.h (working copy) @@ -26,4 +26,7 @@ extern struct cmos_option_table option_table; +/* defined by mainboard.c if the mainboard requires extra resources */ +int add_mainboard_resources(struct lb_memory *mem); + #endif /* COREBOOT_TABLE_H */
signature.asc
Description: OpenPGP digital signature
-- coreboot mailing list: [email protected] http://www.coreboot.org/mailman/listinfo/coreboot

