[PATCH 4/4] ARM: sunxi: Add sunxi restart function via onchip watchdog
Arnd Bergmann
arnd at arndb.de
Mon Nov 19 10:55:53 EST 2012
On Monday 19 November 2012, Stefan Roese wrote:
> Signed-off-by: Stefan Roese <sr at denx.de>
> Cc: Maxime Ripard <maxime.ripard at free-electrons.com>
> Cc: Arnd Bergmann <arnd at arndb.de>
Acked-by: Arnd Bergmann <arnd at arndb.de>
> +void sunxi_restart(char mode, const char *cmd)
> +{
> + /* Use watchdog to reset system */
> +
> + /* Enable timer and set reset bit */
> + writel(3, timer_base + WATCH_DOG_MODE_REG);
> + writel(0xa57 << 1 | 1, timer_base + WATCH_DOG_CTRL_REG);
> +
> + while(1)
> + ;
> +}
> +
> static void __init sunxi_timer_init(void)
> {
> struct device_node *node;
We may have to revisit this if we get to the point where timer drivers
can be in loadable modules. We can't do that yet, so it's probably
better the way you wrote it than something else.
Arnd
More information about the linux-arm-kernel
mailing list