diff options
Diffstat (limited to 'src/soc/amd/common')
-rw-r--r-- | src/soc/amd/common/Makefile.inc | 5 | ||||
-rw-r--r-- | src/soc/amd/common/vboot/Makefile.inc | 6 | ||||
-rw-r--r-- | src/soc/amd/common/vboot/vbnv_cmos.c | 10 |
3 files changed, 20 insertions, 1 deletions
diff --git a/src/soc/amd/common/Makefile.inc b/src/soc/amd/common/Makefile.inc index c0757c5968..418539bca7 100644 --- a/src/soc/amd/common/Makefile.inc +++ b/src/soc/amd/common/Makefile.inc @@ -1 +1,4 @@ -subdirs-$(CONFIG_SOC_AMD_COMMON) += block +ifeq ($(CONFIG_SOC_AMD_COMMON),y) +subdirs-y += block +subdirs-y += vboot +endif diff --git a/src/soc/amd/common/vboot/Makefile.inc b/src/soc/amd/common/vboot/Makefile.inc new file mode 100644 index 0000000000..aff927a5d0 --- /dev/null +++ b/src/soc/amd/common/vboot/Makefile.inc @@ -0,0 +1,6 @@ +ifeq ($(CONFIG_VBOOT_VBNV_CMOS),y) +bootblock-y += vbnv_cmos.c +verstage-y += vbnv_cmos.c +romstage-y += vbnv_cmos.c +ramstage-y += vbnv_cmos.c +endif diff --git a/src/soc/amd/common/vboot/vbnv_cmos.c b/src/soc/amd/common/vboot/vbnv_cmos.c new file mode 100644 index 0000000000..5baf923939 --- /dev/null +++ b/src/soc/amd/common/vboot/vbnv_cmos.c @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <security/vboot/vbnv.h> +#include <pc80/mc146818rtc.h> + +int vbnv_cmos_failed(void) +{ + /* If CMOS power has failed, the century will be set to 0xff */ + return cmos_read(RTC_CLK_ALTCENTURY) == 0xff; +} |