Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56275 )
Change subject: soc/amd/picasso: implement and use mca_is_valid_bank ......................................................................
soc/amd/picasso: implement and use mca_is_valid_bank
In mca_check_all_banks only check valid MCA banks for errors. This aligns the Picasso code a bit more with the Stoneyridge code base which will be updated in a follow-up patch. This is a preparation for commonizing the MCA(X) handing in the soc/amd sub-tree.
Change-Id: I0c7f3066afd220e6b8bf8308a321189d7a2679f6 Signed-off-by: Felix Held felix-coreboot@felixheld.de --- M src/soc/amd/picasso/mca.c 1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/75/56275/1
diff --git a/src/soc/amd/picasso/mca.c b/src/soc/amd/picasso/mca.c index 2b1e1b2..740e974 100644 --- a/src/soc/amd/picasso/mca.c +++ b/src/soc/amd/picasso/mca.c @@ -160,6 +160,11 @@ [22] = "PIE", };
+static bool mca_is_valid_bank(unsigned int bank) +{ + return (bank < ARRAY_SIZE(mca_bank_name) && mca_bank_name[bank] != NULL); +} + static void mca_print_error(unsigned int bank) { msr_t msr; @@ -188,6 +193,9 @@ printk(BIOS_WARNING, "CPU has an unexpected number of MCA banks!\n");
for (unsigned int i = 0 ; i < num_banks ; i++) { + if (!mca_is_valid_bank(i)) + continue; + mci.bank = i; mci.sts = rdmsr(MCAX_STATUS_MSR(i)); if (mci.sts.hi || mci.sts.lo) {