[PATCH next RFC 1/5] ram: rk3399: allow to fail DRAM init if pctl_start fails
Quentin Schulz
foss+uboot at 0leil.net
Tue Nov 5 18:21:55 CET 2024
From: Quentin Schulz <quentin.schulz at cherry.de>
pctl_start() can fail but how this is handled currently is by calling
hang() directly in the driver instead of propagating the error and
letting other code handling it.
This prepares for a future commit which removes the hang() in favor of
letting Rockchip's arch code handle it in a common place.
No change in behavior expected in this commit.
Signed-off-by: Quentin Schulz <quentin.schulz at cherry.de>
---
drivers/ram/rockchip/sdram_rk3399.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
index 6fa8f268770d1c6d69431857e115264957d75703..63d7852555cea3296b7cd9eed422c4d5d1c9776b 100644
--- a/drivers/ram/rockchip/sdram_rk3399.c
+++ b/drivers/ram/rockchip/sdram_rk3399.c
@@ -791,9 +791,9 @@ static void set_ds_odt(const struct chan_info *chan,
phy_io_config(denali_phy, denali_ctl, params, mr5);
}
-static void pctl_start(struct dram_info *dram,
- struct rk3399_sdram_params *params,
- u32 channel_mask)
+static int pctl_start(struct dram_info *dram,
+ struct rk3399_sdram_params *params,
+ u32 channel_mask)
{
const struct chan_info *chan_0 = &dram->chan[0];
const struct chan_info *chan_1 = &dram->chan[1];
@@ -892,6 +892,8 @@ static void pctl_start(struct dram_info *dram,
params->phy_regs.denali_phy[937] &
0xFF);
}
+
+ return 0;
}
static int pctl_cfg(struct dram_info *dram, const struct chan_info *chan,
@@ -2940,7 +2942,8 @@ static int sdram_init(struct dram_info *dram,
}
/* start to trigger initialization */
- pctl_start(dram, params, 3);
+ if (pctl_start(dram, params, 3))
+ return -EINVAL;
/* LPDDR2/LPDDR3 need to wait DAI complete, max 10us */
if (dramtype == LPDDR3)
--
2.47.0
More information about the U-Boot
mailing list