From 58b9b76b2fb871b2648bb2547eba4503a3e486f0 Mon Sep 17 00:00:00 2001 From: Martin Ayotte Date: Mon, 8 Apr 2019 12:24:52 -0400 Subject: [PATCH] fix U-Boot 'reset' --- .../u-boot-sun50iw6/fix-u-boot-H6-reset.patch | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 patch/u-boot/u-boot-sun50iw6/fix-u-boot-H6-reset.patch diff --git a/patch/u-boot/u-boot-sun50iw6/fix-u-boot-H6-reset.patch b/patch/u-boot/u-boot-sun50iw6/fix-u-boot-H6-reset.patch new file mode 100644 index 0000000000..b6ec1c0d33 --- /dev/null +++ b/patch/u-boot/u-boot-sun50iw6/fix-u-boot-H6-reset.patch @@ -0,0 +1,33 @@ +diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h b/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h +index 41a9b0f..6392cb0 100644 +--- a/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h ++++ b/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h +@@ -60,6 +60,7 @@ + #define SUNXI_RTC_BASE 0x07000000 + #define SUNXI_R_CPUCFG_BASE 0x07000400 + #define SUNXI_PRCM_BASE 0x07010000 ++#define SUNXI_R_WDOG_BASE 0x07020400 + #define SUNXI_R_PIO_BASE 0x07022000 + #define SUNXI_R_UART_BASE 0x07080000 + #define SUNXI_R_TWI_BASE 0x07081400 +diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c +index b74eaf2..23a4d80 100644 +--- a/arch/arm/mach-sunxi/board.c ++++ b/arch/arm/mach-sunxi/board.c +@@ -287,9 +287,14 @@ void reset_cpu(ulong addr) + writel(WDT_MODE_RESET_EN | WDT_MODE_EN, &wdog->mode); + } + #elif defined(CONFIG_SUNXI_GEN_SUN6I) || defined(CONFIG_MACH_SUN50I_H6) ++#if defined(CONFIG_MACH_SUN50I_H6) ++ /* WDOG is broken for H6 use the R_WDOG instead */ ++ static const struct sunxi_wdog *wdog = ++ (struct suxi_wdog *)SUNXI_R_WDOG_BASE; ++#else + static const struct sunxi_wdog *wdog = +- ((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog; +- ++ ((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog; ++#endif + /* Set the watchdog for its shortest interval (.5s) and wait */ + writel(WDT_CFG_RESET, &wdog->cfg); + writel(WDT_MODE_EN, &wdog->mode);