Add ARMv8 PSCI framework
v3 cover Add ARMv8 PSCI framework
From: Hongbo Zhang <[email protected]>
v2-v3 changes:
- Drop the previous 1/6, since the previous CONFIG_ARMV8_PSCI in common parts
of codes also work for generic PSCI framework, so there are 5 patches in this iteration.
- Add "Reviewed-by: Tom Rini <[email protected]>" for patches 1/5 and 2/5,
which were 2/6 and 3/6.
- Move config values for ls1043 from armv8/Kconfig to s1043ardb_defconfig.
v1-v2 changes:
- The new config options are introduced in Kconfig when used for first time
- Introduce new config options in armv8/Kconfig instead of LS1043 platform
- Move previous patch 5/6 to current 2/6 place
v1 notes:
This patch set introduces ARMv8 PSCI framework, all the PSCI functions are implemented a default dummy one, it is up to each platform to implement their own specific ones.
The first 1/6 patch is a prepare clean up for adding ARMv8 PSCI. Patches 2/6 to 5/6 introduce new ARMv8 framework and set it up. The last 6/6 adds a most simple implementation on NXP LS1043 platform, to verify this framework.
This patch set mainly introduces ARMv8 PSCI framework, for easier review and merge, further PSCI implementation on LS1043 is coming later.
Hongbo Zhang (5):
ARMv8: Enable SMC instruction
ARMv8: Add secure sections for PSCI text and data
ARMv8: Add basic PSCI framework
ARMv8: Setup PSCI memory and device tree
ARMv8: LS1043A: Enable LS1043A default PSCI support
arch/arm/config.mk | 3 +- arch/arm/cpu/armv8/Kconfig | 41 ++++ arch/arm/cpu/armv8/Makefile | 1 + arch/arm/cpu/armv8/cpu-dt.c | 8 + arch/arm/cpu/armv8/cpu.c | 22 ++ arch/arm/cpu/armv8/fsl-layerscape/Makefile | 1 + arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20 ++ arch/arm/cpu/armv8/psci.S | 286 +++++++++++++++++++++++ arch/arm/cpu/armv8/u-boot.lds | 57 +++++ arch/arm/include/asm/macro.h | 2 +- arch/arm/include/asm/psci.h | 15 ++ arch/arm/include/asm/secure.h | 2 +- arch/arm/include/asm/system.h | 11 + arch/arm/lib/bootm.c | 3 + arch/arm/lib/psci-dt.c | 2 +- board/freescale/ls1043ardb/Kconfig | 9 + configs/ls1043ardb_defconfig | 3 + 17 files changed, 482 insertions(+), 4 deletions(-) create mode 100644 arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S create mode 100644 arch/arm/cpu/armv8/psci.S
Signature · 1 line
2.1.4
PATCH v3 1/5 ARMv8: Enable SMC instruction
From: Hongbo Zhang <[email protected]>
PSCI implementation needs the SMC instruction to be enabled. Following the legacy codes pattern, no bit macro definition and bit operation are used, only the immediate data used in line is changed.
--- arch/arm/include/asm/macro.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/include/asm/macro.h +1 -1
@@ -137,7 +137,7 @@ lr .req x30 .macro armv8_switch_to_el2_m, xreg1 /* 64bit EL2 | HCE | SMD | RES1 (Bits[5:4]) | Non-secure EL0/EL1 */ - mov \xreg1, #0x5b1 + mov \xreg1, #0x531 msr scr_el3, \xreg1 msr cptr_el3, xzr /* Disable coprocessor traps to EL3 */ mov \xreg1, #0x33ff
Signature · 1 line
2.1.4
PATCH v3 2/5 ARMv8: Add secure sections for PSCI text and data
In reply to macro.wave.z at gmail.comFrom: Hongbo Zhang <[email protected]>
This patch adds secure_text, secure_data and secure_stack sections for ARMv8 to hold PSCI text and data, and it is based on the legacy implementation of ARMv7.
--- arch/arm/config.mk | 3 ++- arch/arm/cpu/armv8/Kconfig | 31 +++++++++++++++++++++++ arch/arm/cpu/armv8/u-boot.lds | 57 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 1 deletion(-)
arch/arm/config.mk +2 -1
@@ -118,7 +118,8 @@ endif # limit ourselves to the sections we want in the .bin. ifdef CONFIG_ARM64 -OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn +OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .data \ + -j .u_boot_list -j .rela.dyn else OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .hash \ -j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn
arch/arm/cpu/armv8/Kconfig +31 -0
@@ -39,4 +39,35 @@ config PSCI_RESET Select Y here to make use of PSCI calls for system reset +config ARMV8_PSCI + bool "Enable PSCI support" if EXPERT + default n + help + PSCI is Power State Coordination Interface defined by ARM. + The PSCI in U-boot provides a general framework and each platform + can implement their own specific PSCI functions. + Say Y here to enable PSCI support on ARMv8 platform. + +config ARMV8_PSCI_NR_CPUS + int "Maximum supported CPUs for PSCI" + depends on ARMV8_PSCI + default 4 + help + The maximum number of CPUs supported in the PSCI firmware. + It is no problem to set a larger value than the number of CPUs in + the actual hardware implementation. + +if SYS_HAS_ARMV8_SECURE_BASE + +config ARMV8_SECURE_BASE + hex "Secure address for PSCI image" + depends on ARMV8_PSCI + help + Address for placing the PSCI text, data and stack sections. + If not defined, the PSCI sections are placed together with the u-boot + but platform can choose to place PSCI code image separately in other + places such as some secure RAM built-in SOC etc. + +endif + endif
arch/arm/cpu/armv8/u-boot.lds +57 -0
74 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v3 3/5 ARMv8: Add basic PSCI framework
In reply to macro.wave.z at gmail.comFrom: Hongbo Zhang <[email protected]>
This patch introduces a generic ARMv8 PSCI framework, with all functions returning a dummy ARM_PSCI_RET_NI (Not Implemented), then it is up to each platform to implement their own functions based on this framework.
--- arch/arm/cpu/armv8/Kconfig | 10 ++ arch/arm/cpu/armv8/Makefile | 1 + arch/arm/cpu/armv8/psci.S | 286 ++++++++++++++++++++++++++++++++++++++++++++ arch/arm/include/asm/psci.h | 15 +++ 4 files changed, 312 insertions(+) create mode 100644 arch/arm/cpu/armv8/psci.S
arch/arm/cpu/armv8/Kconfig +10 -0
@@ -57,6 +57,16 @@ config ARMV8_PSCI_NR_CPUS It is no problem to set a larger value than the number of CPUs in the actual hardware implementation. +config ARMV8_PSCI_CPUS_PER_CLUSTER + int "Number of CPUs per cluster" + depends on ARMV8_PSCI + default 0 + help + The number of CPUs per cluster, suppose each cluster has same number + of CPU cores, platforms with asymmetric clusters don't apply here. + A value 0 or no definition of it works for single cluster system. + System with multi-cluster should difine their own exact value. + if SYS_HAS_ARMV8_SECURE_BASE config ARMV8_SECURE_BASE
arch/arm/cpu/armv8/Makefile +1 -0
@@ -25,3 +25,4 @@ obj-$(CONFIG_FSL_LAYERSCAPE) += fsl-layerscape/ obj-$(CONFIG_S32V234) += s32v234/ obj-$(CONFIG_ARCH_ZYNQMP) += zynqmp/ obj-$(CONFIG_TARGET_HIKEY) += hisilicon/ +obj-$(CONFIG_ARMV8_PSCI) += psci.o
arch/arm/cpu/armv8/psci.S new file +286 -0
286 lines not on this page · raw message
arch/arm/include/asm/psci.h +15 -0
@@ -45,6 +45,9 @@#define ARM_PSCI_0_2_FN_BASE 0x84000000#define ARM_PSCI_0_2_FN (n) (ARM_PSCI_0_2_FN_BASE + (n)) +#define ARM_PSCI_0_2_FN64_BASE 0xC4000000 +#define ARM_PSCI_0_2_FN64 (n) (ARM_PSCI_0_2_FN64_BASE + (n)) +#define ARM_PSCI_0_2_FN_PSCI_VERSION ARM_PSCI_0_2_FN(0)#define ARM_PSCI_0_2_FN_CPU_SUSPEND ARM_PSCI_0_2_FN(1)#define ARM_PSCI_0_2_FN_CPU_OFF ARM_PSCI_0_2_FN(2)
@@ -56,6 +59,12 @@#define ARM_PSCI_0_2_FN_SYSTEM_OFF ARM_PSCI_0_2_FN(8)#define ARM_PSCI_0_2_FN_SYSTEM_RESET ARM_PSCI_0_2_FN(9) +#define ARM_PSCI_0_2_FN64_CPU_SUSPEND ARM_PSCI_0_2_FN64(1) +#define ARM_PSCI_0_2_FN64_CPU_ON ARM_PSCI_0_2_FN64(3) +#define ARM_PSCI_0_2_FN64_AFFINITY_INFO ARM_PSCI_0_2_FN64(4) +#define ARM_PSCI_0_2_FN64_MIGRATE ARM_PSCI_0_2_FN64(5) +#define ARM_PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU ARM_PSCI_0_2_FN64(7) +/* PSCI 1.0 interface */ #define ARM_PSCI_1_0_FN_PSCI_FEATURES ARM_PSCI_0_2_FN(10)#define ARM_PSCI_1_0_FN_CPU_FREEZE ARM_PSCI_0_2_FN(11)
@@ -66,6 +75,12 @@#define ARM_PSCI_1_0_FN_STAT_RESIDENCY ARM_PSCI_0_2_FN(16)#define ARM_PSCI_1_0_FN_STAT_COUNT ARM_PSCI_0_2_FN(17) +#define ARM_PSCI_1_0_FN64_CPU_DEFAULT_SUSPEND ARM_PSCI_0_2_FN64(12) +#define ARM_PSCI_1_0_FN64_NODE_HW_STATE ARM_PSCI_0_2_FN64(13) +#define ARM_PSCI_1_0_FN64_SYSTEM_SUSPEND ARM_PSCI_0_2_FN64(14) +#define ARM_PSCI_1_0_FN64_STAT_RESIDENCY ARM_PSCI_0_2_FN64(16) +#define ARM_PSCI_1_0_FN64_STAT_COUNT ARM_PSCI_0_2_FN64(17) +/* 1KB stack per core */ #define ARM_PSCI_STACK_SHIFT 10#define ARM_PSCI_STACK_SIZE (1 << ARM_PSCI_STACK_SHIFT)
Signature · 1 line
2.1.4
PATCH v3 3/5 ARMv8: Add basic PSCI framework
Quoted 7 lines · macro.wave.z at gmail.com
From: Hongbo Zhang <[email protected]>
This patch introduces a generic ARMv8 PSCI framework, with all functions returning a dummy
ARM_PSCI_RET_NI(Not Implemented), then it is up to each platform to implement their own functions based on this framework.Signed-off-by Hongbo Zhang <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161111/60944be4/attachment.sig>
PATCH v3 3/5 ARMv8: Add basic PSCI framework
Quoted 4 lines · Tom Rini
Quoted 2 lines · macro.wave.z at gmail.com
From: Hongbo Zhang <[email protected]>
Quoted 8 lines
Quoted 5 lines
This patch introduces a generic ARMv8 PSCI framework, with all functions returning a dummy
ARM_PSCI_RET_NI(Not Implemented), then it is up to each platform to implement their own functions based on this framework.Signed-off-by Hongbo Zhang <[email protected]>Reviewed-by Tom Rini <[email protected]>
Thanks Tom.
Quoted 2 lines
--
Tom
PATCH v3 4/5 ARMv8: Setup PSCI memory and device tree
In reply to macro.wave.z at gmail.comFrom: Hongbo Zhang <[email protected]>
The newly added ARMv8 PSCI needs to be initialized, be copied or reserved in right place, this patch does all the setup steps.
--- arch/arm/cpu/armv8/cpu-dt.c | 8 ++++++++ arch/arm/cpu/armv8/cpu.c | 22 ++++++++++++++++++++++ arch/arm/include/asm/secure.h | 2 +- arch/arm/include/asm/system.h | 11 +++++++++++ arch/arm/lib/bootm.c | 3 +++ arch/arm/lib/psci-dt.c | 2 +- 6 files changed, 46 insertions(+), 2 deletions(-)
arch/arm/cpu/armv8/cpu-dt.c +8 -0
@@ -6,6 +6,7 @@#include <common.h> #include <asm/psci.h> +#include <asm/system.h> #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT #include <asm/armv8/sec_firmware.h> #endif
@@ -25,6 +26,13 @@ int psci_update_dt(void *fdt)return 0 ;#endif fdt_psci (fdt); + +#ifndef CONFIG_ARMV8_SECURE_BASE +/* secure code lives in RAM, keep it alive */ +fdt_add_mem_rsv (fdt, (unsigned long )__secure_start, + __secure_end - __secure_start); +#endif +#endif #endif return 0 ;
arch/arm/cpu/armv8/cpu.c +22 -0
@@ -14,6 +14,7 @@#include <common.h> #include <command.h> #include <asm/system.h> +#include <asm/secure.h> #include <linux/compiler.h> int cleanup_before_linux (void )
@@ -41,3 +42,24 @@ int cleanup_before_linux(void)return 0 ; } + +#ifdef CONFIG_ARMV8_PSCI +static void relocate_secure_section (void ) +{ +#ifdef CONFIG_ARMV8_SECURE_BASE +size_t sz = __secure_end - __secure_start; + +memcpy ((void *)CONFIG_ARMV8_SECURE_BASE , __secure_start, sz); +flush_dcache_range (CONFIG_ARMV8_SECURE_BASE , +CONFIG_ARMV8_SECURE_BASE + sz +1 ); +invalidate_icache_all (); +#endif +} + +void armv8_setup_psci (void ) +{ +relocate_secure_section (); +secure_ram_addr (psci_setup_vectors)(); +secure_ram_addr (psci_arch_init)(); +} +#endif
arch/arm/include/asm/secure.h +1 -1
@@ -6,7 +6,7 @@#define __secure __attribute__ ((section ("._secure.text")))#define __secure_data __attribute__ ((section ("._secure.data"))) -#ifdef CONFIG_ARMV7_SECURE_BASE +#if defined(CONFIG_ARMV7_SECURE_BASE ) || defined(CONFIG_ARMV8_SECURE_BASE )/* * Warning, horror ahead. *
arch/arm/include/asm/system.h +11 -0
@@ -118,6 +118,17 @@ void smc_call(struct pt_regs *args);void __noreturn psci_system_reset (void );void __noreturn psci_system_off (void ); +#ifdef CONFIG_ARMV8_PSCI +extern char __secure_start[]; +extern char __secure_end[]; +extern char __secure_stack_start[]; +extern char __secure_stack_end[]; + +void armv8_setup_psci (void ); +void psci_setup_vectors (void ); +void psci_arch_init (void ); +#endif +#endif /* __ASSEMBLY__ */ #else /* CONFIG_ARM64 */
arch/arm/lib/bootm.c +3 -0
@@ -291,6 +291,9 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)announce_and_cleanup (fake);if (!fake) { +#ifdef CONFIG_ARMV8_PSCI +armv8_setup_psci (); +#endif do_nonsec_virt_switch ();kernel_entry (images->ft_addr,NULL ,NULL ,NULL ); }
arch/arm/lib/psci-dt.c +1 -1
@@ -65,7 +65,7 @@ int fdt_psci(void *fdt) init_psci_node: #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT psci_ver =sec_firmware_support_psci_version (); -#elif defined(CONFIG_ARMV7_PSCI_1_0) +#elif defined(CONFIG_ARMV7_PSCI_1_0) || defined(CONFIG_ARMV8_PSCI) psci_ver =ARM_PSCI_VER_1_0 ;#endif switch (psci_ver) {
Signature · 1 line
2.1.4
PATCH v3 4/5 ARMv8: Setup PSCI memory and device tree
Quoted 6 lines · macro.wave.z at gmail.com
From: Hongbo Zhang <[email protected]>
The newly added ARMv8 PSCI needs to be initialized, be copied or reserved in right place, this patch does all the setup steps.
Signed-off-by Hongbo Zhang <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161111/a0c8f301/attachment.sig>
PATCH v3 5/5 ARMv8: LS1043A: Enable LS1043A default PSCI support
In reply to macro.wave.z at gmail.comFrom: Hongbo Zhang <[email protected]>
A most basic PSCI implementation with only one psci_version is added for LS1043A, this can verify the generic PSCI framework, and more platform specific implementation will be added later.
--- arch/arm/cpu/armv8/fsl-layerscape/Makefile | 1 + arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20 ++++++++++++++++++++ board/freescale/ls1043ardb/Kconfig | 9 +++++++++ configs/ls1043ardb_defconfig | 3 +++ 4 files changed, 33 insertions(+) create mode 100644 arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
arch/arm/cpu/armv8/fsl-layerscape/Makefile +1 -0
@@ -28,6 +28,7 @@ endif ifneq ($(CONFIG_LS1043A),) obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o +obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o endif ifneq ($(CONFIG_ARCH_LS1012A),)
arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S new file +20 -0
@@ -0,0 +1,20 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * Author: Hongbo Zhang <[email protected]> + * + * SPDX-License-Identifier: GPL-2.0+ + * This file implements LS102X platform PSCI SYSTEM-SUSPEND function + */ + +#include <config.h> +#include <linux/linkage.h> +#include <asm/psci.h> + + .pushsection ._secure.text, "ax" + +.globl psci_version +psci_version: + ldr w0, =0x00010000 /* PSCI v1.0 */ + ret + + .popsection
board/freescale/ls1043ardb/Kconfig +9 -0
@@ -13,4 +13,13 @@ config SYS_SOC config SYS_CONFIG_NAME default "ls1043ardb" +config SYS_HAS_ARMV8_SECURE_BASE + bool "Enable secure RAM for PSCI image" + depends on ARMV8_PSCI + default y + help + PSCI image can be re-located to secure RAM. + If enabled, please also define the value for ARMV8_SECURE_BASE, + for LS1043ARDB, it is address in OCRAM. + endif
configs/ls1043ardb_defconfig +3 -0
@@ -28,3 +28,6 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_ARMV8_PSCI=y +CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4 +CONFIG_ARMV8_SECURE_BASE=0x10010000
Signature · 1 line
2.1.4
PATCH v3 5/5 ARMv8: LS1043A: Enable LS1043A default PSCI support
Quoted 7 lines · macro.wave.z at gmail.com
From: Hongbo Zhang <[email protected]>
A most basic PSCI implementation with only one
psci_versionis added for LS1043A, this can verify the generic PSCI framework, and more platform specific implementation will be added later.Signed-off-by Hongbo Zhang <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161111/39743604/attachment.sig>
PATCH v3 5/5 ARMv8: LS1043A: Enable LS1043A default PSCI support
In reply to macro.wave.z at gmail.comQuoted 77 lines · macro.wave.z at gmail.com
From: Hongbo Zhang <[email protected]>
A most basic PSCI implementation with only one
psci_versionis added for LS1043A, this can verify the generic PSCI framework, and more platform specific implementation will be added later.Signed-off-by Hongbo Zhang <[email protected]>--- arch/arm/cpu/armv8/fsl-layerscape/Makefile | 1 + arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20 ++++++++++++++++++++ board/freescale/ls1043ardb/Kconfig | 9 +++++++++ configs/ls1043ardb_defconfig | 3 +++ 4 files changed, 33 insertions(+) create mode 100644 arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.Sarch/arm/cpu/armv8/fsl-layerscape/Makefile +1
-0@@ -28,6 +28,7 @@ endif ifneq ($(CONFIG_LS1043A),) obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o +obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o endif ifneq ($(CONFIG_ARCH_LS1012A),)arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S new file +20
-0@@ -0,0 +1,20 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * Author: Hongbo Zhang <[email protected]> + * + * SPDX-License-Identifier: GPL-2.0+ + * This file implements LS102X platform PSCI SYSTEM-SUSPEND function + */ + +#include <config.h> +#include <linux/linkage.h> +#include <asm/psci.h> + + .pushsection ._secure.text, "ax" + +.globl psci_version +psci_version: + ldr w0, =0x00010000 /* PSCI v1.0 */ + ret + + .popsectionboard/freescale/ls1043ardb/Kconfig +9
-0@@ -13,4 +13,13 @@ config SYS_SOC config SYS_CONFIG_NAME default "ls1043ardb" +config SYS_HAS_ARMV8_SECURE_BASE + bool "Enable secure RAM for PSCI image" + depends on ARMV8_PSCI + default y + help + PSCI image can be re-located to secure RAM. + If enabled, please also define the value for ARMV8_SECURE_BASE, + for LS1043ARDB, it is address in OCRAM. + endifconfigs/ls1043ardb_defconfig +0
-0
configs/ls1043ardb_defconfig CONFIG_DM_USB=y · line 33
Quoted 6 lines
configs/ls1043ardb_defconfig +3
-0@@ -28,3 +28,6 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_ARMV8_PSCI=y +CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4 +CONFIG_ARMV8_SECURE_BASE=0x10010000
How do you decide the CONFIG_ARMV8_SECURE_BASE?
Zhiqiang,
Does this patch set interfere with existing PPA support?
York
PATCH v3 5/5 ARMv8: LS1043A: Enable LS1043A default PSCI support
Quoted 78 lines · york sun
Quoted 77 lines · macro.wave.z at gmail.com
From: Hongbo Zhang <[email protected]>
A most basic PSCI implementation with only one
psci_versionis added for LS1043A, this can verify the generic PSCI framework, and more platform specific implementation will be added later.Signed-off-by Hongbo Zhang <[email protected]>--- arch/arm/cpu/armv8/fsl-layerscape/Makefile | 1 + arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20 ++++++++++++++++++++ board/freescale/ls1043ardb/Kconfig | 9 +++++++++ configs/ls1043ardb_defconfig | 3 +++ 4 files changed, 33 insertions(+) create mode 100644 arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.Sarch/arm/cpu/armv8/fsl-layerscape/Makefile +1
-0@@ -28,6 +28,7 @@ endif ifneq ($(CONFIG_LS1043A),) obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o +obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o endif ifneq ($(CONFIG_ARCH_LS1012A),)arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S new file +20
-0@@ -0,0 +1,20 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * Author: Hongbo Zhang <[email protected]> + * + * SPDX-License-Identifier: GPL-2.0+ + * This file implements LS102X platform PSCI SYSTEM-SUSPEND function + */ + +#include <config.h> +#include <linux/linkage.h> +#include <asm/psci.h> + + .pushsection ._secure.text, "ax" + +.globl psci_version +psci_version: + ldr w0, =0x00010000 /* PSCI v1.0 */ + ret + + .popsectionboard/freescale/ls1043ardb/Kconfig +9
-0@@ -13,4 +13,13 @@ config SYS_SOC config SYS_CONFIG_NAME default "ls1043ardb" +config SYS_HAS_ARMV8_SECURE_BASE + bool "Enable secure RAM for PSCI image" + depends on ARMV8_PSCI + default y + help + PSCI image can be re-located to secure RAM. + If enabled, please also define the value for ARMV8_SECURE_BASE, + for LS1043ARDB, it is address in OCRAM. + endifconfigs/ls1043ardb_defconfig +0
-0@@ -28,3 +28,6 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y
Quoted 9 lines
configs/ls1043ardb_defconfig CONFIG_DM_USB=y · line 33
Quoted 6 lines
configs/ls1043ardb_defconfig +3
-0CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_ARMV8_PSCI=y +CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4 +CONFIG_ARMV8_SECURE_BASE=0x10010000How do you decide the
CONFIG_ARMV8_SECURE_BASE?
It is OCRAM1, just like ARMv7 LS1021.
Quoted 5 lines
Zhiqiang,
Does this patch set interfere with existing PPA support?
York
PATCH v3 5/5 ARMv8: LS1043A: Enable LS1043A default PSCI support
In reply to york sunHi York
Quoted 100 lines
-----Original Message-----
From: york sun
Sent: 2016?11?15? 2:12
To: macro.wave.z at gmail.com; u-boot at lists.denx.de; trini at konsulko.com; Z.Q. Hou <[email protected]>
Cc: wens at csie.org; H.B. Zhang <[email protected]>
Subject: Re: [PATCH v3 5/5] ARMv8: LS1043A: Enable LS1043A default PSCI supportQuoted 10 lines · macro.wave.z at gmail.com
From: Hongbo Zhang <[email protected]>
A most basic PSCI implementation with only one
psci_versionis added for LS1043A, this can verify the generic PSCI framework, and more platform specific implementation will be added later.Signed-off-by Hongbo Zhang <[email protected]>--- arch/arm/cpu/armv8/fsl-layerscape/Makefile | 1 + arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20++++++++++++++++++++
Quoted 70 lines
board/freescale/ls1043ardb/Kconfig | 9 +++++++++ configs/ls1043ardb_defconfig | 3 +++ 4 files changed, 33 insertions(+) create mode 100644 arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.Sarch/arm/cpu/armv8/fsl-layerscape/Makefile +1
-0@@ -28,6 +28,7 @@ endif ifneq ($(CONFIG_LS1043A),) obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o +obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o endif ifneq ($(CONFIG_ARCH_LS1012A),)arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S new file +20
-0@@ -0,0 +1,20 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * Author: Hongbo Zhang <[email protected]> + * + * SPDX-License-Identifier: GPL-2.0+ + * This file implements LS102X platform PSCI SYSTEM-SUSPEND function +*/ + +#include <config.h> +#include <linux/linkage.h> +#include <asm/psci.h> + + .pushsection ._secure.text, "ax" + +.globl psci_version +psci_version: + ldr w0, =0x00010000 /* PSCI v1.0 */ + ret + + .popsectionboard/freescale/ls1043ardb/Kconfig +9
-0@@ -13,4 +13,13 @@ config SYS_SOC config SYS_CONFIG_NAME default "ls1043ardb" +config SYS_HAS_ARMV8_SECURE_BASE + bool "Enable secure RAM for PSCI image" + depends on ARMV8_PSCI + default y + help + PSCI image can be re-located to secure RAM. + If enabled, please also define the value for ARMV8_SECURE_BASE, + for LS1043ARDB, it is address in OCRAM. + endif(quoted diff) +0
-0b/configs/ls1043ardb_defconfig index 79a4eb2..cb189f3 100644
configs/ls1043ardb_defconfig CONFIG_DM_USB=y · line 33
Quoted 6 lines
configs/ls1043ardb_defconfig +3
-0@@ -28,3 +28,6 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_ARMV8_PSCI=y +CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4 +CONFIG_ARMV8_SECURE_BASE=0x10010000How do you decide the
CONFIG_ARMV8_SECURE_BASE?
Quoted 3 lines
Zhiqiang,
Does this patch set interfere with existing PPA support?
Tried Hongbo's patches with PPA enabled on ls1043ardb, kernel boot failed.
I guess hongbo's u-boot psci setup triggered an exception, because when PPA is initialized u-boot will execute on EL2.
Hongbo, how did you process this circumstance? Another problem, if PPA is disabled, u-boot will go through the spin-table process to wake up secondary cores, will this affect u-boot psci?
Thanks,
Zhiqiang
PATCH v3 5/5 ARMv8: LS1043A: Enable LS1043A default PSCI support
Quoted 102 lines · Z.Q. Hou
Hi York
Quoted 100 lines
-----Original Message-----
From: york sun
Sent: 2016?11?15? 2:12
To: macro.wave.z at gmail.com; u-boot at lists.denx.de; trini at konsulko.com; Z.Q. Hou <[email protected]>
Cc: wens at csie.org; H.B. Zhang <[email protected]>
Subject: Re: [PATCH v3 5/5] ARMv8: LS1043A: Enable LS1043A default PSCI supportQuoted 10 lines · macro.wave.z at gmail.com
From: Hongbo Zhang <[email protected]>
A most basic PSCI implementation with only one
psci_versionis added for LS1043A, this can verify the generic PSCI framework, and more platform specific implementation will be added later.Signed-off-by Hongbo Zhang <[email protected]>--- arch/arm/cpu/armv8/fsl-layerscape/Makefile | 1 + arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20++++++++++++++++++++
Quoted 70 lines
board/freescale/ls1043ardb/Kconfig | 9 +++++++++ configs/ls1043ardb_defconfig | 3 +++ 4 files changed, 33 insertions(+) create mode 100644 arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.Sarch/arm/cpu/armv8/fsl-layerscape/Makefile +1
-0@@ -28,6 +28,7 @@ endif ifneq ($(CONFIG_LS1043A),) obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o +obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o endif ifneq ($(CONFIG_ARCH_LS1012A),)arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S new file +20
-0@@ -0,0 +1,20 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * Author: Hongbo Zhang <[email protected]> + * + * SPDX-License-Identifier: GPL-2.0+ + * This file implements LS102X platform PSCI SYSTEM-SUSPEND function +*/ + +#include <config.h> +#include <linux/linkage.h> +#include <asm/psci.h> + + .pushsection ._secure.text, "ax" + +.globl psci_version +psci_version: + ldr w0, =0x00010000 /* PSCI v1.0 */ + ret + + .popsectionboard/freescale/ls1043ardb/Kconfig +9
-0@@ -13,4 +13,13 @@ config SYS_SOC config SYS_CONFIG_NAME default "ls1043ardb" +config SYS_HAS_ARMV8_SECURE_BASE + bool "Enable secure RAM for PSCI image" + depends on ARMV8_PSCI + default y + help + PSCI image can be re-located to secure RAM. + If enabled, please also define the value for ARMV8_SECURE_BASE, + for LS1043ARDB, it is address in OCRAM. + endif(quoted diff) +0
-0b/configs/ls1043ardb_defconfig index 79a4eb2..cb189f3 100644
configs/ls1043ardb_defconfig CONFIG_DM_USB=y · line 33
Quoted 6 lines
configs/ls1043ardb_defconfig +3
-0@@ -28,3 +28,6 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_ARMV8_PSCI=y +CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4 +CONFIG_ARMV8_SECURE_BASE=0x10010000How do you decide the
CONFIG_ARMV8_SECURE_BASE?
Quoted 8 lines
Quoted 3 lines
Zhiqiang,
Does this patch set interfere with existing PPA support?
Tried Hongbo's patches with PPA enabled on ls1043ardb, kernel boot failed.
I guess hongbo's u-boot psci setup triggered an exception, because when PPA is initialized u-boot will execute on EL2.Hongbo, how did you process this circumstance? Another problem, if PPA is disabled, u-boot will go through the spin-table process to wake up secondary cores, will this affect u-boot psci?
My psci setup doesn't trigger any exception at all.
and about secondary core booting, currently my psci doesn't cover this, it is planned next.
Quoted 3 lines
Thanks,
Zhiqiang
PATCH v3 5/5 ARMv8: LS1043A: Enable LS1043A default PSCI support
Hi Hongbo,
Quoted 121 lines
-----Original Message-----
From: Hongbo Zhang [mailto:macro.wave.z at gmail.com]
Sent: 2016?11?15? 18:29
To: Z.Q. Hou <[email protected]>
Cc: york sun <[email protected]>; u-boot at lists.denx.de; trini at konsulko.com; wens at csie.org; H.B. Zhang <[email protected]>
Subject: Re: [PATCH v3 5/5] ARMv8: LS1043A: Enable LS1043A default PSCI supportQuoted 103 lines · Z.Q. Hou
Hi York
Quoted 101 lines
-----Original Message-----
From: york sun
Sent: 2016?11?15? 2:12
To: macro.wave.z at gmail.com; u-boot at lists.denx.de; trini at konsulko.com; Z.Q. Hou <[email protected]>
Cc: wens at csie.org; H.B. Zhang <[email protected]>
Subject: Re: [PATCH v3 5/5] ARMv8: LS1043A: Enable LS1043A default PSCI supportQuoted 10 lines · macro.wave.z at gmail.com
From: Hongbo Zhang <[email protected]>
A most basic PSCI implementation with only one
psci_versionis added for LS1043A, this can verify the generic PSCI framework, and more platform specific implementation will be added later.Signed-off-by Hongbo Zhang <[email protected]>--- arch/arm/cpu/armv8/fsl-layerscape/Makefile | 1 + arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20++++++++++++++++++++
Quoted 71 lines
board/freescale/ls1043ardb/Kconfig | 9 +++++++++ configs/ls1043ardb_defconfig | 3 +++ 4 files changed, 33 insertions(+) create mode 100644
arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.Sarch/arm/cpu/armv8/fsl-layerscape/Makefile +1
-0@@ -28,6 +28,7 @@ endif ifneq ($(CONFIG_LS1043A),) obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o +obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o endif ifneq ($(CONFIG_ARCH_LS1012A),)arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S new file +20
-0@@ -0,0 +1,20 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * Author: Hongbo Zhang <[email protected]> + * + * SPDX-License-Identifier: GPL-2.0+ + * This file implements LS102X platform PSCI SYSTEM-SUSPEND +function */ + +#include <config.h> +#include <linux/linkage.h> +#include <asm/psci.h> + + .pushsection ._secure.text, "ax" + +.globl psci_version +psci_version: + ldr w0, =0x00010000 /* PSCI v1.0 */ + ret + + .popsectionboard/freescale/ls1043ardb/Kconfig +9
-0@@ -13,4 +13,13 @@ config SYS_SOC config SYS_CONFIG_NAME default "ls1043ardb" +config SYS_HAS_ARMV8_SECURE_BASE + bool "Enable secure RAM for PSCI image" + depends on ARMV8_PSCI + default y + help + PSCI image can be re-located to secure RAM. + If enabled, please also define the value for ARMV8_SECURE_BASE, + for LS1043ARDB, it is address in OCRAM. + endif(quoted diff) +0
-0b/configs/ls1043ardb_defconfig index 79a4eb2..cb189f3 100644
configs/ls1043ardb_defconfig CONFIG_DM_USB=y · line 33
Quoted 6 lines
configs/ls1043ardb_defconfig +3
-0@@ -28,3 +28,6 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_ARMV8_PSCI=y +CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4 +CONFIG_ARMV8_SECURE_BASE=0x10010000How do you decide the
CONFIG_ARMV8_SECURE_BASE?Quoted 6 lines
Quoted 3 lines
Zhiqiang,
Does this patch set interfere with existing PPA support?
Tried Hongbo's patches with PPA enabled on ls1043ardb, kernel boot failed. I guess hongbo's u-boot psci setup triggered an exception, because when
PPA is initialized u-boot will execute on EL2.
Quoted 1 line
Quoted 7 lines
Quoted 1 line
Hongbo, how did you process this circumstance? Another problem, if PPA is
disabled, u-boot will go through the spin-table process to wake up secondary cores, will this affect u-boot psci?
My psci setup doesn't trigger any exception at all.
and about secondary core booting, currently my psci doesn't cover this, it is planned next.
Did you enabled PPA in your experiment? In my side, when PPA initialized the psci setup will trigger exception.
Thanks,
Zhiqiang
PATCH v3 5/5 ARMv8: LS1043A: Enable LS1043A default PSCI support
Then my previous v2 1/6 was right, I should not cancel it.
https://patchwork.ozlabs.org/patch/689804/
Tom, York,
I'll have to re-send this patch set with previous 1/6 included again, with some updates Tom mentioned, e.g move the macros touched into Kconfig although those configs were not created by me.
Comments are still welcome before I send patches out early next week.
Thanks all.
Quoted 135 lines · Z.Q. Hou
Hi Hongbo,
Quoted 121 lines
-----Original Message-----
From: Hongbo Zhang [mailto:macro.wave.z at gmail.com]
Sent: 2016?11?15? 18:29
To: Z.Q. Hou <[email protected]>
Cc: york sun <[email protected]>; u-boot at lists.denx.de; trini at konsulko.com; wens at csie.org; H.B. Zhang <[email protected]>
Subject: Re: [PATCH v3 5/5] ARMv8: LS1043A: Enable LS1043A default PSCI supportQuoted 103 lines · Z.Q. Hou
Hi York
Quoted 101 lines
-----Original Message-----
From: york sun
Sent: 2016?11?15? 2:12
To: macro.wave.z at gmail.com; u-boot at lists.denx.de; trini at konsulko.com; Z.Q. Hou <[email protected]>
Cc: wens at csie.org; H.B. Zhang <[email protected]>
Subject: Re: [PATCH v3 5/5] ARMv8: LS1043A: Enable LS1043A default PSCI supportQuoted 10 lines · macro.wave.z at gmail.com
From: Hongbo Zhang <[email protected]>
A most basic PSCI implementation with only one
psci_versionis added for LS1043A, this can verify the generic PSCI framework, and more platform specific implementation will be added later.Signed-off-by Hongbo Zhang <[email protected]>--- arch/arm/cpu/armv8/fsl-layerscape/Makefile | 1 + arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20++++++++++++++++++++
Quoted 71 lines
board/freescale/ls1043ardb/Kconfig | 9 +++++++++ configs/ls1043ardb_defconfig | 3 +++ 4 files changed, 33 insertions(+) create mode 100644
arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.Sarch/arm/cpu/armv8/fsl-layerscape/Makefile +1
-0@@ -28,6 +28,7 @@ endif ifneq ($(CONFIG_LS1043A),) obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o +obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o endif ifneq ($(CONFIG_ARCH_LS1012A),)arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S new file +20
-0@@ -0,0 +1,20 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * Author: Hongbo Zhang <[email protected]> + * + * SPDX-License-Identifier: GPL-2.0+ + * This file implements LS102X platform PSCI SYSTEM-SUSPEND +function */ + +#include <config.h> +#include <linux/linkage.h> +#include <asm/psci.h> + + .pushsection ._secure.text, "ax" + +.globl psci_version +psci_version: + ldr w0, =0x00010000 /* PSCI v1.0 */ + ret + + .popsectionboard/freescale/ls1043ardb/Kconfig +9
-0@@ -13,4 +13,13 @@ config SYS_SOC config SYS_CONFIG_NAME default "ls1043ardb" +config SYS_HAS_ARMV8_SECURE_BASE + bool "Enable secure RAM for PSCI image" + depends on ARMV8_PSCI + default y + help + PSCI image can be re-located to secure RAM. + If enabled, please also define the value for ARMV8_SECURE_BASE, + for LS1043ARDB, it is address in OCRAM. + endif(quoted diff) +0
-0b/configs/ls1043ardb_defconfig index 79a4eb2..cb189f3 100644
configs/ls1043ardb_defconfig CONFIG_DM_USB=y · line 33
Quoted 6 lines
configs/ls1043ardb_defconfig +3
-0@@ -28,3 +28,6 @@ CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_STORAGE=y +CONFIG_ARMV8_PSCI=y +CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4 +CONFIG_ARMV8_SECURE_BASE=0x10010000How do you decide the
CONFIG_ARMV8_SECURE_BASE?Quoted 6 lines
Quoted 3 lines
Zhiqiang,
Does this patch set interfere with existing PPA support?
Tried Hongbo's patches with PPA enabled on ls1043ardb, kernel boot failed. I guess hongbo's u-boot psci setup triggered an exception, because when
PPA is initialized u-boot will execute on EL2.
Quoted 1 line
Quoted 7 lines
Quoted 1 line
Hongbo, how did you process this circumstance? Another problem, if PPA is
disabled, u-boot will go through the spin-table process to wake up secondary cores, will this affect u-boot psci?
My psci setup doesn't trigger any exception at all.
and about secondary core booting, currently my psci doesn't cover this, it is planned next.Did you enabled PPA in your experiment? In my side, when PPA initialized the psci setup will trigger exception.
Thanks,
Zhiqiang