{cpu/x86, drivers/amd}: Use get_var_mtrr_count() to get MTRR count

This patch replaces the implementation that is used to get the number of
variable MTRRs with `get_var_mtrr_count()` function.

BUG=b:225766934
TEST=Able to build and boot google/redrix board to ChromeOS.

Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: I4751add9c45374e60b7a425df87d06f52e6fcb8c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63219
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Subrata Banik
2022-03-30 23:57:37 +05:30
committed by Felix Held
parent 3ad00d0c89
commit 7578ea43ce
4 changed files with 4 additions and 12 deletions

View File

@@ -14,8 +14,7 @@ static void set_range_uc(u32 base, u32 size)
{
int i, max_var_mtrrs;
msr_t msr;
msr = rdmsr(MTRR_CAP_MSR);
max_var_mtrrs = msr.lo & MTRR_CAP_VCNT;
max_var_mtrrs = get_var_mtrr_count();
for (i = 0; i < max_var_mtrrs; i++) {
msr = rdmsr(MTRR_PHYS_MASK(i));