[U-Boot] [PATCH v2 3/4] rockchip: spl: RK3399: use boot0 hook to create space for SPL magic

Simon Glass sjg at chromium.org
Sun Mar 26 02:40:15 UTC 2017


On 15 March 2017 at 05:08, Philipp Tomsich
<philipp.tomsich at theobroma-systems.com> wrote:
> The SPL binary needs to be prefixed with the boot magic ('RK33' for
> the RK3399) on the Rockchip platform and starts execution of the
> instruction word following immediately after this boot magic.
>
> This poses a challenge for AArch64 (ARMv8) binaries, as the .text
> section would need to start on the odd address, violating natural
> alignment (and potentially triggering a fault for any code that
> tries to access 64bit values embedded in the .text section).
>
> A quick and easy fix is to have the .text section include the 'RK33'
> magic and pad it with a boot0 hook to insert 4 bytes of padding at the
> start of the section (with the intention of having mkimage overwrite
> this padding with the appropriate boot magic). This avoids having to
> modify the linker scripts or more complex logic in mkimage.
>
> X-AffectedPlatforms: RK3399-Q7
> Signed-off-by: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>
> Tested-by: Klaus Goger <klaus.goger at theobroma-systems.com>
>
> ---
>
> Changes in v2:
> - Use BOOT0_HOOK to insert space into the SPL payload that can be
>   overwritten with the boot magic (e.g. 'RK33') by rkimage
>
>  arch/arm/include/asm/arch-rockchip/boot0.h | 18 ++++++++++++++++++
>  arch/arm/mach-rockchip/Kconfig             |  1 +
>  include/configs/rk3399_common.h            |  2 +-
>  3 files changed, 20 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/include/asm/arch-rockchip/boot0.h

Applied to u-boot-rockchip, thanks!


More information about the U-Boot mailing list