[PATCH] drivers: ram: rockchip: Fix dram channels calculation for rk3399

Kever Yang kever.yang at rock-chips.com
Sat Aug 27 04:54:43 CEST 2022


On 2022/5/15 14:11, pengphei at foxmail.com wrote:
> From: Han Pengfei <pengphei at foxmail.com>
>
> Only add the dram channel when we finally setup it successfully at the
> last step.
>
> Signed-off-by: Han Pengfei <pengphei at foxmail.com>
Reviewed-by: Kever Yang <kever.yang at rock-chips.com>

Thanks,
- Kever
> ---
>   drivers/ram/rockchip/sdram_rk3399.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
> index c0a06dcaed..fd8ba45d68 100644
> --- a/drivers/ram/rockchip/sdram_rk3399.c
> +++ b/drivers/ram/rockchip/sdram_rk3399.c
> @@ -2964,8 +2964,6 @@ static int sdram_init(struct dram_info *dram,
>   		if (cap_info->rank == 0) {
>   			clear_channel_params(params, 1);
>   			continue;
> -		} else {
> -			params->base.num_channels++;
>   		}
>   
>   		if (IS_ENABLED(CONFIG_RAM_ROCKCHIP_DEBUG)) {
> @@ -2991,6 +2989,8 @@ static int sdram_init(struct dram_info *dram,
>   			printf("no ddrconfig find, Cap not support!\n");
>   			continue;
>   		}
> +
> +		params->base.num_channels++;
>   		set_ddrconfig(chan, params, channel, cap_info->ddrconfig);
>   		set_cap_relate_config(chan, params, channel);
>   	}


More information about the U-Boot mailing list