sunxi-tools/thunks
Andre Przywara c1f947e085 fel: sid: extend assembly to dump arbitrary range
To workaround a hardware erratum on the H3 SoC, we use an MMIO register
based assembly routine to dump the SID registers, if needed. This is
hard-coded to read the first four 32-bit words of the SID fuses.

For the sid-dump command we need to access any arbitrary regions of the
fuses, so extend the routine to take a start and an end address to dump.

This changes the assembly source in the thunks/ directory:
- We load the start address into r1, instead of zeroing it. The start
  address is put right after the SIO MMIO base address, at the end of
  the code.
- When storing the read value into the result buffer, we automatically
  increase the pointer register (r3), instead of adding the offset
  address, since this is now no longer zero based.
- To check for the end, we read the end pointer (stored at the end of
  the code, right after the offset), and compare against that instead of
  the hardcoded value of 16.
This assembly file was put through the thunks Makefile, and the resulting
content was copied from thunks/sid_read_root.h into fel_lib.c.

For now we are still putting the constant values of 0 and 16 in, but
this time from the C code.

Signed-off-by: Andre Przywara <osp@andrep.de>
2023-03-05 23:24:33 +00:00
..
clrsetbits.h fel: Implement fel_clrsetbits_le32() helper 2017-01-27 23:03:18 +01:00
clrsetbits.S fel: Implement fel_clrsetbits_le32() helper 2017-01-27 23:03:18 +01:00
fel-to-spl-thunk.h fel: thunks: Fix fel-to-spl-thunk to be ARMv5TE compatible 2022-03-06 00:47:36 +00:00
fel-to-spl-thunk.S fel: thunks: Fix fel-to-spl-thunk to be ARMv5TE compatible 2022-03-06 00:47:36 +00:00
Makefile fel: thunks: Use armv5te architecture for thunks 2022-03-06 00:47:47 +00:00
memcpy.h thunks: Add assembly sources for some more thunks 2017-01-27 23:03:18 +01:00
memcpy.S thunks: Add assembly sources for some more thunks 2017-01-27 23:03:18 +01:00
objdump_to_h.awk thunks: Adjust build system for ARM thunk .h 2017-01-27 23:03:18 +01:00
readl_writel.h thunks: Add assembly sources for some more thunks 2017-01-27 23:03:18 +01:00
readl_writel.S thunks: Add assembly sources for some more thunks 2017-01-27 23:03:18 +01:00
README.md Move thunk code / snippets to a dedicated subdirectory 2017-01-27 23:03:18 +01:00
rmr-thunk.h thunks: Add assembly sources for some more thunks 2017-01-27 23:03:18 +01:00
rmr-thunk.S fel: thunks: Use armv5te architecture for thunks 2022-03-06 00:47:47 +00:00
sid_read_root.h fel: sid: extend assembly to dump arbitrary range 2023-03-05 23:24:33 +00:00
sid_read_root.S fel: sid: extend assembly to dump arbitrary range 2023-03-05 23:24:33 +00:00

thunks/README.md

This directory contains assembly sources for ARM thunk code, and a corresponding Makefile. The idea is that the resulting binary routines can be transferred to a suitable target device and then executed 'remotely', usually via sunxi-fel.

Normally you don't need to change or (re)build anything within this folder. Currently our main build process (via the parent directory's Makefile) only includes fel-to-spl-thunk.h directly. Other .h files are provided just for reference. The main purpose of this folder is simply keeping track of .S sources, to help with possible future maintenance of the various code snippets.

Please note that any files lacking explicit license information are intended to be covered by the project's overall license (GPLv2).