i82801dx/gx/ix/jx: Add low-memory backup for S3 path

SMM relocation code overwrite low memory owned by OS.

Change-Id: Ifa3d28bed3d3db65b0707bde62ae2b424a231f1a
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/19405
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
diff --git a/src/southbridge/intel/i82801dx/smi.c b/src/southbridge/intel/i82801dx/smi.c
index 93e2845..945fcf2 100644
--- a/src/southbridge/intel/i82801dx/smi.c
+++ b/src/southbridge/intel/i82801dx/smi.c
@@ -18,6 +18,7 @@
 #include <device/device.h>
 #include <device/pci.h>
 #include <console/console.h>
+#include <arch/acpi.h>
 #include <arch/io.h>
 #include <cpu/cpu.h>
 #include <cpu/x86/cache.h>
@@ -229,6 +230,7 @@
 }
 
 extern uint8_t smm_relocation_start, smm_relocation_end;
+static void *default_smm_area = NULL;
 
 static void smm_relocate(void)
 {
@@ -246,6 +248,8 @@
 		return;
 	}
 
+	default_smm_area = backup_default_smm_area();
+
 	/* copy the SMM relocation code */
 	memcpy((void *)0x38000, &smm_relocation_start,
 			&smm_relocation_end - &smm_relocation_start);
@@ -339,6 +343,11 @@
 	smi_set_eos();
 }
 
+void smm_init_completion(void)
+{
+	restore_default_smm_area(default_smm_area);
+}
+
 void smm_lock(void)
 {
 	/* LOCK the SMM memory window and enable normal SMM.