summaryrefslogtreecommitdiff
path: root/cmd/x86
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-10-01 12:22:37 -0600
committerSimon Glass <sjg@chromium.org>2018-10-09 04:40:27 -0600
commit590cee8315e94e729493d2ecd8a604bcfbfa7d0e (patch)
tree2ac3eacb5e1a1274da1efd3fe34a893d8d978d65 /cmd/x86
parent6f1c0430e88396abc8e6a91ab3cc78882c76cb7c (diff)
downloadu-boot-590cee8315e94e729493d2ecd8a604bcfbfa7d0e.tar.gz
x86: Update mtrr functions to allow leaving cache alone
At present the mtrr functions disable the cache before making changes and enable it again afterwards. This is fine in U-Boot, but does not work if running in CAR (such as we are in SPL). Update the functions so that the caller can request that caches be left alone. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'cmd/x86')
-rw-r--r--cmd/x86/mtrr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/x86/mtrr.c b/cmd/x86/mtrr.c
index 70f373a72a..d3fd959235 100644
--- a/cmd/x86/mtrr.c
+++ b/cmd/x86/mtrr.c
@@ -73,10 +73,10 @@ static int do_mtrr_set(uint reg, int argc, char * const argv[])
mask |= MTRR_PHYS_MASK_VALID;
printf("base=%llx, mask=%llx\n", base, mask);
- mtrr_open(&state);
+ mtrr_open(&state, true);
wrmsrl(MTRR_PHYS_BASE_MSR(reg), base);
wrmsrl(MTRR_PHYS_MASK_MSR(reg), mask);
- mtrr_close(&state);
+ mtrr_close(&state, true);
return 0;
}
@@ -86,14 +86,14 @@ static int mtrr_set_valid(int reg, bool valid)
struct mtrr_state state;
uint64_t mask;
- mtrr_open(&state);
+ mtrr_open(&state, true);
mask = native_read_msr(MTRR_PHYS_MASK_MSR(reg));
if (valid)
mask |= MTRR_PHYS_MASK_VALID;
else
mask &= ~MTRR_PHYS_MASK_VALID;
wrmsrl(MTRR_PHYS_MASK_MSR(reg), mask);
- mtrr_close(&state);
+ mtrr_close(&state, true);
return 0;
}