Merge tag 'mmc-2019-5-3' of https://github.com/MrVan/u-boot
[oweals/u-boot.git] / arch / mips / mach-mt7620 / cpu.c
index 457f09f32c627153716a443b18743b0ff6988ea2..fcd0484a6d871685a0e455ecdbbf3687f37c0022 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <dm.h>
 #include <ram.h>
+#include <wdt.h>
 #include <asm/io.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
@@ -67,3 +68,18 @@ int print_cpuinfo(void)
 
        return 0;
 }
+
+int arch_misc_init(void)
+{
+       /*
+        * It has been noticed, that sometimes the d-cache is not in a
+        * "clean-state" when U-Boot is running on MT7688. This was
+        * detected when using the ethernet driver (which uses d-cache)
+        * and a TFTP command does not complete. Flushing the complete
+        * d-cache (again?) here seems to fix this issue.
+        */
+       flush_dcache_range(gd->bd->bi_memstart,
+                          gd->bd->bi_memstart + gd->ram_size - 1);
+
+       return 0;
+}