]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/cpu/armv7/socfpga/misc.c
Kconfig: Move CONFIG_DESIGNWARE_ETH to Kconfig
[u-boot] / arch / arm / cpu / armv7 / socfpga / misc.c
index 73cffd3a8d6f13a3f1fe8c10de1675912de5ca62..0f8b4d095d40271324cb57b548cb447a16bbe171 100644 (file)
@@ -9,6 +9,7 @@
 #include <altera.h>
 #include <miiphy.h>
 #include <netdev.h>
+#include <watchdog.h>
 #include <asm/arch/reset_manager.h>
 #include <asm/arch/system_manager.h>
 #include <asm/arch/dwmmc.h>
@@ -48,7 +49,7 @@ void enable_caches(void)
 /*
  * DesignWare Ethernet initialization
  */
-#ifdef CONFIG_DESIGNWARE_ETH
+#ifdef CONFIG_ETH_DESIGNWARE
 int cpu_eth_init(bd_t *bis)
 {
 #if CONFIG_EMAC_BASE == SOCFPGA_EMAC0_ADDRESS
@@ -150,14 +151,23 @@ static inline void socfpga_fpga_add(void) {}
 
 int arch_cpu_init(void)
 {
+#ifdef CONFIG_HW_WATCHDOG
+       /*
+        * In case the watchdog is enabled, make sure to (re-)configure it
+        * so that the defined timeout is valid. Otherwise the SPL (Perloader)
+        * timeout value is still active which might too short for Linux
+        * booting.
+        */
+       hw_watchdog_init();
+#else
        /*
         * If the HW watchdog is NOT enabled, make sure it is not running,
         * for example because it was enabled in the preloader. This might
         * trigger a watchdog-triggered reboot of Linux kernel later.
         */
-#ifndef CONFIG_HW_WATCHDOG
        socfpga_watchdog_reset();
 #endif
+
        return 0;
 }