From 4abc73183134def757c553aa4eb195fffa824100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Tue, 12 Jan 2021 17:46:30 +0200 Subject: ACPI: Separate device_nvs_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove typedef device_nvs_t and move struct device_nvs outside of global_nvs. Also remove padding and the reserve for chromeos_acpi_t. Change-Id: I878746b1f0f9152a27dc58e373d58115e2dff22c Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/49476 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak --- src/acpi/Kconfig | 3 +++ src/acpi/gnvs.c | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src/acpi') diff --git a/src/acpi/Kconfig b/src/acpi/Kconfig index 2727889f9e..11e703c606 100644 --- a/src/acpi/Kconfig +++ b/src/acpi/Kconfig @@ -30,6 +30,9 @@ config ACPI_SOC_NVS Set to indicate exists for the platform with a definition for global_nvs. +config ACPI_HAS_DEVICE_NVS + bool + config ACPI_NO_PCAT_8259 bool help diff --git a/src/acpi/gnvs.c b/src/acpi/gnvs.c index a895a83e83..18c1b33130 100644 --- a/src/acpi/gnvs.c +++ b/src/acpi/gnvs.c @@ -39,7 +39,7 @@ void acpi_create_gnvs(void) gnvs_size = sizeof(struct global_nvs); if (gnvs_size < 0x100) gnvs_size = 0x100; - if (gnvs_size > 0x1000) + if (CONFIG(ACPI_HAS_DEVICE_NVS)) gnvs_size = 0x2000; else if (CONFIG(MAINBOARD_HAS_CHROMEOS)) gnvs_size = 0x1000; @@ -57,6 +57,11 @@ void acpi_create_gnvs(void) gnvs_assign_chromeos((u8 *)gnvs + GNVS_CHROMEOS_ACPI_OFFSET); } +void *acpi_get_device_nvs(void) +{ + return (u8 *)gnvs + GNVS_DEVICE_NVS_OFFSET; +} + void acpi_fill_gnvs(void) { if (!gnvs) @@ -68,4 +73,10 @@ void acpi_fill_gnvs(void) acpigen_write_scope("\\"); acpigen_write_name_dword("NVSA", (uintptr_t)gnvs); acpigen_pop_len(); + + if (CONFIG(ACPI_HAS_DEVICE_NVS)) { + acpigen_write_scope("\\"); + acpigen_write_name_dword("NVSD", (uintptr_t)gnvs + GNVS_DEVICE_NVS_OFFSET); + acpigen_pop_len(); + } } -- cgit v1.2.3