linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/26] clk: amlogic: clock controllers clean-up and factorisation
@ 2025-07-02 15:25 Jerome Brunet
  2025-07-02 15:25 ` [PATCH 01/26] clk: amlogic: a1-peripherals: naming consistency alignment Jerome Brunet
                   ` (27 more replies)
  0 siblings, 28 replies; 51+ messages in thread
From: Jerome Brunet @ 2025-07-02 15:25 UTC (permalink / raw)
  To: Neil Armstrong, Michael Turquette, Stephen Boyd, Kevin Hilman,
	Martin Blumenstingl
  Cc: linux-amlogic, linux-clk, linux-kernel, Jerome Brunet

The work on this patchset started with the submission of the Amlogic t7
peripheral clock controller [1]. This controller is fairly similar to
existing controllers. Once again, it redefines the peripheral clock macro,
the probe function and composite clock helpers, even if it is almost the
same as in other controllers. This code duplication trend has been going on
for too long and now is the time to properly address the problem.

There is clearly 4 parts in this patchset. These are sent together for v1
to show why what the ugly first part is useful. If more versions are
needed, the patchset will be split in 4.

While all controllers are doing more or less the same things, tiny and
often pointless differences have emerged between the controllers. This
makes it harder to exploit SoC commonalities.

The first part of this series deals with that problem and realign things
up. There is nothing complicated going on there beside renaming. It is the
ugly stuff, yet necessary, we have to go through to get to the interesting
stuff afterwards. There is one change per controller for the review, with
the intent to squash this into a single change on application.

Second is the factorisation of the probe functions so those stop being
copy/pasted in each clock controller drivers.

Then the clean-up and factorisation for the PCLK macros, again to stop
copy/paste but also the silent use CLK_IGNORE_UNUSED.

Finally the introduction of macros for composite clock definitions. The
same pattern as the for the PCLKs started to appear on s4, c3 and t7. Done
properly, this could also help reduce the verbosity of the older
controllers.

With this, the c3-peripherals controller may be used as an example of what
future similar controllers should look like.

After this, there is still some house keeping to be done in the amlogic
clock drivers:
- Moving remaining reset drivers to the reset subsystem
- Proper decoupling of clk-regmap from the clock controllers
- Reduce verbosity of older controllers with the composite macros, where it
  makes sense.

[1]: https://lore.kernel.org/linux-clk/20250108094025.2664201-6-jian.hu@amlogic.com/

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
Jerome Brunet (26):
      clk: amlogic: a1-peripherals: naming consistency alignment
      clk: amlogic: a1-pll: naming consistency alignment
      clk: amlogic: axg-ao: naming consistency alignment
      clk: amlogic: axg: naming consistency alignment
      clk: amlogic: c3-peripherals: naming consistency alignment
      clk: amlogic: c3-pll: naming consistency alignment
      clk: amlogic: g12a-ao: naming consistency alignment
      clk: amlogic: g12a: naming consistency alignment
      clk: amlogic: gxbb-ao: naming consistency alignment
      clk: amlogic: gxbb: naming consistency alignment
      clk: amlogic: meson8b: naming consistency alignment
      clk: amlogic: s4-peripherals: naming consistency alignment
      clk: amlogic: s4-pll: naming consistency alignment
      clk: amlogic: meson8-ddr: naming consistency alignment
      clk: amlogic: drop meson-clkcee
      clk: amlogic: add probe helper for mmio based controllers
      clk: amlogic: use probe helper in mmio based controllers
      clk: amlogic: aoclk: use clkc-utils syscon probe
      clk: amlogic: move PCLK definition to clkc-utils
      clk: amlogic: drop CLK_SET_RATE_PARENT from peripheral clocks
      clk: amlogic: pclk explicitly use CLK_IGNORE_UNUSED
      clk: amlogic: introduce a common pclk definition
      clk: amlogic: use the common pclk definition
      clk: amlogic: add composite clock helpers
      clk: amlogic: align s4 and c3 pwm clock descriptions
      clk: amlogic: c3-peripherals: use helper for basic composite clocks

 drivers/clk/meson/Kconfig            |   13 +-
 drivers/clk/meson/Makefile           |    1 -
 drivers/clk/meson/a1-peripherals.c   |  995 +++++-----
 drivers/clk/meson/a1-pll.c           |  124 +-
 drivers/clk/meson/axg-aoclk.c        |  153 +-
 drivers/clk/meson/axg.c              |  237 +--
 drivers/clk/meson/c3-peripherals.c   | 2055 ++++++---------------
 drivers/clk/meson/c3-pll.c           |  245 ++-
 drivers/clk/meson/clk-regmap.h       |   20 -
 drivers/clk/meson/g12a-aoclk.c       |  238 +--
 drivers/clk/meson/g12a.c             | 3316 +++++++++++++++++-----------------
 drivers/clk/meson/gxbb-aoclk.c       |  123 +-
 drivers/clk/meson/gxbb.c             |  611 ++++---
 drivers/clk/meson/meson-aoclk.c      |   32 +-
 drivers/clk/meson/meson-aoclk.h      |    2 +-
 drivers/clk/meson/meson-clkc-utils.c |   89 +-
 drivers/clk/meson/meson-clkc-utils.h |   89 +
 drivers/clk/meson/meson-eeclk.c      |   60 -
 drivers/clk/meson/meson-eeclk.h      |   24 -
 drivers/clk/meson/meson8-ddr.c       |   62 +-
 drivers/clk/meson/meson8b.c          |  746 ++++----
 drivers/clk/meson/s4-peripherals.c   | 1160 ++++--------
 drivers/clk/meson/s4-pll.c           |   82 +-
 23 files changed, 4437 insertions(+), 6040 deletions(-)
---
base-commit: 2c37e1c671428002519e7615d786b9b692261052
change-id: 20241211-meson-clk-cleanup-24-41cbe1924619

Best regards,
-- 
Jerome


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2025-08-25 15:13 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02 15:25 [PATCH 00/26] clk: amlogic: clock controllers clean-up and factorisation Jerome Brunet
2025-07-02 15:25 ` [PATCH 01/26] clk: amlogic: a1-peripherals: naming consistency alignment Jerome Brunet
2025-07-02 15:26 ` [PATCH 02/26] clk: amlogic: a1-pll: " Jerome Brunet
2025-07-02 15:26 ` [PATCH 03/26] clk: amlogic: axg-ao: " Jerome Brunet
2025-07-02 15:26 ` [PATCH 04/26] clk: amlogic: axg: " Jerome Brunet
2025-07-02 15:26 ` [PATCH 05/26] clk: amlogic: c3-peripherals: " Jerome Brunet
2025-07-03  2:51   ` Chuan Liu
2025-07-03  7:48     ` Jerome Brunet
2025-07-03  8:31       ` Chuan Liu
2025-07-03  9:02         ` Jerome Brunet
2025-07-03  9:23           ` Chuan Liu
2025-07-02 15:26 ` [PATCH 06/26] clk: amlogic: c3-pll: " Jerome Brunet
2025-07-03  2:57   ` Chuan Liu
2025-07-02 15:26 ` [PATCH 07/26] clk: amlogic: g12a-ao: " Jerome Brunet
2025-07-02 15:26 ` [PATCH 08/26] clk: amlogic: g12a: " Jerome Brunet
2025-07-02 15:26 ` [PATCH 09/26] clk: amlogic: gxbb-ao: " Jerome Brunet
2025-07-02 15:26 ` [PATCH 10/26] clk: amlogic: gxbb: " Jerome Brunet
2025-07-02 15:26 ` [PATCH 11/26] clk: amlogic: meson8b: " Jerome Brunet
2025-07-02 15:26 ` [PATCH 12/26] clk: amlogic: s4-peripherals: " Jerome Brunet
2025-07-03  3:18   ` Chuan Liu
2025-07-03  7:54     ` Jerome Brunet
2025-07-03  8:00       ` Chuan Liu
2025-07-02 15:26 ` [PATCH 13/26] clk: amlogic: s4-pll: " Jerome Brunet
2025-07-03  3:19   ` Chuan Liu
2025-07-02 15:26 ` [PATCH 14/26] clk: amlogic: meson8-ddr: " Jerome Brunet
2025-07-02 15:26 ` [PATCH 15/26] clk: amlogic: drop meson-clkcee Jerome Brunet
2025-07-02 15:26 ` [PATCH 16/26] clk: amlogic: add probe helper for mmio based controllers Jerome Brunet
2025-07-03  3:29   ` Chuan Liu
2025-07-03  8:35     ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 17/26] clk: amlogic: use probe helper in " Jerome Brunet
2025-07-03  6:29   ` Chuan Liu
2025-07-02 15:26 ` [PATCH 18/26] clk: amlogic: aoclk: use clkc-utils syscon probe Jerome Brunet
2025-07-02 15:26 ` [PATCH 19/26] clk: amlogic: move PCLK definition to clkc-utils Jerome Brunet
2025-07-02 15:26 ` [PATCH 20/26] clk: amlogic: drop CLK_SET_RATE_PARENT from peripheral clocks Jerome Brunet
2025-07-02 15:26 ` [PATCH 21/26] clk: amlogic: pclk explicitly use CLK_IGNORE_UNUSED Jerome Brunet
2025-07-03  7:05   ` Chuan Liu
2025-07-02 15:26 ` [PATCH 22/26] clk: amlogic: introduce a common pclk definition Jerome Brunet
2025-07-03  7:10   ` Chuan Liu
2025-07-02 15:26 ` [PATCH 23/26] clk: amlogic: use the " Jerome Brunet
2025-07-03  7:16   ` Chuan Liu
2025-07-03  8:39     ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 24/26] clk: amlogic: add composite clock helpers Jerome Brunet
2025-07-03  7:24   ` Chuan Liu
2025-07-03  8:39     ` Jerome Brunet
2025-07-02 15:26 ` [PATCH 25/26] clk: amlogic: align s4 and c3 pwm clock descriptions Jerome Brunet
2025-07-03  7:27   ` Chuan Liu
2025-07-02 15:26 ` [PATCH 26/26] clk: amlogic: c3-peripherals: use helper for basic composite clocks Jerome Brunet
2025-07-03  7:56   ` Chuan Liu
2025-07-03  8:44     ` Jerome Brunet
2025-08-06  7:10 ` [PATCH 00/26] clk: amlogic: clock controllers clean-up and factorisation Chuan Liu
2025-08-25 14:24 ` Jerome Brunet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).