diff options
author | Subrata Banik <subratabanik@google.com> | 2022-03-30 23:57:37 +0530 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-04-02 14:55:24 +0000 |
commit | 7578ea43ceafd78b46ab64610c9fa86172152081 (patch) | |
tree | 82da77ae643868b6da8e5b47142398a03b7cb8c1 /src/cpu/x86/mtrr/xip_cache.c | |
parent | 3ad00d0c89c9e7a8e9ef13b6dc65bb338a191ec8 (diff) |
{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>
Diffstat (limited to 'src/cpu/x86/mtrr/xip_cache.c')
-rw-r--r-- | src/cpu/x86/mtrr/xip_cache.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cpu/x86/mtrr/xip_cache.c b/src/cpu/x86/mtrr/xip_cache.c index cd82e4fc71..6ed96af95f 100644 --- a/src/cpu/x86/mtrr/xip_cache.c +++ b/src/cpu/x86/mtrr/xip_cache.c @@ -14,8 +14,7 @@ the MTRR, no matter the caching type, are filled and not overlapping. */ static uint32_t max_cache_used(void) { - msr_t msr = rdmsr(MTRR_CAP_MSR); - int i, total_mtrrs = msr.lo & MTRR_CAP_VCNT; + int i, total_mtrrs = get_var_mtrr_count(); uint32_t total_cache = 0; for (i = 0; i < total_mtrrs; i++) { |