From: Ian Campbell <ijc@hellion.org.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] ARM: sunxi: Fix reset command on sun6i/sun8i
Date: Sat, 11 Oct 2014 16:33:48 +0100 [thread overview]
Message-ID: <1413041628.11505.26.camel@hellion.org.uk> (raw)
In-Reply-To: <1412426248-20050-4-git-send-email-wens@csie.org>
On Sat, 2014-10-04 at 20:37 +0800, Chen-Yu Tsai wrote:
> +#else /* CONFIG_SUN6I || CONFIG_SUN8I || .. */
> + static const struct sunxi_wdog *wdog =
> + ((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog;
> +
> + /* Set the watchdog for its shortest interval (.5s) and wait */
> + writel(WDT_CFG_RESET, &wdog->cfg);
> + writel(WDT_MODE_EN, &wdog->mode);
> + writel(WDT_CTRL_KEY | WDT_CTRL_RESTART, &wdog->ctl);
That's annoyingly close to the 4/5/7i version, but not quite close
enough to allow any meaningful sharing :-/
> + while (1) {
> + /* sun5i sometimes gets stuck without this */
Is this not therefore unnecessary on 6i/8i?
> + writel(WDT_MODE_EN, &wdog->mode);
> + }
> +#endif
> }
>
> /* do some early init */
> diff --git a/arch/arm/include/asm/arch-sunxi/watchdog.h b/arch/arm/include/asm/arch-sunxi/watchdog.h
> index 5b755e3..ccc8fa3 100644
> --- a/arch/arm/include/asm/arch-sunxi/watchdog.h
> +++ b/arch/arm/include/asm/arch-sunxi/watchdog.h
> @@ -12,6 +12,9 @@
>
> #define WDT_CTRL_RESTART (0x1 << 0)
> #define WDT_CTRL_KEY (0x0a57 << 1)
> +
> +#if defined(CONFIG_SUN4I) || defined(CONFIG_SUN5I) || defined(CONFIG_SUN7I)
> +
> #define WDT_MODE_EN (0x1 << 0)
> #define WDT_MODE_RESET_EN (0x1 << 1)
>
> @@ -21,4 +24,21 @@ struct sunxi_wdog {
> u32 res[2];
> };
>
> +#else
> +
> +#define WDT_CFG_RESET (0x1)
> +#define WDT_MODE_EN (0x1)
> +
> +struct sunxi_wdog {
> + u32 irq_en; /* 0x00 */
> + u32 irq_sta; /* 0x04 */
> + u32 res1[2];
> + u32 ctl; /* 0x10 */
> + u32 cfg; /* 0x14 */
> + u32 mode; /* 0x18 */
> + u32 res2;
> +};
> +
> +#endif
> +
> #endif /* _SUNXI_WATCHDOG_H_ */
next prev parent reply other threads:[~2014-10-11 15:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-04 12:37 [U-Boot] [PATCH 0/3] ARM: sunxi: Fix reset support on sun6i/sun8i Chen-Yu Tsai
2014-10-04 12:37 ` [U-Boot] [PATCH 1/3] ARM: sunxi: Move watchdog register definitions to separate file Chen-Yu Tsai
2014-10-11 15:30 ` Ian Campbell
2014-10-04 12:37 ` [U-Boot] [PATCH 2/3] ARM: sunxi: Add sun6i/sun8i timer block register definition Chen-Yu Tsai
2014-10-11 15:31 ` Ian Campbell
2014-10-04 12:37 ` [U-Boot] [PATCH 3/3] ARM: sunxi: Fix reset command on sun6i/sun8i Chen-Yu Tsai
2014-10-11 15:33 ` Ian Campbell [this message]
2014-10-12 2:40 ` Chen-Yu Tsai
2014-10-21 18:51 ` Ian Campbell
2014-10-04 15:02 ` [U-Boot] [linux-sunxi] [PATCH 0/3] ARM: sunxi: Fix reset support " Julian Calaby
2014-10-04 15:12 ` Chen-Yu Tsai
2014-10-05 1:14 ` Julian Calaby
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=1413041628.11505.26.camel@hellion.org.uk \
--to=ijc@hellion.org.uk \
--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.