u-boot/arch/arm/include/asm/arch-sunxi
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
..
boot0.h sunxi: Add arm64 FEL support 2021-01-11 23:19:34 +00:00
ccu.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
clock.h sunxi: add clock code for H6 2018-07-31 11:38:13 +05:30
clock_sun4i.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
clock_sun6i.h sunxi: R40: add gigabit ethernet clocks 2018-07-16 12:27:27 +05:30
clock_sun8i_a83t.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
clock_sun9i.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
clock_sun50i_h6.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
cpu.h sunxi: make V3s DRAM initialization more proper 2020-10-22 11:40:28 +05:30
cpu_sun4i.h usb: sunxi: Use proper reg_mask for clock gate, reset 2018-06-29 10:52:18 +02:00
cpu_sun9i.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
cpu_sun50i_h6.h arm: sunxi: h6: fix reset using r_wdog 2019-05-20 22:24:47 +05:30
cpucfg.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
display.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
display2.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dma.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dma_sun4i.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dram.h sunxi: add DRAM support to H6 2018-07-31 11:38:13 +05:30
dram_sun4i.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dram_sun6i.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
dram_sun8i_a23.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dram_sun8i_a33.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
dram_sun8i_a83t.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
dram_sun9i.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
dram_sun50i_h6.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
dram_sunxi_dw.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
gpio.h sunxi: allow to use AXP20[39] attached to I2C0 on V3 series 2020-11-17 00:42:21 +00:00
gtbus.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
gtbus_sun9i.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
i2c.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
lcdc.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mmc.h mmc: sunxi: add support for automatic delay calibration 2018-11-13 22:07:39 +05:30
p2wi.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
pmic_bus.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
prcm.h sunxi: remove __packed from struct sunxi_prcm_reg 2019-12-18 20:19:58 +05:30
pwm.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
rsb.h arm: Don't include common.h in header files 2020-05-18 14:54:24 -04:00
spl.h sunxi: Fix is_boot0_magic macro 2021-01-11 23:19:34 +00:00
sys_proto.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
timer.h sunxi: use sun6i-style watchdog for H6 2018-07-31 11:38:13 +05:30
tve.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
tzpc.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
watchdog.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00