mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] ARM i.MX28: change default watchdog reset method
Date: Tue, 12 Feb 2013 10:03:04 +0100	[thread overview]
Message-ID: <20130212090304.GV1906@pengutronix.de> (raw)
In-Reply-To: <1360579325-31503-1-git-send-email-s.trumtrar@pengutronix.de>

On Mon, Feb 11, 2013 at 11:42:05AM +0100, Steffen Trumtrar wrote:
> The default setting for the imx28 watchdog is to do a power-off reset. If the
> SoC is only powered via battery, then the watchdog powers the chip down, though.
> According to the datasheet it should still be possible to execute a proper POR
> with battery power, but testing showed otherwise.
> When the watchdog power-off reset is disabled, a software reset is executed
> instead. This works with and without battery power.
> 
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>

Applied, thanks

Sascha

> ---
>  arch/arm/mach-mxs/soc-imx28.c |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/arch/arm/mach-mxs/soc-imx28.c b/arch/arm/mach-mxs/soc-imx28.c
> index a181b75..a5f3d68 100644
> --- a/arch/arm/mach-mxs/soc-imx28.c
> +++ b/arch/arm/mach-mxs/soc-imx28.c
> @@ -21,6 +21,7 @@
>  
>  #define HW_CLKCTRL_RESET 0x1e0
>  # define HW_CLKCTRL_RESET_CHIP (1 << 1)
> +#define HW_CLKCTRL_WDOG_POR_DISABLE (1 << 5)
>  
>  /* Reset the full i.MX28 SoC via a chipset feature */
>  void __noreturn reset_cpu(unsigned long addr)
> @@ -35,3 +36,14 @@ void __noreturn reset_cpu(unsigned long addr)
>  	/*NOTREACHED*/
>  }
>  EXPORT_SYMBOL(reset_cpu);
> +
> +static int imx28_init(void)
> +{
> +	/*
> +	 * The default setting for the WDT is to do a POR. If the SoC is only
> +	 * powered via battery, then a WDT reset powers the chip down instead
> +	 * of resetting it. Use a software reset only.
> +	 */
> +	writel(HW_CLKCTRL_WDOG_POR_DISABLE, IMX_CCM_BASE + HW_CLKCTRL_RESET);
> +}
> +postcore_initcall(imx28_init);
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2013-02-12  9:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-11 10:42 Steffen Trumtrar
2013-02-12  9:03 ` Sascha Hauer [this message]

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=20130212090304.GV1906@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.trumtrar@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox