x86: spl: Avoid using init_cache_f_r() from SPL
authorSimon Glass <sjg@chromium.org>
Thu, 4 May 2023 22:50:57 +0000 (16:50 -0600)
committerBin Meng <bmeng@tinylab.org>
Thu, 11 May 2023 02:25:29 +0000 (10:25 +0800)
This function is used by U-Boot proper. It does not set up MTRRs when SPL
is enabled, but we do want this done when it is called from SPL. In fact
it is confusing to use the same function from SPL, since there are quite
a few conditions there.

All init_cache_f_r() really does is commit the MTRRs and set up the cache.
Do this in the SPL's version of this function instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/lib/spl.c

index 479889a..61eb026 100644 (file)
@@ -186,7 +186,8 @@ void board_init_f(ulong flags)
 
 void board_init_f_r(void)
 {
-       init_cache_f_r();
+       mtrr_commit(false);
+       init_cache();
        gd->flags &= ~GD_FLG_SERIAL_READY;
        debug("cache status %d\n", dcache_status());
        board_init_r(gd, 0);