[U-Boot] [PATCH] arm: omap3: Detect boot mode very early
Lokesh Vutla
lokeshvutla at ti.com
Tue Jul 25 06:30:05 UTC 2017
On 7/25/2017 7:38 AM, Siarhei Siamashka wrote:
> On Fri, 14 Jul 2017 08:53:20 -0500
> Adam Ford <aford173 at gmail.com> wrote:
>
>> Fixes 4bd754d8abef ("arm: omap: Detect boot mode very early") where
>> the intent was to store the boot params information in a known
>> location and pass it to SPL very early. Unfortunately it didn't
>> account for OMAP3 boards.
>>
>> This patch adds adds this functionality back into OMAP3 boards.
>>
>> Reviewed-by: Lokesh Vutla <lokeshvutla at ti.com>
>> Signed-off-by: Adam Ford <aford173 at gmail.com>
>>
>> diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c
>> index cd8e302..a61b933 100644
>> --- a/arch/arm/mach-omap2/omap3/board.c
>> +++ b/arch/arm/mach-omap2/omap3/board.c
>> @@ -212,6 +212,12 @@ void board_init_f(ulong dummy)
>> {
>> early_system_init();
>> mem_init();
>> + /*
>> + * Save the boot parameters passed from romcode.
>> + * We cannot delay the saving further than this,
>> + * to prevent overwrites.
>> + */
>> + save_omap_boot_params();
>> }
>> #endif
>>
>
> Hello,
>
> Something seems to be fishy here.
>
> The 4bd754d8abef patch from Lokesh Vutla basically replicated the same
> chunk of code for every OMAP variant rather than keeping it in one
> common location. The justification for this code duplication is that
> the boot parameters may be overwritten. Can we have a bit more details
> about how and when this overwrite actually happens in practice?
ROM stores the boot_params info in SRAM and passed this address to SPL.
For SPL, all the dtb, malloc, stack, and scratch area are in SRAM. There
is high probability that it might override the boot params info. So, we
need to parse this info asap. I did see this is being overwritten on
dra7 evm so I had to introduce this patch. You can always dump R0 at the
beiginning of SPL and compare it with objdump of spl.
>
> I don't quite like the fact that we still have the code, which relies
> on OMAP_SRAM_SCRATCH_BOOT_PARAMS in the "jump_to_image_no_args"
> function very late in the SPL:
I don't think U-Boot uses this information at all, so till now there is
no effect. You can as well not pass anything.
Thanks and regards,
Lokesh
More information about the U-Boot
mailing list