[U-Boot] Fw: FDT pointer value, passed by the PI firmware, is not set in u-boot

Simon Glass sjg at chromium.org
Fri Sep 23 05:47:57 CEST 2016


Hi,

On 19 September 2016 at 21:50,  <dh at synoia.com> wrote:
>
> I modified the current u-boot code to store r2 in rpi.c board_init, but only get a zero value from the register.
>
> It could be one of three issues:
> 1. My use of the c asm statement  to store r2 is wrong (I've never done this before), assembler yes, c assembler no.
> 2. The compiler has consumed the value of r2 before getting to board_init
> 3. The pi firmware does not put the fdt value in r2.
>
> asm statement to store r2 is asm("mov %%r2, %0" : "=r" (gd->bd->bpi_boot_parms) );
>
> In order to use up Marco's ATAG and FDT code.
>
> What the earliest place where I can store the input r2 value?

You could try save_boot_params(). Some boards use that. But gd is not
available then - perhaps you could put it in a variable in the data
segment?

> Hopefully, I'm putting the r2 value into gd->bd->bpi_boot_parms in board_init, but it appear it is zero at that point.
>
> Should I restrict the compiler's use of r2? (I'm reluctant to limit the compiler in that manner)?
>
> Suggestion would be welcome.
>
> Thanks Duncan Hare
>
> 714 931 7952

Regards,
Simon

>
>
>
>
>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot


More information about the U-Boot mailing list