From 9acc572caa55173a02ad8a6fd86151779552abe5 Mon Sep 17 00:00:00 2001 From: Varshit Pandya Date: Mon, 16 Oct 2023 18:33:04 +0530 Subject: [PATCH] soc/amd/genoa: Add Global NVS Change-Id: I8d64236fc81e848503535db6f52e93328a60404c Signed-off-by: Varshit Pandya Reviewed-on: https://review.coreboot.org/c/coreboot/+/78391 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier --- src/mainboard/amd/onyx/dsdt.asl | 2 ++ src/soc/amd/genoa/acpi/globalnvs.asl | 13 +++++++++++++ src/soc/amd/genoa/include/soc/nvs.h | 22 ++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 src/soc/amd/genoa/acpi/globalnvs.asl create mode 100644 src/soc/amd/genoa/include/soc/nvs.h diff --git a/src/mainboard/amd/onyx/dsdt.asl b/src/mainboard/amd/onyx/dsdt.asl index ecfe7a5ebe..c7308a9e78 100644 --- a/src/mainboard/amd/onyx/dsdt.asl +++ b/src/mainboard/amd/onyx/dsdt.asl @@ -10,4 +10,6 @@ DefinitionBlock ( ACPI_TABLE_CREATOR, 0x00010001 /* OEM Revision */ ) +{ /* Start of ASL file */ + #include } /* End of ASL file */ diff --git a/src/soc/amd/genoa/acpi/globalnvs.asl b/src/soc/amd/genoa/acpi/globalnvs.asl new file mode 100644 index 0000000000..23c53ee854 --- /dev/null +++ b/src/soc/amd/genoa/acpi/globalnvs.asl @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +/* + * NOTE: The layout of the GNVS structure below must match the layout in + * soc/amd/genoa/include/soc/nvs.h !!! + */ + +Field (GNVS, ByteAcc, NoLock, Preserve) +{ + /* Miscellaneous */ + PM1I, 64, // 0x00 - 0x07 - System Wake Source - PM1 Index + GPEI, 64, // 0x08 - 0x0f - GPE Wake Source +} diff --git a/src/soc/amd/genoa/include/soc/nvs.h b/src/soc/amd/genoa/include/soc/nvs.h new file mode 100644 index 0000000000..cbc9ba9b4d --- /dev/null +++ b/src/soc/amd/genoa/include/soc/nvs.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +/* TODO: Check if this is still correct */ + +/* + * NOTE: The layout of the global_nvs structure below must match the layout + * in soc/soc/amd/genoa/acpi/globalnvs.asl !!! + * + */ + +#ifndef AMD_GENOA_NVS_H +#define AMD_GENOA_NVS_H + +#include + +struct __packed global_nvs { + /* Miscellaneous */ + uint64_t pm1i; /* 0x00 - 0x07 - System Wake Source - PM1 Index */ + uint64_t gpei; /* 0x08 - 0x0f - GPE Wake Source */ +}; + +#endif /* AMD_GENOA_NVS_H */