[U-Boot] [PATCH 1/2] rpi: save firmware provided boot param for later use

Cédric Schieli cschieli at gmail.com
Sun Nov 6 11:06:58 CET 2016


2016-11-06 3:48 GMT+01:00 Stephen Warren <swarren at wwwdotorg.org>:

> On 11/02/2016 12:06 PM, Cédric Schieli wrote:
>
>> At U-Boot entry point, the r2 register holds the address of the
>> firmware provided boot param. Let's save it for further processing.
>>
>
> diff --git a/board/raspberrypi/rpi/lowlevel_init.S
>> b/board/raspberrypi/rpi/lowlevel_init.S
>>
>
> +.global fw_boot_param
>> +fw_boot_param:
>> +       .word 0x00000000
>>
>
> fw_dtb_pointer might be a better name; there are multiple different
> registers set up by the FW in some cases; best to be explicit about what
> kind of parameter is being saved.
>

I did not want to use a DT oriented naming because of the possibility to
pass a ATAG instead. But I can change it if you prefer.


> See the note later about the size/alignment requirements for this value.
>
> +/*
>> + * Routine: save_boot_params (called after reset from start.S)
>> + * Description: save ATAG/FDT address provided by the firmware at boot
>> time
>> + */
>> +
>> +.global save_boot_params
>> +save_boot_params:
>> +
>> +       /* The firmware provided ATAG/FDT address can be found in r2 */
>> +       str     r2, fw_boot_param
>>
>
> For the 64-bit RPi builds, you need to save x0 not r2. The assembly above
> doesn't compile since r2 isn't a valid register (it's named x2 on 64-bit),
> plus the DTB pointer is actually in x0 not x2.
>

Noted. I'll address all the 64-bit issues in the next round.


>
> +       /* Returns */
>> +       b       save_boot_params_ret
>>
>
> With these patches applied, the build of rpi_defconfig fails since the
> ARM1176 CPU startup file doesn't define that symbol.
>
> diff --git a/include/configs/rpi.h b/include/configs/rpi.h
>>
>
> +#ifndef __ASSEMBLY__
>> +/* Firmware provided boot param */
>> +extern const void *fw_boot_param;
>> +#endif
>>
>
This issue will go away with the next round as the extern declaration will
be moved to the rpi.c file, or simply removed if the save_boot_params code
is converted to C.

Regards,
Cédric


More information about the U-Boot mailing list