]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: socfpga: mailbox: Add 'SYSTEM_RESET' PSCI support to mbox_reset_cold()
authorChee Hong Ang <chee.hong.ang@intel.com>
Thu, 24 Dec 2020 10:21:08 +0000 (18:21 +0800)
committerLey Foon Tan <ley.foon.tan@intel.com>
Fri, 15 Jan 2021 09:48:38 +0000 (17:48 +0800)
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

index 18d44924e6254c02dfb9d086967750a5ebac0a41..429444f06940cf31439732bd567bc4d30c7daf96 100644 (file)
@@ -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;
 }