mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-06 12:53:21 +09:00
ARM: Put target PC for PSCI CPU_ON on per-CPU stack
Use a per-CPU variable for saving the target PC during CPU_ON operations. This allows us to run this service independently on targets that have more than 2 cores and also core-local power control. CC: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Tested-by: Thierry Reding <treding@nvidia.com> Tested-by: Ian Campbell <ijc@hellion.org.uk> Signed-off-by: Tom Warren <twarren@nvidia.com>
This commit is contained in:
parent
4c681a3d22
commit
3317b988b1
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <linux/linkage.h>
|
#include <linux/linkage.h>
|
||||||
|
#include <asm/macro.h>
|
||||||
#include <asm/psci.h>
|
#include <asm/psci.h>
|
||||||
|
|
||||||
.pushsection ._secure.text, "ax"
|
.pushsection ._secure.text, "ax"
|
||||||
@ -202,6 +203,7 @@ ENTRY(psci_get_cpu_stack_top)
|
|||||||
add r5, r5, #0x2000 @ Skip two pages
|
add r5, r5, #0x2000 @ Skip two pages
|
||||||
lsr r5, r5, #12 @ Align to start of page
|
lsr r5, r5, #12 @ Align to start of page
|
||||||
lsl r5, r5, #12
|
lsl r5, r5, #12
|
||||||
|
sub r5, r5, #4 @ reserve 1 word for target PC
|
||||||
sub r0, r5, r0 @ here's our stack!
|
sub r0, r5, r0 @ here's our stack!
|
||||||
|
|
||||||
bx lr
|
bx lr
|
||||||
@ -212,13 +214,10 @@ ENTRY(psci_cpu_entry)
|
|||||||
|
|
||||||
bl _nonsec_init
|
bl _nonsec_init
|
||||||
|
|
||||||
adr r0, _psci_target_pc
|
bl psci_get_cpu_id @ CPU ID => r0
|
||||||
ldr r0, [r0]
|
bl psci_get_cpu_stack_top @ stack top => r0
|
||||||
|
ldr r0, [r0] @ target PC at stack top
|
||||||
b _do_nonsec_entry
|
b _do_nonsec_entry
|
||||||
ENDPROC(psci_cpu_entry)
|
ENDPROC(psci_cpu_entry)
|
||||||
|
|
||||||
.globl _psci_target_pc
|
|
||||||
_psci_target_pc:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
.popsection
|
.popsection
|
||||||
|
@ -139,8 +139,11 @@ out: mcr p15, 0, r7, c1, c1, 0
|
|||||||
@ r2 = target PC
|
@ r2 = target PC
|
||||||
.globl psci_cpu_on
|
.globl psci_cpu_on
|
||||||
psci_cpu_on:
|
psci_cpu_on:
|
||||||
ldr r0, =_psci_target_pc
|
push {lr}
|
||||||
str r2, [r0]
|
|
||||||
|
mov r0, r1
|
||||||
|
bl psci_get_cpu_stack_top @ get stack top of target CPU
|
||||||
|
str r2, [r0] @ store target PC at stack top
|
||||||
dsb
|
dsb
|
||||||
|
|
||||||
movw r0, #(SUN7I_CPUCFG_BASE & 0xffff)
|
movw r0, #(SUN7I_CPUCFG_BASE & 0xffff)
|
||||||
@ -195,7 +198,7 @@ psci_cpu_on:
|
|||||||
str r6, [r0, #0x1e4]
|
str r6, [r0, #0x1e4]
|
||||||
|
|
||||||
mov r0, #ARM_PSCI_RET_SUCCESS @ Return PSCI_RET_SUCCESS
|
mov r0, #ARM_PSCI_RET_SUCCESS @ Return PSCI_RET_SUCCESS
|
||||||
mov pc, lr
|
pop {pc}
|
||||||
|
|
||||||
.globl psci_cpu_off
|
.globl psci_cpu_off
|
||||||
psci_cpu_off:
|
psci_cpu_off:
|
||||||
|
Loading…
Reference in New Issue
Block a user