Attention is currently required from: Jason Glenesk, Raul Rangel, Marshall Dawson. Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56185 )
Change subject: soc/amd/*/mca: use mca_get_bank_count() ......................................................................
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 --- M src/soc/amd/picasso/mca.c M src/soc/amd/stoneyridge/mca.c 2 files changed, 4 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/56185/1
diff --git a/src/soc/amd/picasso/mca.c b/src/soc/amd/picasso/mca.c index 2576f6e..9e2b5e2 100644 --- a/src/soc/amd/picasso/mca.c +++ b/src/soc/amd/picasso/mca.c @@ -152,12 +152,10 @@ 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)); diff --git a/src/soc/amd/stoneyridge/mca.c b/src/soc/amd/stoneyridge/mca.c index b1f955f..910ccac 100644 --- a/src/soc/amd/stoneyridge/mca.c +++ b/src/soc/amd/stoneyridge/mca.c @@ -151,12 +151,10 @@ 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++) {