From 8a5f157fdff9e0af9e7e0b9714c6b55f28f8ef1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sun, 28 Jun 2020 21:28:54 +0300 Subject: sb/intel: Use acpi_inject_nvsa() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5f1762c4a25631af9d29a2cb038620d9e9698f8b Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/48715 Reviewed-by: Arthur Heymans Tested-by: build bot (Jenkins) --- src/southbridge/intel/i82801ix/lpc.c | 14 ++++---------- src/southbridge/intel/i82801jx/lpc.c | 14 ++++---------- 2 files changed, 8 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/southbridge/intel/i82801ix/lpc.c b/src/southbridge/intel/i82801ix/lpc.c index 39cae48d10..844f03bd53 100644 --- a/src/southbridge/intel/i82801ix/lpc.c +++ b/src/southbridge/intel/i82801ix/lpc.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include "chip.h" #include "i82801ix.h" @@ -467,16 +466,11 @@ void *gnvs_chromeos_ptr(struct global_nvs *gnvs) void southbridge_inject_dsdt(const struct device *dev) { struct global_nvs *gnvs = acpi_get_gnvs(); + if (!gnvs) + return; - if (gnvs) { - acpi_create_gnvs(gnvs); - - - /* Add it to SSDT. */ - acpigen_write_scope("\\"); - acpigen_write_name_dword("NVSA", (uintptr_t)gnvs); - acpigen_pop_len(); - } + acpi_create_gnvs(gnvs); + acpi_inject_nvsa(); } static const char *lpc_acpi_name(const struct device *dev) diff --git a/src/southbridge/intel/i82801jx/lpc.c b/src/southbridge/intel/i82801jx/lpc.c index 0cc147d2ba..65d371de16 100644 --- a/src/southbridge/intel/i82801jx/lpc.c +++ b/src/southbridge/intel/i82801jx/lpc.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include "chip.h" #include "i82801jx.h" @@ -485,16 +484,11 @@ size_t gnvs_size_of_array(void) void southbridge_inject_dsdt(const struct device *dev) { struct global_nvs *gnvs = acpi_get_gnvs(); + if (!gnvs) + return; - if (gnvs) { - acpi_create_gnvs(gnvs); - - - /* Add it to SSDT. */ - acpigen_write_scope("\\"); - acpigen_write_name_dword("NVSA", (u32) gnvs); - acpigen_pop_len(); - } + acpi_create_gnvs(gnvs); + acpi_inject_nvsa(); } static const char *lpc_acpi_name(const struct device *dev) -- cgit v1.2.3