| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <security/vboot/vbnv.h> |
| 4 | #include <pc80/mc146818rtc.h> |
| 5 | |
| 6 | void vbnv_platform_init_cmos(void) |
| 7 | { |
| 8 | /* The 0 argument tells cmos_init not to update CMOS unless it is invalid. */ |
| 9 | cmos_init(0); |
| 10 | } |
| 11 | |
| 12 | int vbnv_cmos_failed(void) |
| 13 | { |
| 14 | /* If CMOS power has failed, the century will be set to 0xff */ |
| 15 | return cmos_read(RTC_CLK_ALTCENTURY) == 0xff; |
| 16 | } |