Attention is currently required from: Lance Zhao, Martin Roth. Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/49278 )
Change subject: acpi: Add option to stub out Global NVS ......................................................................
acpi: Add option to stub out Global NVS
Add the `ACPI_NO_GLOBAL_NVS_SUPPORT` Kconfig option. To be used in follow-ups that remove useless GNVS implementations from platforms.
Change-Id: Ie31f02c9e279e47ff10562bb077367d4e33f4dd9 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/acpi/Kconfig M src/acpi/Makefile.inc M src/acpi/gnvs.c A src/acpi/nvs_stub.c 4 files changed, 21 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/78/49278/1
diff --git a/src/acpi/Kconfig b/src/acpi/Kconfig index 293c194..9758d41 100644 --- a/src/acpi/Kconfig +++ b/src/acpi/Kconfig @@ -40,3 +40,8 @@ help This variable specifies whether a given board has ACPI table support. It is usually set in mainboard/*/Kconfig. + +config ACPI_NO_GLOBAL_NVS_SUPPORT + bool + help + Selected by platforms that do not implement Global NVS. diff --git a/src/acpi/Makefile.inc b/src/acpi/Makefile.inc index 1cd837d..b7ece61 100644 --- a/src/acpi/Makefile.inc +++ b/src/acpi/Makefile.inc @@ -13,6 +13,7 @@ ramstage-$(CONFIG_CHROMEOS) += chromeos-gnvs.c ramstage-y += gnvs.c ramstage-$(CONFIG_ACPI_SOC_NVS) += nvs.c +ramstage-$(CONFIG_ACPI_NO_GLOBAL_NVS_SUPPORT) += nvs_stub.c ramstage-y += pld.c ramstage-y += sata.c ramstage-y += soundwire.c diff --git a/src/acpi/gnvs.c b/src/acpi/gnvs.c index c8478ee..0bcdba7 100644 --- a/src/acpi/gnvs.c +++ b/src/acpi/gnvs.c @@ -11,6 +11,9 @@
void *acpi_get_gnvs(void) { + if (CONFIG(ACPI_NO_GLOBAL_NVS_SUPPORT)) + return NULL; + if (gnvs) return gnvs;
diff --git a/src/acpi/nvs_stub.c b/src/acpi/nvs_stub.c new file mode 100644 index 0000000..7abfb56 --- /dev/null +++ b/src/acpi/nvs_stub.c @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <acpi/acpi_gnvs.h> +#include <stddef.h> + +struct __packed global_nvs { +}; + +size_t gnvs_size_of_array(void) +{ + return 0; +}