Attention is currently required from: Jason Glenesk, Raul Rangel, Marshall Dawson. Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56294 )
Change subject: soc/amd/picasso/mca: factor out mca_has_expected_bank_count ......................................................................
soc/amd/picasso/mca: factor out mca_has_expected_bank_count
To factor out the rest of the common MCAX code, mca_bank_name[] may only be accessed by accessor functions, so implement this for the last place that still accessed mca_bank_name[] directly.
Change-Id: Ic6548d3ceeb9c00ad344fc0bb3d97893e17a43a9 Signed-off-by: Felix Held felix-coreboot@felixheld.de --- M src/soc/amd/picasso/mca.c 1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/56294/1
diff --git a/src/soc/amd/picasso/mca.c b/src/soc/amd/picasso/mca.c index 3c5b63f..c41708c 100644 --- a/src/soc/amd/picasso/mca.c +++ b/src/soc/amd/picasso/mca.c @@ -33,6 +33,11 @@ [22] = "PIE", };
+static bool mca_has_expected_bank_count(void) +{ + return ARRAY_SIZE(mca_bank_name) == mca_get_bank_count(); +} + static bool mca_is_valid_bank(unsigned int bank) { return (bank < ARRAY_SIZE(mca_bank_name) && mca_bank_name[bank] != NULL); @@ -70,7 +75,7 @@ struct mca_bank_status mci; const unsigned int num_banks = mca_get_bank_count();
- if (ARRAY_SIZE(mca_bank_name) != num_banks) + if (!mca_has_expected_bank_count()) printk(BIOS_WARNING, "CPU has an unexpected number of MCA banks!\n");
for (unsigned int i = 0 ; i < num_banks ; i++) {