Skip to content

Commit 4717cca

Browse files
Ye Liabelvesa
authored andcommitted
clk: imx: composite-7ulp: Check the PCC present bit
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 <[email protected]> Signed-off-by: Ye Li <[email protected]> Signed-off-by: Peng Fan <[email protected]> Reviewed-by: Abel Vesa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Abel Vesa <[email protected]>
1 parent d342df1 commit 4717cca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
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)