[U-Boot] [U-Boot,2/2] rockchip: rk3288: Fix TPL_TEXT_BASE
Philipp Tomsich
philipp.tomsich at theobroma-systems.com
Fri Feb 16 17:12:41 UTC 2018
> rockchip boot0 add 4 bytes data (0xeaffffff) at beginning
> of executable(0x800) in order to make generic and compatible
> boot0 for all platforms and the resulting executable will be
> input to mkimage and the output of mkimage with initial
> 4 bytes will overwritten by 'spl_hdr'
>
> Since the TPL_TEXT_BASE in rk3288 is 0xff704004 which is improper
> align to branch-to-next-instruction-word, so the resulting 4 bytes
> are written at ff704020 of executable instead of beginning ff704000
>
> Hexdump with overlaped bytes:
> -----------------------------
> 0000000 0000 0000 0000 0000 0000 0000 0000 0000
> 0000010 0000 0000 0000 0000 0000 0000 ffff eaff
>
> So, fix this improper TEXT_BASE which is wrong even before
> and update it to 0xff704000 so-that the boot0 will add
> 4 bytes at beginning.
>
> Disassembly:
> -----------
> with 0xff704020 TEXT_BASE:
>
> ff704004 <__image_copy_start>:
> b 1f /* if overwritten, entry-address is at the next word */
> ff704020: eaffffff b ff704024 <__image_copy_start+0x20>
>
> with 0xff704000 TEXT_BASE:
>
> ff704000 <__image_copy_start>:
> b 1f /* if overwritten, entry-address is at the next word */
> ff704000: eaffffff b ff704004 <__image_copy_start+0x4>
>
> This patch will also move TPL_TEXT_BASE into kconfig.
>
> Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
> ---
> arch/arm/mach-rockchip/Kconfig | 3 +++
> configs/vyasa-rk3288_defconfig | 1 -
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
Acked-by: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>
More information about the U-Boot
mailing list