From: "Stefan Dösinger" <stefandoesinger@gmail•com>
To: Michael Turquette <mturquette@baylibre•com>,
Stephen Boyd <sboyd@kernel•org>, Rob Herring <robh@kernel•org>,
Krzysztof Kozlowski <krzk+dt@kernel•org>,
Conor Dooley <conor+dt@kernel•org>,
Philipp Zabel <p.zabel@pengutronix•de>,
Brian Masney <bmasney@redhat•com>
Cc: linux-clk@vger•kernel.org, devicetree@vger•kernel.org,
linux-kernel@vger•kernel.org,
linux-arm-kernel@lists•infradead.org,
"Stefan Dösinger" <stefandoesinger@gmail•com>
Subject: [PATCH RFC v3 0/5] ZTE zx297520v3 clock bindings and driver
Date: Fri, 29 May 2026 00:52:57 +0300 [thread overview]
Message-ID: <20260529-zx29clk-v3-0-c7fe54ea388f@gmail.com> (raw)
Hi,
I am sending version 3 of my zx297520v3 clock patch. The major change is
that I have merged the top and matrix clocks into one device because
the interface between them is unclear in the hardware.
There are still a few open questions though:
1) The clk-reset interaction: Both clocks and resets are in the same IO
space, sometimes in the same registers. I see a number of clk drivers
that register a reset control. I noticed Yu-Chun Lin's RTD1625 clock
submission added an aux device and placed the reset code in
drivers/reset instead. Is there a preference for either way or any
guideline of which way to use in which circumstances?
2) Unused clocks: I looked at recently introduced clk drivers
(mediatek,mt8196-clock.h, sun55i-a523-mcu-ccu.h) and they do add all a
lot of clocks that do not have an active consumer - which in a way means
unused ABI. Please let me know if you prefer to add clocks one by one as
their consumers are added.
That said, there are a lot of clocks that I want to define for the sole
purpose of shutting them off. The boot loader leaves pretty much every
device enabled, including proprietary timers that I don't even plan to
write a driver for. Registering their clocks in the kernel will allow
the kernel to shut them off, so they aren't entirely unused.
3) I took some naming from the old zx2967 code. In particular, each
device has two clocks: "WCLK" for the device operation and "PCLK" for
register access. Are there more standard names for them? Likewise I took
some device names from ZTE's downstream sources and I am open to better
suggestions.
My impression so far is that "PCLK" is fairly common. There is no agreed
name name prefix/suffix for the other clock. If anything, just nothing.
(i.e. "UART0_PCLK" and "UART0"). On prefix vs suffix, (PCLK_UART0 vs
UART0_PCLK) the existing drivers seem to be all over the place.
4) I took care to test unbinding and rebinding my clock driver to the
hardware and also tested building it as a module - but in practise, the
board will be pretty useless without the clock driver and I have to jump
through some hoops to even test it. Should I even bother, or just set
suppress_bind_attrs = true and make the config a boolean?
Wrt clock name strings vs struct clk / clk_hw pointers for parents:
Using string names seems like the only viable choice in practise.
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.
Signed-off-by: Stefan Dösinger <stefandoesinger@gmail•com>
---
v2: Fix build issues introduced by checkpatch.pl fixes that I didn't
spot earlier.
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
---
Stefan Dösinger (5):
dt-bindings: clk: zte: Add zx297520v3 top clock and reset bindings.
dt-bindings: clk: zte: Add zx297520v3 LSP clock and reset bindings.
clk: zte: Introduce a driver for zx297520v3 top clocks and resets.
clk: zte: Introduce a driver for zx297520v3 LSP clocks and resets.
ARM: dts: zte: Declare a zx297520v3 clock device nodes
.../bindings/clock/zte,zx297520v3-lspclk.yaml | 119 +++
.../bindings/clock/zte,zx297520v3-topclk.yaml | 95 ++
MAINTAINERS | 3 +
arch/arm/boot/dts/zte/zx297520v3.dtsi | 55 +-
drivers/clk/Kconfig | 1 +
drivers/clk/Makefile | 1 +
drivers/clk/zte/Kconfig | 18 +
drivers/clk/zte/Makefile | 5 +
drivers/clk/zte/clk-zx297520v3.c | 1003 ++++++++++++++++++++
drivers/clk/zte/pll.c | 450 +++++++++
drivers/clk/zte/pll.h | 23 +
include/dt-bindings/clock/zte,zx297520v3-clk.h | 179 ++++
12 files changed, 1944 insertions(+), 8 deletions(-)
---
base-commit: c1ecb239fa3456529a32255359fc78b69eb9d847
change-id: 20260510-zx29clk-2e4d39e3128c
Best regards,
--
Stefan Dösinger <stefandoesinger@gmail•com>
next reply other threads:[~2026-05-28 21:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 21:52 Stefan Dösinger [this message]
2026-05-28 21:52 ` [PATCH RFC v3 1/5] dt-bindings: clk: zte: Add zx297520v3 top clock and reset bindings Stefan Dösinger
2026-05-29 16:48 ` Conor Dooley
2026-06-02 19:09 ` Stefan Dösinger
2026-06-02 23:14 ` Conor Dooley
2026-05-28 21:52 ` [PATCH RFC v3 2/5] dt-bindings: clk: zte: Add zx297520v3 LSP " Stefan Dösinger
2026-05-29 16:49 ` Conor Dooley
2026-05-28 21:53 ` [PATCH RFC v3 3/5] clk: zte: Introduce a driver for zx297520v3 top clocks and resets Stefan Dösinger
2026-06-03 9:14 ` Philipp Zabel
2026-06-03 20:49 ` Stefan Dösinger
2026-06-04 13:44 ` Philipp Zabel
2026-05-28 21:53 ` [PATCH RFC v3 4/5] clk: zte: Introduce a driver for zx297520v3 LSP " Stefan Dösinger
2026-05-28 21:53 ` [PATCH RFC v3 5/5] ARM: dts: zte: Declare a zx297520v3 clock device nodes Stefan Dösinger
2026-06-03 8:50 ` [PATCH RFC v3 0/5] ZTE zx297520v3 clock bindings and driver Philipp Zabel
2026-06-03 20:49 ` Stefan Dösinger
2026-06-04 15:23 ` Philipp Zabel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260529-zx29clk-v3-0-c7fe54ea388f@gmail.com \
--to=stefandoesinger@gmail$(echo .)com \
--cc=bmasney@redhat$(echo .)com \
--cc=conor+dt@kernel$(echo .)org \
--cc=devicetree@vger$(echo .)kernel.org \
--cc=krzk+dt@kernel$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-clk@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=mturquette@baylibre$(echo .)com \
--cc=p.zabel@pengutronix$(echo .)de \
--cc=robh@kernel$(echo .)org \
--cc=sboyd@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox