mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-07 07:46:59 +02:00
clk/qcom: bubble up qcom_gate_clk_en() errors
If we try to enable a gate clock that doesn't exist, we used to just fail silently. This may make sense for early bringup of some core peripherals that we know are already enabled, but it only makes debugging missing clocks more difficult. Bubble up errors now that qcom_gate_clk_en() can return an error code to catch any still-missing clocks and make it easier to find missing ones as more complicated peripherals are enabled. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20250314-sc7280-more-clocks-v1-1-ead54487c38e@linaro.org Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
This commit is contained in:
parent
9043792109
commit
7c5460afec
@ -146,9 +146,8 @@ static int apq8016_clk_enable(struct clk *clk)
|
||||
}
|
||||
|
||||
debug("%s: enabling clock %s\n", __func__, apq8016_clks[clk->id].name);
|
||||
qcom_gate_clk_en(priv, clk->id);
|
||||
|
||||
return 0;
|
||||
return qcom_gate_clk_en(priv, clk->id);
|
||||
}
|
||||
|
||||
static struct msm_clk_data apq8016_clk_data = {
|
||||
|
@ -134,9 +134,7 @@ static int qcm2290_enable(struct clk *clk)
|
||||
break;
|
||||
}
|
||||
|
||||
qcom_gate_clk_en(priv, clk->id);
|
||||
|
||||
return 0;
|
||||
return qcom_gate_clk_en(priv, clk->id);
|
||||
}
|
||||
|
||||
static const struct qcom_reset_map qcm2290_gcc_resets[] = {
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <linux/bitfield.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define CFG_CLK_SRC_CXO (0 << 8)
|
||||
#define CFG_CLK_SRC_GPLL0 (1 << 8)
|
||||
@ -106,14 +107,19 @@ void clk_rcg_set_rate(phys_addr_t base, uint32_t cmd_rcgr, int div,
|
||||
int source);
|
||||
void clk_phy_mux_enable(phys_addr_t base, uint32_t cmd_rcgr, bool enabled);
|
||||
|
||||
static inline void qcom_gate_clk_en(const struct msm_clk_priv *priv, unsigned long id)
|
||||
static inline int qcom_gate_clk_en(const struct msm_clk_priv *priv, unsigned long id)
|
||||
{
|
||||
u32 val;
|
||||
if (id >= priv->data->num_clks || priv->data->clks[id].reg == 0)
|
||||
return;
|
||||
if (id >= priv->data->num_clks || priv->data->clks[id].reg == 0) {
|
||||
log_err("gcc@%#08llx: unknown clock ID %lu!\n",
|
||||
priv->base, id);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
val = readl(priv->base + priv->data->clks[id].reg);
|
||||
writel(val | priv->data->clks[id].en_val, priv->base + priv->data->clks[id].reg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -73,9 +73,7 @@ static int sa8775p_enable(struct clk *clk)
|
||||
break;
|
||||
}
|
||||
|
||||
qcom_gate_clk_en(priv, clk->id);
|
||||
|
||||
return 0;
|
||||
return qcom_gate_clk_en(priv, clk->id);
|
||||
}
|
||||
|
||||
static const struct qcom_reset_map sa8775p_gcc_resets[] = {
|
||||
|
@ -73,9 +73,7 @@ static int sc7280_enable(struct clk *clk)
|
||||
break;
|
||||
}
|
||||
|
||||
qcom_gate_clk_en(priv, clk->id);
|
||||
|
||||
return 0;
|
||||
return qcom_gate_clk_en(priv, clk->id);
|
||||
}
|
||||
|
||||
static const struct qcom_reset_map sc7280_gcc_resets[] = {
|
||||
|
@ -162,9 +162,7 @@ static int sdm845_clk_enable(struct clk *clk)
|
||||
break;
|
||||
}
|
||||
|
||||
qcom_gate_clk_en(priv, clk->id);
|
||||
|
||||
return 0;
|
||||
return qcom_gate_clk_en(priv, clk->id);
|
||||
}
|
||||
|
||||
static const struct qcom_reset_map sdm845_gcc_resets[] = {
|
||||
|
@ -146,9 +146,7 @@ static int sm6115_enable(struct clk *clk)
|
||||
break;
|
||||
}
|
||||
|
||||
qcom_gate_clk_en(priv, clk->id);
|
||||
|
||||
return 0;
|
||||
return qcom_gate_clk_en(priv, clk->id);
|
||||
}
|
||||
|
||||
static const struct qcom_reset_map sm6115_gcc_resets[] = {
|
||||
|
@ -243,9 +243,7 @@ static int sm8150_clk_enable(struct clk *clk)
|
||||
break;
|
||||
};
|
||||
|
||||
qcom_gate_clk_en(priv, clk->id);
|
||||
|
||||
return 0;
|
||||
return qcom_gate_clk_en(priv, clk->id);
|
||||
}
|
||||
|
||||
static const struct qcom_reset_map sm8150_gcc_resets[] = {
|
||||
|
@ -195,9 +195,7 @@ static int sm8250_enable(struct clk *clk)
|
||||
break;
|
||||
}
|
||||
|
||||
qcom_gate_clk_en(priv, clk->id);
|
||||
|
||||
return 0;
|
||||
return qcom_gate_clk_en(priv, clk->id);
|
||||
}
|
||||
|
||||
static const struct qcom_reset_map sm8250_gcc_resets[] = {
|
||||
|
@ -220,9 +220,7 @@ static int sm8550_enable(struct clk *clk)
|
||||
break;
|
||||
}
|
||||
|
||||
qcom_gate_clk_en(priv, clk->id);
|
||||
|
||||
return 0;
|
||||
return qcom_gate_clk_en(priv, clk->id);
|
||||
}
|
||||
|
||||
static const struct qcom_reset_map sm8550_gcc_resets[] = {
|
||||
|
@ -217,9 +217,7 @@ static int sm8650_enable(struct clk *clk)
|
||||
break;
|
||||
}
|
||||
|
||||
qcom_gate_clk_en(priv, clk->id);
|
||||
|
||||
return 0;
|
||||
return qcom_gate_clk_en(priv, clk->id);
|
||||
}
|
||||
|
||||
static const struct qcom_reset_map sm8650_gcc_resets[] = {
|
||||
|
@ -174,9 +174,7 @@ static int x1e80100_enable(struct clk *clk)
|
||||
break;
|
||||
}
|
||||
|
||||
qcom_gate_clk_en(priv, clk->id);
|
||||
|
||||
return 0;
|
||||
return qcom_gate_clk_en(priv, clk->id);
|
||||
}
|
||||
|
||||
static const struct qcom_reset_map x1e80100_gcc_resets[] = {
|
||||
|
Loading…
Reference in New Issue
Block a user