Re: [PATCH RFC v4 01/12] dt-bindings: clk: zte: Add zx297520v3 top clock and reset bindings
From: Conor Dooley <conor@kernel.org>
Date: 2026-06-17 16:08:14
Also in:
linux-clk, linux-devicetree, lkml
On Tue, Jun 16, 2026 at 11:26:21PM +0300, Stefan Dösinger wrote:
quoted hunk ↗ jump to hunk
These SoCs have 3 clock and reset controllers: Top, Matrix and LSP. The separation of concerns between Top and Matrix and the interface between them is poorly defined in the hardware, so the bindings list all potential PLL clocks that might be passed between them. Generally every device has two clocks (one work clock, and one that connects it to the bus, I call it PCLK), two reset bits (I don't know what the difference is - sometimes asserting one is enough to reset the device, sometimes both need to be asserted). PCLK and WCLK are controlled by individual gates. Some devices have a mux and/or a divider for their work clock. Some devices, like the GPIO controller, only have reset bits and no clocks. The top clock controller is fed by a 26mhz external oscillator and has 4 PLLs to generate other clock rates. ZTE's kernel mostly relies on the boot ROM to set up PLLs, but one LTE-Related PLL is not configured on some boards. Therefore my driver contains code to program PLLs. It produces identical settings as the boot ROM for the pre-programmed frequencies. Not all clocks will have an explicit user in the end. I am defining a lot of them simply to shut them off. The boot loader sets up a few of the proprietary timers, which will send regular IRQs (although the kernel of course doesn't need to listen to them). I don't plan to add a driver for the proprietary timer as I see no use for them - the ARM arch timer works just fine. I will add a driver for the very similar proprietary watchdog though. The clock list in this patch is pretty complete but not exhaustive. There are other bits that are enabled, but I couldn't deduce what they are controlling by trial and error. Some of them seem to do nothing. Others cause an instant hang of the board when disabled. It is quite likely that a handful more clocks will be added in the future, but not a large number. Signed-off-by: Stefan Dösinger <stefandoesinger@gmail.com> --- .../bindings/clock/zte,zx297520v3-topclk.yaml | 70 ++++++++++++ MAINTAINERS | 2 + include/dt-bindings/clock/zte,zx297520v3-clk.h | 118 +++++++++++++++++++++ 3 files changed, 190 insertions(+)diff --git a/Documentation/devicetree/bindings/clock/zte,zx297520v3-topclk.yaml b/Documentation/devicetree/bindings/clock/zte,zx297520v3-topclk.yaml new file mode 100644 index 000000000000..374f63891288 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/zte,zx297520v3-topclk.yaml@@ -0,0 +1,70 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/zte,zx297520v3-topclk.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ZTE zx297520v3 SoC top clock and reset controller + +maintainers: + - Stefan Dösinger <stefandoesinger@gmail.com> + +description: | + The zx297520v3's top clock controller generates clocks for core devices on the + board like the main bus, USB and timers. In addition to clocks it has reset + controls for peripherals, a global board reset and watchdog reset controls. + + The controller has two clock inputs: a 26 MHz and a 32 KHz external + oscillator. They need to be provided as input clocks. The controller provides + clocks to the downstream Matrix clock controller. + + All available clocks are defined as preprocessor macros in the + 'dt-bindings/clock/zte,zx297520v3-clk.h' header. + +properties: + compatible: + items: + - const: zte,zx297520v3-topclk + - const: syscon + + reg: + maxItems: 1 + + clocks: + items: + - description: 26 MHz external oscillator + - description: 32 KHz external oscillator + + clock-names: + items: + - const: osc26m + - const: osc32k + + "#clock-cells": + const: 1 + + "#reset-cells": + const: 1 + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - '#reset-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/zte,zx297520v3-clk.h> + + clock-controller@13b000 { + compatible = "zte,zx297520v3-topclk", "syscon"; + reg = <0x0013b000 0x400>; + clocks = <&osc26m>, <&osc32k>; + clock-names = "osc26m", "osc32k"; + #clock-cells = <1>; + #reset-cells = <1>; + };diff --git a/MAINTAINERS b/MAINTAINERS index 8629ed2aa82f..0cc1ede3c80c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS@@ -3867,8 +3867,10 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) S: Odd fixes F: Documentation/arch/arm/zte/ F: Documentation/devicetree/bindings/arm/zte.yaml +F: Documentation/devicetree/zte,zx297520v3-*
Sashiko complaint here looks valid. FWIW /scripts/get_maintainer.pl --self-test=patterns will catch these kinds of things. pw-bot: changes-requested Cheers, Conor.
F: arch/arm/boot/dts/zte/ F: arch/arm/mach-zte/ +F: include/dt-bindings/clock/zte,zx297520v3-clk.h
Attachments
- signature.asc [application/pgp-signature] 228 bytes