ACPI: Allocate GNVS early in ramstage

We need this to happen prior to SMM module loader. If
there is some debugging output it's better they do not
appear in the middle of CPU bringup.

Change-Id: I45b4b5c0c5bf8bee258a465d1e364bfe98190e44
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48697
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index 173ee97..d040a0e 100644
--- a/src/lib/hardwaremain.c
+++ b/src/lib/hardwaremain.c
@@ -7,6 +7,7 @@
 
 #include <adainit.h>
 #include <acpi/acpi.h>
+#include <acpi/acpi_gnvs.h>
 #include <arch/exception.h>
 #include <bootstate.h>
 #include <console/console.h>
@@ -447,6 +448,10 @@
 	acpi_is_wakeup_s3();
 	threads_initialize();
 
+	/* Initialise GNVS early. */
+	if (CONFIG(HAVE_ACPI_TABLES))
+		gnvs_get_or_create();
+
 	/* Schedule the static boot state entries. */
 	boot_state_schedule_static_entries();