[PATCH v9 00/12] ZTE zx297520v3 clock bindings and driver
Stefan Dösinger <[email protected]> Sun, 02 Aug 2026 23:33:32 +0300
| Newsgroups | org.kernel.vger.linux-clk,dev.linux.lists.mfd,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-phy,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
Hi, I am sending version 9 of my zx297520v3 clock patch. The main change vs v8 is that the clock driver uses parent_data.hw instead of global names for parent matching. I think the list of clocks in my driver is fairly complete; It is certainly a lot better than what the downstream ZTE drivers have. I deduced a lot of it by trial and error. I am sure there are some clocks missing that will need to be added to the binding later. AFAIU adding clocks is not an issue, but removing or reordering them is an ABI break. Merge dependencies: The binding patches (1, 2, 3) and DT patch (12) in order. The MFD parent (4) is independent, although changing the ordering likely needs trivial adjustments in MAINTAINERS. The clock driver patches depend on the headers added by 1-3 and apply in order (5-10). Reset needs headers (1-3), but it is independent of clock. Though in practice mfd, clock and reset drivers are dead code until patch 12 adds the DT nodes. Clock and reset drivers won't be instantiated without the MFD parent. Signed-off-by: Stefan Dösinger <[email protected]> --- Changes in v9: *) Use parent_data in the clock driver instead of parent_names. That required some infrastructure to keep track of registered clocks rather than devm-and-forget. A nice side effect is that it uncovered a missing top->matrix clock link. (Brian) *) Remove the self-referencing USB PHY reset in topcrm (Krzysztof) *) (Hopefully) get unevaluatedProperties and additionalProperties right in topcrm (Krzysztof) *) GMAC and SDIO on the matrixcrm controller need topcrm's ahb clock as parent. It is added to Matrix's binding and fixed in the driver *) LSP reset and pclk handling moved from clock child to mfd parent driver - Link to v8: https://lore.kernel.org/r/[email protected] Changes in v8: *) Put #phy-cells into topcrm. The mfd child will have to assign itself the MFD parent's of_node to satisfy the check in phy-core.c's __of_phy_provider_register(). *) Added another register to matrixclk that controls in-controller distribution gates. No functional change, but it nicely confirms the top->matrix interface *) Changed clock indices to start at 0, adjusted driver to not use 0 as "do not export" marker. *) Rename DT fixed clock nodes from osc26m -> clock-26m and osc32k -> clock-32k *) Fixed more issues pointed out by Sashiko - Link to v7: https://lore.kernel.org/r/[email protected] Changes in v7: *) Moved DT bindings back to clock/ (Krzysztof) *) Added a usb-phy child node to top to expose the USB status register *) Add clock gates that control input of PLL clocks into topcrm and forward to matrixcrm. Strip down matrixcrm inputs in the bindings to the known clocks in this register *) Add DDR clocks and resets, arm arch timer clock. They are marked critical and tell CCF not to gate off the aforementioned input/forward gates *) Remove syscon from matrixcrm (Krzysztof). The DDR mailbox system is on a different controller (soc_sys at 0x140000). ZTE's code merely controlled clocks in matrixcrm, which doesn't require syscon on this controller. *) Consistently use double quotes in bindings and full include paths (Krzysztof) The individual patches call out changes in more detail. - Link to v6: https://lore.kernel.org/r/[email protected] Changes in v6: *) Use MFD for all 3 controllers - I hope both Conor and Philipp will agree. I kept top and matrix bindings in soc/zte and lsp in clock/ though. *) Clean up issues found by Sashiko. I pointed them out in the individual patches. They are localized fixes and don't affect the overall design *) Small code consistency: Changed "zx297520v3_lsp" to use "-" , "rst" in driver names to "reset" Changes in v5: *) Use MFD instead of aux bus for top and matrix clocks *) Move top and matrix bindings to soc/zte *) Give USB PHY its own resets *) Other localized changes are noted in the individual patches - Link to v4: https://lore.kernel.org/r/[email protected] Changes in v4: *) Use syscon and regmap instead of raw IO *) Move reset to its own driver on the aux bus, but keep reset and clk in the same binding as it matches the way the hardware works *) Go back to having matrixclk in its own device because syscon deals poorly with multi io reg devices. List all PLL outputs from topclk as inputs to matrixclk *) Some more hardware research: Figure out the parents of the 4 possible GPIO clock outputs and declare them in the driver. They are unused on the hardware I have, but they show that all PLLs can be used. - Link to v3: https://lore.kernel.org/r/[email protected] Changes in v3: Model top and matrix clocks as one device Add PLL driver Fixed a few issues found by Sashiko: register lock, some missing devm_, error handling v2: Fix build issues introduced by checkpatch.pl fixes that I didn't spot earlier. --- Stefan Dösinger (12): dt-bindings: clk: zte: Add zx297520v3 top clock and reset controller dt-bindings: clk: zte: Add zx297520v3 matrix clock and reset controller dt-bindings: clk: zte: Add zx297520v3 LSP clock and reset controller mfd: zx297520v3: Add a clock and reset MFD driver clk: zte: Add Clock registration infrastructure clk: zte: Add regmap-based clocks clk: zte: Add zx PLL support infrastructure clk: zte: Introduce a driver for zx297520v3 top clocks clk: zte: Introduce a driver for zx297520v3 matrix clocks clk: zte: Introduce a driver for zx297520v3 LSP clocks reset: zte: Add a zx297520v3 reset driver ARM: dts: zte: Declare zx297520v3 CRM device nodes .../bindings/clock/zte,zx297520v3-lspcrm.yaml | 101 ++ .../bindings/clock/zte,zx297520v3-matrixcrm.yaml | 98 ++ .../bindings/clock/zte,zx297520v3-topcrm.yaml | 122 ++ MAINTAINERS | 9 + arch/arm/boot/dts/zte/zx297520v3.dtsi | 81 +- drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/zte/Kconfig | 28 + drivers/clk/zte/Makefile | 6 + drivers/clk/zte/clk-regmap.c | 237 +++ drivers/clk/zte/clk-zx.c | 189 +++ drivers/clk/zte/clk-zx.h | 142 ++ drivers/clk/zte/clk-zx297520v3.c | 1571 ++++++++++++++++++++ drivers/clk/zte/pll-zx.c | 580 ++++++++ drivers/mfd/Kconfig | 11 + drivers/mfd/Makefile | 2 + drivers/mfd/zte-zx297520v3-crm.c | 117 ++ drivers/reset/Kconfig | 13 + drivers/reset/Makefile | 1 + drivers/reset/reset-zte-zx297520v3.c | 236 +++ include/dt-bindings/clock/zte,zx297520v3-clk.h | 144 ++ include/dt-bindings/phy/zte,zx297520v3-topcrm.h | 12 + include/dt-bindings/reset/zte,zx297520v3-reset.h | 61 + 23 files changed, 3755 insertions(+), 8 deletions(-) --- base-commit: bee763d5f341b99cf472afeb508d4988f62a6ca1 change-id: 20260510-zx29clk-2e4d39e3128c Best regards, -- Stefan Dösinger <[email protected]>