diff options
author | Frans Hendriks <fhendriks@eltan.com> | 2018-11-01 14:02:57 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2018-11-05 09:06:55 +0000 |
commit | 392d69957038b26ce1de5c3a88bb0828fec4c0d4 (patch) | |
tree | 980319b0da4c9fb7eb169708db4f3294715352a4 /src/soc/intel/braswell/romstage | |
parent | fe701ee3982f8c921390aacc45d50871dc86d119 (diff) | |
download | coreboot-392d69957038b26ce1de5c3a88bb0828fec4c0d4.tar.xz |
src/soc/intel/braswell/romstage/romstage.c: Perform RTC init in romstage
soc_rtc_init() is executed in ramstage
The soc_rtc_init() needs to be executeed before FSP is called. Move the RTC
init from ramstage to romstage.
BUG=N/A
TEST=Intel CherryHill CRB
Change-Id: Ic19c768bf9d9aef7505fb9327e4eedf7212b0057
Signed-off-by: Frans Hendriks <fhendriks@eltan.com>
Reviewed-on: https://review.coreboot.org/29397
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/intel/braswell/romstage')
-rw-r--r-- | src/soc/intel/braswell/romstage/romstage.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/soc/intel/braswell/romstage/romstage.c b/src/soc/intel/braswell/romstage/romstage.c index f485dfdfea..03f9ac07f1 100644 --- a/src/soc/intel/braswell/romstage/romstage.c +++ b/src/soc/intel/braswell/romstage/romstage.c @@ -3,6 +3,7 @@ * * Copyright (C) 2013 Google Inc. * Copyright (C) 2015 Intel Corp. + * Copyright (C) 2018 Eltan B.V. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,6 +44,9 @@ #include <soc/romstage.h> #include <soc/smm.h> #include <soc/spi.h> +#include <build.h> +#include <rtc.h> +#include <pc80/mc146818rtc.h> void program_base_addresses(void) { @@ -89,6 +93,22 @@ static void spi_init(void) write32(bcr, reg); } +static void soc_rtc_init(void) +{ + int rtc_failed = rtc_failure(); + + if (rtc_failed) { + printk(BIOS_ERR, + "RTC Failure detected. Resetting date to %x/%x/%x%x\n", + COREBOOT_BUILD_MONTH_BCD, + COREBOOT_BUILD_DAY_BCD, + 0x20, + COREBOOT_BUILD_YEAR_BCD); + } + + cmos_init(rtc_failed); +} + static struct chipset_power_state power_state CAR_GLOBAL; static void migrate_power_state(int is_recovery) @@ -172,6 +192,7 @@ void car_soc_pre_console_init(void) void car_soc_post_console_init(void) { /* Continue chipset initialization */ + soc_rtc_init(); set_max_freq(); spi_init(); |