aboutsummaryrefslogtreecommitdiff
path: root/src/pc80/mc146818rtc_early.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2009-06-30 15:17:49 +0000
committerStefan Reinauer <stepan@openbios.org>2009-06-30 15:17:49 +0000
commit0867062412dd4bfe5a556e5f3fd85ba5b682d79b (patch)
tree81ca5db12b8567b48daaa23a541bfb8a5dc011f8 /src/pc80/mc146818rtc_early.c
parent9702b6bf7ec5a4fb16934f1cf2724480e2460c89 (diff)
This patch unifies the use of config options in v2 to all start with CONFIG_
It's basically done with the following script and some manual fixup: VARS=`grep ^define src/config/Options.lb | cut -f2 -d\ | grep -v ^CONFIG | grep -v ^COREBOOT |grep -v ^CC` for VAR in $VARS; do find . -name .svn -prune -o -type f -exec perl -pi -e "s/(^|[^0-9a-zA-Z_]+)$VAR($|[^0-9a-zA-Z_]+)/\1CONFIG_$VAR\2/g" {} \; done Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4381 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/pc80/mc146818rtc_early.c')
-rw-r--r--src/pc80/mc146818rtc_early.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/pc80/mc146818rtc_early.c b/src/pc80/mc146818rtc_early.c
index 2e3d09c8c0..6db9ec8e1a 100644
--- a/src/pc80/mc146818rtc_early.c
+++ b/src/pc80/mc146818rtc_early.c
@@ -1,11 +1,11 @@
#include <pc80/mc146818rtc.h>
#include <part/fallback_boot.h>
-#ifndef MAX_REBOOT_CNT
-#error "MAX_REBOOT_CNT not defined"
+#ifndef CONFIG_MAX_REBOOT_CNT
+#error "CONFIG_MAX_REBOOT_CNT not defined"
#endif
-#if MAX_REBOOT_CNT > 15
-#error "MAX_REBOOT_CNT too high"
+#if CONFIG_MAX_REBOOT_CNT > 15
+#error "CONFIG_MAX_REBOOT_CNT too high"
#endif
static unsigned char cmos_read(unsigned char addr)
@@ -44,14 +44,14 @@ static int cmos_chksum_valid(void)
unsigned long sum, old_sum;
sum = 0;
/* Comput the cmos checksum */
- for(addr = LB_CKS_RANGE_START; addr <= LB_CKS_RANGE_END; addr++) {
+ for(addr = CONFIG_LB_CKS_RANGE_START; addr <= CONFIG_LB_CKS_RANGE_END; addr++) {
sum += cmos_read(addr);
}
sum = (sum & 0xffff) ^ 0xffff;
/* Read the stored checksum */
- old_sum = cmos_read(LB_CKS_LOC) << 8;
- old_sum |= cmos_read(LB_CKS_LOC+1);
+ old_sum = cmos_read(CONFIG_LB_CKS_LOC) << 8;
+ old_sum |= cmos_read(CONFIG_LB_CKS_LOC+1);
return sum == old_sum;
}
@@ -75,7 +75,7 @@ static int do_normal_boot(void)
*/
byte = cmos_read(RTC_BOOT_BYTE);
byte &= 0x0c;
- byte |= MAX_REBOOT_CNT << 4;
+ byte |= CONFIG_MAX_REBOOT_CNT << 4;
cmos_write(byte, RTC_BOOT_BYTE);
}
@@ -89,12 +89,12 @@ static int do_normal_boot(void)
/* Properly set the last boot flag */
byte &= 0xfc;
- if ((byte >> 4) < MAX_REBOOT_CNT) {
+ if ((byte >> 4) < CONFIG_MAX_REBOOT_CNT) {
byte |= (1<<1);
}
/* Are we already at the max count? */
- if ((byte >> 4) < MAX_REBOOT_CNT) {
+ if ((byte >> 4) < CONFIG_MAX_REBOOT_CNT) {
byte += 1 << 4; /* No, add 1 to the count */
}
else {
@@ -109,7 +109,7 @@ static int do_normal_boot(void)
static unsigned read_option(unsigned start, unsigned size, unsigned def)
{
-#if USE_OPTION_TABLE == 1
+#if CONFIG_USE_OPTION_TABLE == 1
unsigned byte;
byte = cmos_read(start/8);
return (byte >> (start & 7U)) & ((1U << size) - 1U);