You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dd0619a
Browse filesBrowse the repository at this point in the historyBrowse files
On secure-boot H616 and A133 devices, FEL starts in non-secure state.
A direct SMC alone does not leave the BROM command loop in secure SVC,
and A133 NBROM also clears the monitor vector table.
Add a thunk which temporarily patches the writable SRAM SMC vector at
MVBAR + 8 with "mov pc, lr". After SMC, this branches back to the thunk
without restoring SPSR_mon, leaving execution in monitor mode.
Keep SVC SP, LR and interrupt state in unbanked, caller-clobbered
registers. Restore the original vector word, clear SCR and MVBAR, and
set up the secure GIC view before switching to SVC and restoring SP/LR
and the interrupt masks. No SPL workspace or private stack is needed.
Require the MMU and caches to be disabled before invoking the thunk,
and check the runtime probe again on return to detect failure.
Gate the workaround on the secure boot status word at SID base + 0xa0.
Use EFUSE_LCJS at efuse offset 0x48 as the restricted-memory probe:
bit 11 is the secure-boot fuse, so the secure view is non-zero when
secure boot is enabled. This avoids relying on a non-zero value in
the write-protection bitmap at offset 0x40. Both probes are read-only.
Apply the workaround at startup, leaving the existing SID and SPL paths
unchanged. Once LCJS becomes readable, its non-zero value suppresses
repeat application, including across separate sunxi-fel invocations.
Normal-boot devices are excluded by the secure boot status check.
Tested on a secure-boot H616 with repeated cold boots, full SID reads,
separate FEL invocations, and a complete SPL/U-Boot/Linux FIT upload.
U-Boot verified the FIT hashes and reached "Starting kernel ...".
A133 has not been hardware-tested with this thunk.
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
0 commit comments