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>
This commit is contained in:
committed by
Nico Huber
parent
d371cf3336
commit
e75cb331df
@@ -3,6 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright 2014 The Chromium OS Authors. All rights reserved.
|
* Copyright 2014 The Chromium OS Authors. All rights reserved.
|
||||||
* Copyright (C) 2015 Timothy Pearson <tpearson@raptorengineeringinc.com>, Raptor Engineering
|
* 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
|
* 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
|
* 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);
|
cmos_write(0, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmos_invalid)
|
if (cmos_invalid || invalid)
|
||||||
cmos_reset_date();
|
cmos_reset_date();
|
||||||
|
|
||||||
printk(BIOS_WARNING, "RTC:%s%s%s%s\n",
|
printk(BIOS_WARNING, "RTC:%s%s%s%s\n",
|
||||||
|
Reference in New Issue
Block a user