[PATCH v2 0/9] clk: mediatek: mt8365: fix clocks

David Lechner dlechner at baylibre.com
Wed Jan 7 17:21:06 CET 2026


There were a number of bugs in the clock definitions for the mt8365
clock drivers. This series aims to fix the obvious issues.

This builds on [1] that implements the clk dump command to inspect the
clock trees at runtime. Using that revealed quite a few mistakes in
the clock definitions.

Additionally, the topckgen-cg hack is removed for mt8365 since it would
require an extra devicetree node using the same address space as the
topckgen node. This would not be accepted upstream in Linux, so we
shouldn't do it in U-Boot either. mt85{12,16,18} also have this hack.
I didn't attempt to remove it from those platforms since I don't have
hardware to test on.

Patches have been runtime tested on mt8365_evk hardware and compile-
tested on other platforms using:

    ./tools/buildman/buildman --boards=mt7986a_bpir3_sd,mt7620_rfb,mt7986_rfb,mt7987_emmc_rfb,mt7987_rfb,mt7622_rfb,mt7987_sd_rfb,mt7623a_unielec_u7623_02,mt7988_rfb,mt7623n_bpir2,mt7988_sd_rfb,mt7628_rfb,mt8183_pumpkin,mt7629_rfb,mt8365_evk,mt7981_emmc_rfb,mt8512_bm1_emmc,mt7981_rfb,mt8516_pumpkin,mt7981_sd_rfb,mt8518_ap1_emmc -b HEAD -c 9

[1]: https://lore.kernel.org/u-boot/20251218-clk-mtk-improvements-v1-0-72db131ba148@baylibre.com/

Signed-off-by: David Lechner <dlechner at baylibre.com>
---
Changes in v2:
- Picked up review tag.
- Fixed typo in a couple macros.
- Added changes for mt8188 (new driver that was picked up since v1).
- Actually compile-tested all drivers this time (I learned about buildman).
- Link to v1: https://lore.kernel.org/r/20251218-clk-mtk-mt8365-fixes-v1-0-4f8ff0de3268@baylibre.com

---
David Lechner (9):
      mt8365_evk_defconfig: enable clk command
      clk: mediatek: mt8365: fix missing and out of order clocks
      clk: mediatek: add separate gates_offs for cg gates
      clk: mediatek: fix fixed clock parents
      clk: mediatek: mt8365: fix some clock parents
      clk: mediatek: mt8365: split struct mtk_clk_tree
      clk: mediatek: allow gates in topckgen drivers
      clk: mediatek: mt8365: remove separate topckgen-cg driver
      clk: mediatek: mt8365: fix missing topckgen IDs

 configs/mt8365_evk_defconfig      |   1 +
 drivers/clk/mediatek/clk-mt7622.c |  31 ++--
 drivers/clk/mediatek/clk-mt7623.c |  41 +++---
 drivers/clk/mediatek/clk-mt7629.c |  34 +++--
 drivers/clk/mediatek/clk-mt7981.c |  27 ++--
 drivers/clk/mediatek/clk-mt7986.c |  23 +--
 drivers/clk/mediatek/clk-mt7987.c |  21 +--
 drivers/clk/mediatek/clk-mt7988.c |  37 ++---
 drivers/clk/mediatek/clk-mt8183.c |  14 +-
 drivers/clk/mediatek/clk-mt8188.c |  41 +++---
 drivers/clk/mediatek/clk-mt8365.c | 297 ++++++++++++++++++++++++++++----------
 drivers/clk/mediatek/clk-mt8512.c |  11 +-
 drivers/clk/mediatek/clk-mt8516.c |  14 +-
 drivers/clk/mediatek/clk-mt8518.c |  16 +-
 drivers/clk/mediatek/clk-mtk.c    |  88 ++++++++---
 drivers/clk/mediatek/clk-mtk.h    |   8 +-
 16 files changed, 472 insertions(+), 232 deletions(-)
---
base-commit: 53c0d5b387956bb4070a943b61991898373a20e2
change-id: 20251218-clk-mtk-mt8365-fixes-81a312e8af28
prerequisite-change-id: 20251215-clk-mtk-improvements-db0b9d1d3113:v2
prerequisite-patch-id: d8ebdfa01cceb83513361f876553f66eabe2986e
prerequisite-patch-id: 2f272f681a04828ce44ea4010d1d613ca554c321
prerequisite-patch-id: b4d03b405596876fd02b30cf335b677e6c630cee
prerequisite-patch-id: 44f6f31cac0c5361cfd8b23ee7aa4f1d49c7d4b2
prerequisite-patch-id: 539af724f889b136a758a6833dbe4d3eaa986a8b
prerequisite-patch-id: 3330313a7c4178da97b50159ca627aafadfb0049
prerequisite-patch-id: 96f170f2b16aeacc404270b8444dfe5a928f8a93
prerequisite-patch-id: 7379668c38c251dbcd81c4d5b72ba5fdaad91a0d
prerequisite-patch-id: fbe17c1c0d5f18e2a33a8208e63e73292a6b4a5c

Best regards,
-- 
David Lechner <dlechner at baylibre.com>



More information about the U-Boot mailing list