Skip to contentSkip to conversation

ARM: dts: stm32: Duplicate cpu0-opp-table node into stm32mp15-u-boot.dtsi

PATCH Superseded Marek Vasut 3 participants 5 messages Oct 4, 2024 – Oct 11, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ARM: dts: stm32: Duplicate cpu0-opp-table node into stm32mp15-u-boot.dtsi

The cpu0-opp-table {} node does not exist in upstream Linux stm32mp151.dtsi file, in order to enable conversion to OF_UPSTREAM, duplicate the node from current U-Boot stm32mp151.dtsi into stm32mp15-u-boot.dtsi. This makes STM32 DTs buildable even with OF_UPSTREAM enabled. No functional change, since the current U-Boot stm32mp151.dtsi already contains the cpu0-opp-table {} node, stm32mp15-u-boot.dtsi is applied at the end, and does not bring in any new content.

---
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: Sean Anderson <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 arch/arm/dts/stm32mp15-u-boot.dtsi | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)
arch/arm/dts/stm32mp15-u-boot.dtsi +22 -8
index fe56f05616a..66d4c40c6a8 100644
@@ -56,6 +56,24 @@
 			status = "okay";
 		};
 	};
+
+	cpu0_opp_table: cpu0-opp-table {
+		compatible = "operating-points-v2";
+		opp-shared;
+		bootph-pre-ram;
+		opp-650000000 {
+			bootph-pre-ram;
+			opp-hz = /bits/ 64 <650000000>;
+			opp-microvolt = <1200000>;
+			opp-supported-hw = <0x1>;
+		};
+		opp-800000000 {
+			bootph-pre-ram;
+			opp-hz = /bits/ 64 <800000000>;
+			opp-microvolt = <1350000>;
+			opp-supported-hw = <0x2>;
+		};
+	};
 };
 
 &bsec {
@@ -82,14 +100,10 @@
 	bootph-all;
 };
 
-&cpu0_opp_table {
-	bootph-pre-ram;
-	opp-650000000 {
-		bootph-pre-ram;
-	};
-	opp-800000000 {
-		bootph-pre-ram;
-	};
+&cpu0 {
+	nvmem-cells = <&part_number_otp>;
+	nvmem-cell-names = "part_number";
+	operating-points-v2 = <&cpu0_opp_table>;
 };
 
 &gpioa {
Signature · 1 line
2.45.2
#1 lore raw

PATCH 2/3 ARM: dts: stm32: Switch to using upstream DT on DH STM32 DHSOM

Enable OF_UPSTREAM to use upstream DT and add st/ prefix to the DEFAULT_DEVICE_TREE. And thereby directly build DTB from dts/upstream/src/ including *-u-boot.dtsi from arch/$(ARCH)/dts/ directory.

The previous setup used generic SoC prefix like stm32mp15xx-dhco* for generic DTs which could be used on any STM32MP15xx DHSOM variant. The new setup uses specific SoC prefix stm32mp157c-dhco* to match Linux DT names. Since the hardware present on STM32MP153 and STM32MP157 is not enabled in the board configuration and not supported by U-Boot except for the DSI host, using the existing Linux DTs poses no issue even on plain STM32MP151A based SoMs.

---
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: Sean Anderson <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 ...> stm32mp151a-dhcor-testbench-u-boot.dtsi} |   0
 ...si => stm32mp153c-dhcom-drc02-u-boot.dtsi} |   0
 ...stm32mp153c-dhcor-drc-compact-u-boot.dtsi} |   0
 ...> stm32mp157a-dhcor-avenger96-u-boot.dtsi} |   0
 ...tsi => stm32mp157c-dhcom-pdk2-u-boot.dtsi} |   0
 ... => stm32mp157c-dhcom-picoitx-u-boot.dtsi} |   0
 arch/arm/dts/stm32mp15xx-dhcom-drc02.dts      |  17 -
 arch/arm/dts/stm32mp15xx-dhcom-drc02.dtsi     | 169 ------
 arch/arm/dts/stm32mp15xx-dhcom-pdk2.dts       |  17 -
 arch/arm/dts/stm32mp15xx-dhcom-pdk2.dtsi      | 329 -----------
 arch/arm/dts/stm32mp15xx-dhcom-picoitx.dts    |  17 -
 arch/arm/dts/stm32mp15xx-dhcom-picoitx.dtsi   | 151 -----
 arch/arm/dts/stm32mp15xx-dhcom-som.dtsi       | 544 ------------------
 arch/arm/dts/stm32mp15xx-dhcor-avenger96.dts  |  20 -
 arch/arm/dts/stm32mp15xx-dhcor-avenger96.dtsi | 437 --------------
 .../arm/dts/stm32mp15xx-dhcor-drc-compact.dts |  18 -
 .../dts/stm32mp15xx-dhcor-drc-compact.dtsi    | 326 -----------
 arch/arm/dts/stm32mp15xx-dhcor-io1v8.dtsi     |  28 -
 arch/arm/dts/stm32mp15xx-dhcor-som.dtsi       | 221 -------
 arch/arm/dts/stm32mp15xx-dhcor-testbench.dts  | 180 ------
 .../dh_stm32mp1/u-boot-dhcom.its              |  18 +-
 .../dh_stm32mp1/u-boot-dhcor.its              |  12 +-
 configs/stm32mp15_dhcom_basic_defconfig       |   5 +-
 configs/stm32mp15_dhcor_basic_defconfig       |   5 +-
 24 files changed, 21 insertions(+), 2493 deletions(-)
 rename arch/arm/dts/{stm32mp15xx-dhcor-testbench-u-boot.dtsi => stm32mp151a-dhcor-testbench-u-boot.dtsi} (100%)
 rename arch/arm/dts/{stm32mp15xx-dhcom-drc02-u-boot.dtsi => stm32mp153c-dhcom-drc02-u-boot.dtsi} (100%)
 rename arch/arm/dts/{stm32mp15xx-dhcor-drc-compact-u-boot.dtsi => stm32mp153c-dhcor-drc-compact-u-boot.dtsi} (100%)
 rename arch/arm/dts/{stm32mp15xx-dhcor-avenger96-u-boot.dtsi => stm32mp157a-dhcor-avenger96-u-boot.dtsi} (100%)
 rename arch/arm/dts/{stm32mp15xx-dhcom-pdk2-u-boot.dtsi => stm32mp157c-dhcom-pdk2-u-boot.dtsi} (100%)
 rename arch/arm/dts/{stm32mp15xx-dhcom-picoitx-u-boot.dtsi => stm32mp157c-dhcom-picoitx-u-boot.dtsi} (100%)
 delete mode 100644 arch/arm/dts/stm32mp15xx-dhcom-drc02.dts
 delete mode 100644 arch/arm/dts/stm32mp15xx-dhcom-drc02.dtsi
 delete mode 100644 arch/arm/dts/stm32mp15xx-dhcom-pdk2.dts
 delete mode 100644 arch/arm/dts/stm32mp15xx-dhcom-pdk2.dtsi
 delete mode 100644 arch/arm/dts/stm32mp15xx-dhcom-picoitx.dts
 delete mode 100644 arch/arm/dts/stm32mp15xx-dhcom-picoitx.dtsi
 delete mode 100644 arch/arm/dts/stm32mp15xx-dhcom-som.dtsi
 delete mode 100644 arch/arm/dts/stm32mp15xx-dhcor-avenger96.dts
 delete mode 100644 arch/arm/dts/stm32mp15xx-dhcor-avenger96.dtsi
 delete mode 100644 arch/arm/dts/stm32mp15xx-dhcor-drc-compact.dts
 delete mode 100644 arch/arm/dts/stm32mp15xx-dhcor-drc-compact.dtsi
 delete mode 100644 arch/arm/dts/stm32mp15xx-dhcor-io1v8.dtsi
 delete mode 100644 arch/arm/dts/stm32mp15xx-dhcor-som.dtsi
 delete mode 100644 arch/arm/dts/stm32mp15xx-dhcor-testbench.dts
arch/arm/dts/stm32mp151a-dhcor-testbench-u-boot.dtsi renamed from arch/arm/dts/stm32mp15xx-dhcor-testbench-u-boot.dtsi +0 -0
similarity index 100%
rename from arch/arm/dts/stm32mp15xx-dhcor-testbench-u-boot.dtsi
rename to arch/arm/dts/stm32mp151a-dhcor-testbench-u-boot.dtsi
arch/arm/dts/stm32mp153c-dhcom-drc02-u-boot.dtsi renamed from arch/arm/dts/stm32mp15xx-dhcom-drc02-u-boot.dtsi +0 -0
similarity index 100%
rename from arch/arm/dts/stm32mp15xx-dhcom-drc02-u-boot.dtsi
rename to arch/arm/dts/stm32mp153c-dhcom-drc02-u-boot.dtsi
arch/arm/dts/stm32mp153c-dhcor-drc-compact-u-boot.dtsi renamed from arch/arm/dts/stm32mp15xx-dhcor-drc-compact-u-boot.dtsi +0 -0
similarity index 100%
rename from arch/arm/dts/stm32mp15xx-dhcor-drc-compact-u-boot.dtsi
rename to arch/arm/dts/stm32mp153c-dhcor-drc-compact-u-boot.dtsi
arch/arm/dts/stm32mp157a-dhcor-avenger96-u-boot.dtsi renamed from arch/arm/dts/stm32mp15xx-dhcor-avenger96-u-boot.dtsi +0 -0
similarity index 100%
rename from arch/arm/dts/stm32mp15xx-dhcor-avenger96-u-boot.dtsi
rename to arch/arm/dts/stm32mp157a-dhcor-avenger96-u-boot.dtsi
arch/arm/dts/stm32mp157c-dhcom-pdk2-u-boot.dtsi renamed from arch/arm/dts/stm32mp15xx-dhcom-pdk2-u-boot.dtsi +0 -0
similarity index 100%
rename from arch/arm/dts/stm32mp15xx-dhcom-pdk2-u-boot.dtsi
rename to arch/arm/dts/stm32mp157c-dhcom-pdk2-u-boot.dtsi
arch/arm/dts/stm32mp157c-dhcom-picoitx-u-boot.dtsi renamed from arch/arm/dts/stm32mp15xx-dhcom-picoitx-u-boot.dtsi +0 -0
similarity index 100%
rename from arch/arm/dts/stm32mp15xx-dhcom-picoitx-u-boot.dtsi
rename to arch/arm/dts/stm32mp157c-dhcom-picoitx-u-boot.dtsi
arch/arm/dts/stm32mp15xx-dhcom-drc02.dts deleted +0 -17
deleted file mode 100644
index 90625bf6b60..00000000000
@@ -1,17 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
-/*
- * Copyright (C) 2020 Marek Vasut <[email protected]>
- */
-/dts-v1/;
-
-#include "stm32mp151.dtsi"
-#include "stm32mp15xc.dtsi"
-#include "stm32mp15xx-dhcom-som.dtsi"
-#include "stm32mp15xx-dhcom-drc02.dtsi"
-
-/ {
-	model = "DH Electronics STM32MP15xx DHCOM DRC02";
-	compatible = "dh,stm32mp15xx-dhcom-drc02",
-		     "dh,stm32mp15xx-dhcom-som",
-		     "st,stm32mp1xx";
-};
arch/arm/dts/stm32mp15xx-dhcom-drc02.dtsi deleted +0 -169

169 lines not on this page · raw message

arch/arm/dts/stm32mp15xx-dhcom-pdk2.dts deleted +0 -17
deleted file mode 100644
index b2e450aa13b..00000000000
@@ -1,17 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
-/*
- * Copyright (C) 2019 Marek Vasut <[email protected]>
- */
-/dts-v1/;
-
-#include "stm32mp151.dtsi"
-#include "stm32mp15xc.dtsi"
-#include "stm32mp15xx-dhcom-som.dtsi"
-#include "stm32mp15xx-dhcom-pdk2.dtsi"
-
-/ {
-	model = "STMicroelectronics STM32MP15xx DHCOM Premium Developer Kit (2)";
-	compatible = "dh,stm32mp15xx-dhcom-pdk2",
-		     "dh,stm32mp15xx-dhcom-som",
-		     "st,stm32mp15x";
-};
arch/arm/dts/stm32mp15xx-dhcom-pdk2.dtsi deleted +0 -329

329 lines not on this page · raw message

arch/arm/dts/stm32mp15xx-dhcom-picoitx.dts deleted +0 -17
deleted file mode 100644
index 3e908102f61..00000000000
@@ -1,17 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
-/*
- * Copyright (C) 2020 Marek Vasut <[email protected]>
- */
-/dts-v1/;
-
-#include "stm32mp157.dtsi"
-#include "stm32mp15xc.dtsi"
-#include "stm32mp15xx-dhcom-som.dtsi"
-#include "stm32mp15xx-dhcom-picoitx.dtsi"
-
-/ {
-	model = "DH Electronics STM32MP15xx DHCOM PicoITX";
-	compatible = "dh,stm32mp15xx-dhcom-picoitx",
-		     "dh,stm32mp15xx-dhcom-som",
-		     "st,stm32mp1xx";
-};
arch/arm/dts/stm32mp15xx-dhcom-picoitx.dtsi deleted +0 -151

151 lines not on this page · raw message

arch/arm/dts/stm32mp15xx-dhcom-som.dtsi deleted +0 -544

544 lines not on this page · raw message

arch/arm/dts/stm32mp15xx-dhcor-avenger96.dts deleted +0 -20
deleted file mode 100644
index dd8fcecbca5..00000000000
@@ -1,20 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
-/*
- * Copyright (C) Linaro Ltd 2019 - All Rights Reserved
- * Author: Manivannan Sadhasivam <[email protected]>
- * Copyright (C) 2020 Marek Vasut <[email protected]>
- */
-
-/dts-v1/;
-
-#include "stm32mp151.dtsi"
-#include "stm32mp15xc.dtsi"
-#include "stm32mp15xx-dhcor-som.dtsi"
-#include "stm32mp15xx-dhcor-avenger96.dtsi"
-
-/ {
-	model = "Arrow Electronics STM32MP15xx Avenger96 board";
-	compatible = "arrow,stm32mp15xx-avenger96",
-		     "dh,stm32mp15xx-dhcor-som",
-		     "st,stm32mp15x";
-};
arch/arm/dts/stm32mp15xx-dhcor-avenger96.dtsi deleted +0 -437

437 lines not on this page · raw message

arch/arm/dts/stm32mp15xx-dhcor-drc-compact.dts deleted +0 -18
deleted file mode 100644
index c1f99c1685e..00000000000
@@ -1,18 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
-/*
- * Copyright (C) 2022 Marek Vasut <[email protected]>
- */
-
-/dts-v1/;
-
-#include "stm32mp151.dtsi"
-#include "stm32mp15xc.dtsi"
-#include "stm32mp15xx-dhcor-som.dtsi"
-#include "stm32mp15xx-dhcor-drc-compact.dtsi"
-
-/ {
-	model = "DH electronics STM32MP15xx DHCOR DRC Compact";
-	compatible = "dh,stm32mp15xx-dhcor-drc-compact",
-		     "dh,stm32mp15xx-dhcor-som",
-		     "st,stm32mp1xx";
-};
arch/arm/dts/stm32mp15xx-dhcor-drc-compact.dtsi deleted +0 -326

326 lines not on this page · raw message

arch/arm/dts/stm32mp15xx-dhcor-io1v8.dtsi deleted +0 -28
deleted file mode 100644
index e20917824bf..00000000000
@@ -1,28 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
-/*
- * Copyright (C) Linaro Ltd 2019 - All Rights Reserved
- * Author: Manivannan Sadhasivam <[email protected]>
- * Copyright (C) 2020 Marek Vasut <[email protected]>
- */
-
-/ {
-	/* Enpirion EP3A8LQI U2 on the DHCOR */
-	vdd_io: regulator-buck-io {
-		compatible = "regulator-fixed";
-		regulator-name = "buck-io";
-		regulator-min-microvolt = <1800000>;
-		regulator-max-microvolt = <1800000>;
-		regulator-always-on;
-		regulator-boot-on;
-		vin-supply = <&vdd>;
-	};
-};
-
-&vdd {
-	regulator-min-microvolt = <1800000>;
-	regulator-max-microvolt = <2900000>;
-};
-
-&pwr_regulators {
-	vdd-supply = <&vdd_io>;
-};
arch/arm/dts/stm32mp15xx-dhcor-som.dtsi deleted +0 -221

221 lines not on this page · raw message

arch/arm/dts/stm32mp15xx-dhcor-testbench.dts deleted +0 -180

180 lines not on this page · raw message

board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its +9 -9
index 8eed9d0fb24..38ecb601190 100644
@@ -18,7 +18,7 @@
 
 		fdt-1 {
 			description = ".dtb";
-			data = /incbin/("arch/arm/dts/stm32mp15xx-dhcom-pdk2.dtb");
+			data = /incbin/("dts/upstream/src/arm/st/stm32mp157c-dhcom-pdk2.dtb");
 			type = "flat_dt";
 			arch = "arm";
 			compression = "none";
@@ -26,7 +26,7 @@
 
 		fdt-2 {
 			description = ".dtb";
-			data = /incbin/("arch/arm/dts/stm32mp15xx-dhcom-drc02.dtb");
+			data = /incbin/("dts/upstream/src/arm/st/stm32mp153c-dhcom-drc02.dtb");
 			type = "flat_dt";
 			arch = "arm";
 			compression = "none";
@@ -34,7 +34,7 @@
 
 		fdt-3 {
 			description = ".dtb";
-			data = /incbin/("arch/arm/dts/stm32mp15xx-dhcom-picoitx.dtb");
+			data = /incbin/("dts/upstream/src/arm/st/stm32mp157c-dhcom-picoitx.dtb");
 			type = "flat_dt";
 			arch = "arm";
 			compression = "none";
@@ -46,42 +46,42 @@
 
 		config-1 {
 			/* DT+SoM+board model */
-			description = "dh,stm32mp15xx-dhcom-pdk2_somrev0_boardrev0";
+			description = "dh,stm32mp157c-dhcom-pdk2_somrev0_boardrev0";
 			firmware = "uboot";
 			fdt = "fdt-1";
 		};
 
 		config-2 {
 			/* DT+SoM+board model */
-			description = "dh,stm32mp15xx-dhcom-pdk2_somrev1_boardrev0";
+			description = "dh,stm32mp157c-dhcom-pdk2_somrev1_boardrev0";
 			firmware = "uboot";
 			fdt = "fdt-1";
 		};
 
 		config-3 {
 			/* DT+SoM+board model */
-			description = "dh,stm32mp15xx-dhcom-drc02_somrev0_boardrev0";
+			description = "dh,stm32mp153c-dhcom-drc02_somrev0_boardrev0";
 			firmware = "uboot";
 			fdt = "fdt-2";
 		};
 
 		config-4 {
 			/* DT+SoM+board model */
-			description = "dh,stm32mp15xx-dhcom-drc02_somrev1_boardrev0";
+			description = "dh,stm32mp153c-dhcom-drc02_somrev1_boardrev0";
 			firmware = "uboot";
 			fdt = "fdt-2";
 		};
 
 		config-5 {
 			/* DT+SoM+board model */
-			description = "dh,stm32mp15xx-dhcom-picoitx_somrev0_boardrev0";
+			description = "dh,stm32mp157c-dhcom-picoitx_somrev0_boardrev0";
 			loadables = "uboot";
 			fdt = "fdt-3";
 		};
 
 		config-6 {
 			/* DT+SoM+board model */
-			description = "dh,stm32mp15xx-dhcom-picoitx_somrev1_boardrev0";
+			description = "dh,stm32mp157c-dhcom-picoitx_somrev1_boardrev0";
 			loadables = "uboot";
 			fdt = "fdt-3";
 		};
board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its +6 -6
index f9c1075616b..e17dac77804 100644
@@ -18,7 +18,7 @@
 
 		fdt-1 {
 			description = ".dtb";
-			data = /incbin/("arch/arm/dts/stm32mp15xx-dhcor-testbench.dtb");
+			data = /incbin/("dts/upstream/src/arm/st/stm32mp151a-dhcor-testbench.dtb");
 			type = "flat_dt";
 			arch = "arm";
 			compression = "none";
@@ -26,7 +26,7 @@
 
 		fdt-2 {
 			description = ".dtb";
-			data = /incbin/("arch/arm/dts/stm32mp15xx-dhcor-avenger96.dtb");
+			data = /incbin/("dts/upstream/src/arm/st/stm32mp157a-dhcor-avenger96.dtb");
 			type = "flat_dt";
 			arch = "arm";
 			compression = "none";
@@ -34,7 +34,7 @@
 
 		fdt-3 {
 			description = ".dtb";
-			data = /incbin/("arch/arm/dts/stm32mp15xx-dhcor-drc-compact.dtb");
+			data = /incbin/("dts/upstream/src/arm/st/stm32mp153c-dhcor-drc-compact.dtb");
 			type = "flat_dt";
 			arch = "arm";
 			compression = "none";
@@ -46,21 +46,21 @@
 
 		config-1 {
 			/* DT+SoM+board model */
-			description = "dh,stm32mp15xx-dhcor-testbench_somrev0_boardrev1";
+			description = "dh,stm32mp151a-dhcor-testbench_somrev0_boardrev1";
 			firmware = "uboot";
 			fdt = "fdt-1";
 		};
 
 		config-2 {
 			/* DT+SoM+board model */
-			description = "arrow,stm32mp15xx-avenger96_somrev0_boardrev1";
+			description = "arrow,stm32mp157a-avenger96_somrev0_boardrev1";
 			firmware = "uboot";
 			fdt = "fdt-2";
 		};
 
 		config-3 {
 			/* DT+SoM+board model */
-			description = "dh,stm32mp15xx-dhcor-drc-compact_somrev0_boardrev0";
+			description = "dh,stm32mp153c-dhcor-drc-compact_somrev0_boardrev0";
 			firmware = "uboot";
 			fdt = "fdt-3";
 		};
configs/stm32mp15_dhcom_basic_defconfig +3 -2
index c9095a9d2d8..e2a26e2b774 100644
@@ -7,7 +7,7 @@ CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_ENV_SIZE=0x4000
 CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_SPL_DM_SPI=y
-CONFIG_DEFAULT_DEVICE_TREE="stm32mp15xx-dhcom-pdk2"
+CONFIG_DEFAULT_DEVICE_TREE="st/stm32mp157c-dhcom-pdk2"
 CONFIG_SPL_TEXT_BASE=0x2FFC2500
 CONFIG_SPL_MMC=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
@@ -95,7 +95,8 @@ CONFIG_CMD_EXT4_WRITE=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_SPL_PARTITION_UUIDS is not set
 CONFIG_OF_LIVE=y
-CONFIG_OF_LIST="stm32mp15xx-dhcom-pdk2 stm32mp15xx-dhcom-drc02 stm32mp15xx-dhcom-picoitx"
+CONFIG_OF_UPSTREAM=y
+CONFIG_OF_LIST="st/stm32mp157c-dhcom-pdk2 st/stm32mp153c-dhcom-drc02 st/stm32mp157c-dhcom-picoitx"
 CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-names interrupts-extended interrupt-controller \\\#interrupt-cells interrupt-parent dmas dma-names assigned-clocks assigned-clock-rates assigned-clock-parents hwlocks"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
configs/stm32mp15_dhcor_basic_defconfig +3 -2
index fe4540278f4..f73bd2fa12c 100644
@@ -7,7 +7,7 @@ CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_ENV_SIZE=0x4000
 CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_SPL_DM_SPI=y
-CONFIG_DEFAULT_DEVICE_TREE="stm32mp15xx-dhcor-avenger96"
+CONFIG_DEFAULT_DEVICE_TREE="st/stm32mp157a-dhcor-avenger96"
 CONFIG_SPL_TEXT_BASE=0x2FFC2500
 CONFIG_SPL_MMC=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
@@ -93,7 +93,8 @@ CONFIG_CMD_EXT4_WRITE=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_SPL_PARTITION_UUIDS is not set
 CONFIG_OF_LIVE=y
-CONFIG_OF_LIST="stm32mp15xx-dhcor-avenger96 stm32mp15xx-dhcor-testbench stm32mp15xx-dhcor-drc-compact"
+CONFIG_OF_UPSTREAM=y
+CONFIG_OF_LIST="st/stm32mp157a-dhcor-avenger96 st/stm32mp151a-dhcor-testbench st/stm32mp153c-dhcor-drc-compact"
 CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-names interrupts-extended interrupt-controller \\\#interrupt-cells interrupt-parent dmas dma-names assigned-clocks assigned-clock-rates assigned-clock-parents hwlocks"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
Signature · 1 line
2.45.2
#2 lore raw

PATCH 3/3 ARM: dts: stm32: Generate u-boot.itb using binman on DH STM32 DHSOM

In reply to Marek Vasut

Describe the u-boot.its generation in stm32mp15xx-dhsom-u-boot.dtsi binman {} DT node as a replacement for current CONFIG_SPL_FIT_SOURCE use, dispose of both u-boot-dhcom.its and u-boot-dhcor.its.

Use fdt-SEQ/config-SEQ to generate a list of fdt-N fitImage images {} and matching configuration {} node entries. The configuration node entry names no longer encode _somrevN_boardrevN suffix, which was never really used, so drop this functionality by default. Rework board_fit_config_name_match() to match on the new configuration node entry names.

Users who do need the match on _somrevN_boardrevN can either replace the fdt-SEQ/config-SEQ with fixed fdt-N/config-N nodes which each encode the matching 'description = "NAME_somrevN_boardrevN"' to restore the old behavior verbatim, or better use SPL DT overlays for U-Boot control DT the same way e.g. i.MX8MP DHCOM does to support multiple SoM and board variants.

---
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: Sean Anderson <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi    |  1 +
 arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi    |  1 +
 arch/arm/dts/stm32mp15xx-dhsom-u-boot.dtsi    | 53 +++++++++++
 board/dhelectronics/dh_stm32mp1/board.c       | 19 +++-
 .../dh_stm32mp1/u-boot-dhcom.its              | 91 -------------------
 .../dh_stm32mp1/u-boot-dhcor.its              | 70 --------------
 configs/stm32mp15_dhcom_basic_defconfig       |  2 -
 configs/stm32mp15_dhcor_basic_defconfig       |  2 -
 8 files changed, 70 insertions(+), 169 deletions(-)
 create mode 100644 arch/arm/dts/stm32mp15xx-dhsom-u-boot.dtsi
 delete mode 100644 board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its
 delete mode 100644 board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its
arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi +1 -0
index d7b78cdcfa9..dd67e960a64 100644
@@ -8,6 +8,7 @@
 #include "stm32mp15-ddr3-dhsom-2x1Gb-1066-binG.dtsi"
 #include "stm32mp15-ddr3-dhsom-2x2Gb-1066-binG.dtsi"
 #include "stm32mp15-ddr3-dhsom-2x4Gb-1066-binG.dtsi"
+#include "stm32mp15xx-dhsom-u-boot.dtsi"
 
 / {
 	aliases {
arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi +1 -0
index ba84db679e1..08439342cb2 100644
@@ -12,6 +12,7 @@
 #include "stm32mp15-ddr3-dhsom-2x1Gb-1066-binG.dtsi"
 #include "stm32mp15-ddr3-dhsom-2x2Gb-1066-binG.dtsi"
 #include "stm32mp15-ddr3-dhsom-2x4Gb-1066-binG.dtsi"
+#include "stm32mp15xx-dhsom-u-boot.dtsi"
 
 / {
 	bootph-all;
arch/arm/dts/stm32mp15xx-dhsom-u-boot.dtsi new file +53 -0

53 lines not on this page · raw message

board/dhelectronics/dh_stm32mp1/board.c +15 -4
index 24c5f37c12f..3e4b22505ff 100644
@@ -276,15 +276,26 @@ int board_early_init_f(void)
 #ifdef CONFIG_SPL_LOAD_FIT
 int board_fit_config_name_match(const char *name)
 {
+	char *cdevice, *ndevice;
 	const char *compat;
-	char test[128];
 
 	compat = ofnode_get_property(ofnode_root(), "compatible", NULL);
+	if (!compat)
+		return -EINVAL;
+
+	cdevice = strchr(compat, ',');
+	if (!cdevice)
+		return -ENODEV;
+
+	cdevice++;	/* Move past the comma right after vendor prefix. */
+
+	ndevice = strchr(name, '/');
+	if (!ndevice)
+		return -ENODEV;
 
-	snprintf(test, sizeof(test), "%s_somrev%d_boardrev%d",
-		compat, somcode, brdcode);
+	ndevice++;	/* Move past the last slash in DT path */
 
-	if (!strcmp(name, test))
+	if (!strcmp(cdevice, ndevice))
 		return 0;
 
 	return -EINVAL;
board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its deleted +0 -91

91 lines not on this page · raw message

board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its deleted +0 -70

70 lines not on this page · raw message

configs/stm32mp15_dhcom_basic_defconfig +0 -2
index e2a26e2b774..bb2866a6782 100644
@@ -30,7 +30,6 @@ CONFIG_BOARD_SIZE_LIMIT=1441792
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0xc1000000
-CONFIG_SPL_FIT_SOURCE="board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its"
 CONFIG_SYS_BOOTM_LEN=0x2000000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTDELAY=1
@@ -59,7 +58,6 @@ CONFIG_SPL_RAM_SUPPORT=y
 CONFIG_SPL_RAM_DEVICE=y
 CONFIG_SPL_SPI_FLASH_MTD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000
-CONFIG_SPL_TARGET="u-boot.itb"
 CONFIG_SYS_PROMPT="STM32MP> "
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_EXPORTENV is not set
configs/stm32mp15_dhcor_basic_defconfig +0 -2
index f73bd2fa12c..8868d54c120 100644
@@ -28,7 +28,6 @@ CONFIG_BOARD_SIZE_LIMIT=1441792
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0xc1000000
-CONFIG_SPL_FIT_SOURCE="board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its"
 CONFIG_SYS_BOOTM_LEN=0x2000000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTDELAY=1
@@ -57,7 +56,6 @@ CONFIG_SPL_RAM_SUPPORT=y
 CONFIG_SPL_RAM_DEVICE=y
 CONFIG_SPL_SPI_FLASH_MTD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000
-CONFIG_SPL_TARGET="u-boot.itb"
 CONFIG_SYS_PROMPT="STM32MP> "
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_EXPORTENV is not set
Signature · 1 line
2.45.2
Reviewed-by on v1 3/3
#3 lore raw

Re: [PATCH 3/3] ARM: dts: stm32: Generate u-boot.itb using binman on DH STM32 DHSOM

Quoted 28 lines · Marek Vasut

Describe the u-boot.its generation in stm32mp15xx-dhsom-u-boot.dtsi binman {} DT node as a replacement for current CONFIG_SPL_FIT_SOURCE use, dispose of both u-boot-dhcom.its and u-boot-dhcor.its.

Use fdt-SEQ/config-SEQ to generate a list of fdt-N fitImage images {} and matching configuration {} node entries. The configuration node entry names no longer encode _somrevN_boardrevN suffix, which was never really used, so drop this functionality by default. Rework board_fit_config_name_match() to match on the new configuration node entry names.

Users who do need the match on _somrevN_boardrevN can either replace the fdt-SEQ/config-SEQ with fixed fdt-N/config-N nodes which each encode the matching 'description = "NAME_somrevN_boardrevN"' to restore the old behavior verbatim, or better use SPL DT overlays for U-Boot control DT the same way e.g. i.MX8MP DHCOM does to support multiple SoM and board variants.

---
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: Sean Anderson <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

Quoted 13 lines
---
 arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi    |  1 +
 arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi    |  1 +
 arch/arm/dts/stm32mp15xx-dhsom-u-boot.dtsi    | 53 +++++++++++
 board/dhelectronics/dh_stm32mp1/board.c       | 19 +++-
 .../dh_stm32mp1/u-boot-dhcom.its              | 91 -------------------
 .../dh_stm32mp1/u-boot-dhcor.its              | 70 --------------
 configs/stm32mp15_dhcom_basic_defconfig       |  2 -
 configs/stm32mp15_dhcor_basic_defconfig       |  2 -
 8 files changed, 70 insertions(+), 169 deletions(-)
 create mode 100644 arch/arm/dts/stm32mp15xx-dhsom-u-boot.dtsi
 delete mode 100644 board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its
 delete mode 100644 board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its

For the use of Binman:

Reviewed-by on v1 1/3
#4 lore raw
In reply to Marek Vasut

Hi,

Quoted 60 lines · Marek Vasut

The cpu0-opp-table {} node does not exist in upstream Linux stm32mp151.dtsi file, in order to enable conversion to OF_UPSTREAM, duplicate the node from current U-Boot stm32mp151.dtsi into stm32mp15-u-boot.dtsi. This makes STM32 DTs buildable even with OF_UPSTREAM enabled. No functional change, since the current U-Boot stm32mp151.dtsi already contains the cpu0-opp-table {} node, stm32mp15-u-boot.dtsi is applied at the end, and does not bring in any new content.

---
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: Sean Anderson <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
  arch/arm/dts/stm32mp15-u-boot.dtsi | 30 ++++++++++++++++++++++--------
  1 file changed, 22 insertions(+), 8 deletions(-)
arch/arm/dts/stm32mp15-u-boot.dtsi +18 -5
index fe56f05616a..66d4c40c6a8 100644
@@ -56,6 +56,24 @@
  			status = "okay";
  		};
  	};
+
+	cpu0_opp_table: cpu0-opp-table {
+		compatible = "operating-points-v2";
+		opp-shared;
+		bootph-pre-ram;
+		opp-650000000 {
+			bootph-pre-ram;
+			opp-hz = /bits/ 64 <650000000>;
+			opp-microvolt = <1200000>;
+			opp-supported-hw = <0x1>;
+		};
+		opp-800000000 {
+			bootph-pre-ram;
+			opp-hz = /bits/ 64 <800000000>;
+			opp-microvolt = <1350000>;
+			opp-supported-hw = <0x2>;
+		};
+	};
  };
 
  &bsec {
@@ -82,14 +100,10 @@
  	bootph-all;
  };
 
-&cpu0_opp_table {
-	bootph-pre-ram;
-	opp-650000000 {
-		bootph-pre-ram;
-	};

arch/arm/dts/stm32mp15-u-boot.dtsi line 109

Quoted 10 lines
arch/arm/dts/stm32mp15-u-boot.dtsi +4 -3
-	opp-800000000 {
-		bootph-pre-ram;
-	};
+&cpu0 {
+	nvmem-cells = <&part_number_otp>;
+	nvmem-cell-names = "part_number";
+	operating-points-v2 = <&cpu0_opp_table>;
  };
 
  &gpioa {

Thanks
Patrick