[U-Boot] [PATCH 4/4] imx: mx7: add psci_features support

Anson Huang Anson.Huang at nxp.com
Mon May 28 06:17:42 UTC 2018


It is necessary to implement psci_features callback
to report supported features for linux kernel to
decide whether to proceed psci calls, for example,
linux deep sleep mode is ONLY entered when psci_features
returns TRUE when linux kernel checks whether
system suspend is supported by calling psci_features,
otherwise, s2idle will be entered instead.

Signed-off-by: Anson Huang <Anson.Huang at nxp.com>
---
 arch/arm/mach-imx/mx7/psci.S | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm/mach-imx/mx7/psci.S b/arch/arm/mach-imx/mx7/psci.S
index cbe6781..694cef7 100644
--- a/arch/arm/mach-imx/mx7/psci.S
+++ b/arch/arm/mach-imx/mx7/psci.S
@@ -23,6 +23,22 @@
 
 	.arch_extension sec
 
+imx_psci_supported_table:
+	.word	ARM_PSCI_0_2_FN_CPU_OFF
+	.word	ARM_PSCI_RET_SUCCESS
+	.word	ARM_PSCI_0_2_FN_CPU_ON
+	.word	ARM_PSCI_RET_SUCCESS
+	.word	ARM_PSCI_0_2_FN_AFFINITY_INFO
+	.word	ARM_PSCI_RET_SUCCESS
+	.word	ARM_PSCI_0_2_FN_SYSTEM_OFF
+	.word	ARM_PSCI_RET_SUCCESS
+	.word	ARM_PSCI_0_2_FN_SYSTEM_RESET
+	.word	ARM_PSCI_RET_SUCCESS
+	.word	ARM_PSCI_1_0_FN_SYSTEM_SUSPEND
+	.word	ARM_PSCI_RET_SUCCESS
+	.word	0
+	.word	ARM_PSCI_RET_NI
+
 .global ddrc_enter_self_refresh
 ddrc_enter_self_refresh:
 	/* let DDR out of self-refresh */
@@ -112,6 +128,20 @@ v7_invalidate_l1:
        isb
        mov	pc, lr
 
+.globl	psci_features
+psci_features:
+	adr	r2, imx_psci_supported_table
+1:	ldr	r3, [r2]
+	cmp	r3, #0
+	beq	out_psci_features
+	cmp	r1, r3
+	addne	r2, r2, #8
+	bne	1b
+
+out_psci_features:
+	ldr	r0, [r2, #4]
+	bx	lr
+
 .globl psci_cpu_on
 psci_cpu_on:
 	push	{r4, r5, lr}
-- 
2.7.4



More information about the U-Boot mailing list