On 11/9/23 10:13, Patrick DELAUNAY wrote: > Hi, > > On 10/27/23 16:42, Patrice Chotard wrote: >> Limit DDR usage under 4GB boundary on STM32MP regardless of >> memory size declared in device tree. >> >> Signed-off-by: Patrice Chotard <patrice.chot...@foss.st.com> >> --- >> >> arch/arm/mach-stm32mp/dram_init.c | 8 +++++++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/arch/arm/mach-stm32mp/dram_init.c >> b/arch/arm/mach-stm32mp/dram_init.c >> index cb35ed60ca1..fb1208fc5d5 100644 >> --- a/arch/arm/mach-stm32mp/dram_init.c >> +++ b/arch/arm/mach-stm32mp/dram_init.c >> @@ -52,9 +52,15 @@ phys_addr_t board_get_usable_ram_top(phys_size_t >> total_size) >> if (!total_size) >> return gd->ram_top; >> + /* >> + * make sure U-Boot uses address space below 4GB boundaries even >> + * if the effective available memory is bigger >> + */ >> + gd->ram_top = clamp_val(gd->ram_top, 0, SZ_4G - 1); >> + >> /* found enough not-reserved memory to relocated U-Boot */ >> lmb_init(&lmb); >> - lmb_add(&lmb, gd->ram_base, get_effective_memsize()); >> + lmb_add(&lmb, gd->ram_base, gd->ram_top - gd->ram_base); >> boot_fdt_add_mem_rsv_regions(&lmb, (void *)gd->fdt_blob); >> /* add 8M for reserved memory for display, fdt, gd,... */ >> size = ALIGN(SZ_8M + CONFIG_SYS_MALLOC_LEN + total_size, >> MMU_SECTION_SIZE), > > > Reviewed-by: Patrick Delaunay <patrick.delau...@foss.st.com> > > Thanks > Patrick > Applied to u-boot-stm32/next Thanks Patrice
- [PATCH v1 2/9] stm32mp: dram_init: Get RAM size from DT i... Patrice Chotard
- [PATCH v1 3/9] stm32mp: dram_init: Fix AARCH64 compilatio... Patrice Chotard
- [PATCH v1 1/9] arm: caches: Make DCACHE_DEFAULT_OPTION ac... Patrice Chotard
- Re: [PATCH v1 0/9] Add STM32MP2 SoCs and STM32MP257F-EV b... Patrice CHOTARD
- [PATCH v1 0/9] Add STM32MP2 SoCs and STM32MP257F-EV board... Patrice Chotard
- [PATCH v1 2/9] stm32mp: dram_init: Get RAM size from... Patrice Chotard
- Re: [PATCH v1 2/9] stm32mp: dram_init: Get RAM s... Patrick DELAUNAY
- Re: [PATCH v1 2/9] stm32mp: dram_init: Get R... Patrice CHOTARD
- [PATCH v1 4/9] stm32mp: dram_init: Limit DDR usage u... Patrice Chotard
- Re: [PATCH v1 4/9] stm32mp: dram_init: Limit DDR... Patrick DELAUNAY
- Re: [PATCH v1 4/9] stm32mp: dram_init: Limit... Patrice CHOTARD
- [PATCH v1 3/9] stm32mp: dram_init: Fix AARCH64 compi... Patrice Chotard
- Re: [PATCH v1 3/9] stm32mp: dram_init: Fix AARCH... Patrick DELAUNAY
- Re: [PATCH v1 3/9] stm32mp: dram_init: Fix A... Patrice CHOTARD
- Re: [PATCH v1 3/9] stm32mp: dram_init: Fix AARCH... Patrice CHOTARD
- [PATCH v1 1/9] arm: caches: Make DCACHE_DEFAULT_OPTI... Patrice Chotard
- Re: [PATCH v1 1/9] arm: caches: Make DCACHE_DEFA... Patrick DELAUNAY
- Re: [PATCH v1 1/9] arm: caches: Make DCACHE_... Patrice CHOTARD
- [PATCH v1 5/9] stm32mp: bsec: Fix AARCH64 compilatio... Patrice Chotard
- Re: [PATCH v1 5/9] stm32mp: bsec: Fix AARCH64 co... Patrick DELAUNAY
- Re: [PATCH v1 5/9] stm32mp: bsec: Fix AARCH6... Patrice CHOTARD