drivers/pc80/rtc: Remove duplicate cmos_chksum_valid()
Change-Id: I5a4b86921876c24cd1d310b674119b960c3d2fd6 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38194 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
@@ -19,27 +19,14 @@
|
||||
#if CONFIG(USE_OPTION_TABLE)
|
||||
#include <option_table.h>
|
||||
|
||||
int cmos_chksum_valid(void)
|
||||
int cmos_lb_cks_valid(void)
|
||||
{
|
||||
unsigned char addr;
|
||||
u16 sum, old_sum;
|
||||
|
||||
sum = 0;
|
||||
/* Compute the cmos checksum */
|
||||
for (addr = LB_CKS_RANGE_START; addr <= LB_CKS_RANGE_END; addr++)
|
||||
sum += cmos_read(addr);
|
||||
|
||||
/* Read the stored checksum */
|
||||
old_sum = cmos_read(LB_CKS_LOC) << 8;
|
||||
old_sum |= cmos_read(LB_CKS_LOC + 1);
|
||||
|
||||
return sum == old_sum;
|
||||
return cmos_checksum_valid(LB_CKS_RANGE_START, LB_CKS_RANGE_END, LB_CKS_LOC);
|
||||
}
|
||||
|
||||
void sanitize_cmos(void)
|
||||
{
|
||||
if (cmos_error() || !cmos_chksum_valid() ||
|
||||
CONFIG(STATIC_OPTION_TABLE)) {
|
||||
if (cmos_error() || !cmos_lb_cks_valid() || CONFIG(STATIC_OPTION_TABLE)) {
|
||||
size_t length = 128;
|
||||
const unsigned char *cmos_default =
|
||||
cbfs_boot_map_with_leak("cmos.default",
|
||||
@@ -83,7 +70,7 @@ int do_normal_boot(void)
|
||||
{
|
||||
unsigned char byte;
|
||||
|
||||
if (!CONFIG(USE_OPTION_TABLE) || cmos_error() || !cmos_chksum_valid()) {
|
||||
if (!CONFIG(USE_OPTION_TABLE) || cmos_error() || !cmos_lb_cks_valid()) {
|
||||
/* Invalid CMOS checksum detected!
|
||||
* Force fallback boot...
|
||||
*/
|
||||
|
Reference in New Issue
Block a user