diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2021-07-13 22:30:16 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-07-14 21:57:32 +0000 |
commit | b04148aa564c59f0107cc09a02117ddfc8b3aa31 (patch) | |
tree | 6f52ab67c14ad3b70575c8eea6b3476b4ad775e6 /src/soc/amd/picasso | |
parent | 040d7646bcba7c2a22b6a6ae8f460ff75db8e5bf (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/soc/amd/picasso')
-rw-r--r-- | src/soc/amd/picasso/mca.c | 10 |
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); |