summaryrefslogtreecommitdiff
path: root/src/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'src/acpi')
-rw-r--r--src/acpi/acpigen_extern.asl20
-rw-r--r--src/acpi/dsdt_top.asl2
-rw-r--r--src/acpi/gnvs.c6
3 files changed, 26 insertions, 2 deletions
diff --git a/src/acpi/acpigen_extern.asl b/src/acpi/acpigen_extern.asl
new file mode 100644
index 0000000000..73d626fbea
--- /dev/null
+++ b/src/acpi/acpigen_extern.asl
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+/*
+ * Global ACPI memory region. This region is used for passing information
+ * between coreboot (aka "the system bios"), ACPI, and the SMI handler.
+ * Since we don't know where this will end up in memory at ACPI compile time,
+ * we provide it runtime via NVBx and NVSx variables from acpigen.
+ */
+
+#if CONFIG(ACPI_SOC_NVS)
+External (NVB0, IntObj)
+External (NVS0, IntObj)
+OperationRegion (GNVS, SystemMemory, NVB0, NVS0)
+#endif
+
+#if CONFIG(ACPI_HAS_DEVICE_NVS)
+External (NVB1, IntObj)
+External (NVS1, IntObj)
+OperationRegion (DNVS, SystemMemory, NVB1, NVS1)
+#endif
diff --git a/src/acpi/dsdt_top.asl b/src/acpi/dsdt_top.asl
index 853b0877b3..761c1b541d 100644
--- a/src/acpi/dsdt_top.asl
+++ b/src/acpi/dsdt_top.asl
@@ -1 +1,3 @@
/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpigen_extern.asl>
diff --git a/src/acpi/gnvs.c b/src/acpi/gnvs.c
index 18c1b33130..010b0e0149 100644
--- a/src/acpi/gnvs.c
+++ b/src/acpi/gnvs.c
@@ -71,12 +71,14 @@ void acpi_fill_gnvs(void)
mainboard_fill_gnvs(gnvs);
acpigen_write_scope("\\");
- acpigen_write_name_dword("NVSA", (uintptr_t)gnvs);
+ acpigen_write_name_dword("NVB0", (uintptr_t)gnvs);
+ acpigen_write_name_dword("NVS0", CONFIG(MAINBOARD_HAS_CHROMEOS) ? 0x1000 : 0x100);
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_write_name_dword("NVB1", (uintptr_t)gnvs + GNVS_DEVICE_NVS_OFFSET);
+ acpigen_write_name_dword("NVS1", 0x1000);
acpigen_pop_len();
}
}