summaryrefslogtreecommitdiff
path: root/arch/x86/include
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 /arch/x86/include
parent6f1c0430e88396abc8e6a91ab3cc78882c76cb7c (diff)
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 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/mtrr.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/include/asm/mtrr.h b/arch/x86/include/asm/mtrr.h
index 05cd7b7f17..2d897f82ef 100644
--- a/arch/x86/include/asm/mtrr.h
+++ b/arch/x86/include/asm/mtrr.h
@@ -77,8 +77,9 @@ struct mtrr_state {
* possibly the cache.
*
* @state: Empty structure to pass in to hold settings
+ * @do_caches: true to disable caches before opening
*/
-void mtrr_open(struct mtrr_state *state);
+void mtrr_open(struct mtrr_state *state, bool do_caches);
/**
* mtrr_open() - Clean up after adjusting MTRRs, and enable them
@@ -86,8 +87,9 @@ void mtrr_open(struct mtrr_state *state);
* This uses the structure containing information returned from mtrr_open().
*
* @state: Structure from mtrr_open()
+ * @state: true to restore cache state to that before mtrr_open()
*/
-void mtrr_close(struct mtrr_state *state);
+void mtrr_close(struct mtrr_state *state, bool do_caches);
/**
* mtrr_add_request() - Add a new MTRR request