blob: 4774a9bdb78d03339667948f5fab6ba1e70dce08 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Graeme Russa875dda2011-12-23 16:51:29 +11002/*
3 * (C) Copyright 2011
4 * Graeme Russ, <graeme.russ@gmail.com>
Graeme Russa875dda2011-12-23 16:51:29 +11005 */
Bin Meng535109a2015-08-13 00:29:10 -07006
Graeme Russa875dda2011-12-23 16:51:29 +11007#include <common.h>
Masahiro Yamada56a931c2016-09-21 11:28:55 +09008#include <linux/errno.h>
Simon Glass004ba172015-01-01 16:18:11 -07009#include <asm/mtrr.h>
Graeme Russa875dda2011-12-23 16:51:29 +110010
11DECLARE_GLOBAL_DATA_PTR;
12
Graeme Russ3fb4f9e2011-12-23 21:14:22 +110013int init_cache_f_r(void)
14{
Park, Aiden51951432019-08-03 08:31:20 +000015#if CONFIG_IS_ENABLED(X86_32BIT_INIT) && !defined(CONFIG_HAVE_FSP) && \
16 !defined(CONFIG_SYS_SLIMBOOTLOADER)
Simon Glass004ba172015-01-01 16:18:11 -070017 int ret;
18
19 ret = mtrr_commit(false);
Bin Meng80d29762015-01-22 11:29:41 +080020 /* If MTRR MSR is not implemented by the processor, just ignore it */
21 if (ret && ret != -ENOSYS)
Simon Glass004ba172015-01-01 16:18:11 -070022 return ret;
23#endif
Graeme Russ3fb4f9e2011-12-23 21:14:22 +110024 /* Initialise the CPU cache(s) */
25 return init_cache();
26}