ACPI: Separate device_nvs_t
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 <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49476
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
diff --git a/src/acpi/gnvs.c b/src/acpi/gnvs.c
index a895a83..18c1b33 100644
--- a/src/acpi/gnvs.c
+++ b/src/acpi/gnvs.c
@@ -39,7 +39,7 @@
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 @@
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 @@
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();
+ }
}