From: "Clément Péron" <peron.clem@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 3/3] arm: sunxi: h6: fix reset using r_wdog
Date: Wed, 17 Apr 2019 19:41:05 +0200 [thread overview]
Message-ID: <20190417174105.27440-4-peron.clem@gmail.com> (raw)
In-Reply-To: <20190417174105.27440-1-peron.clem@gmail.com>
WDOG is broken for some H6 rev. The board is not
reseted correctly.
Use the R_WDOG instead.
Signed-off-by: Clément Péron <peron.clem@gmail.com>
---
arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h | 1 +
arch/arm/mach-sunxi/board.c | 9 +++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
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 41a9b0fc47..6392cb07b4 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 c6dd7b8e54..921e4c5175 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -289,9 +289,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 some H6 rev. use the R_WDOG instead */
static const struct sunxi_wdog *wdog =
- ((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog;
-
+ (struct sunxi_wdog *)SUNXI_R_WDOG_BASE;
+#else
+ static const struct sunxi_wdog *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);
--
2.17.1
next prev parent reply other threads:[~2019-04-17 17:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-17 17:41 [U-Boot] [PATCH v3 0/3] Add Beelink GS1 Board Clément Péron
2019-04-17 17:41 ` [U-Boot] [PATCH v3 1/3] arm64: allwinner: sun50i: Sync H6 dts(i) files from Linux Clément Péron
2019-04-17 17:41 ` [U-Boot] [PATCH v3 2/3] arm: dts: h6: Add Beelink GS1 initial support Clément Péron
2019-04-18 16:46 ` Jagan Teki
2019-04-17 17:41 ` Clément Péron [this message]
2019-04-19 7:52 ` [U-Boot] [PATCH v3 3/3] arm: sunxi: h6: fix reset using r_wdog Clément Péron
2019-04-19 8:24 ` Jagan Teki
2019-04-19 9:19 ` Clément Péron
2019-04-29 20:28 ` Clément Péron
2019-05-12 18:19 ` Clément Péron
2019-05-12 18:23 ` [U-Boot] [linux-sunxi] " Jagan Teki
2019-05-12 21:28 ` Clément Péron
2019-05-14 13:48 ` Jagan Teki
2019-05-14 13:49 ` [U-Boot] [linux-sunxi] " Jagan Teki
2019-05-14 15:08 ` Clément Péron
2019-05-20 16:37 ` Jagan Teki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190417174105.27440-4-peron.clem@gmail.com \
--to=peron.clem@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.