]> git.sur5r.net Git - u-boot/commitdiff
ARMv7: PSCI: add PSCI v1.0 functions skeleton
authorHongbo Zhang <hongbo.zhang@nxp.com>
Thu, 21 Jul 2016 10:09:36 +0000 (18:09 +0800)
committerYork Sun <york.sun@nxp.com>
Tue, 26 Jul 2016 16:02:39 +0000 (09:02 -0700)
This patch adds all the PSCI v1.0 functions in to the common framework, with
all the functions returning "not implemented" by default, as a common framework
all the dummy functions are added here, it is up to every platform developer to
decide which version of PSCI and which functions to implement.

Signed-off-by: Hongbo Zhang <hongbo.zhang@nxp.com>
Signed-off-by: Wang Dongsheng <dongsheng.wang@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: York Sun <york.sun@nxp.com>
arch/arm/cpu/armv7/psci.S
arch/arm/include/asm/psci.h

index 350b75ce20e888e3512c9f46f6dbe157f38aafb1..f80f6e20d1ecee25edf17a7a12f59081f997d198 100644 (file)
@@ -46,20 +46,62 @@ ENTRY(default_psci_vector)
 ENDPROC(default_psci_vector)
 .weak default_psci_vector
 
+ENTRY(psci_version)
 ENTRY(psci_cpu_suspend)
 ENTRY(psci_cpu_off)
 ENTRY(psci_cpu_on)
+ENTRY(psci_affinity_info)
 ENTRY(psci_migrate)
+ENTRY(psci_migrate_info_type)
+ENTRY(psci_migrate_info_up_cpu)
+ENTRY(psci_system_off)
+ENTRY(psci_system_reset)
+ENTRY(psci_features)
+ENTRY(psci_cpu_freeze)
+ENTRY(psci_cpu_default_suspend)
+ENTRY(psci_node_hw_state)
+ENTRY(psci_system_suspend)
+ENTRY(psci_set_suspend_mode)
+ENTRY(psi_stat_residency)
+ENTRY(psci_stat_count)
        mov     r0, #ARM_PSCI_RET_NI    @ Return -1 (Not Implemented)
        mov     pc, lr
+ENDPROC(psci_stat_count)
+ENDPROC(psi_stat_residency)
+ENDPROC(psci_set_suspend_mode)
+ENDPROC(psci_system_suspend)
+ENDPROC(psci_node_hw_state)
+ENDPROC(psci_cpu_default_suspend)
+ENDPROC(psci_cpu_freeze)
+ENDPROC(psci_features)
+ENDPROC(psci_system_reset)
+ENDPROC(psci_system_off)
+ENDPROC(psci_migrate_info_up_cpu)
+ENDPROC(psci_migrate_info_type)
 ENDPROC(psci_migrate)
+ENDPROC(psci_affinity_info)
 ENDPROC(psci_cpu_on)
 ENDPROC(psci_cpu_off)
 ENDPROC(psci_cpu_suspend)
+ENDPROC(psci_version)
+.weak psci_version
 .weak psci_cpu_suspend
 .weak psci_cpu_off
 .weak psci_cpu_on
+.weak psci_affinity_info
 .weak psci_migrate
+.weak psci_migrate_info_type
+.weak psci_migrate_info_up_cpu
+.weak psci_system_off
+.weak psci_system_reset
+.weak psci_features
+.weak psci_cpu_freeze
+.weak psci_cpu_default_suspend
+.weak psci_node_hw_state
+.weak psci_system_suspend
+.weak psci_set_suspend_mode
+.weak psi_stat_residency
+.weak psci_stat_count
 
 _psci_table:
        .word   ARM_PSCI_FN_CPU_SUSPEND
@@ -70,6 +112,42 @@ _psci_table:
        .word   psci_cpu_on
        .word   ARM_PSCI_FN_MIGRATE
        .word   psci_migrate
+       .word   ARM_PSCI_0_2_FN_PSCI_VERSION
+       .word   psci_version
+       .word   ARM_PSCI_0_2_FN_CPU_SUSPEND
+       .word   psci_cpu_suspend
+       .word   ARM_PSCI_0_2_FN_CPU_OFF
+       .word   psci_cpu_off
+       .word   ARM_PSCI_0_2_FN_CPU_ON
+       .word   psci_cpu_on
+       .word   ARM_PSCI_0_2_FN_AFFINITY_INFO
+       .word   psci_affinity_info
+       .word   ARM_PSCI_0_2_FN_MIGRATE
+       .word   psci_migrate
+       .word   ARM_PSCI_0_2_FN_MIGRATE_INFO_TYPE
+       .word   psci_migrate_info_type
+       .word   ARM_PSCI_0_2_FN_MIGRATE_INFO_UP_CPU
+       .word   psci_migrate_info_up_cpu
+       .word   ARM_PSCI_0_2_FN_SYSTEM_OFF
+       .word   psci_system_off
+       .word   ARM_PSCI_0_2_FN_SYSTEM_RESET
+       .word   psci_system_reset
+       .word   ARM_PSCI_1_0_FN_PSCI_FEATURES
+       .word   psci_features
+       .word   ARM_PSCI_1_0_FN_CPU_FREEZE
+       .word   psci_cpu_freeze
+       .word   ARM_PSCI_1_0_FN_CPU_DEFAULT_SUSPEND
+       .word   psci_cpu_default_suspend
+       .word   ARM_PSCI_1_0_FN_NODE_HW_STATE
+       .word   psci_node_hw_state
+       .word   ARM_PSCI_1_0_FN_SYSTEM_SUSPEND
+       .word   psci_system_suspend
+       .word   ARM_PSCI_1_0_FN_SET_SUSPEND_MODE
+       .word   psci_set_suspend_mode
+       .word   ARM_PSCI_1_0_FN_STAT_RESIDENCY
+       .word   psi_stat_residency
+       .word   ARM_PSCI_1_0_FN_STAT_COUNT
+       .word   psci_stat_count
        .word   0
        .word   0
 
index e76ecb27a7fc0bdb3a8b3e2455b6b67f3f4902fa..25ea44d85d60a037c80b8a76662d2d405f2bd288 100644 (file)
 #define ARM_PSCI_RET_NI                        (-1)
 #define ARM_PSCI_RET_INVAL             (-2)
 #define ARM_PSCI_RET_DENIED            (-3)
+#define ARM_PSCI_RET_ALREADY_ON                (-4)
+#define ARM_PSCI_RET_ON_PENDING                (-5)
+#define ARM_PSCI_RET_INTERNAL_FAILURE  (-6)
+#define ARM_PSCI_RET_NOT_PRESENT       (-7)
+#define ARM_PSCI_RET_DISABLED          (-8)
+#define ARM_PSCI_RET_INVALID_ADDRESS   (-9)
 
 /* PSCI 0.2 interface */
 #define ARM_PSCI_0_2_FN_BASE                   0x84000000
 #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)
 
+/* 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)
+#define ARM_PSCI_1_0_FN_CPU_DEFAULT_SUSPEND    ARM_PSCI_0_2_FN(12)
+#define ARM_PSCI_1_0_FN_NODE_HW_STATE          ARM_PSCI_0_2_FN(13)
+#define ARM_PSCI_1_0_FN_SYSTEM_SUSPEND         ARM_PSCI_0_2_FN(14)
+#define ARM_PSCI_1_0_FN_SET_SUSPEND_MODE       ARM_PSCI_0_2_FN(15)
+#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)
+
 /* 1KB stack per core */
 #define ARM_PSCI_STACK_SHIFT   10
 #define ARM_PSCI_STACK_SIZE    (1 << ARM_PSCI_STACK_SHIFT)