
-----Original Message----- From: Trent Piepho [mailto:tpiepho@impinj.com] Sent: 2018年5月9日 4:11 To: Peng Fan peng.fan@nxp.com; christian.gmeiner@gmail.com; Anson Huang anson.huang@nxp.com; u-boot@lists.denx.de; albert.u.boot@aribaud.net; sbabic@denx.de Cc: Fabio Estevam fabio.estevam@nxp.com Subject: Re: [U-Boot,V2] imx: mx7: psci: add system reset support
On Tue, 2018-05-08 at 05:29 +0000, Peng Fan wrote:
-----Original Message----- From: Trent Piepho [mailto:tpiepho@impinj.com] Sent: 2018年5月8日 6:07 To: christian.gmeiner@gmail.com; Peng Fan peng.fan@nxp.com; Anson Huang anson.huang@nxp.com; u-boot@lists.denx.de; albert.u.boot@aribaud.net; sbabic@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.
Yes.
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.
U-Boot need parse the device tree and configure the WDOG accordingly.
-Peng
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.