diff options
author | Tom Rini <trini@konsulko.com> | 2018-07-19 11:48:33 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-07-19 11:48:33 -0400 |
commit | f7e48c54b246c460503e90315d0cd50ccbd586c6 (patch) | |
tree | 836d7fd9f833b285645a33e457b74be6110a0e08 /board/xilinx/microblaze-generic | |
parent | 1adbf2966adebe67de3dd17094749d387604194e (diff) | |
parent | 577012da71ea9dcf07272c7f458218aa8ab29984 (diff) |
Merge tag 'xilinx-for-v2018.09' of git://git.denx.de/u-boot-microblaze
Xilinx changes for v2018.09
clk:
- Fix zynqmp clock driver
common:
- Handle CMD_RET_USAGE in cmd_process_error
- Use return macros in cmd_process_error
- Fix duplication of CONFIG_SYS_PROMPT_HUSH_PS2
- Support watchdog in usb_kbd.c
- Fix name usage in usb_kbd.c
- Support systems with non zero memory start initialized from DT only
gpio:
- Add support for manual relocation in uclass
- zynq - use live tree
- zynq - fix match data reading
- zynq - setup bank name
- xilinx - convert driver to DM
microblaze:
- Use generic iounmap/ioremap implementations
- Redesign reset logic with sysreset features
- Use watchdog and gpio over DM
- Remove unused macros and fix some checkpatch issues
- Fix timer initialization not to be called twice
serial:
- zynq - Use platdata intead of priv data
sysreset:
- Add support for manual relocation in uclass
- Add gpio-restart driver
- Add microblaze soft reset driver
watchdog:
- Add support for aliases in uclass
- Add support for manual relocation in uclass
- Convert xilinx driver to DM
- cadence - update info in the driver and not stop wdt in probe
xilinx:
- Enable LED gpio for some targets with gpio-leds DT node
- Setup variables via Kconfig
zynq:
- Add support for watchdog aliases
- Add support for mini nand/nor configurations
- Wire FPGA initalization in SPL
zynqmp:
- Enable mass storage for zcu100
- Handle external pmufw files
- Add support for secure images
- Some Kconfig movements and alignments
- Add support for watchdog aliases
- Use subcommands style for platform command
- Add mmio_read/write platform commands
- DT updates
- Add support for mini qspi configuration
Diffstat (limited to 'board/xilinx/microblaze-generic')
-rw-r--r-- | board/xilinx/microblaze-generic/microblaze-generic.c | 81 | ||||
-rw-r--r-- | board/xilinx/microblaze-generic/xparameters.h | 9 |
2 files changed, 50 insertions, 40 deletions
diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c index 58ca1d715d..44fb48b347 100644 --- a/board/xilinx/microblaze-generic/microblaze-generic.c +++ b/board/xilinx/microblaze-generic/microblaze-generic.c @@ -1,26 +1,32 @@ // 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> */ -/* This is a board specific file. It's OK to include board specific - * header files */ +/* + * This is a board specific file. It's OK to include board specific + * header files + */ #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> #include <asm/asm.h> #include <asm/gpio.h> +#include <dm/uclass.h> +#include <wdt.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 */ ulong ram_base; @@ -58,38 +64,51 @@ int dram_init(void) return 0; }; -int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +#ifdef CONFIG_WDT +/* Called by macro WATCHDOG_RESET */ +void watchdog_reset(void) { -#ifndef CONFIG_SPL_BUILD -#ifdef CONFIG_XILINX_GPIO - if (reset_pin != -1) - gpio_direction_output(reset_pin, 1); -#endif +#if !defined(CONFIG_SPL_BUILD) + ulong now; + static ulong next_reset; -#ifdef CONFIG_XILINX_TB_WATCHDOG - hw_watchdog_disable(); -#endif -#endif - puts ("Reseting board\n"); - __asm__ __volatile__ (" mts rmsr, r0;" \ - "bra r0"); + if (!watchdog_dev) + return; - return 0; -} + now = timer_get_us(); -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; + /* Do not reset the watchdog too often */ + if (now > next_reset) { + wdt_reset(watchdog_dev); + next_reset = now + 1000; + } +#endif /* !CONFIG_SPL_BUILD */ } +#endif /* CONFIG_WDT */ int board_late_init(void) { - gpio_init(); +#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_WDT) + watchdog_dev = NULL; + + if (uclass_get_device_by_seq(UCLASS_WDT, 0, &watchdog_dev)) { + debug("Watchdog: Not found by seq!\n"); + if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) { + puts("Watchdog: Not found!\n"); + return 0; + } + } + + 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; } diff --git a/board/xilinx/microblaze-generic/xparameters.h b/board/xilinx/microblaze-generic/xparameters.h index 51bca40e34..5e0911faf6 100644 --- a/board/xilinx/microblaze-generic/xparameters.h +++ b/board/xilinx/microblaze-generic/xparameters.h @@ -10,18 +10,9 @@ * the generated file from your Xilinx design flow. */ -#define XILINX_BOARD_NAME microblaze-generic - /* Microblaze is microblaze_0 */ #define XILINX_FSL_NUMBER 3 -/* GPIO is LEDs_4Bit*/ -#define XILINX_GPIO_BASEADDR 0x40000000 - /* Flash Memory is FLASH_2Mx32 */ #define XILINX_FLASH_START 0x2c000000 #define XILINX_FLASH_SIZE 0x00800000 - -/* Watchdog IP is wxi_timebase_wdt_0 */ -#define XILINX_WATCHDOG_BASEADDR 0x50000000 -#define XILINX_WATCHDOG_IRQ 1 |