[U-Boot] [PATCH] arm: Tegra2: add support for A9 CPU init
Tom Warren
twarren.nvidia at gmail.com
Mon Mar 14 17:15:40 CET 2011
Albert,
On Sun, Mar 13, 2011 at 10:46 AM, Albert ARIBAUD <albert.aribaud at free.fr> wrote:
> Le 16/02/2011 21:26, Tom Warren a écrit :
>>
>> Signed-off-by: Tom Warren<twarren at nvidia.com>
>> ---
>> arch/arm/cpu/armv7/start.S | 6 +
>> arch/arm/cpu/armv7/tegra2/Makefile | 2 +-
>
>> arch/arm/cpu/armv7/tegra2/ap20.c | 490
>> ++++++++++++++++++++++++++++
>
> This one has an extra empty line at end of file.
>
Thanks - I'll remove it.
>> +void cold_boot(void)
>> +{
>> + asm volatile(
>> +
>> + "msr cpsr_c, #0xd3 \n"
>> + /*
>> + * Check current processor: CPU or AVP?
>> + * If AVP, go to AVP boot code, else continue on.
>> + */
>> + "mov r0, %0 \n"
>> + "ldrb r2, [r0, %1] \n"
>> + /* are we the CPU? */
>> + "cmp r2, %2 \n"
>> + "mov sp, %3 \n"
>> + /* leave in some symbols for release debugging */
>> + "mov r3, %6 \n"
>> + "str r3, [sp, #-4]! \n"
>> + "str r3, [sp, #-4]! \n"
>> + /* yep, we are the CPU */
>> + "bxeq %4 \n"
>> + /* AVP Initialization follows this path */
>> + "mov sp, %5 \n"
>> + /* leave in some symbols for release debugging */
>> + "mov r3, %6 \n"
>> + "str r3, [sp, #-4]! \n"
>> + "str r3, [sp, #-4]! \n"
>> +
>> + /* Init and Start CPU */
>> + "b startup_cpu \n"
>> + :
>> + : "i"(NV_PA_PG_UP_BASE),
>
> If I'm not mistaken, NV_PA_PG_UP_BASE could be used just as well directly in
> the asm statement instead of via %0 and i(), as anyway the asm will be
> preprocessed and the macro will turn to a number. That would simplify the
> asm instruction as a whole and make the asm statement more understandable
> (also applies to other macros used similarly).
>
Yeah, this code came this way from our bringup group for out in-house
bootloader, and it's always been confusing.
I'll try to simplify it when I incorporate Peter's critiques. Thanks.
> Apart from that, I must admit I don't know the Tegra2/A9 well enough to
> comment further.
>
> amicalement,
> Amicalement,
> --
> Albert.
Thanks for the input,
Tom
>
More information about the U-Boot
mailing list