diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2021-07-13 01:55:52 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-07-14 02:25:19 +0000 |
commit | bad21a4bd204e4fd22fb683f389dfde21000e22d (patch) | |
tree | a29e848b204361ca94134b09cee5726256dcfdf4 /src/cpu/intel/model_206ax | |
parent | 1b46e76df9ef0a4b38d782732ee914ab70667bfa (diff) |
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 <felix-coreboot@felixheld.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56244
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/cpu/intel/model_206ax')
-rw-r--r-- | src/cpu/intel/model_206ax/model_206ax_init.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/cpu/intel/model_206ax/model_206ax_init.c b/src/cpu/intel/model_206ax/model_206ax_init.c index bfe1fa57dc..541cb3bc67 100644 --- a/src/cpu/intel/model_206ax/model_206ax_init.c +++ b/src/cpu/intel/model_206ax/model_206ax_init.c @@ -301,10 +301,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(); msr.lo = msr.hi = 0; /* This should only be done on a cold boot */ |