28c9efa3a2e0714e7df9d04ef44a3dad9f303bb8
1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2007-2018 Michal Simek
5 * Michal SIMEK <monstr@monstr.eu>
9 * This is a board specific file. It's OK to include board specific
18 #include <asm/processor.h>
19 #include <asm/microblaze_intc.h>
22 #include <dm/uclass.h>
25 DECLARE_GLOBAL_DATA_PTR
;
27 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_WDT)
28 static struct udevice
*watchdog_dev
__attribute__((section(".data"))) = NULL
;
29 #endif /* !CONFIG_SPL_BUILD && CONFIG_WDT */
33 int dram_init_banksize(void)
35 return fdtdec_setup_memory_banksize();
40 if (fdtdec_setup_mem_size_base() != 0)
47 /* Called by macro WATCHDOG_RESET */
48 void watchdog_reset(void)
50 #if !defined(CONFIG_SPL_BUILD)
52 static ulong next_reset
;
59 /* Do not reset the watchdog too often */
60 if (now
> next_reset
) {
61 wdt_reset(watchdog_dev
);
62 next_reset
= now
+ 1000;
64 #endif /* !CONFIG_SPL_BUILD */
66 #endif /* CONFIG_WDT */
68 int board_late_init(void)
70 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_WDT)
73 if (uclass_get_device_by_seq(UCLASS_WDT
, 0, &watchdog_dev
)) {
74 debug("Watchdog: Not found by seq!\n");
75 if (uclass_get_device(UCLASS_WDT
, 0, &watchdog_dev
)) {
76 puts("Watchdog: Not found!\n");
81 wdt_start(watchdog_dev
, 0, 0);
82 puts("Watchdog: Started\n");
83 #endif /* !CONFIG_SPL_BUILD && CONFIG_WDT */
84 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_SYSRESET_MICROBLAZE)
87 ret
= device_bind_driver(gd
->dm_root
, "mb_soft_reset",
90 printf("Warning: No reset driver: ret=%d\n", ret
);