public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V2] imx: mx7: psci: add system reset support
@ 2018-01-04  9:03 Anson Huang
  2018-01-04  9:48 ` Peng Fan
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Anson Huang @ 2018-01-04  9:03 UTC (permalink / raw)
  To: u-boot

Add i.MX7 PSCI system reset support, linux
kernel now can use "reboot" command to reset
system.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
changes since V1:
	write WDOG register directly instead of calling reset_cpu
	which is NOT safe since it is NOT in secure section.
 arch/arm/mach-imx/mx7/psci-mx7.c | 5 +++++
 arch/arm/mach-imx/mx7/psci.S     | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/arch/arm/mach-imx/mx7/psci-mx7.c b/arch/arm/mach-imx/mx7/psci-mx7.c
index 7f429b0..66f6db6 100644
--- a/arch/arm/mach-imx/mx7/psci-mx7.c
+++ b/arch/arm/mach-imx/mx7/psci-mx7.c
@@ -74,3 +74,8 @@ __secure int imx_cpu_off(int cpu)
 	writel(0, SRC_BASE_ADDR + cpu * 8 + SRC_GPR1_MX7D + 4);
 	return 0;
 }
+
+__secure void imx_system_reset(void)
+{
+	writew(1 << 2, WDOG1_BASE_ADDR);
+}
diff --git a/arch/arm/mach-imx/mx7/psci.S b/arch/arm/mach-imx/mx7/psci.S
index fc5eb34..59f98cd 100644
--- a/arch/arm/mach-imx/mx7/psci.S
+++ b/arch/arm/mach-imx/mx7/psci.S
@@ -43,4 +43,11 @@ psci_cpu_off:
 1: 	wfi
 	b 1b
 
+.globl psci_system_reset
+psci_system_reset:
+	b	imx_system_reset
+
+2: 	wfi
+	b 2b
+
 	.popsection
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-05-10  1:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2018-05-09  1:13       ` Peng Fan
2018-05-09 19:22         ` Trent Piepho
2018-05-10  1:53           ` Peng Fan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox