summaryrefslogtreecommitdiff
path: root/src/acpi/gnvs.c
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2021-01-12 17:46:30 +0200
committerPatrick Georgi <pgeorgi@google.com>2021-01-27 10:25:03 +0000
commit4abc73183134def757c553aa4eb195fffa824100 (patch)
treee6fa253f8e7dc46e80a0a33ea903b4fe0be83419 /src/acpi/gnvs.c
parentaeffa86cc551110b62074fa6302f4960d87a9a8c (diff)
downloadcoreboot-4abc73183134def757c553aa4eb195fffa824100.tar.xz
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>
Diffstat (limited to 'src/acpi/gnvs.c')
-rw-r--r--src/acpi/gnvs.c13
1 files changed, 12 insertions, 1 deletions
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();
+ }
}