summaryrefslogtreecommitdiff
path: root/src/soc/intel/apollolake/lpc.c
diff options
context:
space:
mode:
authorLijian Zhao <lijian.zhao@intel.com>2017-09-06 16:47:17 -0700
committerAaron Durbin <adurbin@chromium.org>2017-09-11 18:14:35 +0000
commitbfabe62a6e5cdd9e29394b12737c5ed9bd080036 (patch)
tree6a190f588a2da452fdfd89c68bf31279cd9aa61a /src/soc/intel/apollolake/lpc.c
parent0a712c33379799b13215068e4dcbad8272d38ccc (diff)
soc/intel/common/block: Update common rtc code
Move rtc init code into common area and update the implementation for apollolake to avoid build break. Change-Id: I702ce0efba25cb6fde33cc15698ae44312742367 Signed-off-by: Lijian Zhao <lijian.zhao@intel.com> Reviewed-on: https://review.coreboot.org/21433 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/intel/apollolake/lpc.c')
-rw-r--r--src/soc/intel/apollolake/lpc.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/soc/intel/apollolake/lpc.c b/src/soc/intel/apollolake/lpc.c
index 6c7ffff200..0cd58de7a8 100644
--- a/src/soc/intel/apollolake/lpc.c
+++ b/src/soc/intel/apollolake/lpc.c
@@ -83,23 +83,16 @@ void lpc_configure_pads(void)
gpio_configure_pads(lpc_gpios, ARRAY_SIZE(lpc_gpios));
}
-static void rtc_init(void)
+int soc_get_rtc_failed(void)
{
- int rtc_fail;
const struct chipset_power_state *ps = cbmem_find(CBMEM_ID_POWER_STATE);
if (!ps) {
printk(BIOS_ERR, "Could not find power state in cbmem, RTC init aborted\n");
- return;
+ return 1;
}
- rtc_fail = !!(ps->gen_pmcon1 & RPS);
- /* Ensure the date is set including century byte. */
- cmos_check_update_date();
- if (IS_ENABLED(CONFIG_VBOOT_VBNV_CMOS))
- init_vbnv_cmos(rtc_fail);
- else
- cmos_init(rtc_fail);
+ return !!(ps->gen_pmcon1 & RPS);
}
void lpc_init(struct device *dev)