From ea3402213ff4b80bf8ebfb8502e49aa071cf3d74 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Sat, 14 Nov 2020 01:58:47 +0100 Subject: soc/amd: factor out vbnv_cmos_failed() into soc/amd/common/vboot Change-Id: I7f976c6c5a2a715e1a5372bb93fe657d0d86c848 Signed-off-by: Felix Held Reviewed-on: https://review.coreboot.org/c/coreboot/+/47584 Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) --- src/soc/amd/common/Makefile.inc | 5 ++++- src/soc/amd/common/vboot/Makefile.inc | 6 ++++++ src/soc/amd/common/vboot/vbnv_cmos.c | 10 ++++++++++ src/soc/amd/picasso/Makefile.inc | 4 ---- src/soc/amd/picasso/pmutil.c | 10 ---------- src/soc/amd/stoneyridge/Makefile.inc | 4 ---- src/soc/amd/stoneyridge/pmutil.c | 14 -------------- 7 files changed, 20 insertions(+), 33 deletions(-) create mode 100644 src/soc/amd/common/vboot/Makefile.inc create mode 100644 src/soc/amd/common/vboot/vbnv_cmos.c delete mode 100644 src/soc/amd/picasso/pmutil.c delete mode 100644 src/soc/amd/stoneyridge/pmutil.c (limited to 'src') 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 +#include + +int vbnv_cmos_failed(void) +{ + /* If CMOS power has failed, the century will be set to 0xff */ + return cmos_read(RTC_CLK_ALTCENTURY) == 0xff; +} diff --git a/src/soc/amd/picasso/Makefile.inc b/src/soc/amd/picasso/Makefile.inc index ffc1463b19..6ec4cd1151 100644 --- a/src/soc/amd/picasso/Makefile.inc +++ b/src/soc/amd/picasso/Makefile.inc @@ -23,14 +23,12 @@ bootblock-y += tsc_freq.c bootblock-y += gpio.c bootblock-y += smi_util.c bootblock-y += config.c -bootblock-y += pmutil.c bootblock-y += reset.c bootblock-$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK) += bootblock/vboot_bootblock.c romstage-y += i2c.c romstage-y += romstage.c romstage-y += gpio.c -romstage-y += pmutil.c romstage-y += reset.c romstage-y += memmap.c romstage-y += uart.c @@ -45,7 +43,6 @@ romstage-y += config.c romstage-y += mrc_cache.c verstage-y += i2c.c -verstage-y += pmutil.c verstage-y += config.c verstage-y += aoac.c verstage_x86-y += gpio.c @@ -66,7 +63,6 @@ ramstage-$(CONFIG_HAVE_ACPI_TABLES) += agesa_acpi.c ramstage-y += gpio.c ramstage-y += aoac.c ramstage-y += southbridge.c -ramstage-y += pmutil.c ramstage-y += reset.c ramstage-y += acp.c ramstage-y += sata.c diff --git a/src/soc/amd/picasso/pmutil.c b/src/soc/amd/picasso/pmutil.c deleted file mode 100644 index 5baf923939..0000000000 --- a/src/soc/amd/picasso/pmutil.c +++ /dev/null @@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include - -int vbnv_cmos_failed(void) -{ - /* If CMOS power has failed, the century will be set to 0xff */ - return cmos_read(RTC_CLK_ALTCENTURY) == 0xff; -} diff --git a/src/soc/amd/stoneyridge/Makefile.inc b/src/soc/amd/stoneyridge/Makefile.inc index fb0a45bd65..311ea6886b 100644 --- a/src/soc/amd/stoneyridge/Makefile.inc +++ b/src/soc/amd/stoneyridge/Makefile.inc @@ -17,7 +17,6 @@ bootblock-y += gpio.c bootblock-y += i2c.c bootblock-y += enable_usbdebug.c bootblock-y += monotonic_timer.c -bootblock-y += pmutil.c bootblock-y += tsc_freq.c bootblock-y += southbridge.c bootblock-$(CONFIG_HAVE_SMI_HANDLER) += smi_util.c @@ -28,7 +27,6 @@ romstage-y += romstage.c romstage-y += enable_usbdebug.c romstage-y += gpio.c romstage-y += monotonic_timer.c -romstage-y += pmutil.c romstage-y += smbus_spd.c romstage-y += memmap.c romstage-$(CONFIG_STONEYRIDGE_UART) += uart.c @@ -40,7 +38,6 @@ romstage-y += psp.c verstage-y += gpio.c verstage-y += i2c.c verstage-y += monotonic_timer.c -verstage-y += pmutil.c verstage-$(CONFIG_STONEYRIDGE_UART) += uart.c verstage-y += tsc_freq.c @@ -61,7 +58,6 @@ ramstage-y += gpio.c ramstage-y += monotonic_timer.c ramstage-y += southbridge.c ramstage-y += northbridge.c -ramstage-y += pmutil.c ramstage-y += sata.c ramstage-y += memmap.c ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi.c diff --git a/src/soc/amd/stoneyridge/pmutil.c b/src/soc/amd/stoneyridge/pmutil.c deleted file mode 100644 index a2ad2db4c1..0000000000 --- a/src/soc/amd/stoneyridge/pmutil.c +++ /dev/null @@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include -#include -#include -#include -#include - -int vbnv_cmos_failed(void) -{ - /* If CMOS power has failed, the century will be set to 0xff */ - return cmos_read(RTC_CLK_ALTCENTURY) == 0xff; -} -- cgit v1.2.3