* [PATCH v2 00/13] Enable display support for STM32MP25
@ 2025-08-12 13:48 Raphael Gallais-Pou
2025-08-12 13:48 ` [PATCH v2 01/13] dt-bindings: display: st: add new compatible to LTDC device Raphael Gallais-Pou
` (12 more replies)
0 siblings, 13 replies; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-12 13:48 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier
Cc: dri-devel, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
This series aims to add and enable sufficient LVDS display support for
STM32MP257F-EV1 board.
LVDS is the default use case to drive a display panel on STM32MP257F-EV,
even though DSI panels will be supported in the near future.
The LTDC needs a pixel rate in sync with the bridge currently in use.
For that both DSI and LVDS bridges need to declare an internal clock and
become clock provider to the mux. The mux then selects the reference
clock for the LTDC pixel rate generation.
For now this mux is handled internally in the LTDC, while waiting for
the STM32 clock framework to merge a 'clk-mux' based on the SYSCFG.
This explains the link done in the patch [7/8] between the LVDS,
providing the reference clock for the LTDC internals.
+----------+ |\
| DSI PHY |------------->| \ +------------+
| |ck_dsi_phy | | | |
+----------+ | |--------->| LTDC |
+----------+ | |pixel_clk | |
| LVDS PHY |------------->| | +------------+
| |clk_pix_lvds | |
+----------+ | |
| |
ck_ker_ltdc ------------>| /
|/|
└- SYSCFG
Clock selection applies as follow:
- 0b00: Selects ck_dsi_phy
- 0b01: Selects clk_pix_lvds
- 0b10: Selects ck_ker_ltdc (for parallel or DSI display).
- 0b11: Reserved
The reset value of the register controlling the mux is 0b01, meaning
that the default clock assigned is the clk_pix_lvds. This causes two
things:
- In order to get basic display on the LVDS encoder, like intended,
nothing has to be done on this mux within the LTDC driver (which for now
explains the unused syscfg phandle on the LTDC node in the device-tree).
- 'pixel_clk' is dependent from 'clk_pix_lvds' because of the LTDC clock
domains. They also need to be sync to get a coherent pixel rate though
the display clock tree (which explains the LVDS phandle on the LTDC node
in the device-tree).
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
Changes in v2:
- Documentation:
- Add support for new compatible "st,stm32mp255-lvds"
- Change LTDC compatible for SoC compliant one
- Make clearer LTDC clock-names property
- Devicetree:
- Change compatible according to the documentation
- Change clock and clock-names order to match documentation (and avoid
warnings)
- Drivers:
- Change LTDC compatible
- Add Rob's trailer where relevant
- Link to v1: https://lore.kernel.org/r/20250725-drm-misc-next-v1-0-a59848e62cf9@foss.st.com
---
Raphael Gallais-Pou (11):
dt-bindings: display: st: add new compatible to LTDC device
dt-bindings: display: st,stm32-ltdc: add access-controllers property
dt-bindings: display: st: add new compatible to LVDS device
dt-bindings: display: st,stm32mp25-lvds: add access-controllers property
dt-bindings: display: st,stm32mp25-lvds: add power-domains property
dt-bindings: arm: stm32: add required #clock-cells property
arm64: dts: st: add ltdc support on stm32mp251
arm64: dts: st: add lvds support on stm32mp255
arm64: dts: st: add clock-cells to syscfg node on stm32mp251
arm64: dts: st: enable display support on stm32mp257f-ev1 board
arm64: dts: st: add loopback clocks on LTDC node
Yannick Fertre (2):
drm/stm: ltdc: support new hardware version for STM32MP25 SoC
drm/stm: ltdc: handle lvds pixel clock
.../bindings/arm/stm32/st,stm32-syscon.yaml | 31 ++++++---
.../devicetree/bindings/display/st,stm32-ltdc.yaml | 33 ++++++++-
.../bindings/display/st,stm32mp25-lvds.yaml | 14 +++-
arch/arm64/boot/dts/st/stm32mp251.dtsi | 19 ++++++
arch/arm64/boot/dts/st/stm32mp255.dtsi | 19 +++++-
arch/arm64/boot/dts/st/stm32mp257f-ev1.dts | 79 ++++++++++++++++++++++
drivers/gpu/drm/stm/drv.c | 11 ++-
drivers/gpu/drm/stm/ltdc.c | 57 +++++++++++++++-
drivers/gpu/drm/stm/ltdc.h | 6 ++
9 files changed, 251 insertions(+), 18 deletions(-)
---
base-commit: e48123c607a0db8b9ad02f83c8c3d39918dbda06
change-id: 20250617-drm-misc-next-4af406c1c45f
Best regards,
--
Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 01/13] dt-bindings: display: st: add new compatible to LTDC device
2025-08-12 13:48 [PATCH v2 00/13] Enable display support for STM32MP25 Raphael Gallais-Pou
@ 2025-08-12 13:48 ` Raphael Gallais-Pou
2025-08-14 9:08 ` Krzysztof Kozlowski
2025-08-12 13:48 ` [PATCH v2 02/13] dt-bindings: display: st,stm32-ltdc: add access-controllers property Raphael Gallais-Pou
` (11 subsequent siblings)
12 siblings, 1 reply; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-12 13:48 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier
Cc: dri-devel, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
The new STMicroelectronics SoC features a display controller similar to
the one used in previous SoCs. Because there is additional registers,
it is incompatible with existing IPs.
Add the new name to the list of compatible string.
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
.../devicetree/bindings/display/st,stm32-ltdc.yaml | 30 ++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml b/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml
index d6ea4d62a2cfae26353c9f20a326a4329fed3a2f..33e814f8b85679a09df697246d2f8ccdbfc44223 100644
--- a/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml
+++ b/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml
@@ -12,7 +12,9 @@ maintainers:
properties:
compatible:
- const: st,stm32-ltdc
+ enum:
+ - st,stm32-ltdc
+ - st,stm32mp251-ltdc
reg:
maxItems: 1
@@ -24,11 +26,16 @@ properties:
minItems: 1
clocks:
- maxItems: 1
+ minItems: 1
+ maxItems: 4
clock-names:
items:
- const: lcd
+ - const: bus
+ - const: ref
+ - const: lvds
+ minItems: 1
resets:
maxItems: 1
@@ -51,6 +58,25 @@ required:
- resets
- port
+if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - st,stm32-ltdc
+then:
+ properties:
+ clocks:
+ maxItems: 1
+ clock-names:
+ maxItems: 1
+else:
+ properties:
+ clocks:
+ maxItems: 4
+ clock-names:
+ maxItems: 4
+
additionalProperties: false
examples:
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 02/13] dt-bindings: display: st,stm32-ltdc: add access-controllers property
2025-08-12 13:48 [PATCH v2 00/13] Enable display support for STM32MP25 Raphael Gallais-Pou
2025-08-12 13:48 ` [PATCH v2 01/13] dt-bindings: display: st: add new compatible to LTDC device Raphael Gallais-Pou
@ 2025-08-12 13:48 ` Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 03/13] dt-bindings: display: st: add new compatible to LVDS device Raphael Gallais-Pou
` (10 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-12 13:48 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier
Cc: dri-devel, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
access-controllers is an optional property that allows a peripheral to
refer to one or more domain access controller(s).
This property is added when the peripheral is under the STM32 firewall
controller. It allows an accurate representation of the hardware, where
the peripheral is connected to a firewall bus. The firewall can then check
the peripheral accesses before allowing its device to probe.
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml b/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml
index 33e814f8b85679a09df697246d2f8ccdbfc44223..0ff47ac48ec655c1d126e16922ef37e9c739dbea 100644
--- a/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml
+++ b/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml
@@ -40,6 +40,9 @@ properties:
resets:
maxItems: 1
+ access-controllers:
+ maxItems: 1
+
port:
$ref: /schemas/graph.yaml#/properties/port
description: |
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 03/13] dt-bindings: display: st: add new compatible to LVDS device
2025-08-12 13:48 [PATCH v2 00/13] Enable display support for STM32MP25 Raphael Gallais-Pou
2025-08-12 13:48 ` [PATCH v2 01/13] dt-bindings: display: st: add new compatible to LTDC device Raphael Gallais-Pou
2025-08-12 13:48 ` [PATCH v2 02/13] dt-bindings: display: st,stm32-ltdc: add access-controllers property Raphael Gallais-Pou
@ 2025-08-12 13:49 ` Raphael Gallais-Pou
2025-08-14 9:09 ` Krzysztof Kozlowski
2025-08-12 13:49 ` [PATCH v2 04/13] dt-bindings: display: st,stm32mp25-lvds: add access-controllers property Raphael Gallais-Pou
` (9 subsequent siblings)
12 siblings, 1 reply; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-12 13:49 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier
Cc: dri-devel, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
Update the compatible to accept both "st,stm32mp255-lvds" and
st,stm32mp25-lvds" respectively. Default will fall back to
"st,stm32mp25-lvds".
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml b/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
index 6736f93256b5cebb558cda5250369ec4b1b3033c..b777c55626e4b322d77ef411ad9e4a3afb6c9131 100644
--- a/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
+++ b/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
@@ -31,7 +31,13 @@ description: |
properties:
compatible:
- const: st,stm32mp25-lvds
+ oneOf:
+ - items:
+ - enum:
+ - st,stm32mp255-lvds
+ - const: st,stm32mp25-lvds
+ - items:
+ - const: st,stm32mp25-lvds
"#clock-cells":
const: 0
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 04/13] dt-bindings: display: st,stm32mp25-lvds: add access-controllers property
2025-08-12 13:48 [PATCH v2 00/13] Enable display support for STM32MP25 Raphael Gallais-Pou
` (2 preceding siblings ...)
2025-08-12 13:49 ` [PATCH v2 03/13] dt-bindings: display: st: add new compatible to LVDS device Raphael Gallais-Pou
@ 2025-08-12 13:49 ` Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 05/13] dt-bindings: display: st,stm32mp25-lvds: add power-domains property Raphael Gallais-Pou
` (8 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-12 13:49 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier
Cc: dri-devel, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
access-controllers is an optional property that allows a peripheral to
refer to one or more domain access controller(s).
This property is added when the peripheral is under the STM32 firewall
controller. It allows an accurate representation of the hardware, where
the peripheral is connected to a firewall bus. The firewall can then
check the peripheral accesses before allowing its device to probe.
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml b/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
index b777c55626e4b322d77ef411ad9e4a3afb6c9131..96fa0cb5cb86c41d978c4093448afa3bb2a946fa 100644
--- a/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
+++ b/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
@@ -60,6 +60,9 @@ properties:
resets:
maxItems: 1
+ access-controllers:
+ maxItems: 1
+
ports:
$ref: /schemas/graph.yaml#/properties/ports
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 05/13] dt-bindings: display: st,stm32mp25-lvds: add power-domains property
2025-08-12 13:48 [PATCH v2 00/13] Enable display support for STM32MP25 Raphael Gallais-Pou
` (3 preceding siblings ...)
2025-08-12 13:49 ` [PATCH v2 04/13] dt-bindings: display: st,stm32mp25-lvds: add access-controllers property Raphael Gallais-Pou
@ 2025-08-12 13:49 ` Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 06/13] dt-bindings: arm: stm32: add required #clock-cells property Raphael Gallais-Pou
` (7 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-12 13:49 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier
Cc: dri-devel, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
STM32 LVDS peripheral may be in a power domain. Allow an optional
single 'power-domains' entry for STM32 LVDS devices.
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml b/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
index 96fa0cb5cb86c41d978c4093448afa3bb2a946fa..e9f4be172180b1de9e6b750e8e7c8103d6838798 100644
--- a/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
+++ b/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
@@ -63,6 +63,9 @@ properties:
access-controllers:
maxItems: 1
+ power-domains:
+ maxItems: 1
+
ports:
$ref: /schemas/graph.yaml#/properties/ports
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 06/13] dt-bindings: arm: stm32: add required #clock-cells property
2025-08-12 13:48 [PATCH v2 00/13] Enable display support for STM32MP25 Raphael Gallais-Pou
` (4 preceding siblings ...)
2025-08-12 13:49 ` [PATCH v2 05/13] dt-bindings: display: st,stm32mp25-lvds: add power-domains property Raphael Gallais-Pou
@ 2025-08-12 13:49 ` Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 07/13] drm/stm: ltdc: support new hardware version for STM32MP25 SoC Raphael Gallais-Pou
` (6 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-12 13:49 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier
Cc: dri-devel, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
On STM32MP25 SoC, the syscfg peripheral provides a clock to the display
subsystem through a multiplexer. Since it only provides a single clock,
the cell value is 0.
Doing so allows the clock consumers to reach the peripheral and gate the
clock accordingly.
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
.../bindings/arm/stm32/st,stm32-syscon.yaml | 31 +++++++++++++++-------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml b/Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml
index ed97652c84922813e94b1818c07fe8714891c089..95d2319afe235fa86974d80f89c9deeae2275232 100644
--- a/Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml
+++ b/Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml
@@ -36,20 +36,31 @@ properties:
clocks:
maxItems: 1
+ "#clock-cells":
+ const: 0
+
required:
- compatible
- reg
-if:
- properties:
- compatible:
- contains:
- enum:
- - st,stm32mp157-syscfg
- - st,stm32f4-gcan
-then:
- required:
- - clocks
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - st,stm32mp157-syscfg
+ - st,stm32f4-gcan
+ then:
+ required:
+ - clocks
+ - if:
+ properties:
+ compatible:
+ const: st,stm32mp25-syscfg
+ then:
+ required:
+ - "#clock-cells"
additionalProperties: false
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 07/13] drm/stm: ltdc: support new hardware version for STM32MP25 SoC
2025-08-12 13:48 [PATCH v2 00/13] Enable display support for STM32MP25 Raphael Gallais-Pou
` (5 preceding siblings ...)
2025-08-12 13:49 ` [PATCH v2 06/13] dt-bindings: arm: stm32: add required #clock-cells property Raphael Gallais-Pou
@ 2025-08-12 13:49 ` Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 08/13] drm/stm: ltdc: handle lvds pixel clock Raphael Gallais-Pou
` (5 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-12 13:49 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier
Cc: dri-devel, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
From: Yannick Fertre <yannick.fertre@foss.st.com>
STM32MP25 SoC features a new version of the LTDC IP. Add its compatible
to the list of device to probe and implement its quirks.
This hardware supports a pad frequency of 150MHz and a peripheral bus
clock.
Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
drivers/gpu/drm/stm/drv.c | 11 ++++++++++-
drivers/gpu/drm/stm/ltdc.c | 37 ++++++++++++++++++++++++++++++++++---
drivers/gpu/drm/stm/ltdc.h | 5 +++++
3 files changed, 49 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index 8ebcaf953782d806a738d5a41ff1f428b0ccff78..8bfdeb486862a95df77427d25ce373e69e886c01 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -236,8 +236,17 @@ static void stm_drm_platform_shutdown(struct platform_device *pdev)
drm_atomic_helper_shutdown(platform_get_drvdata(pdev));
}
+static struct ltdc_plat_data stm_drm_plat_data = {
+ .pad_max_freq_hz = 90000000,
+};
+
+static struct ltdc_plat_data stm_drm_plat_data_mp25 = {
+ .pad_max_freq_hz = 150000000,
+};
+
static const struct of_device_id drv_dt_ids[] = {
- { .compatible = "st,stm32-ltdc"},
+ { .compatible = "st,stm32-ltdc", .data = &stm_drm_plat_data, },
+ { .compatible = "st,stm32mp251-ltdc", .data = &stm_drm_plat_data_mp25, },
{ /* end node */ },
};
MODULE_DEVICE_TABLE(of, drv_dt_ids);
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index ba315c66a04d72758b9d3cfcd842432877f66d3a..74e93f076b62a46e7835985d9d330ba66d990e58 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -14,6 +14,7 @@
#include <linux/interrupt.h>
#include <linux/media-bus-format.h>
#include <linux/module.h>
+#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
@@ -51,6 +52,7 @@
#define HWVER_10300 0x010300
#define HWVER_20101 0x020101
#define HWVER_40100 0x040100
+#define HWVER_40101 0x040101
/*
* The address of some registers depends on the HW version: such registers have
@@ -1779,6 +1781,7 @@ static int ltdc_get_caps(struct drm_device *ddev)
{
struct ltdc_device *ldev = ddev->dev_private;
u32 bus_width_log2, lcr, gc2r;
+ const struct ltdc_plat_data *pdata = of_device_get_match_data(ddev->dev);
/*
* at least 1 layer must be managed & the number of layers
@@ -1794,6 +1797,8 @@ static int ltdc_get_caps(struct drm_device *ddev)
ldev->caps.bus_width = 8 << bus_width_log2;
regmap_read(ldev->regmap, LTDC_IDR, &ldev->caps.hw_version);
+ ldev->caps.pad_max_freq_hz = pdata->pad_max_freq_hz;
+
switch (ldev->caps.hw_version) {
case HWVER_10200:
case HWVER_10300:
@@ -1811,7 +1816,6 @@ static int ltdc_get_caps(struct drm_device *ddev)
* does not work on 2nd layer.
*/
ldev->caps.non_alpha_only_l1 = true;
- ldev->caps.pad_max_freq_hz = 90000000;
if (ldev->caps.hw_version == HWVER_10200)
ldev->caps.pad_max_freq_hz = 65000000;
ldev->caps.nb_irq = 2;
@@ -1842,6 +1846,7 @@ static int ltdc_get_caps(struct drm_device *ddev)
ldev->caps.fifo_threshold = false;
break;
case HWVER_40100:
+ case HWVER_40101:
ldev->caps.layer_ofs = LAY_OFS_1;
ldev->caps.layer_regs = ltdc_layer_regs_a2;
ldev->caps.pix_fmt_hw = ltdc_pix_fmt_a2;
@@ -1849,7 +1854,6 @@ static int ltdc_get_caps(struct drm_device *ddev)
ldev->caps.pix_fmt_nb = ARRAY_SIZE(ltdc_drm_fmt_a2);
ldev->caps.pix_fmt_flex = true;
ldev->caps.non_alpha_only_l1 = false;
- ldev->caps.pad_max_freq_hz = 90000000;
ldev->caps.nb_irq = 2;
ldev->caps.ycbcr_input = true;
ldev->caps.ycbcr_output = true;
@@ -1872,6 +1876,8 @@ void ltdc_suspend(struct drm_device *ddev)
DRM_DEBUG_DRIVER("\n");
clk_disable_unprepare(ldev->pixel_clk);
+ if (ldev->bus_clk)
+ clk_disable_unprepare(ldev->bus_clk);
}
int ltdc_resume(struct drm_device *ddev)
@@ -1887,7 +1893,13 @@ int ltdc_resume(struct drm_device *ddev)
return ret;
}
- return 0;
+ if (ldev->bus_clk) {
+ ret = clk_prepare_enable(ldev->bus_clk);
+ if (ret)
+ drm_err(ddev, "failed to enable bus clock (%d)\n", ret);
+ }
+
+ return ret;
}
int ltdc_load(struct drm_device *ddev)
@@ -1922,6 +1934,19 @@ int ltdc_load(struct drm_device *ddev)
return -ENODEV;
}
+ if (of_device_is_compatible(np, "st,stm32mp251-ltdc")) {
+ ldev->bus_clk = devm_clk_get(dev, "bus");
+ if (IS_ERR(ldev->bus_clk))
+ return dev_err_probe(dev, PTR_ERR(ldev->bus_clk),
+ "Unable to get bus clock\n");
+
+ ret = clk_prepare_enable(ldev->bus_clk);
+ if (ret) {
+ drm_err(ddev, "Unable to prepare bus clock\n");
+ return ret;
+ }
+ }
+
/* Get endpoints if any */
for (i = 0; i < nb_endpoints; i++) {
ret = drm_of_find_panel_or_bridge(np, 0, i, &panel, &bridge);
@@ -2034,6 +2059,9 @@ int ltdc_load(struct drm_device *ddev)
clk_disable_unprepare(ldev->pixel_clk);
+ if (ldev->bus_clk)
+ clk_disable_unprepare(ldev->bus_clk);
+
pinctrl_pm_select_sleep_state(ddev->dev);
pm_runtime_enable(ddev->dev);
@@ -2042,6 +2070,9 @@ int ltdc_load(struct drm_device *ddev)
err:
clk_disable_unprepare(ldev->pixel_clk);
+ if (ldev->bus_clk)
+ clk_disable_unprepare(ldev->bus_clk);
+
return ret;
}
diff --git a/drivers/gpu/drm/stm/ltdc.h b/drivers/gpu/drm/stm/ltdc.h
index 9d488043ffdbc652deeede71c9d57d45fb89d3c6..ddfa8ae61a7ba5dc446fae647562d0ec8e6953e1 100644
--- a/drivers/gpu/drm/stm/ltdc.h
+++ b/drivers/gpu/drm/stm/ltdc.h
@@ -40,10 +40,15 @@ struct fps_info {
ktime_t last_timestamp;
};
+struct ltdc_plat_data {
+ int pad_max_freq_hz; /* max frequency supported by pad */
+};
+
struct ltdc_device {
void __iomem *regs;
struct regmap *regmap;
struct clk *pixel_clk; /* lcd pixel clock */
+ struct clk *bus_clk; /* bus clock */
struct mutex err_lock; /* protecting error_status */
struct ltdc_caps caps;
u32 irq_status;
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 08/13] drm/stm: ltdc: handle lvds pixel clock
2025-08-12 13:48 [PATCH v2 00/13] Enable display support for STM32MP25 Raphael Gallais-Pou
` (6 preceding siblings ...)
2025-08-12 13:49 ` [PATCH v2 07/13] drm/stm: ltdc: support new hardware version for STM32MP25 SoC Raphael Gallais-Pou
@ 2025-08-12 13:49 ` Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 09/13] arm64: dts: st: add ltdc support on stm32mp251 Raphael Gallais-Pou
` (4 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-12 13:49 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier
Cc: dri-devel, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
From: Yannick Fertre <yannick.fertre@foss.st.com>
Handle LVDS pixel clock.
The LTDC operates with multiple clock domains for register access,
requiring all clocks to be provided during read/write operations. This
imposes a dependency between the LVDS and LTDC to access correctly all
LTDC registers. And because both IPs' pixel rates must be synchronized,
the LTDC has to handle the LVDS clock.
Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
drivers/gpu/drm/stm/ltdc.c | 22 +++++++++++++++++++++-
drivers/gpu/drm/stm/ltdc.h | 1 +
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 74e93f076b62a46e7835985d9d330ba66d990e58..a4c2a1e960fbe426bf5dd2b3f0a88ccff927d041 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -837,6 +837,12 @@ ltdc_crtc_mode_valid(struct drm_crtc *crtc,
int target_max = target + CLK_TOLERANCE_HZ;
int result;
+ if (ldev->lvds_clk) {
+ result = clk_round_rate(ldev->lvds_clk, target);
+ drm_dbg_driver(crtc->dev, "lvds pixclk rate target %d, available %d\n",
+ target, result);
+ }
+
result = clk_round_rate(ldev->pixel_clk, target);
DRM_DEBUG_DRIVER("clk rate target %d, available %d\n", target, result);
@@ -1878,6 +1884,8 @@ void ltdc_suspend(struct drm_device *ddev)
clk_disable_unprepare(ldev->pixel_clk);
if (ldev->bus_clk)
clk_disable_unprepare(ldev->bus_clk);
+ if (ldev->lvds_clk)
+ clk_disable_unprepare(ldev->lvds_clk);
}
int ltdc_resume(struct drm_device *ddev)
@@ -1895,8 +1903,16 @@ int ltdc_resume(struct drm_device *ddev)
if (ldev->bus_clk) {
ret = clk_prepare_enable(ldev->bus_clk);
- if (ret)
+ if (ret) {
drm_err(ddev, "failed to enable bus clock (%d)\n", ret);
+ return ret;
+ }
+ }
+
+ if (ldev->lvds_clk) {
+ ret = clk_prepare_enable(ldev->lvds_clk);
+ if (ret)
+ drm_err(ddev, "failed to prepare lvds clock\n");
}
return ret;
@@ -1980,6 +1996,10 @@ int ltdc_load(struct drm_device *ddev)
}
}
+ ldev->lvds_clk = devm_clk_get(dev, "lvds");
+ if (IS_ERR(ldev->lvds_clk))
+ ldev->lvds_clk = NULL;
+
rstc = devm_reset_control_get_exclusive(dev, NULL);
mutex_init(&ldev->err_lock);
diff --git a/drivers/gpu/drm/stm/ltdc.h b/drivers/gpu/drm/stm/ltdc.h
index ddfa8ae61a7ba5dc446fae647562d0ec8e6953e1..17b51a7ce28eee5de6d24ca943ca3b1f48695dfd 100644
--- a/drivers/gpu/drm/stm/ltdc.h
+++ b/drivers/gpu/drm/stm/ltdc.h
@@ -48,6 +48,7 @@ struct ltdc_device {
void __iomem *regs;
struct regmap *regmap;
struct clk *pixel_clk; /* lcd pixel clock */
+ struct clk *lvds_clk; /* lvds pixel clock */
struct clk *bus_clk; /* bus clock */
struct mutex err_lock; /* protecting error_status */
struct ltdc_caps caps;
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 09/13] arm64: dts: st: add ltdc support on stm32mp251
2025-08-12 13:48 [PATCH v2 00/13] Enable display support for STM32MP25 Raphael Gallais-Pou
` (7 preceding siblings ...)
2025-08-12 13:49 ` [PATCH v2 08/13] drm/stm: ltdc: handle lvds pixel clock Raphael Gallais-Pou
@ 2025-08-12 13:49 ` Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 10/13] arm64: dts: st: add lvds support on stm32mp255 Raphael Gallais-Pou
` (3 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-12 13:49 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier
Cc: dri-devel, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
The LCD-TFT Display Controller (LTDC) handles display composition,
scaling and rotation. It provides a parallel digital RGB flow to be
used by display interfaces.
Add the LTDC node.
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
arch/arm64/boot/dts/st/stm32mp251.dtsi | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm64/boot/dts/st/stm32mp251.dtsi b/arch/arm64/boot/dts/st/stm32mp251.dtsi
index 8d87865850a7a6e8095c36acdef83c8e3a73ae54..6e8f76aa4680d5c253bae882edc455f4e95413f3 100644
--- a/arch/arm64/boot/dts/st/stm32mp251.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp251.dtsi
@@ -1052,6 +1052,18 @@ dcmipp: dcmipp@48030000 {
status = "disabled";
};
+ ltdc: display-controller@48010000 {
+ compatible = "st,stm32mp251-ltdc";
+ reg = <0x48010000 0x400>;
+ interrupts = <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 159 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_LTDC>, <&rcc CK_BUS_LTDC>;
+ clock-names = "lcd", "bus";
+ resets = <&rcc LTDC_R>;
+ access-controllers = <&rifsc 80>;
+ status = "disabled";
+ };
+
combophy: phy@480c0000 {
compatible = "st,stm32mp25-combophy";
reg = <0x480c0000 0x1000>;
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 10/13] arm64: dts: st: add lvds support on stm32mp255
2025-08-12 13:48 [PATCH v2 00/13] Enable display support for STM32MP25 Raphael Gallais-Pou
` (8 preceding siblings ...)
2025-08-12 13:49 ` [PATCH v2 09/13] arm64: dts: st: add ltdc support on stm32mp251 Raphael Gallais-Pou
@ 2025-08-12 13:49 ` Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 11/13] arm64: dts: st: add clock-cells to syscfg node on stm32mp251 Raphael Gallais-Pou
` (2 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-12 13:49 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier
Cc: dri-devel, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
The LVDS is used on STM32MP2 as a display interface.
Add the LVDS node.
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
arch/arm64/boot/dts/st/stm32mp255.dtsi | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/st/stm32mp255.dtsi b/arch/arm64/boot/dts/st/stm32mp255.dtsi
index f689b47c5010033120146cf1954d6624c0270045..a3b5ae25d28c83ade12c2ff69b82c9cccfd29b00 100644
--- a/arch/arm64/boot/dts/st/stm32mp255.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp255.dtsi
@@ -6,6 +6,18 @@
#include "stm32mp253.dtsi"
&rifsc {
+ lvds: lvds@48060000 {
+ compatible = "st,stm32mp255-lvds", "st,stm32mp25-lvds";
+ #clock-cells = <0>;
+ reg = <0x48060000 0x2000>;
+ clocks = <&rcc CK_BUS_LVDS>, <&rcc CK_KER_LVDSPHY>;
+ clock-names = "pclk", "ref";
+ resets = <&rcc LVDS_R>;
+ access-controllers = <&rifsc 84>;
+ power-domains = <&CLUSTER_PD>;
+ status = "disabled";
+ };
+
vdec: vdec@480d0000 {
compatible = "st,stm32mp25-vdec";
reg = <0x480d0000 0x3c8>;
@@ -22,4 +34,4 @@ venc: venc@480e0000 {
clocks = <&rcc CK_BUS_VENC>;
access-controllers = <&rifsc 90>;
};
-};
\ No newline at end of file
+};
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 11/13] arm64: dts: st: add clock-cells to syscfg node on stm32mp251
2025-08-12 13:48 [PATCH v2 00/13] Enable display support for STM32MP25 Raphael Gallais-Pou
` (9 preceding siblings ...)
2025-08-12 13:49 ` [PATCH v2 10/13] arm64: dts: st: add lvds support on stm32mp255 Raphael Gallais-Pou
@ 2025-08-12 13:49 ` Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 12/13] arm64: dts: st: enable display support on stm32mp257f-ev1 board Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 13/13] arm64: dts: st: add loopback clocks on LTDC node Raphael Gallais-Pou
12 siblings, 0 replies; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-12 13:49 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier
Cc: dri-devel, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
Make the syscfg node a clock provider so clock consumers can reach child
clocks through device-tree.
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
arch/arm64/boot/dts/st/stm32mp251.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/st/stm32mp251.dtsi b/arch/arm64/boot/dts/st/stm32mp251.dtsi
index 6e8f76aa4680d5c253bae882edc455f4e95413f3..d833b2b7904bef1cf1db8f1da210a1abd8a87d09 100644
--- a/arch/arm64/boot/dts/st/stm32mp251.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp251.dtsi
@@ -1344,6 +1344,7 @@ exti1: interrupt-controller@44220000 {
syscfg: syscon@44230000 {
compatible = "st,stm32mp25-syscfg", "syscon";
reg = <0x44230000 0x10000>;
+ #clock-cells = <0>;
};
pinctrl: pinctrl@44240000 {
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 12/13] arm64: dts: st: enable display support on stm32mp257f-ev1 board
2025-08-12 13:48 [PATCH v2 00/13] Enable display support for STM32MP25 Raphael Gallais-Pou
` (10 preceding siblings ...)
2025-08-12 13:49 ` [PATCH v2 11/13] arm64: dts: st: add clock-cells to syscfg node on stm32mp251 Raphael Gallais-Pou
@ 2025-08-12 13:49 ` Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 13/13] arm64: dts: st: add loopback clocks on LTDC node Raphael Gallais-Pou
12 siblings, 0 replies; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-12 13:49 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier
Cc: dri-devel, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
Enable the following IPs on stm32mp257f-ev1 in order to get display:
* LTDC
* LVDS
* WSVGA LVDS panel (1024x600)
* Panel LVDS backlight as GPIO backlight
* ILI2511 i2c touchscreen
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
arch/arm64/boot/dts/st/stm32mp257f-ev1.dts | 79 ++++++++++++++++++++++++++++++
1 file changed, 79 insertions(+)
diff --git a/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts b/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts
index 2f561ad4066544445e93db78557bc4be1c27095a..b324b0c226ddf043e62f01245240f3e8d2b0a53c 100644
--- a/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts
+++ b/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts
@@ -86,6 +86,43 @@ mm_ospi1: mm-ospi@60000000 {
no-map;
};
};
+
+ panel_lvds: display {
+ compatible = "edt,etml0700z9ndha", "panel-lvds";
+ enable-gpios = <&gpiog 15 GPIO_ACTIVE_HIGH>;
+ backlight = <&panel_lvds_backlight>;
+ power-supply = <&scmi_v3v3>;
+ status = "okay";
+
+ width-mm = <156>;
+ height-mm = <92>;
+ data-mapping = "vesa-24";
+
+ panel-timing {
+ clock-frequency = <54000000>;
+ hactive = <1024>;
+ vactive = <600>;
+ hfront-porch = <150>;
+ hback-porch = <150>;
+ hsync-len = <21>;
+ vfront-porch = <24>;
+ vback-porch = <24>;
+ vsync-len = <21>;
+ };
+
+ port {
+ lvds_panel_in: endpoint {
+ remote-endpoint = <&lvds_out0>;
+ };
+ };
+ };
+
+ panel_lvds_backlight: backlight {
+ compatible = "gpio-backlight";
+ gpios = <&gpioi 5 GPIO_ACTIVE_HIGH>;
+ default-on;
+ status = "okay";
+ };
};
&arm_wdt {
@@ -183,6 +220,15 @@ imx335_ep: endpoint {
};
};
};
+
+ ili2511: ili2511@41 {
+ compatible = "ilitek,ili251x";
+ reg = <0x41>;
+ interrupt-parent = <&gpioi>;
+ interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
+ reset-gpios = <&gpiog 14 GPIO_ACTIVE_LOW>;
+ status = "okay";
+ };
};
&i2c8 {
@@ -230,6 +276,39 @@ timer {
};
};
+<dc {
+ status = "okay";
+
+ port {
+ ltdc_ep0_out: endpoint {
+ remote-endpoint = <&lvds_in>;
+ };
+ };
+};
+
+&lvds {
+ status = "okay";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ lvds_in: endpoint {
+ remote-endpoint = <<dc_ep0_out>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ lvds_out0: endpoint {
+ remote-endpoint = <&lvds_panel_in>;
+ };
+ };
+ };
+};
+
&rtc {
status = "okay";
};
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 13/13] arm64: dts: st: add loopback clocks on LTDC node
2025-08-12 13:48 [PATCH v2 00/13] Enable display support for STM32MP25 Raphael Gallais-Pou
` (11 preceding siblings ...)
2025-08-12 13:49 ` [PATCH v2 12/13] arm64: dts: st: enable display support on stm32mp257f-ev1 board Raphael Gallais-Pou
@ 2025-08-12 13:49 ` Raphael Gallais-Pou
12 siblings, 0 replies; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-12 13:49 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier
Cc: dri-devel, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
ck_ker_ltdc has the CLK_SET_RATE_PARENT flag. While having this flag is
semantically correct, it for now leads to an improper setting of the
clock rate. The ck_ker_ltdc parent clock is the flexgen 27, which does
not support changing rates yet. To overcome this issue, a fixed clock
can be used for the kernel clock.
Add the clocks needed for the LTDC to work.
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
arch/arm64/boot/dts/st/stm32mp251.dtsi | 6 ++++++
arch/arm64/boot/dts/st/stm32mp255.dtsi | 5 +++++
2 files changed, 11 insertions(+)
diff --git a/arch/arm64/boot/dts/st/stm32mp251.dtsi b/arch/arm64/boot/dts/st/stm32mp251.dtsi
index d833b2b7904bef1cf1db8f1da210a1abd8a87d09..55f63cb7b881a91498042a71fcd39ac5191ad47d 100644
--- a/arch/arm64/boot/dts/st/stm32mp251.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp251.dtsi
@@ -52,6 +52,12 @@ clk_rcbsec: clk-rcbsec {
compatible = "fixed-clock";
clock-frequency = <64000000>;
};
+
+ clk_flexgen_27_fixed: clk-54000000 {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <54000000>;
+ };
};
firmware {
diff --git a/arch/arm64/boot/dts/st/stm32mp255.dtsi b/arch/arm64/boot/dts/st/stm32mp255.dtsi
index a3b5ae25d28c83ade12c2ff69b82c9cccfd29b00..07c200470b2cedde771ae987f2267d6097ea78f0 100644
--- a/arch/arm64/boot/dts/st/stm32mp255.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp255.dtsi
@@ -5,6 +5,11 @@
*/
#include "stm32mp253.dtsi"
+<dc {
+ clocks = <&clk_flexgen_27_fixed>, <&rcc CK_BUS_LTDC>, <&syscfg>, <&lvds>;
+ clock-names = "lcd", "bus", "ref", "lvds";
+};
+
&rifsc {
lvds: lvds@48060000 {
compatible = "st,stm32mp255-lvds", "st,stm32mp25-lvds";
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH v2 01/13] dt-bindings: display: st: add new compatible to LTDC device
2025-08-12 13:48 ` [PATCH v2 01/13] dt-bindings: display: st: add new compatible to LTDC device Raphael Gallais-Pou
@ 2025-08-14 9:08 ` Krzysztof Kozlowski
2025-08-14 12:38 ` Raphael Gallais-Pou
0 siblings, 1 reply; 19+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-14 9:08 UTC (permalink / raw)
To: Raphael Gallais-Pou
Cc: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier, dri-devel, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel
On Tue, Aug 12, 2025 at 03:48:58PM +0200, Raphael Gallais-Pou wrote:
> +else:
> + properties:
> + clocks:
> + maxItems: 4
minItems instead
> + clock-names:
> + maxItems: 4
minItems instead
> +
> additionalProperties: false
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 03/13] dt-bindings: display: st: add new compatible to LVDS device
2025-08-12 13:49 ` [PATCH v2 03/13] dt-bindings: display: st: add new compatible to LVDS device Raphael Gallais-Pou
@ 2025-08-14 9:09 ` Krzysztof Kozlowski
2025-08-14 12:36 ` Raphael Gallais-Pou
0 siblings, 1 reply; 19+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-14 9:09 UTC (permalink / raw)
To: Raphael Gallais-Pou
Cc: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier, dri-devel, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel
On Tue, Aug 12, 2025 at 03:49:00PM +0200, Raphael Gallais-Pou wrote:
> Update the compatible to accept both "st,stm32mp255-lvds" and
> st,stm32mp25-lvds" respectively. Default will fall back to
> "st,stm32mp25-lvds".
>
> Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
> ---
> Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml b/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
> index 6736f93256b5cebb558cda5250369ec4b1b3033c..b777c55626e4b322d77ef411ad9e4a3afb6c9131 100644
> --- a/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
> +++ b/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
> @@ -31,7 +31,13 @@ description: |
>
> properties:
> compatible:
> - const: st,stm32mp25-lvds
> + oneOf:
> + - items:
> + - enum:
> + - st,stm32mp255-lvds
> + - const: st,stm32mp25-lvds
> + - items:
Drop. This should be just enum or const, no need for items.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 03/13] dt-bindings: display: st: add new compatible to LVDS device
2025-08-14 9:09 ` Krzysztof Kozlowski
@ 2025-08-14 12:36 ` Raphael Gallais-Pou
2025-08-14 14:01 ` Rob Herring
0 siblings, 1 reply; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-14 12:36 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier, dri-devel, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel
On 8/14/25 11:09, Krzysztof Kozlowski wrote:
> On Tue, Aug 12, 2025 at 03:49:00PM +0200, Raphael Gallais-Pou wrote:
>> Update the compatible to accept both "st,stm32mp255-lvds" and
>> st,stm32mp25-lvds" respectively. Default will fall back to
>> "st,stm32mp25-lvds".
>>
>> Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
>> ---
>> Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml b/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
>> index 6736f93256b5cebb558cda5250369ec4b1b3033c..b777c55626e4b322d77ef411ad9e4a3afb6c9131 100644
>> --- a/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
>> +++ b/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
>> @@ -31,7 +31,13 @@ description: |
>>
>> properties:
>> compatible:
>> - const: st,stm32mp25-lvds
>> + oneOf:
>> + - items:
>> + - enum:
>> + - st,stm32mp255-lvds
>> + - const: st,stm32mp25-lvds
>> + - items:
> Drop. This should be just enum or const, no need for items.
Why would items not be applicable in this case ? I want the compatible field to
be either:
compatible = "st,stm32mp255-lvds", "st,stm32mp25-lvds";
or
compatible = "st,stm32mp25-lvds";
example-schema.yaml states the same pattern.
Best regards,
Raphaël
>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> Best regards,
> Krzysztof
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 01/13] dt-bindings: display: st: add new compatible to LTDC device
2025-08-14 9:08 ` Krzysztof Kozlowski
@ 2025-08-14 12:38 ` Raphael Gallais-Pou
0 siblings, 0 replies; 19+ messages in thread
From: Raphael Gallais-Pou @ 2025-08-14 12:38 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Yannick Fertre, Philippe Cornu, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier, dri-devel, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel
On 8/14/25 11:08, Krzysztof Kozlowski wrote:
> On Tue, Aug 12, 2025 at 03:48:58PM +0200, Raphael Gallais-Pou wrote:
>> +else:
>> + properties:
>> + clocks:
>> + maxItems: 4
> minItems instead
>
>> + clock-names:
>> + maxItems: 4
> minItems instead
Ack, indeed I wrongly clamped the values here.
Best regards,
Raphaël
>
>> +
>> additionalProperties: false
> Best regards,
> Krzysztof
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 03/13] dt-bindings: display: st: add new compatible to LVDS device
2025-08-14 12:36 ` Raphael Gallais-Pou
@ 2025-08-14 14:01 ` Rob Herring
0 siblings, 0 replies; 19+ messages in thread
From: Rob Herring @ 2025-08-14 14:01 UTC (permalink / raw)
To: Raphael Gallais-Pou
Cc: Krzysztof Kozlowski, Yannick Fertre, Philippe Cornu,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Catalin Marinas, Will Deacon,
Christophe Roullier, dri-devel, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel
On Thu, Aug 14, 2025 at 02:36:47PM +0200, Raphael Gallais-Pou wrote:
>
>
> On 8/14/25 11:09, Krzysztof Kozlowski wrote:
> > On Tue, Aug 12, 2025 at 03:49:00PM +0200, Raphael Gallais-Pou wrote:
> >> Update the compatible to accept both "st,stm32mp255-lvds" and
> >> st,stm32mp25-lvds" respectively. Default will fall back to
> >> "st,stm32mp25-lvds".
> >>
> >> Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
> >> ---
> >> Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml | 8 +++++++-
> >> 1 file changed, 7 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml b/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
> >> index 6736f93256b5cebb558cda5250369ec4b1b3033c..b777c55626e4b322d77ef411ad9e4a3afb6c9131 100644
> >> --- a/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
> >> +++ b/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml
> >> @@ -31,7 +31,13 @@ description: |
> >>
> >> properties:
> >> compatible:
> >> - const: st,stm32mp25-lvds
> >> + oneOf:
> >> + - items:
> >> + - enum:
> >> + - st,stm32mp255-lvds
> >> + - const: st,stm32mp25-lvds
> >> + - items:
> > Drop. This should be just enum or const, no need for items.
>
> Why would items not be applicable in this case ? I want the compatible field to
> be either:
>
> compatible = "st,stm32mp255-lvds", "st,stm32mp25-lvds";
>
> or
>
> compatible = "st,stm32mp25-lvds";
Krzysztof is only talking about the 2nd 'items' here. For cases with a
single entry, you can skip 'items'. It's just a shorter version. Either
way will work the same.
Rob
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2025-08-14 15:15 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-12 13:48 [PATCH v2 00/13] Enable display support for STM32MP25 Raphael Gallais-Pou
2025-08-12 13:48 ` [PATCH v2 01/13] dt-bindings: display: st: add new compatible to LTDC device Raphael Gallais-Pou
2025-08-14 9:08 ` Krzysztof Kozlowski
2025-08-14 12:38 ` Raphael Gallais-Pou
2025-08-12 13:48 ` [PATCH v2 02/13] dt-bindings: display: st,stm32-ltdc: add access-controllers property Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 03/13] dt-bindings: display: st: add new compatible to LVDS device Raphael Gallais-Pou
2025-08-14 9:09 ` Krzysztof Kozlowski
2025-08-14 12:36 ` Raphael Gallais-Pou
2025-08-14 14:01 ` Rob Herring
2025-08-12 13:49 ` [PATCH v2 04/13] dt-bindings: display: st,stm32mp25-lvds: add access-controllers property Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 05/13] dt-bindings: display: st,stm32mp25-lvds: add power-domains property Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 06/13] dt-bindings: arm: stm32: add required #clock-cells property Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 07/13] drm/stm: ltdc: support new hardware version for STM32MP25 SoC Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 08/13] drm/stm: ltdc: handle lvds pixel clock Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 09/13] arm64: dts: st: add ltdc support on stm32mp251 Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 10/13] arm64: dts: st: add lvds support on stm32mp255 Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 11/13] arm64: dts: st: add clock-cells to syscfg node on stm32mp251 Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 12/13] arm64: dts: st: enable display support on stm32mp257f-ev1 board Raphael Gallais-Pou
2025-08-12 13:49 ` [PATCH v2 13/13] arm64: dts: st: add loopback clocks on LTDC node Raphael Gallais-Pou
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).