]> git.ipfire.org Git - people/ms/u-boot.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)
committerSimon Glass <sjg@chromium.org>
Thu, 11 Jun 2015 01:26:54 +0000 (19:26 -0600)
commit32ba8952cb449f8b151c4c1a27b9e9c3b4995dee
tree6d3096b9cfc1a51bd5dcd7aededdc5ed0978aabb
parent0c5dd9ae2f2e731c5c961fd92fa974aaa3cbdc27
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