[PW_SID:1129353] clk: spacemit: k3: fix i2s clock topology and divider rates#2302
[PW_SID:1129353] clk: spacemit: k3: fix i2s clock topology and divider rates#2302linux-riscv-bot wants to merge 4 commits into
Conversation
…2s1_sysclk_src IDs Add three new clock IDs to expose clocks introduced by the topology fix: - CLK_MPMU_I2S_SYSCLK (51): the common i2s sysclk DDN at MPMU_ISCCR1 - CLK_MPMU_I2S_BCLK_FACTOR (52): the implicit /2 factor feeding i2s_bclk - CLK_MPMU_I2S1_SYSCLK_SRC (53): the dedicated i2s1 sysclk source mux CLK_MPMU_I2S1_SYSCLK keeps its existing ID (47) but will be repointed to the real per-instance i2s1 clock in a subsequent patch. No in-tree user references this ID so the semantic change is contained. Fixes: efe897b ("dt-bindings: soc: spacemit: k3: add clock support") Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The K3 i2s clocks were modelled as a single path behind one MPMU
register:
pll1_d96_25p6 / i2s_153p6_base
`-- i2s_sysclk_src (mux+gate, MPMU_ISCCR)
`-- i2s1_sysclk (DDN, MPMU_ISCCR)
|-- i2s_bclk (div+gate, MPMU_ISCCR)
`-- i2s2_sysclk (mux, parent 0)
The hardware actually has two i2s clock control registers, ISCCR0
(0x0040) and ISCCR1 (0x0044): ISCCR1 drives the common sysclk shared
by i2s0/2/3/4/5 and the common bclk, whose divider always implies a
fixed 1/2 factor in front, while ISCCR0 drives a dedicated path for
i2s1:
pll1_d96_25p6 / i2s_153p6_base
|-- i2s_sysclk_src (mux+gate, MPMU_ISCCR1)
| `-- i2s_sysclk (DDN, MPMU_ISCCR1)
| |-- i2s_bclk_factor (fixed factor, /2)
| | `-- i2s_bclk (div+gate, MPMU_ISCCR1)
| `-- i2s2_sysclk (mux, parent 0)
`-- i2s1_sysclk_src (mux+gate, MPMU_ISCCR0)
`-- i2s1_sysclk (DDN, MPMU_ISCCR0)
Because of this mismatch, i2s_bclk reported twice the real rate, and
the dedicated i2s1 clock path could not be described in DT at all.
Model the tree as above: split the MPMU_ISCCR register macro into
MPMU_ISCCR0 and MPMU_ISCCR1 to match the hardware register names,
rename the common DDN to i2s_sysclk, insert the fixed 1/2 factor
i2s_bclk_factor in front of i2s_bclk, and add the i2s1_sysclk_src mux
and i2s1_sysclk DDN backed by MPMU_ISCCR0. CLK_MPMU_I2S1_SYSCLK now
refers to the dedicated i2s1 clock; no in-tree user references this
ID, so nothing is affected by the change of meaning.
Fixes: e371a77 ("clk: spacemit: k3: add the clock tree")
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The i2s{0,2,3,4,5}_sysclk_div DDNs have an additional fixed 1/2
divider in the hardware IP after the configurable divider, so the
real output rate is:
rate = parent_rate * num / (den * 2)
Set pre_div to 2 to account for it.
Fixes: e371a77 ("clk: spacemit: k3: add the clock tree")
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[1/3] dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs" |
|
Patch 1: "[1/3] dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs" |
|
Patch 1: "[1/3] dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs" |
|
Patch 1: "[1/3] dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs" |
|
Patch 1: "[1/3] dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs" |
|
Patch 1: "[1/3] dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs" |
|
Patch 1: "[1/3] dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs" |
|
Patch 1: "[1/3] dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs" |
|
Patch 1: "[1/3] dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs" |
|
Patch 1: "[1/3] dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs" |
|
Patch 1: "[1/3] dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs" |
|
Patch 1: "[1/3] dt-bindings: soc: spacemit: k3: add i2s_sysclk, i2s_bclk_factor and i2s1_sysclk_src IDs" |
|
Patch 2: "[2/3] clk: spacemit: k3: fix i2s clock topology" |
|
Patch 2: "[2/3] clk: spacemit: k3: fix i2s clock topology" |
|
Patch 2: "[2/3] clk: spacemit: k3: fix i2s clock topology" |
|
Patch 2: "[2/3] clk: spacemit: k3: fix i2s clock topology" |
|
Patch 2: "[2/3] clk: spacemit: k3: fix i2s clock topology" |
|
Patch 2: "[2/3] clk: spacemit: k3: fix i2s clock topology" |
|
Patch 2: "[2/3] clk: spacemit: k3: fix i2s clock topology" |
|
Patch 2: "[2/3] clk: spacemit: k3: fix i2s clock topology" |
|
Patch 2: "[2/3] clk: spacemit: k3: fix i2s clock topology" |
|
Patch 2: "[2/3] clk: spacemit: k3: fix i2s clock topology" |
|
Patch 2: "[2/3] clk: spacemit: k3: fix i2s clock topology" |
|
Patch 2: "[2/3] clk: spacemit: k3: fix i2s clock topology" |
|
Patch 3: "[3/3] clk: spacemit: k3: fix missing /2 factor in i2s sysclk dividers" |
|
Patch 3: "[3/3] clk: spacemit: k3: fix missing /2 factor in i2s sysclk dividers" |
|
Patch 3: "[3/3] clk: spacemit: k3: fix missing /2 factor in i2s sysclk dividers" |
|
Patch 3: "[3/3] clk: spacemit: k3: fix missing /2 factor in i2s sysclk dividers" |
|
Patch 3: "[3/3] clk: spacemit: k3: fix missing /2 factor in i2s sysclk dividers" |
|
Patch 3: "[3/3] clk: spacemit: k3: fix missing /2 factor in i2s sysclk dividers" |
|
Patch 3: "[3/3] clk: spacemit: k3: fix missing /2 factor in i2s sysclk dividers" |
|
Patch 3: "[3/3] clk: spacemit: k3: fix missing /2 factor in i2s sysclk dividers" |
|
Patch 3: "[3/3] clk: spacemit: k3: fix missing /2 factor in i2s sysclk dividers" |
|
Patch 3: "[3/3] clk: spacemit: k3: fix missing /2 factor in i2s sysclk dividers" |
|
Patch 3: "[3/3] clk: spacemit: k3: fix missing /2 factor in i2s sysclk dividers" |
|
Patch 3: "[3/3] clk: spacemit: k3: fix missing /2 factor in i2s sysclk dividers" |
8ca72ef to
60e0882
Compare
PR for series 1129353 applied to workflow__riscv__fixes
Name: clk: spacemit: k3: fix i2s clock topology and divider rates
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1129353
Version: 1