Merge tag 'mmc-2019-5-3' of https://github.com/MrVan/u-boot
[oweals/u-boot.git] / arch / mips / mach-mt7620 / cpu.c
index 87cc973b756ea712f03d814c6428a4552ff39f4a..fcd0484a6d871685a0e455ecdbbf3687f37c0022 100644 (file)
@@ -69,41 +69,17 @@ int print_cpuinfo(void)
        return 0;
 }
 
-#ifdef CONFIG_WATCHDOG
-static struct udevice *watchdog_dev;
-
-/* Called by macro WATCHDOG_RESET */
-void watchdog_reset(void)
-{
-       static ulong next_reset;
-       ulong now;
-
-       if (!watchdog_dev)
-               return;
-
-       now = get_timer(0);
-
-       /* Do not reset the watchdog too often */
-       if (now > next_reset) {
-               next_reset = now + 1000;        /* reset every 1000ms */
-               wdt_reset(watchdog_dev);
-       }
-}
-
 int arch_misc_init(void)
 {
-       /* Init watchdog */
-       if (uclass_get_device_by_seq(UCLASS_WDT, 0, &watchdog_dev)) {
-               debug("Watchdog: Not found by seq!\n");
-               if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) {
-                       puts("Watchdog: Not found!\n");
-                       return 0;
-               }
-       }
-
-       wdt_start(watchdog_dev, 60000, 0);      /* 60 seconds */
-       printf("Watchdog: Started\n");
+       /*
+        * 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;
 }
-#endif