From eb50c7d922e91f0247b3705eccb2d2eec638c277 Mon Sep 17 00:00:00 2001 From: Edwin Beasant Date: Tue, 6 Jul 2010 21:05:04 +0000 Subject: Re-integrate "USE_OPTION_TABLE" code. Signed-off-by: Edwin Beasant Signed-off-by: Myles Watson Acked-by: Myles Watson git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5653 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/pc80/mc146818rtc.c | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) (limited to 'src/pc80/mc146818rtc.c') diff --git a/src/pc80/mc146818rtc.c b/src/pc80/mc146818rtc.c index 078bde273c..23b834c06a 100644 --- a/src/pc80/mc146818rtc.c +++ b/src/pc80/mc146818rtc.c @@ -1,11 +1,7 @@ #include -#include #include #include #include -#if CONFIG_HAVE_OPTION_TABLE -#include -#endif /* control registers - Moto names */ @@ -76,29 +72,7 @@ # define RTC_VRT 0x80 /* valid RAM and time */ /**********************************************************************/ -static inline unsigned char cmos_read(unsigned char addr) -{ - int offs = 0; - if (addr >= 128) { - offs = 2; - addr -= 128; - } - outb(addr, RTC_BASE_PORT + offs + 0); - return inb(RTC_BASE_PORT + offs + 1); -} - -static inline void cmos_write(unsigned char val, unsigned char addr) -{ - int offs = 0; - if (addr >= 128) { - offs = 2; - addr -= 128; - } - outb(addr, RTC_BASE_PORT + offs + 0); - outb(val, RTC_BASE_PORT + offs + 1); -} - -#if CONFIG_HAVE_OPTION_TABLE +#if CONFIG_USE_OPTION_TABLE static int rtc_checksum_valid(int range_start, int range_end, int cks_loc) { int i; @@ -138,14 +112,14 @@ static void rtc_set_checksum(int range_start, int range_end, int cks_loc) void rtc_init(int invalid) { -#if CONFIG_HAVE_OPTION_TABLE +#if CONFIG_USE_OPTION_TABLE unsigned char x; int cmos_invalid, checksum_invalid; #endif printk(BIOS_DEBUG, "RTC Init\n"); -#if CONFIG_HAVE_OPTION_TABLE +#if CONFIG_USE_OPTION_TABLE /* See if there has been a CMOS power problem. */ x = cmos_read(RTC_VALID); cmos_invalid = !(x & RTC_VRT); @@ -186,7 +160,7 @@ void rtc_init(int invalid) /* Setup the frequency it operates at */ cmos_write(RTC_FREQ_SELECT_DEFAULT, RTC_FREQ_SELECT); -#if CONFIG_HAVE_OPTION_TABLE +#if CONFIG_USE_OPTION_TABLE /* See if there is a LB CMOS checksum error */ checksum_invalid = !rtc_checksum_valid(LB_CKS_RANGE_START, LB_CKS_RANGE_END,LB_CKS_LOC); @@ -203,7 +177,7 @@ void rtc_init(int invalid) } -#if CONFIG_USE_OPTION_TABLE == 1 +#if CONFIG_USE_OPTION_TABLE /* This routine returns the value of the requested bits input bit = bit count from the beginning of the cmos image length = number of bits to include in the value -- cgit v1.2.3