[U-Boot] [PATCH V2 2/3] imx: mx7: psci: add system reset support

Anson Huang Anson.Huang at nxp.com
Sat Jan 6 02:17:55 UTC 2018


Add i.MX7 PSCI system reset support, linux
kernel can use "reboot" command to reset
system even wdog driver is disabled in kernel.

Signed-off-by: Anson Huang <Anson.Huang at nxp.com>
---
changes since v1:
	use "bl" instead of "b" as we need the call to return back.
 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..e23db24 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:
+	bl	imx_system_reset
+
+2: 	wfi
+	b 2b
+
 	.popsection
-- 
1.9.1



More information about the U-Boot mailing list