[PATCH] rpi: bcm2712: Extend DRAM mapping to 16 GiB

Peter Robinson pbrobinson at gmail.com
Mon May 11 13:40:25 CEST 2026


Hi Simon,

Thanks for this.

On Sat, 9 May 2026 at 00:33, Simon Glass <sjg at chromium.org> wrote:
>
> The bcm2712 memory map only covers the first 1 GiB of DRAM, but Pi 5
> models ship with up to 16 GiB. Accesses above 1 GiB fault because the
> range is not present in the MMU page tables.
>
> Allocations above 1 GiB used to be blocked at the lmb layer because
> memory above ram_top was reserved as no-overwrite. Commit 0efb6bc3e36d
> ("lmb: Reinstate access to memory above ram_top") removed that
> reservation, so callers like tftp now route allocations into the
> unmapped range and trigger a fault.
>
> Extend the first DRAM entry to 16 GiB to cover the largest addressable
> range for any production Pi 5 model. Smaller models are unaffected
> because aarch64 only faults on actual access of unbacked memory, and
> no peripheral region lies between 1 GiB and 64 GiB on this SoC
> (peripherals start at 0x1000000000).

So a couple of questions:
1) Do we need to do this for the Pi4 (bcm2711) too? It's currently at ~4Gb.
2) On the bcm2711 it sits at just under 4gb, initially that was
4Gb-16Mb AFAICT (917a1e9a78fe) and then it was reduced in a followup
commit (c44b3f523c48) because of overlap with "device's IO area"
3) why doesn't the rpi5 have the overlap issues?

Peter

> Fixes: 0efb6bc3e36d ("lmb: Reinstate access to memory above ram_top")
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>  arch/arm/mach-bcm283x/init.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-bcm283x/init.c b/arch/arm/mach-bcm283x/init.c
> index 7a1de22e0ae..3d11c9e5c3b 100644
> --- a/arch/arm/mach-bcm283x/init.c
> +++ b/arch/arm/mach-bcm283x/init.c
> @@ -69,10 +69,10 @@ static struct mm_region bcm2711_mem_map[MEM_MAP_MAX_ENTRIES] = {
>
>  static struct mm_region bcm2712_mem_map[MEM_MAP_MAX_ENTRIES] = {
>         {
> -               /* First 1GB of DRAM */
> +               /* DRAM, up to the 16 GiB maximum supported by Pi 5 models */
>                 .virt = 0x00000000UL,
>                 .phys = 0x00000000UL,
> -               .size = 0x40000000UL,
> +               .size = 0x400000000UL,
>                 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
>                          PTE_BLOCK_INNER_SHARE
>         }, {
> ---
> base-commit: 3cdd19089f1b1b7cd08530f33ff4708abcfd426c
> branch: rpi-us
>
> --
> 2.43.0
>


More information about the U-Boot mailing list