Arthur Heymans has uploaded this change for review.

View Change

cpu/amd/smm: Remove unused code

Change-Id: I4ba31528f3fc888d9441911b40c882f82933c89c
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
---
M src/cpu/amd/agesa/family15tn/Makefile.inc
D src/cpu/amd/smm/Makefile.inc
D src/cpu/amd/smm/smm_init.c
3 files changed, 10 insertions(+), 63 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/69/68169/1
diff --git a/src/cpu/amd/agesa/family15tn/Makefile.inc b/src/cpu/amd/agesa/family15tn/Makefile.inc
index ca51196..7f60cd9 100644
--- a/src/cpu/amd/agesa/family15tn/Makefile.inc
+++ b/src/cpu/amd/agesa/family15tn/Makefile.inc
@@ -9,4 +9,3 @@
smm-y += udelay.c

subdirs-y += ../../mtrr
-subdirs-$(CONFIG_SMM_LEGACY_ASEG) += ../../smm
diff --git a/src/cpu/amd/smm/Makefile.inc b/src/cpu/amd/smm/Makefile.inc
deleted file mode 100644
index 97a6694..0000000
--- a/src/cpu/amd/smm/Makefile.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-
-ramstage-y += smm_init.c
diff --git a/src/cpu/amd/smm/smm_init.c b/src/cpu/amd/smm/smm_init.c
deleted file mode 100644
index 75dd4506..0000000
--- a/src/cpu/amd/smm/smm_init.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <cpu/x86/msr.h>
-#include <cpu/x86/mtrr.h>
-#include <cpu/amd/mtrr.h>
-#include <cpu/amd/msr.h>
-#include <cpu/x86/cache.h>
-#include <cpu/x86/smm.h>
-#include <cpu/x86/smi_deprecated.h>
-#include <string.h>
-
-void smm_init(void)
-{
- msr_t msr, syscfg_orig, mtrr_aseg_orig;
-
- /* Back up MSRs for later restore */
- syscfg_orig = rdmsr(SYSCFG_MSR);
- mtrr_aseg_orig = rdmsr(MTRR_FIX_16K_A0000);
-
- /* MTRR changes don't like an enabled cache */
- disable_cache();
-
- msr = syscfg_orig;
-
- /* Allow changes to MTRR extended attributes */
- msr.lo |= SYSCFG_MSR_MtrrFixDramModEn;
- /* turn the extended attributes off until we fix
- * them so A0000 is routed to memory
- */
- msr.lo &= ~SYSCFG_MSR_MtrrFixDramEn;
- wrmsr(SYSCFG_MSR, msr);
-
- /* set DRAM access to 0xa0000 */
- msr.lo = 0x18181818;
- msr.hi = 0x18181818;
- wrmsr(MTRR_FIX_16K_A0000, msr);
-
- /* enable the extended features */
- msr = syscfg_orig;
- msr.lo |= SYSCFG_MSR_MtrrFixDramModEn;
- msr.lo |= SYSCFG_MSR_MtrrFixDramEn;
- wrmsr(SYSCFG_MSR, msr);
-
- enable_cache();
- /* copy the real SMM handler */
- memcpy((void *)SMM_BASE, _binary_smm_start, _binary_smm_end - _binary_smm_start);
- wbinvd();
- disable_cache();
-
- /* Restore SYSCFG and MTRR */
- wrmsr(SYSCFG_MSR, syscfg_orig);
- wrmsr(MTRR_FIX_16K_A0000, mtrr_aseg_orig);
- enable_cache();
-
- /* CPU MSR are set in CPU init */
-}
-
-void smm_init_completion(void)
-{
-}

To view, visit change 68169. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4ba31528f3fc888d9441911b40c882f82933c89c
Gerrit-Change-Number: 68169
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-MessageType: newchange