Skip to contentSkip to conversation

dt-bindings: arm: stm32: Document st,stm32mp23/25-syscfg subnodes and cells

PATCH In review Marek Vasut 5 participants 7 messages Sep 2 – Oct 1

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v6 1/2 dt-bindings: arm: stm32: Document st,stm32mp23/25-syscfg subnodes and cells

The st,stm32mp23-syscfg and st,stm32mp25-syscfg can have subnodes, which represent the USB 2.0 FEMTO-PHY. Document subnodes pattern properties and address/size cells.

---
Cc: Alexandre Torgue <[email protected]>
Cc: Christophe Roullier <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Raphael Gallais-Pou <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Yannick Fertre <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
V2: New patch
V3: Fix the bindings
V4: - Undo simple-mfd in favor of dedicated SYSCFG SoC driver
- Update commit message to match, this used to be patch
dt-bindings: arm: stm32: Switch st,stm32mp23/25-syscfg into simple-mfd
- Split this from series arm64: dts: phy: st: usb: Add STM32MP2 USB support
https://lore.kernel.org/all/[email protected]/
V5: - Add missing contains: into conditional
- Add phy subnodes into required list for stm32mp23-syscfg/stm32mp25-syscfg
V6: - Reduce the pattern in patternProperties to match only on phy@2400 and phy@2800
- Disable address/clock/size-cells/phy@2400/phy@2800 unless compatible with st,stm32mp23-syscfg or st,stm32mp25-syscfg
- Disable clocks unless compatible with st,stm32mp157-syscfg or st,stm32f4-gcan

---
 .../bindings/arm/stm32/st,stm32-syscon.yaml   | 30 ++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml +29 -1
index 95d2319afe235..a559f8b03b842 100644
@@ -39,6 +39,17 @@ properties:
   "#clock-cells":
     const: 0
 
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 1
+
+patternProperties:
+  "^phy@2[48]00$":
+    type: object
+    $ref: /schemas/phy/st,stm32-usb2phy.yaml
+
 required:
   - compatible
   - reg
@@ -54,13 +65,30 @@ allOf:
     then:
       required:
         - clocks
+    else:
+      properties:
+        clocks: false
   - if:
       properties:
         compatible:
-          const: st,stm32mp25-syscfg
+          contains:
+            enum:
+              - st,stm32mp23-syscfg
+              - st,stm32mp25-syscfg
     then:
       required:
+        - "#address-cells"
         - "#clock-cells"
+        - "#size-cells"
+        - phy@2400
+        - phy@2800
+    else:
+      properties:
+        '#address-cells': false
+        '#clock-cells': false
+        '#size-cells': false
+        phy@2400: false
+        phy@2800: false
 
 additionalProperties: false
 
Signature · 1 line
2.53.0
#1 lore raw

PATCH v6 2/2 soc: st: Add STM32MP2 SYSCFG driver

Add trivial SYSCFG driver for ST STM32MP25xx, which binds drivers to its subnodes. This is currently used to bind USB PHY drivers to subnodes described in the SYSCFG DT node.

---
Cc: Alexandre Torgue <[email protected]>
Cc: Christophe Roullier <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Raphael Gallais-Pou <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Yannick Fertre <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
V4: New patch
V5: No change
V6: - Fix up the SPDX-License-Identifier
- Add AB/TB from Fabrice

---
 drivers/soc/Kconfig              |  1 +
 drivers/soc/Makefile             |  1 +
 drivers/soc/st/Kconfig           | 12 ++++++++++++
 drivers/soc/st/Makefile          |  1 +
 drivers/soc/st/stm32mp2-syscfg.c | 33 ++++++++++++++++++++++++++++++++
 5 files changed, 48 insertions(+)
 create mode 100644 drivers/soc/st/Kconfig
 create mode 100644 drivers/soc/st/Makefile
 create mode 100644 drivers/soc/st/stm32mp2-syscfg.c
drivers/soc/Kconfig +1 -0
index a2d65adffb805..dfe5cec592626 100644
@@ -24,6 +24,7 @@ source "drivers/soc/renesas/Kconfig"
 source "drivers/soc/rockchip/Kconfig"
 source "drivers/soc/samsung/Kconfig"
 source "drivers/soc/sophgo/Kconfig"
+source "drivers/soc/st/Kconfig"
 source "drivers/soc/sunxi/Kconfig"
 source "drivers/soc/tegra/Kconfig"
 source "drivers/soc/ti/Kconfig"
drivers/soc/Makefile +1 -0
index c9e689080ceb7..894bd6ebaaa4d 100644
@@ -30,6 +30,7 @@ obj-y				+= renesas/
 obj-y				+= rockchip/
 obj-$(CONFIG_SOC_SAMSUNG)	+= samsung/
 obj-y				+= sophgo/
+obj-y				+= st/
 obj-y				+= sunxi/
 obj-$(CONFIG_ARCH_TEGRA)	+= tegra/
 obj-y				+= ti/
drivers/soc/st/Kconfig new file +12 -0
new file mode 100644
index 0000000000000..2a9d6a77be450
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0-only
+menu "ST SoC drivers"
+
+config SOC_STM32MP2
+	tristate "STM32MP2 SoC family support"
+	depends on ARCH_STM32 || COMPILE_TEST
+	default ARCH_STM32 && ARM64
+	select SOC_BUS
+	help
+	  If you say yes here, you get support for the ST STM32MP2 family
+
+endmenu
drivers/soc/st/Makefile new file +1 -0
new file mode 100644
index 0000000000000..5ca313476ca93
@@ -0,0 +1 @@
+obj-$(CONFIG_SOC_STM32MP2) += stm32mp2-syscfg.o
drivers/soc/st/stm32mp2-syscfg.c new file +33 -0
new file mode 100644
index 0000000000000..770321a4a6f71
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright 2026 Marek Vasut
+ */
+
+#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);
+}
+
+static const struct of_device_id stm32mp2_syscfg_ids[] = {
+	{ .compatible = "st,stm32mp23-syscfg" },
+	{ .compatible = "st,stm32mp25-syscfg" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, stm32mp2_syscfg_ids);
+
+static struct platform_driver stm32mp2_syscfg_driver = {
+	.driver = {
+		.name	= "stm32mp2_syscfg",
+		.of_match_table = stm32mp2_syscfg_ids,
+	},
+	.probe = stm32mp2_syscfg_probe,
+};
+module_platform_driver(stm32mp2_syscfg_driver);
+
+MODULE_AUTHOR("Marek Vasut <[email protected]>");
+MODULE_DESCRIPTION("ST STM32MP2 SYSCFG driver");
+MODULE_LICENSE("GPL");
Signature · 1 line
2.53.0
maintainer
#2 lore raw

Re: [PATCH v6 2/2] soc: st: Add STM32MP2 SYSCFG driver

Hi

Quoted 34 lines · Marek Vasut

Add trivial SYSCFG driver for ST STM32MP25xx, which binds drivers to its subnodes. This is currently used to bind USB PHY drivers to subnodes described in the SYSCFG DT node.

---
Cc: Alexandre Torgue <[email protected]>
Cc: Christophe Roullier <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Raphael Gallais-Pou <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Yannick Fertre <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
V4: New patch
V5: No change
V6: - Fix up the SPDX-License-Identifier
- Add AB/TB from Fabrice

---
  drivers/soc/Kconfig              |  1 +
  drivers/soc/Makefile             |  1 +
  drivers/soc/st/Kconfig           | 12 ++++++++++++
  drivers/soc/st/Makefile          |  1 +
  drivers/soc/st/stm32mp2-syscfg.c | 33 ++++++++++++++++++++++++++++++++
  5 files changed, 48 insertions(+)
Quoted 4 lines

create mode 100644 drivers/soc/st/Kconfig create mode 100644 drivers/soc/st/Makefile create mode 100644 drivers/soc/st/stm32mp2-syscfg.c

applied on stm32-next.

Regards.

Alex

#3 lore raw
In reply to Marek Vasut
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [High] The `clocks: false` restriction in the `else` block incorrectly forbids the `clocks` property for…

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] The clocks: false restriction in the else block incorrectly forbids the clocks property for st,stm32-syscfg, breaking validation of existing in-tree device trees.
- [High] Making phy@2400, phy@2800, #address-cells, and #size-cells unconditionally required contradicts their optional nature and breaks existing device trees.
- [Medium] The patternProperties entry contains a $ref to a schema file (st,stm32-usb2phy.yaml) that does not exist in the repository.
--

commit ddc0637029fe22061a9355ce24276a2cff5c6682
Author: Marek Vasut <[email protected]>

dt-bindings: arm: stm32: Document st,stm32mp23/25-syscfg subnodes and cells

The st,stm32mp23-syscfg and st,stm32mp25-syscfg can have subnodes, which represent the USB 2.0 FEMTO-PHY. Document subnodes pattern properties and address/size cells.

Quoted 5 lines
Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml +0 -0
index 95d2319afe235..a559f8b03b842 100644
@@ -39,6 +39,17 @@ properties:

[ ... ]

Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml properties: · line 51

Quoted 4 lines
Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml +4 -0
+patternProperties:
+  "^phy@2[48]00$":
+    type: object
+    $ref: /schemas/phy/st,stm32-usb2phy.yaml

[Severity: Medium]
Does this reference target a schema file (st,stm32-usb2phy.yaml) that is missing from the repository? Schema validation tooling might fail to resolve this reference.

Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml allOf: · line 70

Quoted 10 lines

required:
- compatible
- reg

Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml +3 -0
@@ -54,13 +65,30 @@ allOf:
     then:
       required:
         - clocks
+    else:
+      properties:
+        clocks: false

[Severity: High]
Does this block incorrectly forbid the clocks property for other compatibles, breaking validation of existing in-tree device trees?

For example, platforms like STM32F429 use the st,stm32-syscfg compatible and define clocks:

arch/arm/boot/dts/st/stm32f429.dtsi:syscfg {
    ...
    clocks = <&rcc 0 STM32F4_APB2_CLOCK(SYSCFG)>;
    ...
}

Because st,stm32-syscfg does not match the preceding if condition, it falls into this else block, which will cause dtbs_check to fail.

Quoted 5 lines
Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml +1 -1
   - if:
       properties:
         compatible:
-          const: st,stm32mp25-syscfg
+          contains:

Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml allOf: · line 84

Quoted 10 lines
Documentation/devicetree/bindings/arm/stm32/st,stm32-syscon.yaml +7 -0
+            enum:
+              - st,stm32mp23-syscfg
+              - st,stm32mp25-syscfg
     then:
       required:
+        - "#address-cells"
         - "#clock-cells"
+        - "#size-cells"
+        - phy@2400
+        - phy@2800

[Severity: High]
Does making these properties unconditionally required contradict their optional nature implied by "can have subnodes" in the commit message?

Existing devicetrees without these subnodes will fail validation. For example, in arch/arm64/boot/dts/st/stm32mp251.dtsi:

syscfg: syscon@44230000 {
	compatible = "st,stm32mp25-syscfg", "syscon";
	reg = <0x44230000 0x10000>;
	#clock-cells = <0>;
};

This node will immediately fail dtbs_check because it lacks the newly mandated phy@2400, phy@2800, #address-cells, and #size-cells properties.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer
#5 lore raw
In reply to Marek Vasut
Quoted 4 lines · Marek Vasut

The st,stm32mp23-syscfg and st,stm32mp25-syscfg can have subnodes, which represent the USB 2.0 FEMTO-PHY. Document subnodes pattern properties and address/size cells.

ST folks,

Can you please pick this up. It is introducing warnings due to .dts changes you already picked up:

      8 syscon@44230000 (st,stm32mp25-syscfg): '#address-cells',
'#size-cells', 'phy@2400', 'phy@2800' do not match any of the regexes:
'^pinctrl-[0-9]+$'
      2 syscon@44230000 (st,stm32mp23-syscfg): '#address-cells',

'#size-cells', 'phy@2400', 'phy@2800' do not match any of the regexes:
'^pinctrl-[0-9]+$'

Rob

maintainer
#6 lore raw

Hi

Quoted 15 lines · Rob Herring
Quoted 4 lines · Marek Vasut

The st,stm32mp23-syscfg and st,stm32mp25-syscfg can have subnodes, which represent the USB 2.0 FEMTO-PHY. Document subnodes pattern properties and address/size cells.

ST folks,

Can you please pick this up. It is introducing warnings due to .dts changes you already picked up:

       8 syscon@44230000 (st,stm32mp25-syscfg): '#address-cells',
'#size-cells', 'phy@2400', 'phy@2800' do not match any of the regexes:
'^pinctrl-[0-9]+$'
       2 syscon@44230000 (st,stm32mp23-syscfg): '#address-cells',
Quoted 5 lines

'#size-cells', 'phy@2400', 'phy@2800' do not match any of the regexes:
'^pinctrl-[0-9]+$'

Rob

Patch applied on stm32-next.

Regards
Alex