Revert "elog: Use the RTC driver interface instead of reading CMOS directly."
This reverts commit 474313d1b6
.
This reverted commit was applied out of sequence and there are a number
of dependencies that need to be in place prior to adding it. Remove it
for now.
Change-Id: If80c40867098dee2feff2b9a1d824558f4d7028d
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/7837
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
9d0ae597d7
commit
127ad41f64
|
@ -25,8 +25,6 @@
|
||||||
#if CONFIG_ARCH_X86
|
#if CONFIG_ARCH_X86
|
||||||
#include <pc80/mc146818rtc.h>
|
#include <pc80/mc146818rtc.h>
|
||||||
#endif
|
#endif
|
||||||
#include <bcd.h>
|
|
||||||
#include <rtc.h>
|
|
||||||
#include <smbios.h>
|
#include <smbios.h>
|
||||||
#include <spi-generic.h>
|
#include <spi-generic.h>
|
||||||
#include <spi_flash.h>
|
#include <spi_flash.h>
|
||||||
|
@ -640,15 +638,20 @@ int elog_init(void)
|
||||||
*/
|
*/
|
||||||
static void elog_fill_timestamp(struct event_header *event)
|
static void elog_fill_timestamp(struct event_header *event)
|
||||||
{
|
{
|
||||||
struct rtc_time time;
|
#if CONFIG_ARCH_X86
|
||||||
|
event->second = cmos_read(RTC_CLK_SECOND);
|
||||||
rtc_get(&time);
|
event->minute = cmos_read(RTC_CLK_MINUTE);
|
||||||
event->second = bin2bcd(time.sec);
|
event->hour = cmos_read(RTC_CLK_HOUR);
|
||||||
event->minute = bin2bcd(time.min);
|
event->day = cmos_read(RTC_CLK_DAYOFMONTH);
|
||||||
event->hour = bin2bcd(time.hour);
|
event->month = cmos_read(RTC_CLK_MONTH);
|
||||||
event->day = bin2bcd(time.mday);
|
event->year = cmos_read(RTC_CLK_YEAR);
|
||||||
event->month = bin2bcd(time.mon);
|
#else
|
||||||
event->year = bin2bcd(time.year) & 0xff;
|
/*
|
||||||
|
* FIXME: We need to abstract the CMOS stuff on non-x86 platforms.
|
||||||
|
* Until then, use bogus data here to force the values to 0.
|
||||||
|
*/
|
||||||
|
event->month = 0xff;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Basic sanity check of expected ranges */
|
/* Basic sanity check of expected ranges */
|
||||||
if (event->month > 0x12 || event->day > 0x31 || event->hour > 0x23 ||
|
if (event->month > 0x12 || event->day > 0x31 || event->hour > 0x23 ||
|
||||||
|
|
Loading…
Reference in New Issue