1 // SPDX-License-Identifier: GPL-2.0+
4 * Graeme Russ, <graeme.russ@gmail.com>
9 #include <asm/global_data.h>
10 #include <linux/errno.h>
13 DECLARE_GLOBAL_DATA_PTR;
15 int init_cache_f_r(void)
17 bool do_mtrr = CONFIG_IS_ENABLED(X86_32BIT_INIT) ||
18 IS_ENABLED(CONFIG_FSP_VERSION2);
22 * Supported configurations:
24 * booting from slimbootloader - MTRRs are already set up
25 * booting with FSPv1 - MTRRs are already set up
26 * booting with FSPv2 - MTRRs must be set here
27 * booting from coreboot - in this case there is no SPL, so we set up
29 * Note: if there is an SPL, then it has already set up MTRRs so we
30 * don't need to do that here
32 do_mtrr &= !IS_ENABLED(CONFIG_FSP_VERSION1) &&
33 !IS_ENABLED(CONFIG_SYS_SLIMBOOTLOADER);
36 ret = mtrr_commit(false);
38 * If MTRR MSR is not implemented by the processor, just ignore
41 if (ret && ret != -ENOSYS)
45 /* Initialise the CPU cache(s) */