diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2021-07-14 00:05:39 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-07-14 23:10:46 +0000 |
commit | 1e1d490ff885206dfb30dbd7a3dfeffa818afdb6 (patch) | |
tree | 24f9036e33f77983c2089bbfc3f5c64736bf9aa4 /src/soc/amd/common | |
parent | dc970fc0399b96e42671770fad6a7da5a40de461 (diff) |
soc/amd: factor out check_mca to common code
Change-Id: I139d1fe41bad5213da8890c2867f275b6847e3e1
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56281
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/amd/common')
-rw-r--r-- | src/soc/amd/common/block/cpu/Kconfig | 20 | ||||
-rw-r--r-- | src/soc/amd/common/block/cpu/mca/Makefile.inc | 1 | ||||
-rw-r--r-- | src/soc/amd/common/block/cpu/mca/mca_common.c | 12 | ||||
-rw-r--r-- | src/soc/amd/common/block/include/amdblocks/mca.h | 1 |
4 files changed, 34 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/cpu/Kconfig b/src/soc/amd/common/block/cpu/Kconfig index 1437326f9d..79e011fadd 100644 --- a/src/soc/amd/common/block/cpu/Kconfig +++ b/src/soc/amd/common/block/cpu/Kconfig @@ -26,6 +26,26 @@ config MEMLAYOUT_LD_FILE endif # SOC_AMD_COMMON_BLOCK_NONCAR +config SOC_AMD_COMMON_BLOCK_MCA_COMMON + bool + help + Add common machine check architecture support. Do not select this + in the SoC's Kconfig; select either SOC_AMD_COMMON_BLOCK_MCA or + SOC_AMD_COMMON_BLOCK_MCAX which will select this one. + +config SOC_AMD_COMMON_BLOCK_MCA + bool + select SOC_AMD_COMMON_BLOCK_MCA_COMMON + help + Add IA32 machine check architecture (MCA) support for pre-Zen CPUs. + +config SOC_AMD_COMMON_BLOCK_MCAX + bool + select SOC_AMD_COMMON_BLOCK_MCA_COMMON + help + Add extended machine check architecture (MCAX) support for AMD family + 17h, 19h and possibly newer CPUs. + config SOC_AMD_COMMON_BLOCK_SMM bool help diff --git a/src/soc/amd/common/block/cpu/mca/Makefile.inc b/src/soc/amd/common/block/cpu/mca/Makefile.inc new file mode 100644 index 0000000000..0aa47e161c --- /dev/null +++ b/src/soc/amd/common/block/cpu/mca/Makefile.inc @@ -0,0 +1 @@ +ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_MCA_COMMON) += mca_common.c diff --git a/src/soc/amd/common/block/cpu/mca/mca_common.c b/src/soc/amd/common/block/cpu/mca/mca_common.c new file mode 100644 index 0000000000..0a375089f2 --- /dev/null +++ b/src/soc/amd/common/block/cpu/mca/mca_common.c @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <amdblocks/mca.h> +#include <cpu/x86/msr.h> + +void check_mca(void) +{ + mca_check_all_banks(); + /* mca_clear_status uses the MCA registers which can be used in both the MCA and MCAX + case */ + mca_clear_status(); +} diff --git a/src/soc/amd/common/block/include/amdblocks/mca.h b/src/soc/amd/common/block/include/amdblocks/mca.h index 9ea29e8ccc..16b016b4cb 100644 --- a/src/soc/amd/common/block/include/amdblocks/mca.h +++ b/src/soc/amd/common/block/include/amdblocks/mca.h @@ -4,5 +4,6 @@ #define AMD_BLOCK_MCA_H void check_mca(void); +void mca_check_all_banks(void); #endif /* AMD_BLOCK_MCA_H */ |