summaryrefslogtreecommitdiff
path: root/src/cpu/x86/smm
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2016-04-30 15:14:18 -0500
committerMartin Roth <martinroth@google.com>2016-05-04 18:51:34 +0200
commitd87c7bc07c03d80fc7c346a027cb000657f1e76b (patch)
tree9b5b82d1458ba1f371463fde50db396fc1f98eae /src/cpu/x86/smm
parentaa431c0e1774a34b0b6dacd9b0d44de3c82d4922 (diff)
downloadcoreboot-d87c7bc07c03d80fc7c346a027cb000657f1e76b.tar.xz
cpu/x86: remove BACKUP_DEFAULT_SMM_REGION option
Unconditionally provide the backup default SMM area API. There's no reason to guard the symbols behind anything since linker garbage collection is implemented. A board or chipset is free to use the code or not without needing to select an option. Change-Id: I14cf1318136a17f48ba5ae119507918190e25387 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/14561 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/cpu/x86/smm')
-rw-r--r--src/cpu/x86/smm/Makefile.inc1
-rw-r--r--src/cpu/x86/smm/backup_default_smm.c64
2 files changed, 0 insertions, 65 deletions
diff --git a/src/cpu/x86/smm/Makefile.inc b/src/cpu/x86/smm/Makefile.inc
index 72c9796f81..32f5ea713d 100644
--- a/src/cpu/x86/smm/Makefile.inc
+++ b/src/cpu/x86/smm/Makefile.inc
@@ -13,7 +13,6 @@
## GNU General Public License for more details.
##
-ramstage-$(CONFIG_BACKUP_DEFAULT_SMM_REGION) += backup_default_smm.c
ramstage-y += smm_module_loader.c
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
diff --git a/src/cpu/x86/smm/backup_default_smm.c b/src/cpu/x86/smm/backup_default_smm.c
deleted file mode 100644
index 2023aede74..0000000000
--- a/src/cpu/x86/smm/backup_default_smm.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2014 Google Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; version 2 of
- * the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#include <string.h>
-#include <arch/acpi.h>
-#include <console/console.h>
-#include <cbmem.h>
-#include <cpu/x86/smm.h>
-
-void *backup_default_smm_area(void)
-{
- void *save_area;
- const void *default_smm = (void *)SMM_DEFAULT_BASE;
-
- if (!IS_ENABLED(CONFIG_HAVE_ACPI_RESUME))
- return NULL;
-
- /*
- * The buffer needs to be preallocated regardless. In the non-resume
- * path it will be allocated for handling resume. Note that cbmem_add()
- * does a find before the addition.
- */
- save_area = cbmem_add(CBMEM_ID_SMM_SAVE_SPACE, SMM_DEFAULT_SIZE);
-
- if (save_area == NULL) {
- printk(BIOS_DEBUG, "SMM save area not added.\n");
- return NULL;
- }
-
- /* Only back up the area on S3 resume. */
- if (acpi_is_wakeup_s3()) {
- memcpy(save_area, default_smm, SMM_DEFAULT_SIZE);
- return save_area;
- }
-
- /*
- * Not the S3 resume path. No need to restore memory contents after
- * SMM relocation.
- */
- return NULL;
-}
-
-void restore_default_smm_area(void *smm_save_area)
-{
- void *default_smm = (void *)SMM_DEFAULT_BASE;
-
- if (smm_save_area == NULL)
- return;
-
- memcpy(default_smm, smm_save_area, SMM_DEFAULT_SIZE);
-}