From cb457aca41bcdd77b203acbcc3546923179b3764 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Tue, 13 Jul 2021 16:47:57 +0200 Subject: soc/amd/picasso/mca: use mca_clear_status() Since we can use both the old MCA registers and the new MCAX registers to access the MCA status registers, we can use the common mca_clear_status function here. Change-Id: I9ddcc119eca2659361b1496fd7ffe124fb323d26 Signed-off-by: Felix Held Reviewed-on: https://review.coreboot.org/c/coreboot/+/56260 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel --- src/soc/amd/picasso/mca.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/soc/amd/picasso/mca.c b/src/soc/amd/picasso/mca.c index 973b3b5277..23d7b61735 100644 --- a/src/soc/amd/picasso/mca.c +++ b/src/soc/amd/picasso/mca.c @@ -181,19 +181,11 @@ static void mca_check_all_banks(void) } } -static void mca_clear_errors(void) -{ - const unsigned int num_banks = mca_get_bank_count(); - const msr_t msr = {.lo = 0, .hi = 0}; - - /* Zero all machine check error status registers */ - for (unsigned int i = 0 ; i < num_banks ; i++) - wrmsr(MCAX_STATUS_MSR(i), msr); -} - /* Check the Machine Check Architecture Extension registers */ void check_mca(void) { mca_check_all_banks(); - mca_clear_errors(); + /* mca_clear_status uses the MCA registers and not the MCAX ones. Since they are + aliases, we can use either set of registers. */ + mca_clear_status(); } -- cgit v1.2.3