summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-07-13 22:30:16 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-07-14 21:57:32 +0000
commitb04148aa564c59f0107cc09a02117ddfc8b3aa31 (patch)
tree6f52ab67c14ad3b70575c8eea6b3476b4ad775e6 /src
parent040d7646bcba7c2a22b6a6ae8f460ff75db8e5bf (diff)
soc/amd/picasso: implement and use mca_get_bank_name
Change-Id: I42abff5efcd7c85d2932a7aaacc736d0376cfaa0 Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/56276 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/soc/amd/picasso/mca.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/soc/amd/picasso/mca.c b/src/soc/amd/picasso/mca.c
index b03df9004b..6787b75236 100644
--- a/src/soc/amd/picasso/mca.c
+++ b/src/soc/amd/picasso/mca.c
@@ -165,12 +165,20 @@ static bool mca_is_valid_bank(unsigned int bank)
return (bank < ARRAY_SIZE(mca_bank_name) && mca_bank_name[bank] != NULL);
}
+static const char *mca_get_bank_name(unsigned int bank)
+{
+ if (mca_is_valid_bank(bank))
+ return mca_bank_name[bank];
+ else
+ return "";
+}
+
static void mca_print_error(unsigned int bank)
{
msr_t msr;
printk(BIOS_WARNING, "#MC Error: core %u, bank %u %s\n", initial_lapicid(), bank,
- bank < ARRAY_SIZE(mca_bank_name) ? mca_bank_name[bank] : "");
+ mca_get_bank_name(bank));
msr = rdmsr(MCAX_STATUS_MSR(bank));
printk(BIOS_WARNING, " MC%u_STATUS = %08x_%08x\n", bank, msr.hi, msr.lo);