diff options
author | Edwin Beasant <edwin_beasant@virtensys.com> | 2010-07-06 21:05:04 +0000 |
---|---|---|
committer | Myles Watson <mylesgw@gmail.com> | 2010-07-06 21:05:04 +0000 |
commit | eb50c7d922e91f0247b3705eccb2d2eec638c277 (patch) | |
tree | 2def570d089b2f6deb2beac165e18756a578e308 /src/pc80/mc146818rtc.c | |
parent | 8376831eafc1be1175529fd21e0d2fe40339d4eb (diff) | |
download | coreboot-eb50c7d922e91f0247b3705eccb2d2eec638c277.tar.xz |
Re-integrate "USE_OPTION_TABLE" code.
Signed-off-by: Edwin Beasant <edwin_beasant@virtensys.com>
Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Myles Watson <mylesgw@gmail.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5653 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/pc80/mc146818rtc.c')
-rw-r--r-- | src/pc80/mc146818rtc.c | 36 |
1 files changed, 5 insertions, 31 deletions
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 <console/console.h> -#include <arch/io.h> #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 */ @@ -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 |