From bad21a4bd204e4fd22fb683f389dfde21000e22d Mon Sep 17 00:00:00 2001 From: Felix Held Date: Tue, 13 Jul 2021 01:55:52 +0200 Subject: cpu/intel/*/*_init: 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, and make it constant. In the case of Intel model 2065x the mca_get_bank_count() call replaces a magic number. Change-Id: I245b15f57e77edca179e9e28965383a227617174 Signed-off-by: Felix Held Reviewed-on: https://review.coreboot.org/c/coreboot/+/56244 Reviewed-by: Raul Rangel Reviewed-by: Patrick Rudolph Tested-by: build bot (Jenkins) --- src/cpu/intel/haswell/haswell_init.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/cpu/intel/haswell') diff --git a/src/cpu/intel/haswell/haswell_init.c b/src/cpu/intel/haswell/haswell_init.c index 2d8bd152d7..29c663e2e7 100644 --- a/src/cpu/intel/haswell/haswell_init.c +++ b/src/cpu/intel/haswell/haswell_init.c @@ -520,10 +520,7 @@ static void configure_mca(void) { msr_t msr; int i; - int num_banks; - - msr = rdmsr(IA32_MCG_CAP); - num_banks = msr.lo & 0xff; + const unsigned int num_banks = mca_get_bank_count(); /* Enable all error reporting */ msr.lo = msr.hi = ~0; -- cgit v1.2.3