u-boot-brain/arch/arm/cpu/armv8
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
..
bcmns3 board: ns3: add api to save boot parameters passed from BL31 2020-07-29 10:13:41 -04:00
fsl-layerscape Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
hisilicon common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
s32v234 treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
xen board: Introduce xenguest_arm64 board 2020-08-14 15:18:27 -04:00
cache_v8.c armv8: cache_v8: fix mmu_set_region_dcache_behaviour 2020-05-25 11:54:53 -04:00
cache.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
config.mk SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
cpu-dt.c treewide: use CONFIG_IS_ENABLED() for ARMV8_SEC_FIRMWARE_SUPPORT 2020-12-04 16:09:05 -05:00
cpu.c common: Drop net.h from common header 2020-05-18 17:33:31 -04:00
exception_level.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
exceptions.S armv8: Reduce exception handling code 2018-08-03 19:53:54 -04:00
fel_utils.S sunxi: Add arm64 FEL support 2021-01-11 23:19:34 +00:00
fwcall.c common: Drop net.h from common header 2020-05-18 17:33:31 -04:00
generic_timer.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
Kconfig armv8: lx2162a: Add Soc changes to support LX2162A 2020-12-10 13:56:39 +05:30
linux-kernel-image-header-vars.h arm64: add an option to switch visibility of CONFIG_SYS_INIT_SP_BSS_OFFSET 2019-07-10 22:37:23 +09:00
lowlevel_init.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Makefile sunxi: Add arm64 FEL support 2021-01-11 23:19:34 +00:00
psci.S ARMv8: PSCI: Fix PSCI_TABLE relocation issue 2019-04-23 17:57:28 -04:00
sec_firmware_asm.S armv8: sec_firmware: change el2_to_aarch32 SMC ID 2018-12-06 14:37:19 -08:00
sec_firmware.c common: Drop asm/ptrace.h from common header 2020-05-18 21:19:23 -04:00
smccc-call.S arm: Leave smccc calls in .text when efi_loader=n 2019-02-13 09:40:06 +01:00
spin_table_v8.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
spin_table.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
spl_data.c imx: imx8qm/qxp: Recover SPL data section for partition reboot 2020-05-10 20:55:20 +02:00
start.S arm64: PIE: Skip fixups if distance is zero 2020-10-08 11:42:36 -04:00
tlb.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
transition.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
u-boot-spl.lds imx: imx8qm/qxp: Recover SPL data section for partition reboot 2020-05-10 20:55:20 +02:00
u-boot.lds ARMv8: Allow SiP service extensions on top of PSCI code 2019-04-22 18:13:21 -04:00