[U-Boot] mkimage: spl address computation seems weird in PBL

Vincent vincent.siles+uboot at gmail.com
Fri May 6 20:14:18 CEST 2016


The behavior of the global variable "pbl_cmd_initaddr" seems wrong,
and prevent to use some address depending on the size of the SPL.
This is maybe due to some alignment constraints but I didn't find any
documentation that would explain it.

The variable is initialized like this:
 288                 pbl_cmd_initaddr = params->addr & PBL_ADDR_24BIT_MASK;
 289                 pbl_cmd_initaddr |= PBL_ACS_CONT_CMD;
 290                 pbl_cmd_initaddr |= uboot_size;

Then, during the computation of the addresses of the 64 bytes chunk,
it is used like this:
 84         next_pbl_cmd = pbl_cmd_initaddr - uboot_size;

So basically, if the size of the SPL is using n bits, we can't use the
first n bits of the address range.
In my particular case, I wanted to copy the SPL at address 0x1000_0a00
and mkimage computed 0x1000_0800 instead.

Why is "size" embedded like this in "pbl_cmd_initaddr" when it is a
global variable too ?

Best,

Vincent


More information about the U-Boot mailing list