From patchwork Thu Feb 13 18:29:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 236314 List-Id: U-Boot discussion From: patrick.delaunay at st.com (Patrick Delaunay) Date: Thu, 13 Feb 2020 19:29:50 +0100 Subject: [PATCH] ARM: bootm: take into account gd->ram_top Message-ID: <20200213182950.10744-1-patrick.delaunay@st.com> From: Patrice Chotard If gd->ram_top has been tuned using board_get_usable_ram_top(), it must be taken into account when reserving arch lmb. Signed-off-by: Patrice Chotard Reviewed-by: Patrick DELAUNAY Signed-off-by: Patrick Delaunay --- arch/arm/lib/bootm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index a135bcfc7b..f4b5ca6de0 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -75,6 +75,9 @@ void arch_lmb_reserve(struct lmb *lmb) gd->bd->bi_dram[bank].size - 1; if (sp > bank_end) continue; + if (bank_end > gd->ram_top) + bank_end = gd->ram_top - 1; + lmb_reserve(lmb, sp, bank_end - sp + 1); break; }