diff options
author | Frans Hendriks <fhendriks@eltan.com> | 2019-03-22 11:06:56 +0100 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2019-04-05 12:39:51 +0000 |
commit | e75cb331df508c98e87c9f407484667c90577e6a (patch) | |
tree | 6f3fc88b49918b8d50904dd8b9b31f7d0b454a87 /src/drivers/pc80 | |
parent | d371cf3336df96407e974f34e39451790a97809a (diff) | |
download | coreboot-e75cb331df508c98e87c9f407484667c90577e6a.tar.xz |
drivers/pc80/rtc/mc146818rtc.c: Reset RTC time on RTC power failure
RTC time contains invalid values on system without RTC battery.
Handle 'invalid' the same way as 'cmos_invalid'. This will reset CMOS date
when calling function enables 'invalid'.
BUG=N/A
TEST=Portwell PQ-M107 booting Linux Embedded
Change-Id: I5eae57d00f328400a8b03c28b7ecdbbc71522206
Signed-off-by: Frans Hendriks <fhendriks@eltan.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/29329
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers/pc80')
-rw-r--r-- | src/drivers/pc80/rtc/mc146818rtc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/drivers/pc80/rtc/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c index c18f1e947b..99079b985e 100644 --- a/src/drivers/pc80/rtc/mc146818rtc.c +++ b/src/drivers/pc80/rtc/mc146818rtc.c @@ -3,6 +3,7 @@ * * Copyright 2014 The Chromium OS Authors. All rights reserved. * Copyright (C) 2015 Timothy Pearson <tpearson@raptorengineeringinc.com>, Raptor Engineering + * Copyright (C) 2018-2019 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 @@ -144,7 +145,7 @@ static bool __cmos_init(bool invalid) cmos_write(0, i); } - if (cmos_invalid) + if (cmos_invalid || invalid) cmos_reset_date(); printk(BIOS_WARNING, "RTC:%s%s%s%s\n", |