aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan Pengfei <pengphei@foxmail.com>2022-05-15 14:11:59 +0800
committerKever Yang <kever.yang@rock-chips.com>2022-09-04 20:00:38 +0800
commitfc1526f651a557ddbf7c3cba8575be963573871f (patch)
treea4dc4632f3833f80612d53e6600e1f90613dff21
parent69820e02d2251d27238139ffa8f4c2ff9a07dca4 (diff)
downloadu-boot-fc1526f651a557ddbf7c3cba8575be963573871f.zip
u-boot-fc1526f651a557ddbf7c3cba8575be963573871f.tar.gz
u-boot-fc1526f651a557ddbf7c3cba8575be963573871f.tar.bz2
drivers: ram: rockchip: Fix dram channels calculation for rk3399
Only add the dram channel when we finally setup it successfully at the last step. Signed-off-by: Han Pengfei <pengphei@foxmail.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
-rw-r--r--drivers/ram/rockchip/sdram_rk3399.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
index c0a06dc..8b4d525 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);
}