u-boot/arch
Andre Przywara 0e4d5db4e0 sunxi: Add arm64 FEL support
So far we did not support the BootROM based FEL USB debug mode on the
64-bit builds for Allwinner SoCs: The BootROM is using AArch32, but the
SPL runs in AArch64.
Returning back to AArch32 was not working as expected, since the RMR
reset into 32-bit mode always starts execution in the BootROM, but not
in the FEL routine.

After some debug and research and with help via IRC, the CPU hotplug
mechanism emerged as a solution: If a certain R_CPUCFG register contains
some magic, the BootROM will immediately branch to an address stored in
some other register. This works well for our purposes.

Enable the FEL feature by providing early AArch32 code to first save the
FEL state, *before* initially entering AArch64.
If we eventually determine that we should return to FEL, we reset back
into AArch32, and use the CPU hotplug mechanism to run some small
AArch32 code snippet that restores the initially saved FEL state.

That allows the normal AArch64 SPL build to be loaded via the sunxi-fel
tool, with it returning into FEL mode, so that other payloads can be
transferred via FEL as well.

Tested on A64, H5 and H6.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Icenowy Zheng <icenowy@aosc.io>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
Tested-by: Priit Laes <plaes@plaes.org> (on Olimex A64-Olinuxino)
2021-01-11 23:19:34 +00:00
..
arc Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
arm sunxi: Add arm64 FEL support 2021-01-11 23:19:34 +00:00
m68k arc: m68k: nds32: nios2: sh: xtensa: Add empty spl.h header 2021-01-05 12:24:40 -07:00
microblaze microblaze: Enable GCC garbage collector for full U-Boot 2020-11-20 10:42:53 +01:00
mips Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
nds32 arc: m68k: nds32: nios2: sh: xtensa: Add empty spl.h header 2021-01-05 12:24:40 -07:00
nios2 arc: m68k: nds32: nios2: sh: xtensa: Add empty spl.h header 2021-01-05 12:24:40 -07:00
powerpc powerpc: mpc85xx: Allow boards to override CONFIG_USB_MAX_CONTROLLER_COUNT 2020-12-10 13:56:39 +05:30
riscv Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
sandbox sandbox: Update dts files to reduce SPL size 2021-01-05 12:24:41 -07:00
sh arc: m68k: nds32: nios2: sh: xtensa: Add empty spl.h header 2021-01-05 12:24:40 -07:00
x86 Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
xtensa arc: m68k: nds32: nios2: sh: xtensa: Add empty spl.h header 2021-01-05 12:24:40 -07:00
.gitignore
Kconfig linker_lists: Fix alignment issue 2020-12-18 20:32:21 -07:00
u-boot-elf.lds arch: Add explicit linker script for u-boot-elf 2020-04-03 11:52:55 -04:00