Merge tag 'u-boot-imx-20191009' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
[oweals/u-boot.git] / arch / arm / mach-at91 / spl_at91.c
index cc3341acb537c4b4edf3a241f386a44c40220c9f..1065f090e0102d06686409ccf7d477524fa042af 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2014 DENX Software Engineering
  *     Heiko Schocher <hs@denx.de>
@@ -5,8 +6,6 @@
  * Based on:
  * Copyright (C) 2013 Atmel Corporation
  *                   Bo Shen <voice.shen@atmel.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -76,8 +75,20 @@ void __weak spl_board_init(void)
 
 void board_init_f(ulong dummy)
 {
+#if CONFIG_IS_ENABLED(OF_CONTROL)
+       int ret;
+
+       ret = spl_early_init();
+       if (ret) {
+               debug("spl_early_init() failed: %d\n", ret);
+               hang();
+       }
+#endif
+
        lowlevel_clock_init();
+#if !defined(CONFIG_WDT_AT91)
        at91_disable_wdt();
+#endif
 
        /*
         * At this stage the main oscillator is supposed to be enabled