diff mbox series

[v1,13/16] arm: socfpga: mailbox: Add 'SYSTEM_RESET' PSCI support to mbox_reset_cold()

Message ID 20200817043431.28718-14-chee.hong.ang@intel.com
State Deferred
Delegated to: Tom Rini
Headers show
Series Enable ARM Trusted Firmware for U-Boot | expand

Commit Message

Ang, Chee Hong Aug. 17, 2020, 4:34 a.m. UTC
mbox_reset_cold() will invoke ATF's PSCI service when running in
non-secure mode (EL2).

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
---
 arch/arm/mach-socfpga/mailbox_s10.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Ley Foon Tan Sept. 25, 2020, 7:42 a.m. UTC | #1
> -----Original Message-----
> From: Ang, Chee Hong <chee.hong.ang@intel.com>
> Sent: Monday, August 17, 2020 12:34 PM
> To: u-boot@lists.denx.de
> Cc: Marek Vasut <marex@denx.de>; Simon Goldschmidt
> <simon.k.r.goldschmidt@gmail.com>; Tom Rini <trini@konsulko.com>; See,
> Chin Liang <chin.liang.see@intel.com>; Tan, Ley Foon
> <ley.foon.tan@intel.com>; Ang, Chee Hong <chee.hong.ang@intel.com>;
> Chee, Tien Fong <tien.fong.chee@intel.com>; Lim, Elly Siew Chin
> <elly.siew.chin.lim@intel.com>
> Subject: [PATCH v1 13/16] arm: socfpga: mailbox: Add 'SYSTEM_RESET' PSCI
> support to mbox_reset_cold()
> 
> mbox_reset_cold() will invoke ATF's PSCI service when running in non-secure
> mode (EL2).
> 
> Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
> ---
>  arch/arm/mach-socfpga/mailbox_s10.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-
> socfpga/mailbox_s10.c
> index 18d44924e6..429444f069 100644
> --- a/arch/arm/mach-socfpga/mailbox_s10.c
> +++ b/arch/arm/mach-socfpga/mailbox_s10.c
> @@ -11,6 +11,7 @@
>  #include <asm/arch/mailbox_s10.h>
>  #include <asm/arch/system_manager.h>
>  #include <asm/secure.h>
> +#include <asm/system.h>
> 
>  DECLARE_GLOBAL_DATA_PTR;
> 
> @@ -398,6 +399,9 @@ error:
> 
>  int mbox_reset_cold(void)
>  {
> +#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_ATF)
> +	psci_system_reset();
> +#else
>  	int ret;
> 
>  	ret = mbox_send_cmd(MBOX_ID_UBOOT, MBOX_REBOOT_HPS,
> MBOX_CMD_DIRECT, @@ -406,6 +410,7 @@ int mbox_reset_cold(void)
>  		/* mailbox sent failure, wait for watchdog to kick in */
>  		hang();
>  	}
> +#endif
>  	return 0;
>  }
> 


Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
diff mbox series

Patch

diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga/mailbox_s10.c
index 18d44924e6..429444f069 100644
--- a/arch/arm/mach-socfpga/mailbox_s10.c
+++ b/arch/arm/mach-socfpga/mailbox_s10.c
@@ -11,6 +11,7 @@ 
 #include <asm/arch/mailbox_s10.h>
 #include <asm/arch/system_manager.h>
 #include <asm/secure.h>
+#include <asm/system.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -398,6 +399,9 @@  error:
 
 int mbox_reset_cold(void)
 {
+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_ATF)
+	psci_system_reset();
+#else
 	int ret;
 
 	ret = mbox_send_cmd(MBOX_ID_UBOOT, MBOX_REBOOT_HPS, MBOX_CMD_DIRECT,
@@ -406,6 +410,7 @@  int mbox_reset_cold(void)
 		/* mailbox sent failure, wait for watchdog to kick in */
 		hang();
 	}
+#endif
 	return 0;
 }