diff options
author | Siarhei Siamashka | 2016-05-14 04:13:26 +0300 |
---|---|---|
committer | Hans de Goede | 2016-05-25 17:52:39 +0200 |
commit | b19236fd1c1ef289bab9e243ee5b50d658fcac3f (patch) | |
tree | 5857c12cfe8024b57b5b026f799a1ca1a645ee1a /arch/arm/mach-sunxi | |
parent | 795857df413aea278af95305d4b6ffc48089d6e8 (diff) |
sunxi: Increase SPL header size to 64 bytes to avoid code corruption
The current SPL header, created by the 'mksunxiboot' tool, has size
32 bytes. But the code in the boot ROM stores the information about
the boot media at the offset 0x28 before passing control to the SPL.
For example, when booting from the SD card, the magic number written
by the boot ROM is 0. And when booting from the SPI flash, the magic
number is 3. NAND and eMMC probably have their own special magic
numbers too.
Currently the corrupted byte is a part of one of the instructions in
the reset vectors table:
b reset
ldr pc, _undefined_instruction
ldr pc, _software_interrupt <- Corruption happens here
ldr pc, _prefetch_abort
ldr pc, _data_abort
ldr pc, _not_used
ldr pc, _irq
ldr pc, _fiq
In practice this does not cause any visible problems, but it's still
better to fix it. As a bonus, the reported boot media type can be
later used in the 'spl_boot_device' function, but this is out of
the scope of this patch.
Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'arch/arm/mach-sunxi')
0 files changed, 0 insertions, 0 deletions