Skip to contentSkip to conversation

devicetree: move nvmem-cells users to nvmem-layout

PATCH Superseded Rosen Penev 3 participants 9 messages Oct 4, 2024 – Oct 5, 2024

Subsystems (9)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover devicetree: move nvmem-cells users to nvmem-layout

The former has been soft deprecated by the latter. Move all users to the latter to avoid having nvmem-cells as an example.

v2: add missing semicolon to fix dt_binding_check

Rosen Penev (5):
ARM: dts: qcom: ipq4019: use nvmem-layout
arm64: dts: bcm4908: nvmem-layout conversion
arm64: dts: armada-3720-gl-mv1000: use nvmem-layout
arm64: dts: mediatek: 7886cax: use nvmem-layout
documentation: use nvmem-layout in examples

 .../mtd/partitions/qcom,smem-part.yaml        | 19 +++++++-----
 .../bindings/net/marvell,aquantia.yaml        | 13 ++++----
 .../boot/dts/qcom/qcom-ipq4018-ap120c-ac.dtsi | 19 +++++++-----
 .../bcmbca/bcm4906-netgear-r8000p.dts         | 14 +++++----
 .../dts/marvell/armada-3720-gl-mv1000.dts     | 30 +++++++++----------
 .../mediatek/mt7986a-acelink-ew-7886cax.dts   |  1 -
 6 files changed, 53 insertions(+), 43 deletions(-)
Signature · 1 line
2.46.2
#1 lore raw

PATCH v2 1/5 ARM: dts: qcom: ipq4019: use nvmem-layout

nvmem-layout is a more flexible replacement for nvmem-cells.

---
 .../boot/dts/qcom/qcom-ipq4018-ap120c-ac.dtsi | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
arch/arm/boot/dts/qcom/qcom-ipq4018-ap120c-ac.dtsi +11 -8
index 0d23c03fae33..a6d4390efa7c 100644
@@ -166,16 +166,19 @@ partition@170000 {
 				label = "ART";
 				reg = <0x00170000 0x00010000>;
 				read-only;
-				compatible = "nvmem-cells";
-				#address-cells = <1>;
-				#size-cells = <1>;
 
-				precal_art_1000: precal@1000 {
-					reg = <0x1000 0x2f20>;
-				};
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					precal_art_1000: precal@1000 {
+						reg = <0x1000 0x2f20>;
+					};
 
-				precal_art_5000: precal@5000 {
-					reg = <0x5000 0x2f20>;
+					precal_art_5000: precal@5000 {
+						reg = <0x5000 0x2f20>;
+					};
 				};
 			};
 
Signature · 1 line
2.46.2
#2 lore raw

PATCH v2 2/5 arm64: dts: bcm4908: nvmem-layout conversion

In reply to Rosen Penev

nvmem-layout is a more flexible replacement for nvmem-cells.

---
 .../dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts +8 -6
index 999d93730240..df47fc75fa3a 100644
@@ -144,16 +144,18 @@ partitions {
 		#size-cells = <1>;
 
 		partition@0 {
-			compatible = "nvmem-cells";
 			label = "cferom";
 			reg = <0x0 0x100000>;
-
-			#address-cells = <1>;
-			#size-cells = <1>;
 			ranges = <0 0x0 0x100000>;
 
-			base_mac_addr: mac@106a0 {
-				reg = <0x106a0 0x6>;
+			nvmem-layout {
+				compatible = "fixed-layout";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				base_mac_addr: mac@106a0 {
+					reg = <0x106a0 0x6>;
+				};
 			};
 		};
 
Signature · 1 line
2.46.2
#3 lore raw

PATCH v2 3/5 arm64: dts: armada-3720-gl-mv1000: use nvmem-layout

In reply to Rosen Penev

nvmem-layout is a more flexible replacement for nvmem-cells.

---
 .../dts/marvell/armada-3720-gl-mv1000.dts     | 30 +++++++++----------
 1 file changed, 15 insertions(+), 15 deletions(-)
arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts +15 -15
index 56930f2ce481..7b801b60862d 100644
@@ -98,10 +98,24 @@ partition@f0000 {
 				reg = <0xf0000 0x8000>;
 			};
 
-			factory: partition@f8000 {
+			partition@f8000 {
 				label = "factory";
 				reg = <0xf8000 0x8000>;
 				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					macaddr_factory_0: macaddr@0 {
+						reg = <0x0 0x6>;
+					};
+
+					macaddr_factory_6: macaddr@6 {
+						reg = <0x6 0x6>;
+					};
+				};
 			};
 
 			partition@100000 {
@@ -221,17 +235,3 @@ fixed-link {
 		full-duplex;
 	};
 };
-
-&factory {
-	compatible = "nvmem-cells";
-	#address-cells = <1>;
-	#size-cells = <1>;
-
-	macaddr_factory_0: macaddr@0 {
-		reg = <0x0 0x6>;
-	};
-
-	macaddr_factory_6: macaddr@6 {
-		reg = <0x6 0x6>;
-	};
-};
Signature · 1 line
2.46.2
#4 lore raw

PATCH v2 4/5 arm64: dts: mediatek: 7886cax: use nvmem-layout

In reply to Rosen Penev

nvmem-layout is a more flexible replacement for nvmem-cells.

---
 arch/arm64/boot/dts/mediatek/mt7986a-acelink-ew-7886cax.dts | 1 -
 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7986a-acelink-ew-7886cax.dts +0 -1
index 08b3b0827436..9a6625d8660f 100644
@@ -121,7 +121,6 @@ partition@100000 {
 			};
 
 			partition@180000 {
-				compatible = "nvmem-cells";
 				reg = <0x180000 0x200000>;
 				label = "factory";
 				read-only;
Signature · 1 line
2.46.2
#5 lore raw

PATCH v2 5/5 documentation: use nvmem-layout in examples

In reply to Rosen Penev

nvmem-cells are deprecated and replaced with nvmem-layout. For these examples, replace. They're not relevant to the main point of the document anyway.

---
 .../mtd/partitions/qcom,smem-part.yaml        | 19 +++++++++++--------
 .../bindings/net/marvell,aquantia.yaml        | 13 ++++++++-----
 2 files changed, 19 insertions(+), 13 deletions(-)
Documentation/devicetree/bindings/mtd/partitions/qcom,smem-part.yaml +11 -8
index 1c2b4e780ca9..8ae149534b23 100644
@@ -45,17 +45,20 @@ examples:
             compatible = "qcom,smem-part";
 
             partition-art {
-                compatible = "nvmem-cells";
-                #address-cells = <1>;
-                #size-cells = <1>;
                 label = "0:art";
 
-                macaddr_art_0: macaddr@0 {
-                    reg = <0x0 0x6>;
-                };
+                nvmem-layout {
+                    compatible = "fixed-layout";
+                    #address-cells = <1>;
+                    #size-cells = <1>;
+
+                    macaddr_art_0: macaddr@0 {
+                        reg = <0x0 0x6>;
+                    };
 
-                macaddr_art_6: macaddr@6 {
-                    reg = <0x6 0x6>;
+                    macaddr_art_6: macaddr@6 {
+                        reg = <0x6 0x6>;
+                    };
                 };
             };
         };
Documentation/devicetree/bindings/net/marvell,aquantia.yaml +8 -5
index 9854fab4c4db..5d118553228b 100644
@@ -98,15 +98,18 @@ examples:
             /* ... */
 
             partition@650000 {
-                compatible = "nvmem-cells";
                 label = "0:ethphyfw";
                 reg = <0x650000 0x80000>;
                 read-only;
-                #address-cells = <1>;
-                #size-cells = <1>;
 
-                aqr_fw: aqr_fw@0 {
-                    reg = <0x0 0x5f42a>;
+                nvmem-layout {
+                    compatible = "fixed-layout";
+                    #address-cells = <1>;
+                    #size-cells = <1>;
+
+                    aqr_fw: aqr_fw@0 {
+                        reg = <0x0 0x5f42a>;
+                    };
                 };
             };
 
Signature · 1 line
2.46.2
#6 lore raw

Re: [PATCHv2 5/5] documentation: use nvmem-layout in examples

Quoted 3 lines · Rosen Penev

nvmem-cells are deprecated and replaced with nvmem-layout. For these examples, replace. They're not relevant to the main point of the document anyway.

Please use subject prefixes matching the subsystem. You can get them for example with git log --oneline -- DIRECTORY_OR_FILE on the directory your patch is touching. For bindings, the preferred subjects are explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters

Quoted 15 lines
---
 .../mtd/partitions/qcom,smem-part.yaml        | 19 +++++++++++--------
 .../bindings/net/marvell,aquantia.yaml        | 13 ++++++++-----
 2 files changed, 19 insertions(+), 13 deletions(-)
Documentation/devicetree/bindings/mtd/partitions/qcom,smem-part.yaml +0 -0
index 1c2b4e780ca9..8ae149534b23 100644
@@ -45,17 +45,20 @@ examples:
             compatible = "qcom,smem-part";
 
             partition-art {

Documentation/devicetree/bindings/mtd/partitions/qcom,smem-part.yaml examples: · line 51

Quoted 10 lines
Documentation/devicetree/bindings/mtd/partitions/qcom,smem-part.yaml +2 -6
-                compatible = "nvmem-cells";
-                #address-cells = <1>;
-                #size-cells = <1>;
                 label = "0:art";
 
-                macaddr_art_0: macaddr@0 {
-                    reg = <0x0 0x6>;
-                };
+                nvmem-layout {
+                    compatible = "fixed-layout";

This does not look right - the binding still expects nvmem-cells. I wonder how does the nvmem-cells.yaml work if the compatible is being removed so it is not being selected.

Best regards,
Krzysztof

#7 lore raw

Re: [PATCHv2 5/5] documentation: use nvmem-layout in examples

Quoted 33 lines · Krzysztof Kozlowski
Quoted 3 lines · Rosen Penev

nvmem-cells are deprecated and replaced with nvmem-layout. For these examples, replace. They're not relevant to the main point of the document anyway.

Please use subject prefixes matching the subsystem. You can get them for example with git log --oneline -- DIRECTORY_OR_FILE on the directory your patch is touching. For bindings, the preferred subjects are explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters

Quoted 20 lines
---
 .../mtd/partitions/qcom,smem-part.yaml        | 19 +++++++++++--------
 .../bindings/net/marvell,aquantia.yaml        | 13 ++++++++-----
 2 files changed, 19 insertions(+), 13 deletions(-)
Documentation/devicetree/bindings/mtd/partitions/qcom,smem-part.yaml +0 -3
index 1c2b4e780ca9..8ae149534b23 100644
@@ -45,17 +45,20 @@ examples:
             compatible = "qcom,smem-part";
 
             partition-art {
-                compatible = "nvmem-cells";
-                #address-cells = <1>;
-                #size-cells = <1>;
                 label = "0:art";
 
Quoted 9 lines

Documentation/devicetree/bindings/mtd/partitions/qcom,smem-part.yaml examples: · line 51

Quoted 5 lines
Documentation/devicetree/bindings/mtd/partitions/qcom,smem-part.yaml +2 -3
-                macaddr_art_0: macaddr@0 {
-                    reg = <0x0 0x6>;
-                };
+                nvmem-layout {
+                    compatible = "fixed-layout";

This does not look right - the binding still expects nvmem-cells. I wonder how does the nvmem-cells.yaml work if the compatible is being removed so it is not being selected.

Not sure I follow here. You mean replace nvmem-cells.yaml with nvmem-layout.yaml ?

Quoted 5 lines

Best regards,
Krzysztof

#8 lore raw
In reply to Rosen Penev
Quoted 20 lines · Rosen Penev

The former has been soft deprecated by the latter. Move all users to the latter to avoid having nvmem-cells as an example.

v2: add missing semicolon to fix dt_binding_check

Rosen Penev (5):
ARM: dts: qcom: ipq4019: use nvmem-layout
arm64: dts: bcm4908: nvmem-layout conversion
arm64: dts: armada-3720-gl-mv1000: use nvmem-layout
arm64: dts: mediatek: 7886cax: use nvmem-layout
documentation: use nvmem-layout in examples

 .../mtd/partitions/qcom,smem-part.yaml        | 19 +++++++-----
 .../bindings/net/marvell,aquantia.yaml        | 13 ++++----
 .../boot/dts/qcom/qcom-ipq4018-ap120c-ac.dtsi | 19 +++++++-----
 .../bcmbca/bcm4906-netgear-r8000p.dts         | 14 +++++----
 .../dts/marvell/armada-3720-gl-mv1000.dts     | 30 +++++++++----------
 .../mediatek/mt7986a-acelink-ew-7886cax.dts   |  1 -
 6 files changed, 53 insertions(+), 43 deletions(-)
Quoted 5 lines

--
2.46.2

My bot found new DTB warnings on the .dts files added or changed in this series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date:

  pip3 install dtschema --upgrade

New warnings running 'make CHECK_DTBS=y broadcom/bcmbca/bcm4906-netgear-r8000p.dtb marvell/armada-3720-gl-mv1000.dtb mediatek/mt7986a-acelink-ew-7886cax.dtb' for [email protected]:

arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts:149.4-30: Warning (ranges_format): /bus@ff800000/nand-controller@1800/nand@0/partitions/partition@0:ranges: "ranges" property has invalid length (12 bytes) (parent #address-cells == 1, child #address-cells == 2, #size-cells == 1)