mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
To: Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Christophe Roullier <christophe.roullier@foss.st.com>
Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	<linux-clk@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Gabriel Fernandez <gabriel.fernandez@foss.st.com>,
	Brian Masney <masneyb@kernel.org>
Subject: [PATCH v4 0/5] clk: stm32: Add the STM32MP2 SYSCFG LTDC pixel clock mux
Date: Tue, 24 Nov 2026 14:41:06 +0100	[thread overview]
Message-ID: <20261124-ups_mp25_clk_syscfg-v4-0-894d95dffec4@foss.st.com> (raw)

On STM32MP23x and STM32MP25x, the LTDC pixel clock is selected in the
SYSCFG DISPLAYCLKCR register among the LTDC kernel clock (RGB output),
the LVDS PHY pixel clock (reset value) and the DSI PHY byte lane clock.
The SYSCFG node is already described as the provider of this clock, used
as the LTDC "ref" clock, but no driver registers it, so the RGB output
can't be used.

This series adds a clock driver for this mux. It is based on the RFC
sent by Dario [1] and on the driver delivered in the ST downstream
kernel.

The SYSCFG node remains the clock provider ('#clock-cells = <0>'), and
the inputs of the mux are described by its "clocks" property. They are
only described on STM32MP235 and STM32MP255, which have the LVDS and the
DSI and whose LTDC uses this clock, with new SoC specific SYSCFG
compatibles. As the SYSCFG node is bound to the STM32MP2 SYSCFG driver,
the clock driver is an auxiliary driver, whose device is created by the
SYSCFG driver. The LTDC "ref" clock is left unchanged.

As the SYSCFG node is a syscon, the syscon core attaches its first
clock to the SYSCFG regmap, i.e. the LTDC kernel clock on STM32MP235 and
STM32MP255: this clock is kept prepared, with its parents, and enabled
around each register access. The SYSCFG registers don't need it, but
this has no functional impact. The LTDC kernel clock is listed first as
it is always provided by the RCC, while the LVDS may be disabled, which
would defer all the SYSCFG users.

v3 avoided this by registering the SYSCFG regmap from the SYSCFG
driver, but the syscon users could create it before, all the more as
fw_devlink defers the SYSCFG probe until its clocks are available. As
doing it reliably would require an early initcall, this patch is
dropped. Please let me know if you would prefer this approach.

Changes compared to the RFC [1]:
- parents described by clocks/clock-names instead of global names
- auxiliary device created on STM32MP23x too
- SoC devicetrees updated, Engicam board patches dropped

[1] https://lore.kernel.org/all/20261028135915.2665857-1-dario.binacchi@amarulasolutions.com/

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
---
Changes in v4:
- Describe the mux inputs only on STM32MP235 and STM32MP255, whose LTDC
  uses the SYSCFG clock, and make them fixed for each compatible instead
  of a variable minItems list (Krzysztof): add the "st,stm32mp235-syscfg"
  and "st,stm32mp255-syscfg" compatibles, the family ones being shared
  with the SoCs which don't have this mux
- dt-bindings: arm: stm32: drop Krzysztof's Reviewed-by from v3, as the
  binding changed substantially (minItems removed, SoC-specific
  compatibles added); it needs a new review
- Drop "soc: st: stm32mp2-syscfg: register the syscon regmap": the
  syscon users could create the SYSCFG regmap before the SYSCFG driver
  probes, and the regmap was leaked or left registered on errors
  (Sashiko). The syscon core thus attaches the LTDC kernel clock to the
  SYSCFG regmap, see above
- soc: st: stm32mp2-syscfg: add my missing Signed-off-by to the patch
  from Dario (Sashiko)
- Link to v3: https://lore.kernel.org/r/20261118-ups_mp25_clk_syscfg-v3-0-935de791a4ce@foss.st.com

Changes in v3:
- Drop the clock-controller sub-node, its binding and the dt-bindings
  header: describe the mux inputs in the SYSCFG node, which remains the
  clock provider with '#clock-cells = <0>' (Krzysztof, Conor)
- Keep '#clock-cells' in the SoC devicetrees and the SYSCFG node as LTDC
  "ref" clock, not to break the existing users (Krzysztof)
- Make the clock driver an auxiliary driver, whose device is created by
  the STM32MP2 SYSCFG driver (RFC patch 3/4 from Dario)
- New patch: create the SYSCFG regmap in the STM32MP2 SYSCFG driver, so
  that the syscon core doesn't attach the LTDC kernel clock to it
- clk driver: depend on SOC_STM32MP2 || COMPILE_TEST, check the
  regmap_read() return value, drop the redundant CLK_SET_RATE_NO_REPARENT
  flag, fix the copyright year and the order of the local variables
  (Brian). The of_get_parent() change doesn't apply anymore, the driver
  using the SYSCFG node directly
- clk driver: drop <linux/mod_devicetable.h> (Uwe)
- Link to v2: https://lore.kernel.org/r/20261110-ups_mp25_clk_syscfg-v2-0-624559bb8ec7@foss.st.com

Changes in v2:
- Deprecate the '#clock-cells' property of the SYSCFG node and remove it
  from the SoC devicetrees, the clock-controller sub-node being the only
  provider of the LTDC pixel clock (Sashiko)
- Explain why the mux needs a sub-node: its inputs can't be described by
  the "clocks" property of the SYSCFG node, which is a syscon (Sashiko)
- Link to v1: https://lore.kernel.org/r/20261110-ups_mp25_clk_syscfg-v1-0-667829cd290a@foss.st.com

---
Dario Binacchi (1):
      soc: st: stm32mp2-syscfg: register the clock device

Gabriel Fernandez (4):
      dt-bindings: arm: stm32: Add clock inputs to STM32MP2 SYSCFG
      clk: stm32: Add STM32MP25 SYSCFG clock driver
      arm64: dts: st: add LTDC pixel clock mux inputs on stm32mp23
      arm64: dts: st: add LTDC pixel clock mux inputs on stm32mp25

 .../bindings/arm/stm32/st,stm32-syscon.yaml        |  40 ++++++-
 arch/arm64/boot/dts/st/stm32mp235.dtsi             |   6 +
 arch/arm64/boot/dts/st/stm32mp255.dtsi             |   8 +-
 drivers/clk/stm32/Kconfig                          |  13 +++
 drivers/clk/stm32/Makefile                         |   1 +
 drivers/clk/stm32/clk-stm32mp25-syscfg.c           | 127 +++++++++++++++++++++
 drivers/soc/st/Kconfig                             |   1 +
 drivers/soc/st/stm32mp2-syscfg.c                   |  14 ++-
 8 files changed, 207 insertions(+), 3 deletions(-)
---
base-commit: 630059a5a632377b9b7b487baccde92b7ae1dd47
change-id: 20261103-ups_mp25_clk_syscfg-6a4224156431

Best regards,
-- 
Gabriel Fernandez <gabriel.fernandez@foss.st.com>


             reply	other threads:[~2026-11-24 13:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 13:41 Gabriel Fernandez [this message]
2026-11-24 13:41 ` [PATCH v4 1/5] dt-bindings: arm: stm32: Add clock inputs to STM32MP2 SYSCFG Gabriel Fernandez
2026-11-24 13:41 ` [PATCH v4 2/5] clk: stm32: Add STM32MP25 SYSCFG clock driver Gabriel Fernandez
2026-11-24 13:41 ` [PATCH v4 3/5] soc: st: stm32mp2-syscfg: register the clock device Gabriel Fernandez
2026-11-24 13:41 ` [PATCH v4 4/5] arm64: dts: st: add LTDC pixel clock mux inputs on stm32mp23 Gabriel Fernandez
2026-11-24 13:41 ` [PATCH v4 5/5] arm64: dts: st: add LTDC pixel clock mux inputs on stm32mp25 Gabriel Fernandez

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=20261124-ups_mp25_clk_syscfg-v4-0-894d95dffec4@foss.st.com \
    --to=gabriel.fernandez@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=bmasney+clk@redhat.com \
    --cc=christophe.roullier@foss.st.com \
    --cc=conor+dt@kernel.org \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet+clk@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=masneyb@kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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

all inboxes | Powered by JetHome®