]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: rmobile: Add basic PSCI support for R8A779A0 V3U Falcon
authorHai Pham <hai.pham.ud@renesas.com>
Tue, 27 Oct 2020 12:06:51 +0000 (19:06 +0700)
committerMarek Vasut <marek.vasut+renesas@gmail.com>
Thu, 24 Jun 2021 18:22:18 +0000 (20:22 +0200)
Enable basic PSCI support for R8A779A0 V3U Falcon

Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
arch/arm/mach-rmobile/Makefile
arch/arm/mach-rmobile/psci-r8a779a0.c [new file with mode: 0644]
configs/r8a779a0_falcon_defconfig

index 81a0dedb41af58c53d8dc09b69c56049c4697ff2..195bbeb5c883a5e92b73ce6942ac841171584203 100644 (file)
@@ -15,6 +15,10 @@ obj-$(CONFIG_RCAR_GEN2) += lowlevel_init_ca15.o cpu_info-rcar.o
 obj-$(CONFIG_RCAR_GEN3) += lowlevel_init_gen3.o cpu_info-rcar.o memmap-gen3.o
 obj-$(CONFIG_RZ_G2) += cpu_info-rzg.o
 
+ifneq ($(CONFIG_R8A779A0),)
+obj-$(CONFIG_ARMV8_PSCI) += psci-r8a779a0.o
+endif
+
 OBJCOPYFLAGS_u-boot-spl.srec := -O srec
 quiet_cmd_objcopy = OBJCOPY $@
 cmd_objcopy = $(OBJCOPY) --gap-fill=0x00 $(OBJCOPYFLAGS) \
diff --git a/arch/arm/mach-rmobile/psci-r8a779a0.c b/arch/arm/mach-rmobile/psci-r8a779a0.c
new file mode 100644 (file)
index 0000000..6a85eb2
--- /dev/null
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * This file implements basic PSCI support for Renesas r8a779a0 SoC
+ *
+ * Copyright (C) 2020 Renesas Electronics Corp.
+ *
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/psci.h>
+#include <asm/secure.h>
+
+int __secure psci_features(u32 function_id, u32 psci_fid)
+{
+       switch (psci_fid) {
+       case ARM_PSCI_0_2_FN_PSCI_VERSION:
+       case ARM_PSCI_0_2_FN_SYSTEM_RESET:
+               return 0x0;
+       }
+       /* case ARM_PSCI_0_2_FN_CPU_ON: */
+       /* case ARM_PSCI_0_2_FN_CPU_OFF: */
+       /* case ARM_PSCI_0_2_FN_AFFINITY_INFO: */
+       /* case ARM_PSCI_0_2_FN_MIGRATE_INFO_TYPE: */
+       /* case ARM_PSCI_0_2_FN_SYSTEM_OFF: */
+       return ARM_PSCI_RET_NI;
+}
+
+u32 __secure psci_version(void)
+{
+       return ARM_PSCI_VER_0_2;
+}
+
+#define RST_BASE       0xE6160000 /* Domain0 */
+#define RST_SRESCR0    (RST_BASE + 0x18)
+#define RST_SPRES      0x5AA58000
+
+void __secure __noreturn psci_system_reset(void)
+{
+       writel(RST_SPRES, RST_SRESCR0);
+
+       while (1)
+               ;
+}
+
+int psci_update_dt(void *fdt)
+{
+       return 0;
+}
index dad8b77acf55f720129484d51fbaad13ac96b26c..8df647acfb5f8d5cac089dcb7018cebb618ea97e 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_SPL_TEXT_BASE=0xe6338000
 CONFIG_RCAR_GEN3=y
 CONFIG_TARGET_FALCON=y
 # CONFIG_PSCI_RESET is not set
+CONFIG_ARMV8_PSCI=y
 CONFIG_DEFAULT_DEVICE_TREE="r8a779a0-falcon-u-boot"
 CONFIG_FIT=y
 CONFIG_SUPPORT_RAW_INITRD=y