u-boot-brain/arch
Siarhei Siamashka b19236fd1c 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>
2016-05-25 17:52:39 +02:00
..
arc arc/cache: really do flush_dcache_all() even if IOC exists 2016-04-21 20:09:59 +03:00
arm sunxi: Increase SPL header size to 64 bytes to avoid code corruption 2016-05-25 17:52:39 +02:00
avr32 Change my mailaddress 2016-05-02 18:37:09 -04:00
blackfin configs: Re-sync almost all of cmd/Kconfig 2016-04-25 15:09:40 -04:00
m68k Merge git://git.denx.de/u-boot-dm 2016-05-17 13:58:27 -04:00
microblaze microblaze: Remove !OF_CONTROL code for timer and interrupt 2016-04-04 20:28:38 +02:00
mips malta: Support MIPS32r6 configurations 2016-05-21 01:36:39 +02:00
nds32 Use correct spelling of "U-Boot" 2016-02-06 12:00:59 +01:00
nios2 dm: Use uclass_first_device_err() where it is useful 2016-03-14 15:34:50 -06:00
openrisc openrisc: Fix build errors 2016-01-25 10:40:01 -05:00
powerpc Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq 2016-05-24 13:42:03 -04:00
sandbox sandbox: Add string and 16-bit I/O functions 2016-05-17 09:54:43 -06:00
sh Add more SPDX-License-Identifier tags 2016-01-19 08:31:21 -05:00
sparc Fix spelling of "transferred". 2016-03-22 12:16:16 -04:00
x86 x86: Switch to use SMBIOS Kconfig options when writing SMBIOS tables 2016-05-23 15:27:42 +08:00
.gitignore .gitignore: drop include/asm/proc from ignore pattern 2014-06-19 11:18:54 -04:00
Kconfig MIPS: add initial infrastructure for device-tree files 2016-01-16 21:06:45 +01:00