Skip to contentSkip to conversation

devicetree: move nvmem-cells users to nvmem-layout

PATCH In review Rosen Penev 2 participants 7 messages Oct 9, 2024 – Oct 10, 2024

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

v3 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.

v3: add back address/size cells to fix warnings on r8000p.
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        | 21 +++++++------
 .../bindings/net/marvell,aquantia.yaml        | 13 ++++----
 .../boot/dts/qcom/qcom-ipq4018-ap120c-ac.dtsi | 19 +++++++-----
 .../bcmbca/bcm4906-netgear-r8000p.dts         | 12 +++++---
 .../dts/marvell/armada-3720-gl-mv1000.dts     | 30 +++++++++----------
 .../mediatek/mt7986a-acelink-ew-7886cax.dts   |  1 -
 6 files changed, 54 insertions(+), 42 deletions(-)
Signature · 1 line
2.46.2
#1 lore raw

PATCH v3 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 v3 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   | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts +8 -4
index 999d93730240..a5f9ec92bd5e 100644
@@ -144,16 +144,20 @@ 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 v3 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 v3 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 v3 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        | 21 +++++++++++--------
 .../bindings/net/marvell,aquantia.yaml        | 13 +++++++-----
 2 files changed, 20 insertions(+), 14 deletions(-)
Documentation/devicetree/bindings/mtd/partitions/qcom,smem-part.yaml +12 -9
index 1c2b4e780ca9..c2cc11286d80 100644
@@ -23,7 +23,7 @@ properties:
 
 patternProperties:
   "^partition-[0-9a-z]+$":
-    $ref: nvmem-cells.yaml
+    $ref: nvmem-layout.yaml
 
 required:
   - compatible
@@ -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: [PATCHv3 5/5] documentation: use nvmem-layout in examples

Quoted 6 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

You already got this comment, is something unclear?

Quoted 9 lines
 .../mtd/partitions/qcom,smem-part.yaml        | 21 +++++++++++--------
 .../bindings/net/marvell,aquantia.yaml        | 13 +++++++-----
 2 files changed, 20 insertions(+), 14 deletions(-)
Documentation/devicetree/bindings/mtd/partitions/qcom,smem-part.yaml +0 -0
index 1c2b4e780ca9..c2cc11286d80 100644

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

Quoted 5 lines
Documentation/devicetree/bindings/mtd/partitions/qcom,smem-part.yaml +1 -1
@@ -23,7 +23,7 @@ properties:
 
 patternProperties:
   "^partition-[0-9a-z]+$":
-    $ref: nvmem-cells.yaml
+    $ref: nvmem-layout.yaml

There is no such file here, so this should be full path /schemas/nvmem/....

but is this a nvmem? Looks like MTD and NAND. Previously this was a partition, now it is not. I don't understand what you are trying to achieve here.

Best regards,
Krzysztof