[PATCH 1/2] rockchip: spl: do full dram_init instead of only probing

Kever Yang kever.yang at rock-chips.com
Fri May 15 04:07:41 CEST 2020


On 2020/5/12 下午6:34, Heiko Stuebner wrote:
> From: Heiko Stuebner <heiko.stuebner at theobroma-systems.com>
>
> Parts of later SPL may need RAM information as well, so do full
> dram_init() call, which includes the existing dram probing but also
> initializes the ram information in gd.

NAK.

I would prefer to use DM interface and leave the decision of ram 
initialization to the ram driver.

>
> All Rockchip SoCs use a TPL+SPL combination now, so that's ok for all
> of them.
Still not all of the board use the combination.
>
> Signed-off-by: Heiko Stuebner <heiko.stuebner at theobroma-systems.com>
> Change-Id: I2c7496f2d88d65a9f80f74d2139bf307bb4b442b

Please remove the Change-Id next time.

Thanks,

- Kever

> ---
>   arch/arm/mach-rockchip/spl.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c
> index 0b76af6080..0eda2c3485 100644
> --- a/arch/arm/mach-rockchip/spl.c
> +++ b/arch/arm/mach-rockchip/spl.c
> @@ -135,13 +135,15 @@ void board_init_f(ulong dummy)
>   	/* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */
>   	timer_init();
>   #endif
> -#if !defined(CONFIG_TPL) || defined(CONFIG_SPL_OS_BOOT)
> +#if !defined(CONFIG_TPL) || defined(CONFIG_SPL_RAM)
>   	debug("\nspl:init dram\n");
> -	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
> +	ret = dram_init();
>   	if (ret) {
>   		printf("DRAM init failed: %d\n", ret);
>   		return;
>   	}
> +	gd->ram_top = gd->ram_base + get_effective_memsize();
> +	gd->ram_top = board_get_usable_ram_top(gd->ram_size);
>   #endif
>   	preloader_console_init();
>   }




More information about the U-Boot mailing list