aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/global_data.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-12-06 21:42:07 -0700
committerBin Meng <bmeng.cn@gmail.com>2019-12-15 11:44:14 +0800
commit515e8174f5560d98c2f84999b2e5585c0f2ccd57 (patch)
tree37780fa9094496d93c76818fd8768ccd892c43e7 /arch/x86/include/asm/global_data.h
parent83f288f236505e2e73da8c8d2d72f97c0fe5b06b (diff)
downloadu-boot-515e8174f5560d98c2f84999b2e5585c0f2ccd57.zip
u-boot-515e8174f5560d98c2f84999b2e5585c0f2ccd57.tar.gz
u-boot-515e8174f5560d98c2f84999b2e5585c0f2ccd57.tar.bz2
x86: Update mrccache to support multiple caches
With Apollo Lake we need to support a normal cache, which almost never changes and a much smaller 'variable' cache which changes every time. Update the code to add a cache type, use an array for the caches and use a for loop to iterate over the caches. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/include/asm/global_data.h')
-rw-r--r--arch/x86/include/asm/global_data.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h
index 3212b00..190b604 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -67,6 +67,21 @@ struct mtrr_request {
uint64_t size;
};
+/**
+ * struct mrc_output - holds the MRC data
+ *
+ * @buf: MRC training data to save for the next boot. This is set to point to
+ * the raw data after SDRAM init is complete. Then mrccache_setup()
+ * turns it into a proper cache record with a checksum
+ * @len: Length of @buf
+ * @cache: Resulting cache record
+ */
+struct mrc_output {
+ char *buf;
+ uint len;
+ struct mrc_data_container *cache;
+};
+
/* Architecture-specific global data */
struct arch_global_data {
u64 gdt[X86_GDT_NUM_ENTRIES] __aligned(16);
@@ -91,10 +106,8 @@ struct arch_global_data {
struct mtrr_request mtrr_req[MAX_MTRR_REQUESTS];
int mtrr_req_count;
int has_mtrr;
- /* MRC training data to save for the next boot */
- char *mrc_output;
- unsigned int mrc_output_len;
- struct mrc_data_container *mrc_cache;
+ /* MRC training data */
+ struct mrc_output mrc[MRC_TYPE_COUNT];
ulong table; /* Table pointer from previous loader */
int turbo_state; /* Current turbo state */
struct irq_routing_table *pirq_routing_table;