On Thu, Nov 19, 2020 at 4:24 PM Andre Przywara <andre.przyw...@arm.com> wrote: > > 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.przyw...@arm.com> > ---
Acked-by: Jagan Teki <ja...@amarulasolutions.com> -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscr...@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/CAMty3ZCntuSMZkBRkY4QAAvFUbftHYGhF9mTLPoqemwpeKWXSA%40mail.gmail.com.