u-boot-brain/arch
Philipp Tomsich 700f3108d3 rockchip: spl: make boot0 hook TPL safe
When building for a TPL/SPL setup (e.g. on the RK3368), we need the
TPL stage to have the extra space for for the 'Rockchip SPL name'
(i.e. 'RK33' word).  Yet, the SPL will start execution at its first
word (i.e. the first word in the SPL binary needs to be a valid
instruction).  To make things a bit more involved, CONFIG_SPL_BUILD
is defined both for the SPL and the TPL stage.

To avoid having to explicitly test for the first stage (TPL, if and
only if TPL and SPL are built, SPL otherwise), this commit modifies
the sequence to repeat the 'b reset' (instead of reserving 4 bytes
of undefined space) at the start of the boot0 hook: if overwritten
(and execution starts at the second word), the first instruction is
still a 'b reset'... if not overwritten, we start on a 'b reset' as
well.

This solution wouldn't even require the check whether we are in the
SPL/TPL build (i.e. CONFIG_SPL_BUILD), but we leave this check in for
documentation purposes.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-27 14:59:02 +02:00
..
arc arc: Add support for HS Development Kit board 2017-06-29 19:34:10 +03:00
arm rockchip: spl: make boot0 hook TPL safe 2017-07-27 14:59:02 +02:00
m68k Convert CONFIG_ENV_IS_IN_FLASH to Kconfig 2017-07-25 21:20:02 -04:00
microblaze Convert CONFIG_ENV_IS_IN_FLASH to Kconfig 2017-07-25 21:20:02 -04:00
mips Merge git://git.denx.de/u-boot-mips 2017-07-26 11:29:20 -04:00
nds32 nds32: Remove include files from common.h 2017-06-05 11:02:36 -04:00
nios2 fdt: Move fdt_fixup_ethernet to a common place 2017-05-01 09:11:59 -04:00
powerpc Convert CONFIG_ENV_IS_IN_FLASH to Kconfig 2017-07-25 21:20:02 -04:00
sandbox sandbox: Stop printing platdata at the start of SPL 2017-07-11 10:08:20 -06:00
sh Convert CONFIG_ENV_IS_IN_FLASH to Kconfig 2017-07-25 21:20:02 -04:00
x86 Convert CONFIG_ENV_IS_IN_SPI_FLASH to Kconfig 2017-07-25 21:31:03 -04:00
xtensa board_f: Rename initdram() to dram_init() 2017-04-13 09:40:57 -04:00
.gitignore .gitignore: drop include/asm/proc from ignore pattern 2014-06-19 11:18:54 -04:00
Kconfig configs: Migrate RBTREE, LZO, CMD_MTDPARTS, CMD_UBI and CMD_UBIFS 2017-07-24 20:35:55 -04:00