Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/3] clk: spacemit: k3: fix i2s clock topology and divider rates
@ 2026-07-17  7:26 Troy Mitchell
  2026-07-17  7:26 ` [PATCH 1/3] dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs Troy Mitchell
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Troy Mitchell @ 2026-07-17  7:26 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Brian Masney, Yixun Lan,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-clk, linux-riscv, spacemit, linux-kernel,
	Krzysztof Kozlowski, devicetree, Troy Mitchell

The K3 i2s clock tree was modelled on the K1 layout but does not match
the actual K3 hardware topology, leading to incorrect clock rates being
reported and programmed.

Three fixes are provided in dependency order:

First, the MPMU_ISCCR syscon register is renamed to MPMU_ISCCR1 to
match the hardware register name, and MPMU_ISCCR0 (offset 0x0040) is
added. This prepares the header for the clock topology corrections that
follow.

Second, the clock topology is reworked to reflect the real hardware:
the common i2s_sysclk DDN at MPMU_ISCCR1 is renamed from "i2s1_sysclk",
an implicit 1/2 factor (i2s_bclk_factor) is introduced before i2s_bclk,
and the dedicated i2s1 clock path (i2s1_sysclk_src MUX + i2s1_sysclk
DDN backed by MPMU_ISCCR0) is added. CLK_MPMU_I2S1_SYSCLK keeps its
existing ID but now refers to the real per-instance i2s1 clock; no
in-tree user references this ID so the semantic change is contained.

Third, the per-instance i2s sysclk DDNs (i2s{0,2,3,4,5}_sysclk_div)
are corrected to account for the hardware-internal 1/2 factor by setting
pre_div to 2 instead of 1, so clk_get_rate() and clk_set_rate() report
and program the real hardware rate.

---
Troy Mitchell (3):
      dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs
      clk: spacemit: k3: fix i2s clock topology
      clk: spacemit: k3: fix missing /2 factor in i2s sysclk dividers

 drivers/clk/spacemit/ccu-k3.c                  | 31 +++++++++++++++++---------
 include/dt-bindings/clock/spacemit,k3-clocks.h |  3 +++
 include/soc/spacemit/k3-syscon.h               |  3 ++-
 3 files changed, 26 insertions(+), 11 deletions(-)
---
base-commit: c425609d6ac4012c8bbf01ec2e10e801b1923a7b
change-id: 20260615-k3-clk-fix-i2s-5e278a472061

Best regards,
--  
Troy Mitchell <troy.mitchell@linux.spacemit.com>


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

end of thread, other threads:[~2026-07-17  7:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17  7:26 [PATCH 0/3] clk: spacemit: k3: fix i2s clock topology and divider rates Troy Mitchell
2026-07-17  7:26 ` [PATCH 1/3] dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs Troy Mitchell
2026-07-17  7:33   ` sashiko-bot
2026-07-17  7:26 ` [PATCH 2/3] clk: spacemit: k3: fix i2s clock topology Troy Mitchell
2026-07-17  7:26 ` [PATCH 3/3] clk: spacemit: k3: fix missing /2 factor in i2s sysclk dividers Troy Mitchell
2026-07-17  7:37   ` sashiko-bot

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