Skip to content

clk: realtek: Add RTD1625 clock support

Yu-Chun Lin linux-arm-kernel linux-clk linux-devicetree lkml 18 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v17 Latest9 patches 0 repliesNew
  2. v16 posting 2/23 patches 3 repliesApplied
  3. v16 posting 1/29 patches 9 repliesSuperseded
Earlier versions · 15
VersionPostedPatchesRepliesStatus
v1511 patches12 repliesSuperseded
v1411 patches10 repliesSuperseded
v1311 patches9 repliesSuperseded
v1211 patches3 repliesSuperseded
v1111 patches16 repliesSuperseded
v1011 patches5 repliesSuperseded
v912 patches6 repliesSuperseded
v810 patches3 repliesSuperseded
v710 patches1 replySuperseded
v610 patches20 repliesSuperseded
v510 patches7 repliesSuperseded
v410 patches8 repliesSuperseded
v39 patches2 repliesSuperseded
v29 patches3 repliesSuperseded
v19 patches6 repliesSuperseded

Patches in v17 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9dt-bindings: clock: Add Realtek RTD1625 Clock & Reset ControllerDocumentation/devicetree/bindings/clock/realtek,rtd1625-clk.yaml MAINTAINERS include/dt-bindings/clock/realtek,rtd1625-clk.h+265 -00 replies
2/9clk: realtek: Introduce common probe()MAINTAINERS drivers/clk/Kconfig drivers/clk/Makefile +4 more+150 -00 replies
3/9clk: realtek: Add support for phase locked loops (PLLs)drivers/clk/realtek/Makefile drivers/clk/realtek/clk-regmap-pll.c drivers/clk/realtek/clk-regmap-pll.h +2 more+306 -00 replies
4/9clk: realtek: Add support for gate clockdrivers/clk/realtek/Makefile drivers/clk/realtek/clk-regmap-gate.c drivers/clk/realtek/clk-regmap-gate.h+114 -00 replies
5/9clk: realtek: Add support for mux clockdrivers/clk/realtek/Makefile drivers/clk/realtek/clk-regmap-mux.c drivers/clk/realtek/clk-regmap-mux.h+83 -00 replies
6/9clk: realtek: Add support for MMC-tuned PLL clocksdrivers/clk/realtek/Kconfig drivers/clk/realtek/Makefile drivers/clk/realtek/clk-regmap-pll-mmc.c +2 more+518 -00 replies
7/9clk: realtek: Add RTD1625-CRT clock controller driverdrivers/clk/realtek/Kconfig drivers/clk/realtek/Makefile drivers/clk/realtek/clk-rtd1625-crt.c+874 -00 replies
8/9clk: realtek: Add RTD1625-ISO clock controller driverdrivers/clk/realtek/Makefile drivers/clk/realtek/clk-rtd1625-iso.c+141 -00 replies
9/9arm64: dts: realtek: Add clock support for RTD1625arch/arm64/boot/dts/realtek/kent.dtsi+41 -00 replies

Reviews trailers per patch

1 of 9 patches has a Reviewed-by or Acked-by.

PatchBrian Masney
1/9
2/9R-b
3/9
4/9
5/9
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v17 thread

Cover letter [PATCH v17 0/9] clk: realtek: Add RTD1625 clock support

Hello,

This patch series adds the clock controller support for Realtek's RTD1625 SoC platform.

Because the reset controllers share the same register space with the clock controllers on this platform, we utilize the Auxiliary Bus framework to decouple them. The clock controllers act as the primary devices, registering the reset controllers as auxiliary devices.

The series includes:
1. Device Tree Bindings:
- Add bindings for the Realtek RTD1625 Clock & Reset Controllers.

2. Clock Subsystem Infrastructure:
- Introduce a common probe, and add support for basic clocks including PLLs, gate clocks, mux clocks, and MMC-tuned PLLs.

3. Clock Platform Drivers:
- Add the clock controller drivers for RTD1625-CRT and RTD1625-ISO.
- These drivers provide the clock sources and instantiate the corresponding auxiliary reset devices.

Best regards,
Yu-Chun Lin
---
Changes in v17:

Patch 1 (dt-binding):
- Move the 'clocks' and 'clock-names' item descriptions to the top level, and keep only the item counts in the if/else branches.

Patch 2:
- Make the "Realtek Clock Common" Kconfig symbol a bare tristate and drop its prompt and help text.
- Change the type of aux_name from 'char *' to 'const char *'.

Patch 3 (PLL):
- Move the power-on sequence from '.enable()' to '.prepare()', and use 'regmap_read_poll_timeout()' instead of the atomic variant: 'wait_freq_ready()' can take up to 500 us, which is too long to busy-wait in atomic context.
- Drop the spinlock now that '.prepare()', '.unprepare()' and '.set_rate()' are all serialized by 'prepare_lock'.
- Turn 'ftbl_find_closest_by_rate()' into a macro so that tables other than 'struct rtk_freq_table' can use it.

Patch 4 (GATE):
- Return 0 instead of the error code from '.is_enabled()'.

Patch 6 (MMC PLL):
- Reuse the 'ftbl_find_closest_by_rate()' macro and drop the local duplicate.
- Make 'rate_tbl' optional and add a built-in default table, which also covers the SPI-NAND operating point at 99,999,206 Hz.
- Add an 'ssc' flag to 'struct rtk_clk_pll_mmc_rate', so that the SSC analog registers are left untouched in SPI-NAND mode.
- Replace 'shift' with 'phsel_mask' in 'struct rtk_clk_pll_mmc_phase', and use 'field_prep()'/'field_get()'.
- '.recalc_rate()' always computes the rate from the dividers instead of reverse-matching the rate table.

Patch 7 (CRT):
Add '.suppress_bind_attrs = true'

v16: https://lore.kernel.org/lkml/[email protected]/
v15: https://lore.kernel.org/lkml/[email protected]/
v14: https://lore.kernel.org/lkml/[email protected]/
v13: https://lore.kernel.org/lkml/[email protected]/
v12: https://lore.kernel.org/lkml/[email protected]/
v11: https://lore.kernel.org/lkml/[email protected]/
v10: https://lore.kernel.org/lkml/[email protected]/
v9: https://lore.kernel.org/lkml/[email protected]/
v8: https://lore.kernel.org/lkml/[email protected]/
v7: https://lore.kernel.org/lkml/[email protected]/
v6: https://lore.kernel.org/lkml/[email protected]/
v5: https://lore.kernel.org/lkml/[email protected]/
v4: https://lore.kernel.org/lkml/[email protected]/
v3: https://lore.kernel.org/lkml/[email protected]/
v2: https://lore.kernel.org/lkml/[email protected]/
v1: https://lore.kernel.org/lkml/[email protected]/

Cheng-Yu Lee (7):
clk: realtek: Introduce common probe()
clk: realtek: Add support for phase locked loops (PLLs)
clk: realtek: Add support for gate clock
clk: realtek: Add support for mux clock
clk: realtek: Add support for MMC-tuned PLL clocks
clk: realtek: Add RTD1625-CRT clock controller driver
clk: realtek: Add RTD1625-ISO clock controller driver

Yu-Chun Lin (2):
dt-bindings: clock: Add Realtek RTD1625 Clock & Reset Controller
arm64: dts: realtek: Add clock support for RTD1625

 .../bindings/clock/realtek,rtd1625-clk.yaml   |  93 ++
 MAINTAINERS                                   |   7 +
 arch/arm64/boot/dts/realtek/kent.dtsi         |  41 +
 drivers/clk/Kconfig                           |   1 +
 drivers/clk/Makefile                          |   1 +
 drivers/clk/realtek/Kconfig                   |  39 +
 drivers/clk/realtek/Makefile                  |  12 +
 drivers/clk/realtek/clk-regmap-gate.c         |  59 ++
 drivers/clk/realtek/clk-regmap-gate.h         |  54 ++
 drivers/clk/realtek/clk-regmap-mux.c          |  40 +
 drivers/clk/realtek/clk-regmap-mux.h          |  42 +
 drivers/clk/realtek/clk-regmap-pll-mmc.c      | 443 +++++++++
 drivers/clk/realtek/clk-regmap-pll-mmc.h      |  69 ++
 drivers/clk/realtek/clk-regmap-pll.c          | 177 ++++
 drivers/clk/realtek/clk-regmap-pll.h          |  44 +
 drivers/clk/realtek/clk-rtd1625-crt.c         | 859 ++++++++++++++++++
 drivers/clk/realtek/clk-rtd1625-iso.c         | 140 +++
 drivers/clk/realtek/clk-rtk-common.c          |  84 ++
 drivers/clk/realtek/clk-rtk-common.h          |  37 +
 drivers/clk/realtek/freq_table.c              |  39 +
 drivers/clk/realtek/freq_table.h              |  45 +
 .../dt-bindings/clock/realtek,rtd1625-clk.h   | 166 ++++
 22 files changed, 2492 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/realtek,rtd1625-clk.yaml
 create mode 100644 drivers/clk/realtek/Kconfig
 create mode 100644 drivers/clk/realtek/Makefile
 create mode 100644 drivers/clk/realtek/clk-regmap-gate.c
 create mode 100644 drivers/clk/realtek/clk-regmap-gate.h
 create mode 100644 drivers/clk/realtek/clk-regmap-mux.c
 create mode 100644 drivers/clk/realtek/clk-regmap-mux.h
 create mode 100644 drivers/clk/realtek/clk-regmap-pll-mmc.c
 create mode 100644 drivers/clk/realtek/clk-regmap-pll-mmc.h
 create mode 100644 drivers/clk/realtek/clk-regmap-pll.c
 create mode 100644 drivers/clk/realtek/clk-regmap-pll.h
 create mode 100644 drivers/clk/realtek/clk-rtd1625-crt.c
 create mode 100644 drivers/clk/realtek/clk-rtd1625-iso.c
 create mode 100644 drivers/clk/realtek/clk-rtk-common.c
 create mode 100644 drivers/clk/realtek/clk-rtk-common.h
 create mode 100644 drivers/clk/realtek/freq_table.c
 create mode 100644 drivers/clk/realtek/freq_table.h
 create mode 100644 include/dt-bindings/clock/realtek,rtd1625-clk.h
Signature · 1 line
2.43.0