Am 28.04.2009 10:41, schrieb Patrick Georgi:
Am 27.04.2009 23:37, schrieb Peter Stuge:
This code doesn't seem mainboard specific so I think it must not be
in mainboard/.
add_mainboard_resources is necessary for some boards (eg. kontron), but
this generic code could be added to the caller of
add_mainboard_resources (wrapped in HAVE_HIGH_TABLES, of course).
That way, boards that really need it (for other things) can use this
function, while others don't have to do anything.

I'll prepare a patch for that.
Attached.

Signed-off-by: Patrick Georgi <[email protected]>
Index: src/mainboard/supermicro/h8dme/Options.lb
===================================================================
--- src/mainboard/supermicro/h8dme/Options.lb   (Revision 4222)
+++ src/mainboard/supermicro/h8dme/Options.lb   (Arbeitskopie)
@@ -56,7 +56,6 @@
 uses STACK_SIZE
 uses HEAP_SIZE
 uses USE_OPTION_TABLE
-uses HAVE_MAINBOARD_RESOURCES
 uses HAVE_HIGH_TABLES
 uses HAVE_LOW_TABLES
 uses CONFIG_MULTIBOOT
@@ -129,7 +128,6 @@
 #default ROM_SIZE=524288
 default ROM_SIZE=0x100000
 
-default HAVE_MAINBOARD_RESOURCES = 1
 default HAVE_HIGH_TABLES = 1
 default HAVE_LOW_TABLES = 0
 default CONFIG_MULTIBOOT=0
Index: src/mainboard/supermicro/h8dme/mainboard.c
===================================================================
--- src/mainboard/supermicro/h8dme/mainboard.c  (Revision 4222)
+++ src/mainboard/supermicro/h8dme/mainboard.c  (Arbeitskopie)
@@ -17,22 +17,8 @@
  */
 
 #include <device/device.h>
-#include <console/console.h>
-#include <boot/tables.h>
 #include "chip.h"
 
-/* in arch/i386/boot/tables.c */
-extern uint64_t high_tables_base, high_tables_size;
-
-int add_mainboard_resources(struct lb_memory *mem)
-{
-#if HAVE_HIGH_TABLES == 1
-  lb_add_memory_range(mem, LB_MEM_TABLE,
-    high_tables_base, high_tables_size);
-#endif
-  return 0;
-}
-
 struct chip_operations mainboard_ops = {
        CHIP_NAME("Supermicro H8DME Mainboard")
 };
Index: src/mainboard/kontron/986lcd-m/mainboard.c
===================================================================
--- src/mainboard/kontron/986lcd-m/mainboard.c  (Revision 4222)
+++ src/mainboard/kontron/986lcd-m/mainboard.c  (Arbeitskopie)
@@ -25,19 +25,11 @@
 #include <boot/tables.h>
 #include "chip.h"
 
-/* in arch/i386/boot/tables.c */
-extern uint64_t high_tables_base, high_tables_size;
-
 /* in northbridge/intel/i945/northbridge.c */
 extern uint64_t uma_memory_base, uma_memory_size;
 
 int add_mainboard_resources(struct lb_memory *mem)
 {
-#if HAVE_HIGH_TABLES == 1
-       printk_debug("Adding high table area\n");
-       lb_add_memory_range(mem, LB_MEM_TABLE,
-               high_tables_base, high_tables_size);
-#endif
        printk_debug("Adding UMA memory area\n");
        lb_add_memory_range(mem, LB_MEM_RESERVED, 
                uma_memory_base, uma_memory_size);
Index: src/mainboard/tyan/s2891/Options.lb
===================================================================
--- src/mainboard/tyan/s2891/Options.lb (Revision 4222)
+++ src/mainboard/tyan/s2891/Options.lb (Arbeitskopie)
@@ -33,7 +33,6 @@
 uses LB_CKS_LOC
 uses HAVE_ACPI_TABLES
 uses HAVE_ACPI_RESUME
-uses HAVE_MAINBOARD_RESOURCES
 uses HAVE_HIGH_TABLES
 uses HAVE_LOW_TABLES
 uses CONFIG_MULTIBOOT
@@ -130,8 +129,7 @@
 ##
 default HAVE_ACPI_TABLES=1
 default HAVE_LOW_TABLES=1
-default HAVE_MAINBOARD_RESOURCES=1
-default HAVE_HIGH_TABLES=0
+default HAVE_HIGH_TABLES=1
 default CONFIG_MULTIBOOT=0
 
 ##
Index: src/mainboard/tyan/s2891/mainboard.c
===================================================================
--- src/mainboard/tyan/s2891/mainboard.c        (Revision 4222)
+++ src/mainboard/tyan/s2891/mainboard.c        (Arbeitskopie)
@@ -1,22 +1,6 @@
 #include <device/device.h>
-#include <console/console.h>
-#include <boot/tables.h>
 #include "chip.h"
 
-/* in arch/i386/boot/tables.c */
-extern uint64_t high_tables_base, high_tables_size;
-
-int add_mainboard_resources(struct lb_memory *mem)
-{
-#if HAVE_HIGH_TABLES == 1
-       printk_debug("Adding high table area\n");
-       lb_add_memory_range(mem, LB_MEM_TABLE,
-               high_tables_base, high_tables_size);
-#endif
-       return 0;
-}
-
-
 struct chip_operations mainboard_ops = {
        CHIP_NAME("Tyan S2891 Mainboard")
 };
Index: src/mainboard/tyan/s2892/Options.lb
===================================================================
--- src/mainboard/tyan/s2892/Options.lb (Revision 4222)
+++ src/mainboard/tyan/s2892/Options.lb (Arbeitskopie)
@@ -33,7 +33,6 @@
 uses LB_CKS_LOC
 uses HAVE_ACPI_TABLES
 uses HAVE_ACPI_RESUME
-uses HAVE_MAINBOARD_RESOURCES
 uses HAVE_HIGH_TABLES
 uses HAVE_LOW_TABLES
 uses CONFIG_MULTIBOOT
@@ -124,8 +123,7 @@
 ##
 default HAVE_ACPI_TABLES=1
 default HAVE_LOW_TABLES=1
-default HAVE_MAINBOARD_RESOURCES=1
-default HAVE_HIGH_TABLES=0
+default HAVE_HIGH_TABLES=1
 default CONFIG_MULTIBOOT=0
 
 ##
Index: src/mainboard/tyan/s2892/mainboard.c
===================================================================
--- src/mainboard/tyan/s2892/mainboard.c        (Revision 4222)
+++ src/mainboard/tyan/s2892/mainboard.c        (Arbeitskopie)
@@ -1,22 +1,6 @@
 #include <device/device.h>
-#include <console/console.h>
-#include <boot/tables.h>
 #include "chip.h"
 
-/* in arch/i386/boot/tables.c */
-extern uint64_t high_tables_base, high_tables_size;
-
-int add_mainboard_resources(struct lb_memory *mem)
-{
-#if HAVE_HIGH_TABLES == 1
-       printk_debug("Adding high table area\n");
-       lb_add_memory_range(mem, LB_MEM_TABLE,
-               high_tables_base, high_tables_size);
-#endif
-       return 0;
-}
-
-
 struct chip_operations mainboard_ops = {
        CHIP_NAME("Tyan S2892 Mainboard")
 };
Index: src/mainboard/tyan/s2895/Options.lb
===================================================================
--- src/mainboard/tyan/s2895/Options.lb (Revision 4222)
+++ src/mainboard/tyan/s2895/Options.lb (Arbeitskopie)
@@ -36,7 +36,6 @@
 uses LB_CKS_LOC
 uses HAVE_ACPI_TABLES
 uses HAVE_ACPI_RESUME
-uses HAVE_MAINBOARD_RESOURCES
 uses HAVE_HIGH_TABLES
 uses HAVE_LOW_TABLES
 uses CONFIG_MULTIBOOT
@@ -137,8 +136,7 @@
 ##
 default HAVE_ACPI_TABLES=1
 default HAVE_LOW_TABLES=1
-default HAVE_MAINBOARD_RESOURCES=1
-default HAVE_HIGH_TABLES=0
+default HAVE_HIGH_TABLES=1
 default CONFIG_MULTIBOOT=0
 
 ##
Index: src/mainboard/tyan/s2895/mainboard.c
===================================================================
--- src/mainboard/tyan/s2895/mainboard.c        (Revision 4222)
+++ src/mainboard/tyan/s2895/mainboard.c        (Arbeitskopie)
@@ -1,22 +1,6 @@
 #include <device/device.h>
-#include <console/console.h>
-#include <boot/tables.h>
 #include "chip.h"
 
-/* in arch/i386/boot/tables.c */
-extern uint64_t high_tables_base, high_tables_size;
-
-int add_mainboard_resources(struct lb_memory *mem)
-{
-#if HAVE_HIGH_TABLES == 1
-       printk_debug("Adding high table area\n");
-       lb_add_memory_range(mem, LB_MEM_TABLE,
-               high_tables_base, high_tables_size);
-#endif
-       return 0;
-}
-
-
 struct chip_operations mainboard_ops = {
        CHIP_NAME("Tyan S2895 Mainboard")
 };
Index: src/mainboard/via/vt8454c/Options.lb
===================================================================
--- src/mainboard/via/vt8454c/Options.lb        (Revision 4222)
+++ src/mainboard/via/vt8454c/Options.lb        (Arbeitskopie)
@@ -27,7 +27,6 @@
 uses USE_OPTION_TABLE
 uses HAVE_LOW_TABLES
 uses HAVE_HIGH_TABLES
-uses HAVE_MAINBOARD_RESOURCES
 
 uses USE_FALLBACK_IMAGE
 uses HAVE_FALLBACK_BOOT
@@ -147,7 +146,6 @@
 ##
 default HAVE_LOW_TABLES=1
 default HAVE_HIGH_TABLES=1
-default HAVE_MAINBOARD_RESOURCES=1
 
 
 ##
Index: src/mainboard/via/vt8454c/mainboard.c
===================================================================
--- src/mainboard/via/vt8454c/mainboard.c       (Revision 4222)
+++ src/mainboard/via/vt8454c/mainboard.c       (Arbeitskopie)
@@ -20,23 +20,8 @@
  */
 
 #include <device/device.h>
-#include <boot/tables.h>
-#include <console/console.h>
 #include "chip.h"
 
-/* in arch/i386/boot/tables.c */
-extern uint64_t high_tables_base, high_tables_size;
-
-int add_mainboard_resources(struct lb_memory *mem)
-{
-#if HAVE_HIGH_TABLES == 1
-        printk_debug("Adding high table area\n");
-        lb_add_memory_range(mem, LB_MEM_TABLE,
-                high_tables_base, high_tables_size);
-#endif
-       return 0;
-}
-
 struct chip_operations mainboard_ops = {
        CHIP_NAME("VIA VT8454c Mainboard")
 };
Index: src/mainboard/asus/m2v-mx_se/mainboard.c
===================================================================
--- src/mainboard/asus/m2v-mx_se/mainboard.c    (Revision 4222)
+++ src/mainboard/asus/m2v-mx_se/mainboard.c    (Arbeitskopie)
@@ -17,23 +17,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#include <console/console.h>
 #include <device/device.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <boot/tables.h>
 #include "chip.h"
 
-/* in arch/i386/boot/tables.c */
-extern uint64_t high_tables_base, high_tables_size;
-
 int add_mainboard_resources(struct lb_memory *mem)
 {
-#if HAVE_HIGH_TABLES == 1
-       printk_debug("Adding high table area\n");
-       lb_add_memory_range(mem, LB_MEM_TABLE,
-               high_tables_base, high_tables_size);
-#endif
 #if HAVE_ACPI_RESUME == 1
        lb_add_memory_range(mem, LB_MEM_RESERVED,
                _RAMBASE, ((CONFIG_LB_MEM_TOPK<<10) - _RAMBASE));
Index: src/arch/i386/boot/coreboot_table.c
===================================================================
--- src/arch/i386/boot/coreboot_table.c (Revision 4222)
+++ src/arch/i386/boot/coreboot_table.c (Arbeitskopie)
@@ -413,6 +413,10 @@
        return mem;
 }
 
+#if HAVE_HIGH_TABLES == 1
+extern uint64_t high_tables_base, high_tables_size;
+#endif
+
 unsigned long write_coreboot_table( 
        unsigned long low_table_start, unsigned long low_table_end, 
        unsigned long rom_table_start, unsigned long rom_table_end)
@@ -479,6 +483,12 @@
        lb_add_memory_range(mem, LB_MEM_TABLE, 
                rom_table_start, rom_table_end-rom_table_start);
 
+#if HAVE_HIGH_TABLES == 1
+       printk_debug("Adding high table area\n");
+       lb_add_memory_range(mem, LB_MEM_TABLE,
+               high_tables_base, high_tables_size);
+#endif
+
 #if (HAVE_MAINBOARD_RESOURCES == 1)
        add_mainboard_resources(mem);
 #endif
-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to