public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@impinj.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-Boot,V2] imx: mx7: psci: add system reset support
Date: Tue, 8 May 2018 20:10:46 +0000	[thread overview]
Message-ID: <1525810245.31312.85.camel@impinj.com> (raw)
In-Reply-To: <HE1PR04MB300462A342F8BF74EA56C3AD889A0@HE1PR04MB3004.eurprd04.prod.outlook.com>

On Tue, 2018-05-08 at 05:29 +0000, Peng Fan wrote:
> > -----Original Message-----
> > From: Trent Piepho [mailto:tpiepho at impinj.com]
> > Sent: 2018年5月8日 6:07
> > To: christian.gmeiner at gmail.com; Peng Fan <peng.fan@nxp.com>; Anson
> > Huang <anson.huang@nxp.com>; u-boot at lists.denx.de;
> > albert.u.boot at aribaud.net; sbabic at denx.de
> > Cc: Fabio Estevam <fabio.estevam@nxp.com>
> > Subject: Re: [U-Boot,V2] imx: mx7: psci: add system reset support
> > 
> > On Thu, 2018-01-04 at 17:03 +0800, Anson Huang wrote:
> > > Add i.MX7 PSCI system reset support, linux kernel now can use "reboot"
> > > command to reset system.
> > 
> > 
> > > +__secure void imx_system_reset(void)
> > > +{
> > > +	writew(1 << 2, WDOG1_BASE_ADDR);
> > > +}
> > 
> > This does not work properly on our board.
> 
> You could try write 0x14 to WDOG1_BASE_ADDR to see whether it works.
> Here using (1 << 2) triggers both SRS and WDOG_B which seems wrong.

It works when the Linux driver does that and appears to work
identically when uboot does it that way.

Triggering both SRS and WDOG_B does not work as it causes a very short
wdog_b assertion.

There is a little difficulty here in just changing the code to use
WCR_WDE|WCR_SRS, as that would be wrong if the board does not use an
external signal.  The Linux driver uses the device tree to determine
what to do, but this will not work for PSCI.

> > Due to an erratum in iMX7d it is necessary to wire the external WDOG_B
> > signal to the pmic to cycle power in order to reset the board.  The
> > Linux IMX watchdog driver works when it does a reboot via the watchdog,
> > but this code does not.
> > 
> > When the Linux drivers is configured for an external wdog signal, using
> > a DT property, it sets WCR_SRS to prevent the internal system reset in
> > response to watchdog triggering.  When that is not done, as in this
> > patch, the internal reset appears to reset the wdog module or iomux or
> > something, which causes the imx7d to stop asserting the external wdog
> > signal.
> > 
> > In my tests, this takes only about 2.4 µs.  Such a short wdog_b pulse
> > does not appear to be sufficient to trigger the pmic to cycle power.
> > 
> > When SRS is set, then the WDOG_B signal will remain asserted until the
> > POR_B input signal to the imx7d is asserted.  I.e., until pmic responds
> > to the watchdog signal.

  reply	other threads:[~2018-05-08 20:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04  9:03 [U-Boot] [PATCH V2] imx: mx7: psci: add system reset support Anson Huang
2018-01-04  9:48 ` Peng Fan
2018-01-04 10:46   ` Anson Huang
2018-01-04 12:57 ` Fabio Estevam
2018-01-05  6:25   ` Anson Huang
2018-01-06 22:47     ` Fabio Estevam
2018-01-07  5:57       ` Anson Huang
2018-01-07  6:27       ` Anson Huang
2018-05-07 22:06 ` [U-Boot] [U-Boot,V2] " Trent Piepho
2018-05-08  5:29   ` Peng Fan
2018-05-08 20:10     ` Trent Piepho [this message]
2018-05-09  1:13       ` Peng Fan
2018-05-09 19:22         ` Trent Piepho
2018-05-10  1:53           ` Peng Fan

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=1525810245.31312.85.camel@impinj.com \
    --to=tpiepho@impinj.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox