From: chee.hong.ang at intel.com Date: Mon, 6 May 2019 22:20:23 -0700 Subject: [U-Boot] [PATCH v1 1/3] ARM: socfpga: stratix10: Enable PSCI system reset In-Reply-To: <1557206425-37534-1-git-send-email-chee.hong.ang@intel.com> References: <1557206425-37534-1-git-send-email-chee.hong.ang@intel.com> Message-ID: <1557206425-37534-2-git-send-email-chee.hong.ang@intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: "Ang, Chee Hong" Enable psci_system_reset support for Stratix10. This PSCI function will eventually trigger the mailbox HPS_REBOOT to SDM. Signed-off-by: Ang, Chee Hong --- arch/arm/mach-socfpga/Makefile | 3 +++ arch/arm/mach-socfpga/psci.c | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 arch/arm/mach-socfpga/psci.c diff --git a/arch/arm/mach-socfpga/Makefile b/arch/arm/mach-socfpga/Makefile index e667204..f77b229 100644 --- a/arch/arm/mach-socfpga/Makefile +++ b/arch/arm/mach-socfpga/Makefile @@ -38,6 +38,9 @@ obj-y += system_manager_s10.o obj-y += timer_s10.o obj-y += wrap_pinmux_config_s10.o obj-y += wrap_pll_config_s10.o +ifndef CONFIG_SPL_BUILD +obj-$(CONFIG_ARMV8_PSCI) += psci.o +endif endif ifdef CONFIG_SPL_BUILD diff --git a/arch/arm/mach-socfpga/psci.c b/arch/arm/mach-socfpga/psci.c new file mode 100644 index 0000000..9ef3931 --- /dev/null +++ b/arch/arm/mach-socfpga/psci.c @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2017 Intel Corporation + * + * SPDX-License-Identifier: GPL-2.0 + */ + +#include +#include +#include +#include +#include +#include + +void __noreturn __secure psci_system_reset(void) +{ + mbox_send_cmd_psci(MBOX_ID_UBOOT, MBOX_REBOOT_HPS, + MBOX_CMD_DIRECT, 0, NULL, 0, 0, NULL); + + while (1) + ; +} -- 2.7.4