aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/arch/i386/boot/Makefile.inc2
-rw-r--r--src/arch/i386/boot/coreboot_table.c2
-rw-r--r--src/arch/i386/include/arch/pirq_routing.h9
-rw-r--r--src/include/pc80/mc146818rtc.h8
-rw-r--r--src/pc80/Makefile.inc2
-rw-r--r--src/pc80/mc146818rtc.c5
-rw-r--r--src/pc80/mc146818rtc_early.c7
7 files changed, 23 insertions, 12 deletions
diff --git a/src/arch/i386/boot/Makefile.inc b/src/arch/i386/boot/Makefile.inc
index e9c539f187..4ef5d6f386 100644
--- a/src/arch/i386/boot/Makefile.inc
+++ b/src/arch/i386/boot/Makefile.inc
@@ -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)
+
diff --git a/src/arch/i386/boot/coreboot_table.c b/src/arch/i386/boot/coreboot_table.c
index d904c91ec4..b88ca1adba 100644
--- a/src/arch/i386/boot/coreboot_table.c
+++ b/src/arch/i386/boot/coreboot_table.c
@@ -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)
diff --git a/src/arch/i386/include/arch/pirq_routing.h b/src/arch/i386/include/arch/pirq_routing.h
index 174884d02f..4f56de3598 100644
--- a/src/arch/i386/include/arch/pirq_routing.h
+++ b/src/arch/i386/include/arch/pirq_routing.h
@@ -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;
diff --git a/src/include/pc80/mc146818rtc.h b/src/include/pc80/mc146818rtc.h
index 4172a4a28a..cd8c8181aa 100644
--- a/src/include/pc80/mc146818rtc.h
+++ b/src/include/pc80/mc146818rtc.h
@@ -81,10 +81,10 @@
#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);
diff --git a/src/pc80/Makefile.inc b/src/pc80/Makefile.inc
index c7c0cd5d0a..43190fd071 100644
--- a/src/pc80/Makefile.inc
+++ b/src/pc80/Makefile.inc
@@ -6,3 +6,5 @@ obj-y += keyboard.o
#initobj-y += serial.o
subdirs-y += vga
+
+$(obj)/pc80/mc146818rtc.o : $(OPTION_TABLE_H)
diff --git a/src/pc80/mc146818rtc.c b/src/pc80/mc146818rtc.c
index 1b39db21d1..4bee1cdffe 100644
--- a/src/pc80/mc146818rtc.c
+++ b/src/pc80/mc146818rtc.c
@@ -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);
}
diff --git a/src/pc80/mc146818rtc_early.c b/src/pc80/mc146818rtc_early.c
index 7a1492102a..87fc3f0a61 100644
--- a/src/pc80/mc146818rtc_early.c
+++ b/src/pc80/mc146818rtc_early.c
@@ -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
}