@nprofile1q... So I'm going through some STM32MP2 notes about aliasing and I found something else that reminded me of our conversation a few weeks ago.
The RETRAM (and other SRAMs but let's just talk about this one for a moment) is mapped at 0x0e08_0000 (boot/I-side/secure) and 0x3008_0000 (D-side/secure).
Due to quirks of the caching, you *have* to alias these if you enable the I$ - in other words you have a single image but you only ever access code via 0e08 and data via 3008. They both refer to the same physical SRAM cells.
Good luck handling this nicely in a compiler. Hell, doing this in a *linker script* was a nightmare (having .data, .bss, and .text not overlap physical memory despite being in different MEMORY sections in the linker script)
The RETRAM (and other SRAMs but let's just talk about this one for a moment) is mapped at 0x0e08_0000 (boot/I-side/secure) and 0x3008_0000 (D-side/secure).
Due to quirks of the caching, you *have* to alias these if you enable the I$ - in other words you have a single image but you only ever access code via 0e08 and data via 3008. They both refer to the same physical SRAM cells.
Good luck handling this nicely in a compiler. Hell, doing this in a *linker script* was a nightmare (having .data, .bss, and .text not overlap physical memory despite being in different MEMORY sections in the linker script)