[PATCH 2/3] sandbox: align LMB memory

Tom Rini trini at konsulko.com
Sat Jun 7 16:22:28 CEST 2025


On Sat, Jun 07, 2025 at 01:49:04PM +0200, Heinrich Schuchardt wrote:

> 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.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
>  arch/sandbox/cpu/state.c         | 6 ++++--
>  arch/sandbox/include/asm/state.h | 1 +
>  include/configs/sandbox.h        | 2 ++
>  3 files changed, 7 insertions(+), 2 deletions(-)
[snip]
> diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
> index db2ac7f83bb..ee1ad21fd8d 100644
> --- a/include/configs/sandbox.h
> +++ b/include/configs/sandbox.h
> @@ -14,6 +14,8 @@
>  #define CFG_SYS_SDRAM_BASE		0
>  #define CFG_SYS_SDRAM_SIZE \
>  		(SB_TO_UL(CONFIG_SANDBOX_RAM_SIZE_MB) << 20)
> +/** define CFG_SYS_SDRAM_ALIGN - Alignment of emulated RAM */
> +#define CFG_SYS_SDRAM_ALIGN		0x400000
>  
>  #define CFG_SYS_BAUDRATE_TABLE	{4800, 9600, 19200, 38400, 57600,\
>  					115200}

Can we avoid adding something to the CFG_SYS namespace? Since this is
sandbox centric is there something under arch/sandbox/include/asm we can
drop this in to instead? Thanks.

> -- 
> 2.48.1
> 

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250607/bf5cbd36/attachment.sig>


More information about the U-Boot mailing list