* [PATCH v4 1/5] dt-bindings: arm: stm32: Add clock inputs to STM32MP2 SYSCFG
2026-11-24 13:41 [PATCH v4 0/5] clk: stm32: Add the STM32MP2 SYSCFG LTDC pixel clock mux Gabriel Fernandez
@ 2026-11-24 13:41 ` Gabriel Fernandez
2026-11-24 13:41 ` [PATCH v4 2/5] clk: stm32: Add STM32MP25 SYSCFG clock driver Gabriel Fernandez
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Gabriel Fernandez @ 2026-11-24 13:41 UTC (permalink / raw)
To: Stephen Boyd, Brian Masney, Jerome Brunet, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Christophe Roullier
Cc: Dario Binacchi, linux-clk, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel, Gabriel Fernandez
The SYSCFG of the STM32MP23x and STM32MP25x SoCs is the provider of the
LTDC pixel clock, which it selects in its DISPLAYCLKCR register among
the LTDC kernel clock, the LVDS PHY pixel clock and the DSI PHY byte
lane clock.
This clock is only used on STM32MP235 and STM32MP255, which have the
LVDS and the DSI: the LTDC of STM32MP231/233 and STM32MP251/253 takes
the LTDC kernel clock directly. As the SYSCFG compatibles are shared by
all the SoCs of a family, add the "st,stm32mp235-syscfg" and
"st,stm32mp255-syscfg" compatibles, with the family ones as fallback, as
done for the LVDS of these SoCs.
Describe the three inputs of the mux with the clocks and clock-names
properties, required with these compatibles only. The existing
devicetrees thus remain valid.
The LTDC kernel clock comes first: the SYSCFG node being a syscon, the
syscon core takes its first clock as the clock of the SYSCFG registers,
and the RCC always provides this one, while the LVDS may be disabled,
which would defer all the SYSCFG users.
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
---
.../bindings/arm/stm32/st,stm32-syscon.yaml | 40 +++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml b/Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml
index a559f8b03b84..2a3c0ce90391 100644
--- a/Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml
+++ b/Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml
@@ -25,6 +25,14 @@ properties:
- st,stm32mp23-syscfg
- st,stm32mp25-syscfg
- const: syscon
+ - items:
+ - const: st,stm32mp235-syscfg
+ - const: st,stm32mp23-syscfg
+ - const: syscon
+ - items:
+ - const: st,stm32mp255-syscfg
+ - const: st,stm32mp25-syscfg
+ - const: syscon
- items:
- const: st,stm32-tamp
- const: syscon
@@ -34,7 +42,14 @@ properties:
maxItems: 1
clocks:
- maxItems: 1
+ minItems: 1
+ maxItems: 3
+
+ clock-names:
+ items:
+ - const: ltdc
+ - const: lvds
+ - const: dsi
"#clock-cells":
const: 0
@@ -62,12 +77,35 @@ allOf:
enum:
- st,stm32mp157-syscfg
- st,stm32f4-gcan
+ - st,stm32mp235-syscfg
+ - st,stm32mp255-syscfg
then:
required:
- clocks
else:
properties:
clocks: false
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - st,stm32mp235-syscfg
+ - st,stm32mp255-syscfg
+ then:
+ properties:
+ clocks:
+ items:
+ - description: LTDC kernel clock
+ - description: LVDS PHY pixel clock
+ - description: DSI PHY byte lane clock
+ required:
+ - clock-names
+ else:
+ properties:
+ clocks:
+ maxItems: 1
+ clock-names: false
- if:
properties:
compatible:
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v4 2/5] clk: stm32: Add STM32MP25 SYSCFG clock driver
2026-11-24 13:41 [PATCH v4 0/5] clk: stm32: Add the STM32MP2 SYSCFG LTDC pixel clock mux Gabriel Fernandez
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 ` Gabriel Fernandez
2026-11-24 13:41 ` [PATCH v4 3/5] soc: st: stm32mp2-syscfg: register the clock device Gabriel Fernandez
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Gabriel Fernandez @ 2026-11-24 13:41 UTC (permalink / raw)
To: Stephen Boyd, Brian Masney, Jerome Brunet, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Christophe Roullier
Cc: Dario Binacchi, linux-clk, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel, Gabriel Fernandez, Brian Masney
On STM32MP23x and STM32MP25x, the LTDC pixel clock is selected in the
SYSCFG DISPLAYCLKCR register among the DSI PHY byte lane clock, the LVDS
PHY pixel clock (reset value) and the LTDC kernel clock, the latter
being the one needed by the RGB (DPI) output.
The SYSCFG node is described as the provider of this clock, but no
driver registers it, so the selection can't be changed from its reset
value and a display connected to the LTDC RGB output can't work.
Add a driver registering this clock as a mux. The SYSCFG node is bound
to the STM32MP2 SYSCFG driver, so this driver is an auxiliary driver,
probed from an auxiliary device which shares the SYSCFG node. The mux
parents are taken from the "clocks" property of the SYSCFG node, which
remains the clock provider.
The DISPLAYCLKCR register is accessed through the syscon regmap of the
SYSCFG node. On STM32MP235 and STM32MP255, the syscon core attaches the
first clock of the node, the LTDC kernel clock, to this regmap: it is
kept prepared and enabled around each register access. The SYSCFG
registers don't need it, but this has no functional impact.
Co-developed-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Reviewed-by: Brian Masney <masneyb@kernel.org>
---
drivers/clk/stm32/Kconfig | 13 ++++
drivers/clk/stm32/Makefile | 1 +
drivers/clk/stm32/clk-stm32mp25-syscfg.c | 127 +++++++++++++++++++++++++++++++
3 files changed, 141 insertions(+)
diff --git a/drivers/clk/stm32/Kconfig b/drivers/clk/stm32/Kconfig
index 5dbd75cde657..18289816f030 100644
--- a/drivers/clk/stm32/Kconfig
+++ b/drivers/clk/stm32/Kconfig
@@ -39,5 +39,18 @@ config COMMON_CLK_STM32MP257
help
Support for stm32mp25x SoC family clocks.
+config COMMON_CLK_STM32MP25_SYSCFG
+ tristate "Clock driver for stm32mp25x SYSCFG clocks"
+ depends on COMMON_CLK_STM32MP257
+ depends on SOC_STM32MP2 || COMPILE_TEST
+ select AUXILIARY_BUS
+ select MFD_SYSCON
+ default COMMON_CLK_STM32MP257
+ help
+ Support for the clocks provided by the stm32mp25x SYSCFG, i.e.
+ the LTDC pixel clock source selection between the LTDC kernel
+ clock (RGB output), the LVDS PHY pixel clock and the DSI byte
+ lane clock.
+
endif
diff --git a/drivers/clk/stm32/Makefile b/drivers/clk/stm32/Makefile
index e04727b59449..8088d172651f 100644
--- a/drivers/clk/stm32/Makefile
+++ b/drivers/clk/stm32/Makefile
@@ -2,3 +2,4 @@ obj-$(CONFIG_COMMON_CLK_STM32MP135) += clk-stm32mp13.o clk-stm32-core.o reset-st
obj-$(CONFIG_COMMON_CLK_STM32MP157) += clk-stm32mp1.o reset-stm32.o
obj-$(CONFIG_COMMON_CLK_STM32MP215) += clk-stm32mp21.o clk-stm32-core.o reset-stm32.o
obj-$(CONFIG_COMMON_CLK_STM32MP257) += clk-stm32mp25.o clk-stm32-core.o reset-stm32.o
+obj-$(CONFIG_COMMON_CLK_STM32MP25_SYSCFG) += clk-stm32mp25-syscfg.o
diff --git a/drivers/clk/stm32/clk-stm32mp25-syscfg.c b/drivers/clk/stm32/clk-stm32mp25-syscfg.c
new file mode 100644
index 000000000000..c7e840fb2d95
--- /dev/null
+++ b/drivers/clk/stm32/clk-stm32mp25-syscfg.c
@@ -0,0 +1,127 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) STMicroelectronics 2026 - All Rights Reserved
+ * Author: Gabriel Fernandez <gabriel.fernandez@foss.st.com> for STMicroelectronics.
+ */
+
+#include <linux/auxiliary_bus.h>
+#include <linux/bitfield.h>
+#include <linux/bits.h>
+#include <linux/clk-provider.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/limits.h>
+#include <linux/mfd/syscon.h>
+#include <linux/module.h>
+#include <linux/regmap.h>
+
+#define SYSCFG_DISPLAYCLKCR 0x5000
+#define DISPLAYCLKCR_DPIVSLVDS GENMASK(1, 0)
+
+/*
+ * The LTDC pixel clock source is selected in SYSCFG_DISPLAYCLKCR among
+ * the DSI byte lane clock, the LVDS PHY pixel clock (reset value) and
+ * the LTDC kernel clock, which is used with the RGB (DPI) output.
+ *
+ * The parents are listed in the DPIVSLVDS field order, while .index refers
+ * to the "clocks" property of the SYSCFG node, ordered "ltdc", "lvds", "dsi".
+ */
+static const struct clk_parent_data clk_pix_ltdc_parents[] = {
+ { .index = 2 }, /* dsi */
+ { .index = 1 }, /* lvds */
+ { .index = 0 }, /* ltdc */
+};
+
+struct stm32mp25_syscfg_mux {
+ struct clk_hw hw;
+ struct device *dev;
+ struct regmap *regmap;
+};
+
+static inline struct stm32mp25_syscfg_mux *to_syscfg_mux(struct clk_hw *hw)
+{
+ return container_of(hw, struct stm32mp25_syscfg_mux, hw);
+}
+
+static u8 stm32mp25_syscfg_mux_get_parent(struct clk_hw *hw)
+{
+ struct stm32mp25_syscfg_mux *mux = to_syscfg_mux(hw);
+ unsigned int val;
+ int ret;
+
+ ret = regmap_read(mux->regmap, SYSCFG_DISPLAYCLKCR, &val);
+ if (ret) {
+ dev_err(mux->dev, "%s: failed to read the parent: %pe\n",
+ clk_hw_get_name(hw), ERR_PTR(ret));
+ /* An out of range index leaves the clock orphan */
+ return U8_MAX;
+ }
+
+ return FIELD_GET(DISPLAYCLKCR_DPIVSLVDS, val);
+}
+
+static int stm32mp25_syscfg_mux_set_parent(struct clk_hw *hw, u8 index)
+{
+ struct stm32mp25_syscfg_mux *mux = to_syscfg_mux(hw);
+
+ return regmap_update_bits(mux->regmap, SYSCFG_DISPLAYCLKCR,
+ DISPLAYCLKCR_DPIVSLVDS,
+ FIELD_PREP(DISPLAYCLKCR_DPIVSLVDS, index));
+}
+
+static const struct clk_ops stm32mp25_syscfg_mux_ops = {
+ .get_parent = stm32mp25_syscfg_mux_get_parent,
+ .set_parent = stm32mp25_syscfg_mux_set_parent,
+ .determine_rate = clk_hw_determine_rate_no_reparent,
+};
+
+static int stm32mp25_syscfg_clk_probe(struct auxiliary_device *adev,
+ const struct auxiliary_device_id *id)
+{
+ struct stm32mp25_syscfg_mux *mux;
+ struct device *dev = &adev->dev;
+ struct clk_init_data init = { };
+ int ret;
+
+ mux = devm_kzalloc_obj(dev, *mux);
+ if (!mux)
+ return -ENOMEM;
+
+ mux->dev = dev;
+
+ /* The auxiliary device shares the node of the SYSCFG */
+ mux->regmap = syscon_node_to_regmap(dev->of_node);
+ if (IS_ERR(mux->regmap))
+ return dev_err_probe(dev, PTR_ERR(mux->regmap),
+ "failed to get the SYSCFG regmap\n");
+
+ init.name = "clk_pix_ltdc";
+ init.ops = &stm32mp25_syscfg_mux_ops;
+ init.parent_data = clk_pix_ltdc_parents;
+ init.num_parents = ARRAY_SIZE(clk_pix_ltdc_parents);
+ init.flags = CLK_SET_RATE_PARENT;
+ mux->hw.init = &init;
+
+ ret = devm_clk_hw_register(dev, &mux->hw);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to register %s\n",
+ init.name);
+
+ return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, &mux->hw);
+}
+
+static const struct auxiliary_device_id stm32mp25_syscfg_clk_ids[] = {
+ { .name = "stm32mp2_syscfg.clk" },
+ { }
+};
+MODULE_DEVICE_TABLE(auxiliary, stm32mp25_syscfg_clk_ids);
+
+static struct auxiliary_driver stm32mp25_syscfg_clk_driver = {
+ .probe = stm32mp25_syscfg_clk_probe,
+ .id_table = stm32mp25_syscfg_clk_ids,
+};
+module_auxiliary_driver(stm32mp25_syscfg_clk_driver);
+
+MODULE_AUTHOR("Gabriel Fernandez <gabriel.fernandez@foss.st.com>");
+MODULE_DESCRIPTION("STM32MP25 SYSCFG clock driver");
+MODULE_LICENSE("GPL");
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v4 3/5] soc: st: stm32mp2-syscfg: register the clock device
2026-11-24 13:41 [PATCH v4 0/5] clk: stm32: Add the STM32MP2 SYSCFG LTDC pixel clock mux Gabriel Fernandez
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 ` 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
4 siblings, 0 replies; 6+ messages in thread
From: Gabriel Fernandez @ 2026-11-24 13:41 UTC (permalink / raw)
To: Stephen Boyd, Brian Masney, Jerome Brunet, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Christophe Roullier
Cc: Dario Binacchi, linux-clk, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel, Gabriel Fernandez
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
The STM32MP23x and STM32MP25x SYSCFG provides the LTDC pixel clock mux,
whose driver is an auxiliary driver since the SYSCFG node is bound to
this driver.
Create the auxiliary device for the clock driver.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
[gabriel.fernandez@foss.st.com: create the device on STM32MP23x too]
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
---
drivers/soc/st/Kconfig | 1 +
drivers/soc/st/stm32mp2-syscfg.c | 14 +++++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/st/Kconfig b/drivers/soc/st/Kconfig
index 2a9d6a77be45..62bbe8c63238 100644
--- a/drivers/soc/st/Kconfig
+++ b/drivers/soc/st/Kconfig
@@ -5,6 +5,7 @@ config SOC_STM32MP2
tristate "STM32MP2 SoC family support"
depends on ARCH_STM32 || COMPILE_TEST
default ARCH_STM32 && ARM64
+ select AUXILIARY_BUS
select SOC_BUS
help
If you say yes here, you get support for the ST STM32MP2 family
diff --git a/drivers/soc/st/stm32mp2-syscfg.c b/drivers/soc/st/stm32mp2-syscfg.c
index 770321a4a6f7..1160b65d3dde 100644
--- a/drivers/soc/st/stm32mp2-syscfg.c
+++ b/drivers/soc/st/stm32mp2-syscfg.c
@@ -3,13 +3,25 @@
* Copyright 2026 Marek Vasut
*/
+#include <linux/auxiliary_bus.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
static int stm32mp2_syscfg_probe(struct platform_device *pdev)
{
- return devm_of_platform_populate(&pdev->dev);
+ struct device *dev = &pdev->dev;
+ int ret;
+
+ ret = devm_of_platform_populate(dev);
+ if (ret)
+ return ret;
+
+ if (!devm_auxiliary_device_create(dev, "clk", NULL))
+ return dev_err_probe(dev, -ENODEV,
+ "failed to register the clock device\n");
+
+ return 0;
}
static const struct of_device_id stm32mp2_syscfg_ids[] = {
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v4 4/5] arm64: dts: st: add LTDC pixel clock mux inputs on stm32mp23
2026-11-24 13:41 [PATCH v4 0/5] clk: stm32: Add the STM32MP2 SYSCFG LTDC pixel clock mux Gabriel Fernandez
` (2 preceding siblings ...)
2026-11-24 13:41 ` [PATCH v4 3/5] soc: st: stm32mp2-syscfg: register the clock device Gabriel Fernandez
@ 2026-11-24 13:41 ` Gabriel Fernandez
2026-11-24 13:41 ` [PATCH v4 5/5] arm64: dts: st: add LTDC pixel clock mux inputs on stm32mp25 Gabriel Fernandez
4 siblings, 0 replies; 6+ messages in thread
From: Gabriel Fernandez @ 2026-11-24 13:41 UTC (permalink / raw)
To: Stephen Boyd, Brian Masney, Jerome Brunet, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Christophe Roullier
Cc: Dario Binacchi, linux-clk, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel, Gabriel Fernandez
Describe the inputs of the LTDC pixel clock mux in the SYSCFG node of
STM32MP235, which is the provider of the LTDC "ref" clock, and add its
SoC specific compatible.
The LTDC of STM32MP231 and STM32MP233 doesn't use this clock, it takes
the LTDC kernel clock directly, so their SYSCFG node is left unchanged.
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
---
arch/arm64/boot/dts/st/stm32mp235.dtsi | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm64/boot/dts/st/stm32mp235.dtsi b/arch/arm64/boot/dts/st/stm32mp235.dtsi
index 7a87c344a4fe..a3423c247df5 100644
--- a/arch/arm64/boot/dts/st/stm32mp235.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp235.dtsi
@@ -32,3 +32,9 @@ vdec: vdec@480d0000 {
access-controllers = <&rifsc 89>;
};
};
+
+&syscfg {
+ compatible = "st,stm32mp235-syscfg", "st,stm32mp23-syscfg", "syscon";
+ clocks = <&rcc CK_KER_LTDC>, <&lvds>, <&clk_dsi_txbyte>;
+ clock-names = "ltdc", "lvds", "dsi";
+};
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v4 5/5] arm64: dts: st: add LTDC pixel clock mux inputs on stm32mp25
2026-11-24 13:41 [PATCH v4 0/5] clk: stm32: Add the STM32MP2 SYSCFG LTDC pixel clock mux Gabriel Fernandez
` (3 preceding siblings ...)
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 ` Gabriel Fernandez
4 siblings, 0 replies; 6+ messages in thread
From: Gabriel Fernandez @ 2026-11-24 13:41 UTC (permalink / raw)
To: Stephen Boyd, Brian Masney, Jerome Brunet, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Christophe Roullier
Cc: Dario Binacchi, linux-clk, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel, Gabriel Fernandez
Describe the inputs of the LTDC pixel clock mux in the SYSCFG node of
STM32MP255, which is the provider of the LTDC "ref" clock, and add its
SoC specific compatible.
The LTDC of STM32MP251 and STM32MP253 doesn't use this clock, it takes
the LTDC kernel clock directly, so their SYSCFG node is left unchanged.
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
---
arch/arm64/boot/dts/st/stm32mp255.dtsi | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/st/stm32mp255.dtsi b/arch/arm64/boot/dts/st/stm32mp255.dtsi
index 7a598f53a2a0..4d4d100d3f89 100644
--- a/arch/arm64/boot/dts/st/stm32mp255.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp255.dtsi
@@ -40,4 +40,10 @@ venc: venc@480e0000 {
clocks = <&rcc CK_BUS_VENC>;
access-controllers = <&rifsc 90>;
};
-};
\ No newline at end of file
+};
+
+&syscfg {
+ compatible = "st,stm32mp255-syscfg", "st,stm32mp25-syscfg", "syscon";
+ clocks = <&rcc CK_KER_LTDC>, <&lvds>, <&clk_dsi_txbyte>;
+ clock-names = "ltdc", "lvds", "dsi";
+};
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread