Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arch: aarch32: fix z_mapped_start location for non-XIP operation
Move the z_mapped_start marker for non-XIP builds to the base RAM address. This has already been the marker's location when building for XIP. Prior to this change, z_mapped_start was located at the start of the text section for non-XIP builds. However, at least for the Cortex-A family of CPUs, the first section located at the RAM base address isn't the text section, but the single 4k page containing the exception vectors which are copied to either address 0 or the HIVECS address upon early boot. This resulted in this first 4k page at the bottom of RAM to be considered available for memory mappings via the MMU at run-time, followed by all the permanently mapped stuff, with available mappable memory only continuing behind z_mapped_end. A call at run-time requesting memory to be mapped via the MMU therefore always assigned the single 4k page containing the vectors data first, before continuing mapping physical memory behind z_mapped_end. For any map call requesting more than 4k, this resulted in a contiguous virtual memory address range mapped to non-contiguous physical memory. This behaviour has already been documented in #51024. This behaviour would also cause further problems in case of support for the Cortex-A's VBAR register, which has been proposed before, but eventually wasn't merged. Letting VBAR point to the RAM base where the 4k vectors page is located within the Zephyr image instead of copying the vectors to either 0 or the HIVECS address means that this page may under no circumstance be re-assigned for use as regular RAM mapped via the MMU. Signed-off-by: Immo Birnbaum <[email protected]>
- Loading branch information