u-boot-brain/arch/arm/include/asm
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
..
arch-am33xx common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
arch-armada8k SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arch-armada100 SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arch-armv7 SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arch-aspeed include/configs: aspeed: Remove hardcoded variables 2020-08-14 09:46:40 -04:00
arch-bcm235xx SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arch-bcm281xx SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arch-bcmcygnus Convert CONFIG_PHYLIB et al to Kconfig 2020-04-28 15:57:58 -04:00
arch-bcmns3 board: ns3: add api to save boot parameters passed from BL31 2020-07-29 10:13:41 -04:00
arch-bcmnsp SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arch-ep93xx SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arch-fsl-layerscape armv8: lx2162a: Add Soc changes to support LX2162A 2020-12-10 13:56:39 +05:30
arch-hi3660 common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
arch-hi3798cv200 poplar: clean up board level mmc initialization code 2019-01-25 12:12:57 -05:00
arch-hi6220 dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
arch-imx imx8mp: Remove parts MIMX8ML7 and MIMX8ML5 support 2020-09-17 14:40:22 +02:00
arch-imx8 dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
arch-imx8m dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
arch-imxrt video: mxsfb: add support for i.MXRT 2020-04-18 12:54:43 +02:00
arch-lpc32xx arm: Don't include common.h in header files 2020-05-18 14:54:24 -04:00
arch-ls102xa Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq 2020-05-20 08:46:56 -04:00
arch-mediatek mediatek: Drop dm.h header file 2020-08-03 22:19:54 -04:00
arch-meson mmc: meson-gx: move arch header to local header 2020-11-12 14:31:29 +01:00
arch-mvebu km/spi: remove deprecated SPI flash driver code for KM Kirkwood boards 2019-07-11 10:58:03 +02:00
arch-mx5 Use __ASSEMBLY__ as the assembly macros 2020-05-18 21:19:23 -04:00
arch-mx6 treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
arch-mx7 imx7: ccm: correct target interface num 2020-09-17 14:39:55 +02:00
arch-mx7ulp arm: Don't include common.h in header files 2020-05-18 14:54:24 -04:00
arch-mx25 arm: Don't include common.h in header files 2020-05-18 14:54:24 -04:00
arch-mx27 treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
arch-mx31 treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
arch-mx35 arm: Don't include common.h in header files 2020-05-18 14:54:24 -04:00
arch-mxs treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
arch-octeontx arm: octeontx: Add headers for OcteonTX 2020-08-25 08:01:16 +02:00
arch-octeontx2 arm: octeontx2: Add headers for OcteonTX2 2020-08-25 08:01:16 +02:00
arch-omap3 i2c: omap24xx_i2c: Move away from SoC specific headers for reg offset 2018-12-10 06:09:34 +01:00
arch-omap4 arm: Don't include common.h in header files 2020-05-18 14:54:24 -04:00
arch-omap5 arm: Don't include common.h in header files 2020-05-18 14:54:24 -04:00
arch-orion5x SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arch-owl net: designware: s700: Add glue code for S700 mac 2020-07-07 17:11:58 -04:00
arch-px30 rockchip: add px30 architecture core 2019-11-17 17:23:24 +08:00
arch-pxa SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arch-rk322x rockchip: add common header boot0.h and gpio.h for soc 2019-05-08 17:34:12 +08:00
arch-rk3036 rockchip: add common header boot0.h and gpio.h for soc 2019-05-08 17:34:12 +08:00
arch-rk3128 rockchip: add common header boot0.h and gpio.h for soc 2019-05-08 17:34:12 +08:00
arch-rk3188 rockchip: add common header boot0.h and gpio.h for soc 2019-05-08 17:34:12 +08:00
arch-rk3288 rockchip: add common header boot0.h and gpio.h for soc 2019-05-08 17:34:12 +08:00
arch-rk3308 arm: Don't include common.h in header files 2020-05-18 14:54:24 -04:00
arch-rk3328 rockchip: add common header boot0.h and gpio.h for soc 2019-05-08 17:34:12 +08:00
arch-rk3368 rockchip: add common header boot0.h and gpio.h for soc 2019-05-08 17:34:12 +08:00
arch-rk3399 rockchip: add common header boot0.h and gpio.h for soc 2019-05-08 17:34:12 +08:00
arch-rockchip video: rockchip: Restrict EDP, VOP, MIPI files to GPL-2.0 2020-11-13 18:16:11 +08:00
arch-rv1108 rockchip: add common header boot0.h and gpio.h for soc 2019-05-08 17:34:12 +08:00
arch-s32v234 Use __ASSEMBLY__ as the assembly macros 2020-05-18 21:19:23 -04:00
arch-sa1100 Move architecture-specific includes to arch/$ARCH/include/asm 2010-04-13 09:13:12 +02:00
arch-spear arm: spear: fix enabling of SSP2 clock 2018-09-25 21:49:18 -04:00
arch-stih410 treewide: Update email address Patrick Delaunay and Patrice Chotard 2020-12-09 10:57:50 +01:00
arch-stm32 treewide: Update email address Patrick Delaunay and Patrice Chotard 2020-12-09 10:57:50 +01:00
arch-stm32f4 treewide: Update email address Patrick Delaunay and Patrice Chotard 2020-12-09 10:57:50 +01:00
arch-stm32f7 treewide: Update email address Patrick Delaunay and Patrice Chotard 2020-12-09 10:57:50 +01:00
arch-stm32h7 treewide: Update email address Patrick Delaunay and Patrice Chotard 2020-12-09 10:57:50 +01:00
arch-stv0991 SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arch-sunxi sunxi: Add arm64 FEL support 2021-01-11 23:19:34 +00:00
arch-tegra common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
arch-tegra20 ARM: tegra: Use common header for PMU declarations 2019-06-05 09:16:33 -07:00
arch-tegra30 ARM: tegra: Use common header for PMU declarations 2019-06-05 09:16:33 -07:00
arch-tegra114 ARM: tegra: Use common header for PMU declarations 2019-06-05 09:16:33 -07:00
arch-tegra124 common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
arch-tegra186 SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arch-tegra210 ARM: tegra: Use common header for PMU declarations 2019-06-05 09:16:33 -07:00
arch-vf610 dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
armv8 common: Move hang() to the same header as panic() 2020-01-17 17:53:40 -05:00
iproc-common configs: migrate CONFIG_SYS_ARM_CACHE_* in Kconfig 2020-05-01 11:34:01 -04:00
kona-common SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mach-imx Prepare v2021.01-rc5 2021-01-05 16:20:26 -05:00
proc-armv ARM: correct detection of thumb mode 2019-07-18 11:31:24 -04:00
ti-common common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
xen Revert "arch: arm/xen: add putc() for debugging" 2020-10-23 09:16:07 -04:00
armv7_mpu.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
armv7.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
armv7m.h arm: armv7m: clean up armv7m unified code compilation 2018-09-10 21:19:33 -04:00
assembler.h arm: Migrate SYS_THUMB_BUILD to Kconfig, introduce SPL_SYS_THUMB_BUILD 2017-03-18 20:28:01 -04:00
atomic.h ARM: use asm-generic/atomic.h 2018-09-25 21:49:18 -04:00
barriers.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bitops.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
boot0-linux-kernel-header.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bootm.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
byteorder.h armv8: Use __aarch64__ rather than CONFIG_ARM64 in some cases 2014-01-10 10:10:23 +01:00
cache.h arm: asm/cache.c: Introduce arm_reserve_mmu 2020-04-24 15:17:14 -04:00
config.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
davinci_rtc.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dma-mapping.h arm: Don't include common.h in header files 2020-05-18 14:54:24 -04:00
ehci-omap.h usb: ehci-omap: Add Support for DM_USB and OF_CONTROL 2020-05-22 15:22:35 +02:00
emif.h arm: Don't include common.h in header files 2020-05-18 14:54:24 -04:00
fsl_secure_boot.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
gic-v3.h arch: arm: use dt and UCLASS_SYSCON to get gic lpi details 2020-07-29 10:37:11 -04:00
gic.h arm64 patch: gicv3 support 2014-04-08 00:15:12 +02:00
global_data.h arm: remove outdated comment concerning -ffixed-x18 2020-07-07 18:23:48 -04:00
gpio.h board: armltd: Add support for Total Compute platform 2020-08-24 14:11:31 -04:00
handoff.h arm: Add arm handoff header file 2020-01-24 11:19:52 -05:00
hardware.h Move architecture-specific includes to arch/$ARCH/include/asm 2010-04-13 09:13:12 +02:00
io.h arm: include/asm/io.h: Add 64bit clrbits and setbits helpers 2020-08-25 08:01:16 +02:00
linkage.h arm: adapt asm/linkage.h from Linux 2012-05-15 08:31:26 +02:00
mach-types.h mcx: remove board 2019-05-28 13:58:06 -04:00
macro.h ARMv8: Enable all asynchronous abort exceptions taken to EL3 2018-11-16 13:34:33 -05:00
memory.h Various, accumulated typos collected from around the tree. 2016-10-06 20:57:40 -04:00
mmu.h arm: provide a function for boards init code to modify MMU virtual-physical map 2020-07-10 14:10:43 -04:00
omap_common.h arm: Don't include common.h in header files 2020-05-18 14:54:24 -04:00
omap_gpio.h dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
omap_i2c.h dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
omap_mmc.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
omap_musb.h dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
omap_sec_common.h arm: Don't include common.h in header files 2020-05-18 14:54:24 -04:00
opcodes-sec.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
opcodes-virt.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
opcodes.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
pl310.h ARM: pl310: Add macro's for handling tag and data latency mask 2019-05-05 08:48:50 -04:00
posix_types.h armv8: Use __aarch64__ rather than CONFIG_ARM64 in some cases 2014-01-10 10:10:23 +01:00
processor.h Remove ${objtree}/include/asm/proc/ link 2014-06-11 16:27:05 -04:00
psci.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
ptrace.h Remove ${objtree}/include/asm/proc/ link 2014-06-11 16:27:05 -04:00
sections.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
secure.h ARMv8: Allow SiP service extensions on top of PSCI code 2019-04-22 18:13:21 -04:00
setjmp.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
setup.h Various, accumulated typos collected from around the tree. 2016-10-06 20:57:40 -04:00
spin_table.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
spl.h arm: K3: am654: Add support for boot device detection 2018-09-11 08:32:55 -04:00
string.h ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra 2016-12-27 11:24:15 -05:00
system.h arm: enable allocate-on-read for LPAE's DCACHE_WRITEBACK/_WRITETHROUGH 2020-07-29 08:43:40 -04:00
types.h arch: types.h: factor out fixed width typedefs to int-ll64.h 2018-09-10 20:48:16 -04:00
u-boot-arm.h common: Move reset_misc() function to arch header 2020-01-17 13:27:30 -05:00
u-boot.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
unaligned.h arm64: core support 2014-01-09 16:08:44 +01:00
unified.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
utils.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
xen.h board: Introduce xenguest_arm64 board 2020-08-14 15:18:27 -04:00