[PATCH v1 1/4] treewide: move bi_dram[] from bd to gd

Anshul Dalal anshuld at ti.com
Mon Apr 6 14:19:39 CEST 2026


On Fri, 03 Apr 2026 12:01:03 +0300, Ilias Apalodimas <ilias.apalodimas at linaro.org> wrote:
> [...]
> Additionally, U-Boot defaults to relocating to the top of the first memory
> bank. While boards currently use custom functions to override this
> behavior, having the DRAM bank information available earlier in gd makes
> relocating to a different bank trivial and standardizes the process.
> 
> Signed-off-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>

Two files below still refer to 'bd->bi_dram' after your patch, rest looks good
to me.

	--- a/arch/arm/lib/cache-cp15.c
	+++ b/arch/arm/lib/cache-cp15.c
	@@ -96,7 +96,7 @@ __weak void dram_bank_mmu_setup(int bank)
	 {
	 	int	i;
 
	-	/* bd->bi_dram is available only after relocation */
	+	/* gd->bi_dram is available only after relocation */
	 	if ((gd->flags & GD_FLG_RELOC) == 0)
	 		return;
 
	--- a/arch/arm/mach-stm32mp/stm32mp1/cpu.c
	+++ b/arch/arm/mach-stm32mp/stm32mp1/cpu.c
	@@ -66,7 +66,7 @@ void dram_bank_mmu_setup(int bank)
	 		size = ALIGN(STM32_SYSRAM_SIZE, MMU_SECTION_SIZE);
	 #endif
	 	} else if (gd->flags & GD_FLG_RELOC) {
	-		/* bd->bi_dram is available only after relocation */
	+		/* gd->bi_dram is available only after relocation */
	 		start = gd->bi_dram[bank].start;
	 		size =  gd->bi_dram[bank].size;
	 		use_lmb = true;

Reviewed-by: Anshul Dalal <anshuld at ti.com>

-- 
Anshul Dalal <anshuld at ti.com>


More information about the U-Boot mailing list