lmb: enable LMB_LIMIT_DMA_BELOW_RAM_TOP for ARCH_MVEBU
A message that is not in the archive (sent off-list or not yet received): [email protected]
Stefan Roese
Reviewed-byQuoted 28 lines · Bruno Banelli
On Armada 7k/8k only a part of DRAM is mapped in U-Boot's MMU.
arch/arm/mach-mvebu/armada8k/cpu.cmaps 0..0x04000000 and 0x05400000..0x85400000 (plus MMIO), andarm64-common.cclampsboard_get_usable_ram_top()toUSABLE_RAM_SIZE(2 GiB) with the comment "Not all memory is mapped in the MMU". At the same timea8k_dram_init_banksize()advertises the whole DRAM in bi_dram[], adding a second bank at 4 GiB whenever more than 3 GiB is populated.Until commit
e1b6822d6522("efi_memory: do not add RAM memory to the memory map") the EFI subsystem bridged that gap:efi_add_known_memory()reserved everything abovegd->ram_top, as introduced by commit7b78d6438a2b("efi_loader: Reserve unaccessible memory"). EFI allocations are now backed by LMB, and LMB does not considerram_topby default, so the firstefi_allocate_pool()of the boot - fromefi_init_early()->efi_console_register()->efi_create_event()- takes the highest free page and faults:Tested on a SolidRun MACCHIATObin (Armada 8040): without this change the abort reproduces both with 4 GiB of DRAM (far
0x13ffff000) and with 8 GiB (far0x23ffff000), the faulting address tracking the top of the highest bank; with it, U-Boot reaches the prompt.
LMB_LIMIT_DMA_BELOW_RAM_TOP, added by commitaf4aad1f0a0b("lmb:
Optionally limit available memory to 4 GiB on limited systems"), reserves the memory aboveram_topand addresses exactly this case. It is already enabled forARCH_BCM283XandARCH_ROCKCHIP; enable it forARCH_MVEBUas well.
Quoted 6 lines
Tested on a SolidRun MACCHIATObin (Armada 8040) with 4 GiB of DRAM, which reproduces the abort above without this change and reaches the prompt with it.
Fixes e1b6822d6522 ("efi_memory: do not add RAM memory to the memory map")Signed-off-by Bruno Banelli <[email protected]>
Thanks,
Stefan
Quoted 28 lines · Bruno Banelli
On Armada 7k/8k only a part of DRAM is mapped in U-Boot's MMU.
arch/arm/mach-mvebu/armada8k/cpu.cmaps 0..0x04000000 and 0x05400000..0x85400000 (plus MMIO), andarm64-common.cclampsboard_get_usable_ram_top()toUSABLE_RAM_SIZE(2 GiB) with the comment "Not all memory is mapped in the MMU". At the same timea8k_dram_init_banksize()advertises the whole DRAM in bi_dram[], adding a second bank at 4 GiB whenever more than 3 GiB is populated.Until commit
e1b6822d6522("efi_memory: do not add RAM memory to the memory map") the EFI subsystem bridged that gap:efi_add_known_memory()reserved everything abovegd->ram_top, as introduced by commit7b78d6438a2b("efi_loader: Reserve unaccessible memory"). EFI allocations are now backed by LMB, and LMB does not considerram_topby default, so the firstefi_allocate_pool()of the boot - fromefi_init_early()->efi_console_register()->efi_create_event()- takes the highest free page and faults:Tested on a SolidRun MACCHIATObin (Armada 8040): without this change the abort reproduces both with 4 GiB of DRAM (far
0x13ffff000) and with 8 GiB (far0x23ffff000), the faulting address tracking the top of the highest bank; with it, U-Boot reaches the prompt.
LMB_LIMIT_DMA_BELOW_RAM_TOP, added by commitaf4aad1f0a0b("lmb:
Optionally limit available memory to 4 GiB on limited systems"), reserves the memory aboveram_topand addresses exactly this case. It is already enabled forARCH_BCM283XandARCH_ROCKCHIP; enable it forARCH_MVEBUas well.
Quoted 6 lines
Tested on a SolidRun MACCHIATObin (Armada 8040) with 4 GiB of DRAM, which reproduces the abort above without this change and reaches the prompt with it.
Fixes e1b6822d6522 ("efi_memory: do not add RAM memory to the memory map")Signed-off-by Bruno Banelli <[email protected]>
Applied to u-boot-marvell/next
Thanks,
Stefan