[PATCH v2 0/3] sandbox: align LMB memory
Heinrich Schuchardt
heinrich.schuchardt at canonical.com
Sun Jun 8 09:54:25 CEST 2025
To implement the EFI_SYSTEM_TABLE_POINTER we need 4 MiB aligned
memory.
On the sandbox LMB uses addresses relative to the start of a page aligned
RAM buffer allocated with mmap(). This leads to a mismatch of alignment
between EFI which uses pointers and LMB which uses phys_addr_t.
Ensure that the RAM buffer used for LMB is 4 MiB aligned.
Provide a unit test for efi_alloc_aligned_pages() verifying this alignment.
Do not overwrite RAM size in dram_init().
v2:
rename define CFG_SYS_SDRAM_ALIGN to SB_SDRAM_ALIGN
Heinrich Schuchardt (3):
sandbox: fix dram_init()
sandbox: align LMB memory
test: unit test for efi_alloc_aligned_pages()
arch/sandbox/cpu/state.c | 6 ++-
arch/sandbox/include/asm/state.h | 1 +
board/sandbox/sandbox.c | 1 -
include/configs/sandbox.h | 2 +
test/lib/Makefile | 2 +-
test/lib/efi_memory.c | 63 ++++++++++++++++++++++++++++++++
6 files changed, 71 insertions(+), 4 deletions(-)
create mode 100644 test/lib/efi_memory.c
--
2.48.1
More information about the U-Boot
mailing list