soc/amd/*/mca: use mca_get_bank_count()

Use the common mca_get_bank_count function instead of open-coding the
functionality to get the MCA bank number. Also re-type the num_banks
variable from signed in to unsigned int, since the number of MCA bank is
always positive.

Change-Id: I126767cf9ad468cab6d6537dd73e9b2dc377b5c4
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56185
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
This commit is contained in:
Felix Held 2021-07-09 23:04:27 +02:00
parent f48eecbbe0
commit 4add9923c0
2 changed files with 4 additions and 8 deletions

View File

@ -152,12 +152,10 @@ static const char *const mca_bank_name[] = {
void check_mca(void)
{
int i;
msr_t cap;
struct mca_bank mci;
int num_banks;
unsigned int num_banks;
cap = rdmsr(IA32_MCG_CAP);
num_banks = cap.lo & MCA_BANKS_MASK;
num_banks = mca_get_bank_count();
for (i = 0 ; i < num_banks ; i++) {
mci.sts = rdmsr(MCAX_STATUS_MSR(i));

View File

@ -151,12 +151,10 @@ static const char *const mca_bank_name[] = {
void check_mca(void)
{
int i;
msr_t cap;
struct mca_bank mci;
int num_banks;
unsigned int num_banks;
cap = rdmsr(IA32_MCG_CAP);
num_banks = cap.lo & MCA_BANKS_MASK;
num_banks = mca_get_bank_count();
if (is_warm_reset()) {
for (i = 0 ; i < num_banks ; i++) {