Merge tag 'dm-9oct18' of git://git.denx.de/u-boot-dm
[platform/kernel/u-boot.git] / arch / x86 / include / asm / mtrr.h
index 70762ee..2d897f8 100644 (file)
@@ -1,9 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright (c) 2014 Google, Inc
  *
  * From Coreboot file of the same name
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifndef _ASM_MTRR_H
@@ -55,6 +54,8 @@
 #define MTRR_FIX_4K_F0000_MSR  0x26e
 #define MTRR_FIX_4K_F8000_MSR  0x26f
 
+#define MTRR_FIX_TYPE(t)       ((t << 24) | (t << 16) | (t << 8) | t)
+
 #if !defined(__ASSEMBLER__)
 
 /**
@@ -76,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
@@ -85,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