Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/6] riscv: spacemit: k1: RCPU2 PWM clocks and the BPI-F3 fan
@ 2026-11-17 20:59 Frédéric Mahé
  2026-11-17 20:59 ` [PATCH 1/6] dt-bindings: clock: spacemit: k1: Add RCPU2 PWM clocks Frédéric Mahé
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Frédéric Mahé @ 2026-11-17 20:59 UTC (permalink / raw)
  To: Stephen Boyd, Yixun Lan
  Cc: Brian Masney, Jerome Brunet, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Troy Mitchell, Haylen Chu, Hung-Chun Tseng,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	linux-clk, devicetree, linux-riscv, spacemit, linux-kernel,
	Frédéric Mahé

The BPI-F3 fan header (J27) has a PWM line driven by an RCPU2 PWM
(GPIO 79). This series adds the RCPU2 PWM clocks and DT nodes and
enables the fan on the BPI-F3.

Patch 2 keeps pll1_aud_245p7 enabled: once clk_disable_unused() gates
it, accesses to the RCPU2 block hang the CPU (the vendor kernel keeps
it on through its RCPU firmware). It may be better tied to a power
domain once the K1 power domain driver lands; comments welcome.

Tested on a BPI-F3 on v7.4-rc1 (no fan with a PWM input at hand, so
with a multimeter on J27 pin 3): 0.86, 1.76, 2.74 and 4.66 V at 25,
50, 75 and 100% duty (0.04 V off), as with the vendor kernel, and
the fan goes to level 1 when the package reaches 40 C under load.

Trees: 1-3 clk, 4-5 SpacemiT DT (4 needs the IDs from 1), 6 riscv
defconfig. Depends on "reset: spacemit: Fix the RCPU2 PWM reset
registers" (reset/fixes).

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

Signed-off-by: Frédéric Mahé <frederic.mahe@cirad.fr>


Frédéric Mahé (6):
  dt-bindings: clock: spacemit: k1: Add RCPU2 PWM clocks
  clk: spacemit: k1: Keep pll1_aud_245p7 enabled
  clk: spacemit: k1: Add RCPU2 PWM clocks
  riscv: dts: spacemit: k1: Add RCPU2 PWM nodes
  riscv: dts: spacemit: k1-bananapi-f3: Add PWM fan
  riscv: defconfig: Enable PWM fan support

 .../boot/dts/spacemit/k1-bananapi-f3.dts      | 63 +++++++++++++
 arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi  |  7 ++
 arch/riscv/boot/dts/spacemit/k1.dtsi          | 91 +++++++++++++++++++
 arch/riscv/configs/defconfig                  |  1 +
 drivers/clk/spacemit/ccu-k1.c                 | 45 ++++++++-
 .../dt-bindings/clock/spacemit,k1-syscon.h    | 12 +++
 6 files changed, 218 insertions(+), 1 deletion(-)


base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
prerequisite-patch-id: 76613a144ac2f5db5511e6f3dc8645510933c14c
-- 
2.47.3


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-17 21:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 20:59 [PATCH 0/6] riscv: spacemit: k1: RCPU2 PWM clocks and the BPI-F3 fan Frédéric Mahé
2026-11-17 20:59 ` [PATCH 1/6] dt-bindings: clock: spacemit: k1: Add RCPU2 PWM clocks Frédéric Mahé
2026-11-17 20:59 ` [PATCH 2/6] clk: spacemit: k1: Keep pll1_aud_245p7 enabled Frédéric Mahé
2026-11-17 21:18   ` sashiko-bot
2026-11-17 20:59 ` [PATCH 3/6] clk: spacemit: k1: Add RCPU2 PWM clocks Frédéric Mahé
2026-11-17 20:59 ` [PATCH 4/6] riscv: dts: spacemit: k1: Add RCPU2 PWM nodes Frédéric Mahé
2026-11-17 20:59 ` [PATCH 5/6] riscv: dts: spacemit: k1-bananapi-f3: Add PWM fan Frédéric Mahé
2026-11-17 20:59 ` [PATCH 6/6] riscv: defconfig: Enable PWM fan support Frédéric Mahé
2026-11-17 21:16 ` [PATCH 0/6] riscv: spacemit: k1: RCPU2 PWM clocks and the BPI-F3 fan Frédéric Mahé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox