]> git.karo-electronics.de Git - karo-tx-uboot.git/commit
arm: spl: Add an API to detect when U-Boot is started from SPL
authorSimon Glass <sjg@chromium.org>
Wed, 13 May 2015 13:02:24 +0000 (07:02 -0600)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 22:42:36 +0000 (00:42 +0200)
commitfcb109ca50c29c173c2738f2895e9c9f1456a88e
tree5444f998a6ad0e45d43c0ef23f85f9a8bd39aeb8
parentde0ff4a2908c699dd3e0702d85d1c26a682342f1
arm: spl: Add an API to detect when U-Boot is started from SPL

For secure boot systems it is common to have a read-only U-Boot which starts
the machine and jumps to a read-write U-Boot for actual booting the OS. This
allows the read-write U-Boot to be upgraded without risk of permanently
bricking the machine. In the event that the read-write U-Boot is corrupted,
the read-only U-Boot can detect this with a checksum and boot into a
recovery flow.

To support this, add a way to detect when U-Boot is run from SPL as opposed
to some other method, such as booted directly (no SPL) or started from
another source (e.g. a primary U-Boot). This works by putting a special value
in r0.

For now we rely on board-specific code to actually check the register and
set a flag. At some point this could be generalised, perhaps by using a spare
register and passing a flag to _main and/or board_init_f().

This commit does not implement any feature, but merely provides the API for
boards to implement.

Signed-off-by: Simon Glass <sjg@chromium.org>
include/spl.h