soc/amd/stoneyridge/mca: refactor warm boot check in mca_check_all_banks

Change-Id: Id0cf8269d1b695e05c55f33af92978b8244090fa
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56242
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Felix Held 2021-07-12 23:13:45 +02:00
parent 2927a66dc9
commit e3f7ef2286
1 changed files with 12 additions and 11 deletions

View File

@ -169,19 +169,20 @@ static void mca_check_all_banks(void)
struct mca_bank_status mci; struct mca_bank_status mci;
const unsigned int num_banks = mca_get_bank_count(); const unsigned int num_banks = mca_get_bank_count();
if (is_warm_reset()) { if (!is_warm_reset())
for (unsigned int i = 0 ; i < num_banks ; i++) { return;
if (i == 3) /* Reserved in Family 15h */
continue;
mci.bank = i; for (unsigned int i = 0 ; i < num_banks ; i++) {
mci.sts = rdmsr(IA32_MC0_STATUS + (i * 4)); if (i == 3) /* Reserved in Family 15h */
if (mci.sts.hi || mci.sts.lo) { continue;
mca_print_error(i);
if (CONFIG(ACPI_BERT) && mca_valid(mci.sts)) mci.bank = i;
build_bert_mca_error(&mci); mci.sts = rdmsr(IA32_MC0_STATUS + (i * 4));
} if (mci.sts.hi || mci.sts.lo) {
mca_print_error(i);
if (CONFIG(ACPI_BERT) && mca_valid(mci.sts))
build_bert_mca_error(&mci);
} }
} }
} }