Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit ed32365

Browse files
Ye Ligregkh
Ye Li
authored andcommitted
clk: imx: composite-7ulp: Check the PCC present bit
[ Upstream commit 4717cca ] When some module is disabled by fuse, its PCC PR bit is default 0 and PCC is not operational. Any write to this PCC will cause SError. Fixes: b40ba80 ("clk: imx: Update the compsite driver to support imx8ulp") Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Abel Vesa <abel.vesa@linaro.org> Link: https://lore.kernel.org/r/20240607133347.3291040-4-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa <abel.vesa@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c1eb71f commit ed32365

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/clk/imx/clk-composite-7ulp.c

+7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "../clk-fractional-divider.h"
1515
#include "clk.h"
1616

17+
#define PCG_PR_MASK BIT(31)
1718
#define PCG_PCS_SHIFT 24
1819
#define PCG_PCS_MASK 0x7
1920
#define PCG_CGC_SHIFT 30
@@ -78,6 +79,12 @@ static struct clk_hw *imx_ulp_clk_hw_composite(const char *name,
7879
struct clk_hw *hw;
7980
u32 val;
8081

82+
val = readl(reg);
83+
if (!(val & PCG_PR_MASK)) {
84+
pr_info("PCC PR is 0 for clk:%s, bypass\n", name);
85+
return 0;
86+
}
87+
8188
if (mux_present) {
8289
mux = kzalloc(sizeof(*mux), GFP_KERNEL);
8390
if (!mux)

0 commit comments

Comments
 (0)