u-boot/arch/arm
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
..
cpu sunxi: Add arm64 FEL support 2021-01-11 23:19:34 +00:00
dts sunxi: add PineCube board 2021-01-11 23:19:33 +00:00
include sunxi: Add arm64 FEL support 2021-01-11 23:19:34 +00:00
lib dm: Rename DM_GET_DRIVER() to DM_DRIVER_GET() 2021-01-05 12:26:35 -07:00
mach-aspeed dm: Rename DM_GET_DRIVER() to DM_DRIVER_GET() 2021-01-05 12:26:35 -07:00
mach-at91 Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
mach-bcm283x dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
mach-bcmstb
mach-cortina board: presidio-asic: Add basic G3 engr. development board support 2020-02-07 16:16:01 -05:00
mach-davinci serial: Rename ns16550 functions to lower case 2021-01-05 12:24:40 -07:00
mach-exynos common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
mach-highbank common: Drop init.h from common header 2020-05-18 17:33:33 -04:00
mach-imx Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
mach-integrator
mach-ipq40xx dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
mach-k3 dm: Rename DM_GET_DRIVER() to DM_DRIVER_GET() 2021-01-05 12:26:35 -07:00
mach-keystone serial: Rename ns16550 functions to lower case 2021-01-05 12:24:40 -07:00
mach-kirkwood Convert CONFIG_NETCONSOLE to Kconfig 2020-08-23 13:06:36 -04:00
mach-lpc32xx dm: Rename U_BOOT_DEVICE() to U_BOOT_DRVINFO() 2021-01-05 12:26:35 -07:00
mach-mediatek dm: Rename DM_GET_DRIVER() to DM_DRIVER_GET() 2021-01-05 12:26:35 -07:00
mach-meson ARM: mach-meson: update SoC IDs 2020-11-12 14:28:37 +01:00
mach-mvebu arm: mvebu: a38x: Configurable USB2 high-speed impedance threshold 2020-12-07 07:11:37 +01:00
mach-nexell dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
mach-octeontx arm: octeontx: Add support for OcteonTX SoC platforms 2020-08-25 08:01:16 +02:00
mach-octeontx2 arm: octeontx2: Add support for OcteonTX2 SoC platforms 2020-08-25 08:01:16 +02:00
mach-omap2 dm: Rename U_BOOT_DEVICE() to U_BOOT_DRVINFO() 2021-01-05 12:26:35 -07:00
mach-orion5x treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
mach-owl Actions: OWL: Calculate SDRAM size 2020-07-07 16:09:22 -04:00
mach-qemu qemu: arm: Initialise virtio devices in board_late_init 2020-12-31 14:41:31 +01:00
mach-rmobile pinctrl: renesas: r8a77951: Add R8A774E1 PFC support 2020-11-22 12:49:22 +01:00
mach-rockchip dm: Rename DM_GET_DRIVER() to DM_DRIVER_GET() 2021-01-05 12:26:35 -07:00
mach-s5pc1xx common: Drop net.h from common header 2020-05-18 17:33:31 -04:00
mach-snapdragon dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
mach-socfpga dm: Rename DM_GET_DRIVER() to DM_DRIVER_GET() 2021-01-05 12:26:35 -07:00
mach-sti
mach-stm32 treewide: Update email address Patrick Delaunay and Patrice Chotard 2020-12-09 10:57:50 +01:00
mach-stm32mp dm: Rename DM_GET_DRIVER() to DM_DRIVER_GET() 2021-01-05 12:26:35 -07:00
mach-sunxi sunxi: add V3/S3 support 2020-11-17 00:42:21 +00:00
mach-tegra Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
mach-u8500 common: Drop init.h from common header 2020-05-18 17:33:33 -04:00
mach-uniphier dm: Rename DM_GET_DRIVER() to DM_DRIVER_GET() 2021-01-05 12:26:35 -07:00
mach-versal xilinx: kconfig: Move sourcing of board Kconfig to mach folders 2020-09-23 10:31:40 +02:00
mach-versatile
mach-zynq dm: Rename DM_GET_DRIVER() to DM_DRIVER_GET() 2021-01-05 12:26:35 -07:00
mach-zynqmp arm64: zynqmp: Get rid of unused macros 2020-11-20 10:42:54 +01:00
mach-zynqmp-r5 xilinx: r5: Fix MPU setting for R5 2020-09-23 10:31:41 +02:00
thumb1/include/asm/proc-armv
config.mk Makefile: Rename ALL-y to INPUTS-y 2020-07-28 19:30:39 -06:00
Kconfig armv8: lx2162aqds: Add support for LX2162AQDS platform 2020-12-10 13:56:39 +05:30
Kconfig.debug
Makefile arm: octeontx2: Add support for OcteonTX2 SoC platforms 2020-08-25 08:01:16 +02:00