[PATCH v1 4/4] common: Add an optionto relocate on ram top

Marek Vasut marek.vasut at mailbox.org
Sun Apr 5 06:01:32 CEST 2026


On 4/3/26 11:01 AM, Ilias Apalodimas wrote:

[...]

> @@ -353,8 +357,19 @@ static int setup_ram_config(void)
>   	 */
>   	gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;
>   #endif
> +#if CONFIG_IS_ENABLED(RELOC_ADDR_TOP)
> +	for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) {
> +		if (gd->ram_top <= gd->bi_dram[bank].start)
> +			gd->ram_top = gd->bi_dram[bank].start +
> +					gd->bi_dram[bank].size;
> +		total_size += gd->bi_dram[bank].size;
> +	}
> +
> +	gd->ram_size = total_size;
> +#else
>   	gd->ram_top = gd->ram_base + get_effective_memsize();
>   	gd->ram_top = board_get_usable_ram_top(gd->mon_len);
> +#endif
It would be nice if we could get rid of this ifdeffery and align the two 
branches of the code, but otherwise this looks nice.


More information about the U-Boot mailing list