The SpacemiT K1/X60 has 512KiB of TCM (Tightly Coupled Memory) on its first cluster of 4 cores: https://developer.spacemit.com/documentation?token=Alhewa0fai7lvbk9sajcumNqn4f
The TCM is mapped to 0xD800000
in the physical address space: https://developer.spacemit.com/documentation?token=LzJyw97BCipK1dkUygrcbT0NnMg
I don’t really see anything in the documentation about accessing this memory.
I see that some ARM CPUs expose a TCM through asm/tcm.h
with tcm_alloc()
/tcm_free()
and some other utilities: https://github.com/torvalds/linux/blob/master/arch/arm/include/asm/tcm.h
Looking at SpacemiTs linux kernel source, I see the TCM in the device tree: https://github.com/BPI-SINOVOIP/pi-linux/blob/linux-6.6.36-k1/arch/riscv/boot/dts/spacemit/k1-x.dtsi#L2275-L2299 but I don’t see an equivalent to arm’s tcm.h
The TCM infrastructure on ARM seems to be somewhat more elaborate than just a flat mapping to physical memory: https://github.com/torvalds/linux/blob/master/arch/arm/kernel/tcm.c . Would it make sense to just implement something like a more simple tcm.c/h
in the kernel and expose it that way?