From 0867062412dd4bfe5a556e5f3fd85ba5b682d79b Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Tue, 30 Jun 2009 15:17:49 +0000 Subject: 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 Acked-by: Ronald G. Minnich git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4381 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/pc80/mc146818rtc_early.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/pc80/mc146818rtc_early.c') 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 #include -#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); -- cgit v1.2.3