Don't include option_table.h every time we include mc146818rtc.h, that was a
authorStefan Reinauer <stepan@coresystems.de>
Mon, 29 Mar 2010 23:01:35 +0000 (23:01 +0000)
committerStefan Reinauer <stepan@openbios.org>
Mon, 29 Mar 2010 23:01:35 +0000 (23:01 +0000)
stupid idea. Instead include it where it is needed. And add some explicit
dependencies to it.

Also, error for missing IRQ_SLOT_COUNT for now, so we can fix up the boards.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5321 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

src/arch/i386/boot/Makefile.inc
src/arch/i386/boot/coreboot_table.c
src/arch/i386/include/arch/pirq_routing.h
src/include/pc80/mc146818rtc.h
src/pc80/Makefile.inc
src/pc80/mc146818rtc.c
src/pc80/mc146818rtc_early.c

index e9c539f18779ced500e2f458e8f8f1ad56ad799b..4ef5d6f386697407dc5c109e8f6ee29c1d7858a5 100644 (file)
@@ -8,3 +8,5 @@ obj-$(CONFIG_GENERATE_ACPI_TABLES) += acpi.o
 obj-$(CONFIG_GENERATE_ACPI_TABLES) += acpigen.o
 obj-$(CONFIG_HAVE_ACPI_RESUME) += wakeup.o
 
+$(obj)/arch/i386/boot/coreboot_table.o : $(OPTION_TABLE_H)
+
index d904c91ec43b6976106c711cedd7115e502b7c68..b88ca1adbaca02a9bdadac63d2d276f976227e0e 100644 (file)
@@ -30,7 +30,7 @@
 #include <device/device.h>
 #include <stdlib.h>
 #if (CONFIG_HAVE_OPTION_TABLE == 1)
-#include <pc80/mc146818rtc.h>
+#include <option_table.h>
 #endif
 
 static struct lb_header *lb_table_init(unsigned long addr)
index 174884d02f69763cef4c5ed526ffa0a0cd0d9e0a..4f56de35982e344acb7caa515bd042c2e1e9a123 100644 (file)
@@ -16,11 +16,8 @@ struct irq_info {
        uint8_t rfu;
 } __attribute__((packed));
 
-#if defined(CONFIG_IRQ_SLOT_COUNT)
-#define IRQ_SLOTS_COUNT CONFIG_IRQ_SLOT_COUNT
-#else
-#warning "No IRQ_SLOT_COUNT in Kconfig."
-#define IRQ_SLOTS_COUNT
+#if !defined(CONFIG_IRQ_SLOT_COUNT)
+#error "No IRQ_SLOT_COUNT in Kconfig."
 #endif
 
 struct irq_routing_table {
@@ -33,7 +30,7 @@ struct irq_routing_table {
        uint32_t miniport_data;                 /* Crap */
        uint8_t  rfu[11];
        uint8_t  checksum;                      /* Modulo 256 checksum must give zero */
-       struct irq_info slots[IRQ_SLOTS_COUNT];
+       struct irq_info slots[CONFIG_IRQ_SLOT_COUNT];
 } __attribute__((packed));
 
 extern const struct irq_routing_table intel_irq_routing_table;
index 4172a4a28ab6626c4478cf34bb6a3277d020fe8e..cd8c8181aa8154e6948d4444dd95b19d83575a7f 100644 (file)
 #define PC_CKS_RANGE_END       45
 #define PC_CKS_LOC             46
 
-/* coreboot cmos checksum is usually only built over bytes 49..125 */
-#if CONFIG_HAVE_OPTION_TABLE
-#include <option_table.h>
-#endif
+/* coreboot cmos checksum is usually only built over bytes 49..125
+ * LB_CKS_RANGE_START, LB_CKS_RANGE_END and LB_CKS_LOC are defined
+ * in option_table.h
+ */
 
 #if !defined(ASSEMBLY) && !defined(__PRE_RAM__)
 void rtc_init(int invalid);
index c7c0cd5d0a304bee0209a5361588de483b78b0dc..43190fd07102e288014f5bc6e16905af867a7495 100644 (file)
@@ -6,3 +6,5 @@ obj-y += keyboard.o
 
 #initobj-y += serial.o
 subdirs-y += vga
+
+$(obj)/pc80/mc146818rtc.o : $(OPTION_TABLE_H)
index 1b39db21d11be39b84cd3bf74134056b6b600b5c..4bee1cdffe5d94a3cacd83f16317ededbc3a94a3 100644 (file)
@@ -3,6 +3,9 @@
 #include <pc80/mc146818rtc.h>
 #include <boot/coreboot_tables.h>
 #include <string.h>
+#if CONFIG_HAVE_OPTION_TABLE
+#include <option_table.h>
+#endif
 
 /* control registers - Moto names
  */
@@ -257,7 +260,7 @@ int get_option(void *dest, const char *name)
                }
        }
        if(!found) {
-               printk(BIOS_DEBUG, "WARNING: No cmos option '%s'\n", name);
+               printk(BIOS_DEBUG, "WARNING: No CMOS option '%s'.\n", name);
                return(-2);
        }
        
index 7a1492102a77bd6abe6812f1ee8c46608c0af012..87fc3f0a61b7d6d8e9678f27ac6b9f6a8506a9d0 100644 (file)
@@ -1,5 +1,8 @@
 #include <pc80/mc146818rtc.h>
 #include <fallback.h>
+#if CONFIG_HAVE_OPTION_TABLE
+#include <option_table.h>
+#endif
 
 #ifndef CONFIG_MAX_REBOOT_CNT
 #error "CONFIG_MAX_REBOOT_CNT not defined"
@@ -40,6 +43,7 @@ static int cmos_error(void)
 
 static int cmos_chksum_valid(void)
 {
+#if CONFIG_HAVE_OPTION_TABLE == 1
        unsigned char addr;
        unsigned long sum, old_sum;
        sum = 0;
@@ -54,6 +58,9 @@ static int cmos_chksum_valid(void)
        old_sum |=  cmos_read(LB_CKS_LOC+1);
 
        return sum == old_sum;
+#else
+       return 0;
+#endif
 }