Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / board / cssi / MCR3000 / MCR3000.c
index 6939a2cf6179e341104f3b37e7c6c729ea3aee13..570e846a21b74b67b4dcd848e1ec0b5a79d81b84 100644 (file)
@@ -1,18 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2010-2017 CS Systemes d'Information
  * Florent Trinh Thai <florent.trinh-thai@c-s.fr>
  * Christophe Leroy <christophe.leroy@c-s.fr>
  *
  * Board specific routines for the MCR3000 board
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <env.h>
 #include <hwconfig.h>
+#include <init.h>
 #include <mpc8xx.h>
 #include <fdt_support.h>
+#include <serial.h>
 #include <asm/io.h>
+#include <dm/uclass.h>
+#include <wdt.h>
+#include <linux/delay.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -144,3 +149,17 @@ int board_early_init_f(void)
 
        return 0;
 }
+
+int board_early_init_r(void)
+{
+       struct udevice *watchdog_dev = NULL;
+
+       if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) {
+               puts("Cannot find watchdog!\n");
+       } else {
+               puts("Enabling watchdog.\n");
+               wdt_start(watchdog_dev, 0xffff, 0);
+       }
+
+       return 0;
+}