]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
common: fix regression on block cache init
authorAngelo Durgehello <angelo.dureghello@timesys.com>
Sun, 26 Jan 2020 18:31:22 +0000 (19:31 +0100)
committerTom Rini <trini@konsulko.com>
Sun, 26 Jan 2020 18:36:14 +0000 (13:36 -0500)
m68k needs block cache list initialized after relocation.
Other architectures must not be involved.

Fixing regression related to:

commit 1526bcce0f7285087621e16e6720636d01839da8
("common: add blkcache init")

Signed-off-by: Angelo Durgehello <angelo.dureghello@timesys.com>
common/board_r.c
drivers/block/blkcache.c

index 4f56c19fcc977432d0cf2dcba37ada488569b7c9..0bbeaa7594c6bbbcbc9274a238581bf8d02526ca 100644 (file)
@@ -865,7 +865,7 @@ static init_fnc_t init_sequence_r[] = {
 #if defined(CONFIG_PRAM)
        initr_mem,
 #endif
-#ifdef CONFIG_BLOCK_CACHE
+#if defined(CONFIG_M68K) && defined(CONFIG_BLOCK_CACHE)
        blkcache_init,
 #endif
        run_main_loop,
index f603aa129d4699351c243c2aa38d9aae80bbda58..ea40929e3e520e6748e151561cc8ea9ed55626c9 100644 (file)
@@ -21,19 +21,25 @@ struct block_cache_node {
        char *cache;
 };
 
+#ifndef CONFIG_M68K
+static LIST_HEAD(block_cache);
+#else
 static struct list_head block_cache;
+#endif
 
 static struct block_cache_stats _stats = {
        .max_blocks_per_entry = 8,
        .max_entries = 32
 };
 
+#ifdef CONFIG_M68K
 int blkcache_init(void)
 {
        INIT_LIST_HEAD(&block_cache);
 
        return 0;
 }
+#endif
 
 static struct block_cache_node *cache_find(int iftype, int devnum,
                                           lbaint_t start, lbaint_t blkcnt,