-#ifndef _ASM_MICROBLAZE_GPIO_H_
-#define _ASM_MICROBLAZE_GPIO_H_
-
#include <asm-generic/gpio.h>
-
-/* Allocation functions */
-extern int gpio_alloc_dual(u32 baseaddr, const char *name, u32 gpio_no0,
- u32 gpio_no1);
-extern int gpio_alloc(u32 baseaddr, const char *name, u32 gpio_no);
-
-#define gpio_status() gpio_info()
-extern void gpio_info(void);
-
-#endif
// SPDX-License-Identifier: GPL-2.0+
/*
- * (C) Copyright 2007 Michal Simek
+ * (C) Copyright 2007-2018 Michal Simek
*
- * Michal SIMEK <monstr@monstr.eu>
+ * Michal SIMEK <monstr@monstr.eu>
*/
/*
#include <common.h>
#include <config.h>
+#include <dm.h>
+#include <dm/lists.h>
#include <fdtdec.h>
#include <asm/processor.h>
#include <asm/microblaze_intc.h>
DECLARE_GLOBAL_DATA_PTR;
-#ifdef CONFIG_XILINX_GPIO
-static int reset_pin = -1;
-#endif
-
#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_WDT)
static struct udevice *watchdog_dev;
#endif /* !CONFIG_SPL_BUILD && CONFIG_WDT */
return 0;
};
-#if !defined(CONFIG_SYSRESET) || defined(CONFIG_SPL_BUILD)
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-#ifndef CONFIG_SPL_BUILD
-#ifdef CONFIG_XILINX_GPIO
- if (reset_pin != -1)
- gpio_direction_output(reset_pin, 1);
-#endif
-#endif
- puts("Resetting board\n");
- __asm__ __volatile__ (" mts rmsr, r0;" \
- "bra r0");
-
- return 0;
-}
-#endif
-
-static int gpio_init(void)
-{
-#ifdef CONFIG_XILINX_GPIO
- reset_pin = gpio_alloc(CONFIG_SYS_GPIO_0_ADDR, "reset", 1);
- if (reset_pin != -1)
- gpio_request(reset_pin, "reset_pin");
-#endif
- return 0;
-}
-
#ifdef CONFIG_WDT
/* Called by macro WATCHDOG_RESET */
void watchdog_reset(void)
int board_late_init(void)
{
- gpio_init();
-
#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_WDT)
watchdog_dev = NULL;
wdt_start(watchdog_dev, 0, 0);
puts("Watchdog: Started\n");
#endif /* !CONFIG_SPL_BUILD && CONFIG_WDT */
+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_SYSRESET_MICROBLAZE)
+ int ret;
+ ret = device_bind_driver(gd->dm_root, "mb_soft_reset",
+ "reset_soft", NULL);
+ if (ret)
+ printf("Warning: No reset driver: ret=%d\n", ret);
+#endif
return 0;
}