[U-Boot] [PATCH 2/9] ARM: Factor out reusable psci_cpu_entry

Jan Kiszka jan.kiszka at web.de
Sun Feb 15 07:29:26 CET 2015


On 2015-02-15 03:01, Chen-Yu Tsai wrote:
> Hi,
> 
> On Sun, Feb 15, 2015 at 5:28 AM, Jan Kiszka <jan.kiszka at web.de> wrote:
>> From: Jan Kiszka <jan.kiszka at siemens.com>
>>
>> _sunxi_cpu_entry can be converted completely into a reusable
>> psci_cpu_entry. Tegra124 will use it as well.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka at siemens.com>
>> ---
>>  arch/arm/cpu/armv7/psci.S       | 19 +++++++++++++++++++
>>  arch/arm/cpu/armv7/sunxi/psci.S | 21 ++-------------------
>>  2 files changed, 21 insertions(+), 19 deletions(-)
>>
>> diff --git a/arch/arm/cpu/armv7/psci.S b/arch/arm/cpu/armv7/psci.S
>> index d688607..e916d71 100644
>> --- a/arch/arm/cpu/armv7/psci.S
>> +++ b/arch/arm/cpu/armv7/psci.S
>> @@ -170,4 +170,23 @@ ENTRY(psci_cpu_off_common)
>>         bx      lr
>>  ENDPROC(psci_cpu_off_common)
>>
>> +ENTRY(psci_cpu_entry)
>> +       @ Set SMP bit
>> +       mrc     p15, 0, r0, c1, c0, 1           @ ACTLR
>> +       orr     r0, r0, #(1 << 6)               @ Set SMP bit
>> +       mcr     p15, 0, r0, c1, c0, 1           @ ACTLR
>> +       isb
>> +
>> +       bl      _nonsec_init
>> +       bl      psci_arch_init
>> +
>> +       adr     r0, _psci_target_pc
>> +       ldr     r0, [r0]
>> +       b       _do_nonsec_entry
>> +ENDPROC(psci_cpu_entry)
>> +
>> +.globl _psci_target_pc
>> +_psci_target_pc:
>> +       .word   0
> 
> The sunxi version didn't have a per-core target_pc variable.
> It is still the case here. Is this the correct way to implement
> it? I see per-core storage of this in some of the kernel's smp
> ops.
> 
> On sunxi it works because the only platform using it only has
> one secondary core.
> 

With homogeneous SMP, it probably works as well because reset vectors
may not differ across the cores. But this remains a valid point.

I'm considering to push this variable to the top of the per-CPU stack.
Calculating the stack position is actually another function to factor out.

Thanks,
Jan


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150215/6a393c34/attachment.sig>


More information about the U-Boot mailing list