Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/48113 )
Change subject: libpayload: Provide API to expose MMU memery ranges for ARM64 ......................................................................
libpayload: Provide API to expose MMU memery ranges for ARM64
Provide get_mmu_ranges() for ARM64 to let payloads could get MMU ranges for all used memory regions.
BUG=b:171858277 TEST=Build in x86, arm, arm64. emerge-zork libpayload depthcharge emerge-nyan libpayload depthcharge emerge-asurada libpayload depthcharge
Signed-off-by: Meng-Huan Yu menghuan@google.com Change-Id: I39b24aefc9dbe530169b272e839d0e1e7c697742 Reviewed-on: https://review.coreboot.org/c/coreboot/+/48113 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Julius Werner jwerner@chromium.org Reviewed-by: Yu-Ping Wu yupingso@google.com --- M payloads/libpayload/arch/arm64/mmu.c M payloads/libpayload/include/arm64/arch/mmu.h 2 files changed, 13 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved Yu-Ping Wu: Looks good to me, but someone else must approve
diff --git a/payloads/libpayload/arch/arm64/mmu.c b/payloads/libpayload/arch/arm64/mmu.c index cb0081b..bc4c233 100644 --- a/payloads/libpayload/arch/arm64/mmu.c +++ b/payloads/libpayload/arch/arm64/mmu.c @@ -705,3 +705,8 @@ mmu_init(&usedmem_ranges); mmu_enable(); } + +const struct mmu_ranges *mmu_get_used_ranges(void) +{ + return &usedmem_ranges; +} diff --git a/payloads/libpayload/include/arm64/arch/mmu.h b/payloads/libpayload/include/arm64/arch/mmu.h index 5a1dd98..2b1e9e1 100644 --- a/payloads/libpayload/include/arm64/arch/mmu.h +++ b/payloads/libpayload/include/arm64/arch/mmu.h @@ -194,4 +194,12 @@ */ void mmu_presysinfo_memory_used(uint64_t base, uint64_t size); void mmu_presysinfo_enable(void); + +/* + * Functions for exposing the used memory ranges to payloads. The ranges contain + * all used memory ranges that are actually used by payload. i.e. _start -> _end + * in linker script, the coreboot tables and framebuffer/DMA allocated in MMU + * initialization. + */ +const struct mmu_ranges *mmu_get_used_ranges(void); #endif // __ARCH_ARM64_MMU_H__