mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Juergen Beisert <jbe@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 4/4] ARM/MXS: add reset cause detection
Date: Thu, 12 Jul 2012 21:56:25 +0200	[thread overview]
Message-ID: <4FFF2BE9.1030802@pengutronix.de> (raw)
In-Reply-To: <1342100835-9870-5-git-send-email-jbe@pengutronix.de>


[-- Attachment #1.1: Type: text/plain, Size: 1966 bytes --]

On 07/12/2012 03:47 PM, Juergen Beisert wrote:
> Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
> ---
>  drivers/watchdog/im28wd.c |   25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/drivers/watchdog/im28wd.c b/drivers/watchdog/im28wd.c
> index b016910..c465f87 100644
> --- a/drivers/watchdog/im28wd.c
> +++ b/drivers/watchdog/im28wd.c
> @@ -21,6 +21,7 @@
>  #include <errno.h>
>  #include <malloc.h>
>  #include <watchdog.h>
> +#include <reset_source.h>
>  
>  #define MXS_RTC_CTRL 0x0
>  #define MXS_RTC_SET_ADDR 0x4
> @@ -73,6 +74,27 @@ static int imx28_watchdog_set_timeout(struct watchdog *wd, unsigned timeout)
>  	return 0;
>  }
>  
> +static void __maybe_unused imx28_detect_reset_source(const struct imx28_wd *p)
> +{
> +	u32 reg;
> +
> +	reg = readl(p->regs + MXS_RTC_PERSISTENT0);
> +	if (reg & MXS_RTC_PERSISTENT0_EXT_RST) {
> +		writel(MXS_RTC_PERSISTENT0_EXT_RST,
> +			p->regs + MXS_RTC_PERSISTENT0 + MXS_RTC_CLR_ADDR);
> +		set_reset_source(RESET_POR);
> +		return;
> +	}
> +	if (reg & MXS_RTC_PERSISTENT0_THM_RST) {
> +		writel(MXS_RTC_PERSISTENT0_THM_RST,
> +			p->regs + MXS_RTC_PERSISTENT0 + MXS_RTC_CLR_ADDR);
> +		set_reset_source(RESET_RST);
> +		return;
> +	}
> +
> +	set_reset_source(RESET_RST);
> +}
> +
>  static int imx28_wd_probe(struct device_d *dev)
>  {
>  	struct imx28_wd *priv;
> @@ -94,6 +116,9 @@ static int imx28_wd_probe(struct device_d *dev)
>  	if (rc != 0)
>  		goto on_error;
>  
> +#ifdef CONFIG_GLOBALVAR
What about:

	if (IS_ENABLED(CONFIG_GLOBALVAR))

> +	imx28_detect_reset_source(priv);
> +#endif
>  	dev->priv = priv;
>  	return 0;
>  


-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

  reply	other threads:[~2012-07-12 19:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12 13:47 [PATCHv3] Enable a way to provide the reason for "being here" Juergen Beisert
2012-07-12 13:47 ` [PATCH 1/4] " Juergen Beisert
2012-07-12 13:47 ` [PATCH 2/4] ARM/Samsung: add support to detect the reset source Juergen Beisert
2012-07-12 13:47 ` [PATCH 3/4] ARM/i.MX: " Juergen Beisert
2012-07-12 13:47 ` [PATCH 4/4] ARM/MXS: add reset cause detection Juergen Beisert
2012-07-12 19:56   ` Marc Kleine-Budde [this message]
2012-07-13  5:31     ` Juergen Beisert
2012-07-13  6:04 [PATCHv4] Enable a way to provide the reason for "being here" Juergen Beisert
2012-07-13  6:04 ` [PATCH 4/4] ARM/MXS: add reset cause detection Juergen Beisert
2012-07-18  8:46 [PATCHv5] Enable a way to provide the reason for "being here" Juergen Beisert
2012-07-18  8:46 ` [PATCH 4/4] ARM/MXS: add reset cause detection Juergen Beisert

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=4FFF2BE9.1030802@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jbe@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