[PATCH v6 00/27] Add support for MT8196 clock controllers

Laura Nao
2025-09-15T15:21:37Z

This patch series introduces support for the clock controllers on the
MediaTek MT8196 platform, following up on an earlier submission[1].

MT8196 uses a hardware voting mechanism to control some of the clock muxes
and gates, along with a fence register responsible for tracking PLL and mux
gate readiness. The series introduces support for these voting and fence
mechanisms, and includes drivers for all clock controllers on the platform.

[1] https://lore.kernel.org/all/20250307032942.10447-1-guangjie.song@mediatek.com/

Changes in v6:
- Removed unnecessary braces in clk-mux and clk-gate
- Excluded clk26m from the parent lists of vlp_audio_h, vlp_aud_engen1,
vlp_aud_engen2, and vlp_aud_intbus
- Reordered entries in of_match_clk_mt8196_mdpsys
- Converted mfg_eb clock into a mux with a gate

Link to v5: https://lore.kernel.org/all/20250829091913.131528-1-laura.nao@collabora.com/

Laura Nao (27):
clk: mediatek: clk-pll: Add set/clr regs for shared PLL enable control
clk: mediatek: clk-pll: Add ops for PLLs using set/clr regs and FENC
clk: mediatek: clk-mux: Add ops for mux gates with set/clr/upd and
FENC
clk: mediatek: clk-mtk: Introduce mtk_clk_get_hwv_regmap()
clk: mediatek: clk-mux: Add ops for mux gates with HW voter and FENC
clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use
mtk_gate struct
clk: mediatek: clk-gate: Add ops for gates with HW voter
clk: mediatek: clk-mtk: Add MUX_DIV_GATE macro
dt-bindings: clock: mediatek: Describe MT8196 clock controllers
clk: mediatek: Add MT8196 apmixedsys clock support
clk: mediatek: Add MT8196 topckgen clock support
clk: mediatek: Add MT8196 topckgen2 clock support
clk: mediatek: Add MT8196 vlpckgen clock support
clk: mediatek: Add MT8196 peripheral clock support
clk: mediatek: Add MT8196 ufssys clock support
clk: mediatek: Add MT8196 pextpsys clock support
clk: mediatek: Add MT8196 I2C clock support
clk: mediatek: Add MT8196 mcu clock support
clk: mediatek: Add MT8196 mdpsys clock support
clk: mediatek: Add MT8196 mfg clock support
clk: mediatek: Add MT8196 disp0 clock support
clk: mediatek: Add MT8196 disp1 clock support
clk: mediatek: Add MT8196 disp-ao clock support
clk: mediatek: Add MT8196 ovl0 clock support
clk: mediatek: Add MT8196 ovl1 clock support
clk: mediatek: Add MT8196 vdecsys clock support
clk: mediatek: Add MT8196 vencsys clock support

.../bindings/clock/mediatek,mt8196-clock.yaml | 112 ++
.../clock/mediatek,mt8196-sys-clock.yaml | 107 ++
drivers/clk/mediatek/Kconfig | 71 ++
drivers/clk/mediatek/Makefile | 13 +
drivers/clk/mediatek/clk-gate.c | 117 ++-
drivers/clk/mediatek/clk-gate.h | 3 +
drivers/clk/mediatek/clk-mt8196-apmixedsys.c | 204 ++++
drivers/clk/mediatek/clk-mt8196-disp0.c | 170 +++
drivers/clk/mediatek/clk-mt8196-disp1.c | 170 +++
.../clk/mediatek/clk-mt8196-imp_iic_wrap.c | 118 +++
drivers/clk/mediatek/clk-mt8196-mcu.c | 167 +++
drivers/clk/mediatek/clk-mt8196-mdpsys.c | 186 ++++
drivers/clk/mediatek/clk-mt8196-mfg.c | 150 +++
drivers/clk/mediatek/clk-mt8196-ovl0.c | 154 +++
drivers/clk/mediatek/clk-mt8196-ovl1.c | 154 +++
drivers/clk/mediatek/clk-mt8196-peri_ao.c | 142 +++
drivers/clk/mediatek/clk-mt8196-pextp.c | 131 +++
drivers/clk/mediatek/clk-mt8196-topckgen.c | 985 ++++++++++++++++++
drivers/clk/mediatek/clk-mt8196-topckgen2.c | 568 ++++++++++
drivers/clk/mediatek/clk-mt8196-ufs_ao.c | 108 ++
drivers/clk/mediatek/clk-mt8196-vdec.c | 253 +++++
drivers/clk/mediatek/clk-mt8196-vdisp_ao.c | 80 ++
drivers/clk/mediatek/clk-mt8196-venc.c | 236 +++++
drivers/clk/mediatek/clk-mt8196-vlpckgen.c | 725 +++++++++++++
drivers/clk/mediatek/clk-mtk.c | 16 +
drivers/clk/mediatek/clk-mtk.h | 22 +
drivers/clk/mediatek/clk-mux.c | 120 ++-
drivers/clk/mediatek/clk-mux.h | 87 ++
drivers/clk/mediatek/clk-pll.c | 45 +-
drivers/clk/mediatek/clk-pll.h | 8 +
.../dt-bindings/clock/mediatek,mt8196-clock.h | 803 ++++++++++++++
.../reset/mediatek,mt8196-resets.h | 26 +
32 files changed, 6216 insertions(+), 35 deletions(-)
create mode 100644 Documentation/devicetree/bindings/clock/mediatek,mt8196-clock.yaml
create mode 100644 Documentation/devicetree/bindings/clock/mediatek,mt8196-sys-clock.yaml
create mode 100644 drivers/clk/mediatek/clk-mt8196-apmixedsys.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-disp0.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-disp1.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-imp_iic_wrap.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-mcu.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-mdpsys.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-mfg.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-ovl0.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-ovl1.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-peri_ao.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-pextp.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-topckgen.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-topckgen2.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-ufs_ao.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-vdec.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-vdisp_ao.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-venc.c
create mode 100644 drivers/clk/mediatek/clk-mt8196-vlpckgen.c
create mode 100644 include/dt-bindings/clock/mediatek,mt8196-clock.h
create mode 100644 include/dt-bindings/reset/mediatek,mt8196-resets.h

--
2.39.5