[PATCH 2/6] clk: spacemit: k1: Keep pll1_aud_245p7 enabled

From: Frédéric Mahé

Date: Tue Nov 17 2026 - 16:01:00 EST


Accesses to the RCPU2 block (0xc0888000) hang once pll1_aud_245p7 is
gated: the CPU stops responding, even to NMIs. Nothing claims this
clock in mainline, so clk_disable_unused() turns it off at boot, and
probing an RCPU2 PWM afterwards hangs the board. The RCPU2 clock and
reset registers live in the same block.

Mark it critical, as was done for the K3 RCPU clock.

Tested on a BPI-F3: without this, probing an RCPU2 PWM hangs the
board; with it, no hang, also with no PWM in use.

Written with help from Claude (Anthropic); reviewed and tested on hardware.

Signed-off-by: Frédéric Mahé <frederic.mahe@xxxxxxxx>
---
drivers/clk/spacemit/ccu-k1.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/spacemit/ccu-k1.c b/drivers/clk/spacemit/ccu-k1.c
index dee14d25f..364388ff8 100644
--- a/drivers/clk/spacemit/ccu-k1.c
+++ b/drivers/clk/spacemit/ccu-k1.c
@@ -60,7 +60,8 @@ CCU_FACTOR_GATE_DEFINE(pll1_d11_223p4, CCU_PARENT_HW(pll1), APBS_PLL1_SWCR2, BIT
CCU_FACTOR_GATE_DEFINE(pll1_d13_189, CCU_PARENT_HW(pll1), APBS_PLL1_SWCR2, BIT(16), 13, 1);
CCU_FACTOR_GATE_DEFINE(pll1_d23_106p8, CCU_PARENT_HW(pll1), APBS_PLL1_SWCR2, BIT(20), 23, 1);
CCU_FACTOR_GATE_DEFINE(pll1_d64_38p4, CCU_PARENT_HW(pll1), APBS_PLL1_SWCR2, BIT(0), 64, 1);
-CCU_FACTOR_GATE_DEFINE(pll1_aud_245p7, CCU_PARENT_HW(pll1), APBS_PLL1_SWCR2, BIT(10), 10, 1);
+CCU_FACTOR_GATE_FLAGS_DEFINE(pll1_aud_245p7, CCU_PARENT_HW(pll1), APBS_PLL1_SWCR2, BIT(10), 10, 1,
+ CLK_IS_CRITICAL);
CCU_FACTOR_GATE_DEFINE(pll1_aud_24p5, CCU_PARENT_HW(pll1), APBS_PLL1_SWCR2, BIT(11), 100, 1);

CCU_FACTOR_GATE_DEFINE(pll2_d1, CCU_PARENT_HW(pll2), APBS_PLL2_SWCR2, BIT(0), 1, 1);
--
2.47.3