Skip to contentSkip to conversation

powerpc: dtc: update P2020RDB dts

PATCH In review Pawel Dembicki 2 participants 3 messages Aug 1, 2024

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

PATCH 1/1 powerpc: dtc: update P2020RDB dts

P2020RDB contains multiple peripherals, which isn't added to devicetree:
- Switch: Microchip VSC7385
- PMIC: Renesas ZL2006
- Temperature sensor: Analog Devices ADT7461
- Two eeproms: 24C256 and 24C01
- GPIO expander: NXP PCA9557
- reset gpios of Ethernet PHYs

This commit adds it.

Some refreshments was done:
- fixed link in ethernet-node
- platform drivers nodes names
- added 'gpio0' label in pq3-gpio-0.dtsi

---
 arch/powerpc/boot/dts/fsl/p2020rdb.dts    | 85 +++++++++++++++++++++--
 arch/powerpc/boot/dts/fsl/pq3-gpio-0.dtsi |  2 +-
 2 files changed, 81 insertions(+), 6 deletions(-)
arch/powerpc/boot/dts/fsl/p2020rdb.dts +80 -5
index 3acd3890b397..d563d37b91f1 100644
@@ -6,6 +6,7 @@
  */
 
 /include/ "p2020si-pre.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
 	model = "fsl,P2020RDB";
@@ -33,7 +34,7 @@ lbc: localbus@ffe05000 {
 			  0x1 0x0 0x0 0xffa00000 0x00040000
 			  0x2 0x0 0x0 0xffb00000 0x00020000>;
 
-		nor@0,0 {
+		nor@0 {
 			#address-cells = <1>;
 			#size-cells = <1>;
 			compatible = "cfi-flash";
@@ -79,7 +80,7 @@ partition@f00000 {
 			};
 		};
 
-		nand@1,0 {
+		nand@1 {
 			#address-cells = <1>;
 			#size-cells = <1>;
 			compatible = "fsl,p2020-fcm-nand",
@@ -128,11 +129,49 @@ partition@1100000 {
 			};
 		};
 
-		L2switch@2,0 {
+		ethernet-switch@2 {
 			#address-cells = <1>;
 			#size-cells = <1>;
-			compatible = "vitesse-7385";
+			compatible = "vitesse,vsc7385";
 			reg = <0x2 0x0 0x20000>;
+			reset-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@1 {
+					reg = <1>;
+					label = "lan1";
+				};
+				port@2 {
+					reg = <2>;
+					label = "lan2";
+				};
+				port@3 {
+					reg = <3>;
+					label = "lan3";
+				};
+				port@4 {
+					reg = <4>;
+					label = "lan4";
+				};
+				vsc: port@6 {
+					reg = <6>;
+					label = "cpu";
+					ethernet = <&enet0>;
+					phy-mode = "rgmii";
+					rx-internal-delay-ps = <1400>;
+					tx-internal-delay-ps = <2000>;
+
+					fixed-link {
+						speed = <1000>;
+						full-duplex;
+						pause;
+					};
+				};
+			};
+
 		};
 
 	};
@@ -141,12 +180,39 @@ soc: soc@ffe00000 {
 		ranges = <0x0 0x0 0xffe00000 0x100000>;
 
 		i2c@3000 {
+			temperature-sensor@4c {
+				compatible = "adi,adt7461";
+				reg = <0x4c>;
+			};
+
+			eeprom@50 {
+				compatible = "atmel,24c256";
+				reg = <0x50>;
+			};
+
 			rtc@68 {
 				compatible = "dallas,ds1339";
 				reg = <0x68>;
 			};
 		};
 
+		i2c@3100 {
+			pmic@11 {
+				compatible = "zl2006";
+				reg = <0x11>;
+			};
+
+			gpio@18 {
+				compatible = "nxp,pca9557";
+				reg = <0x18>;
+			};
+
+			eeprom@52 {
+				compatible = "atmel,24c01";
+				reg = <0x52>;
+			};
+		};
+
 		spi@7000 {
 			flash@0 {
 				#address-cells = <1>;
@@ -200,11 +266,15 @@ mdio@24520 {
 			phy0: ethernet-phy@0 {
 				interrupts = <3 1 0 0>;
 				reg = <0x0>;
+				reset-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
 			};
+
 			phy1: ethernet-phy@1 {
 				interrupts = <3 1 0 0>;
 				reg = <0x1>;
+				reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 			};
+
 			tbi-phy@2 {
 				device_type = "tbi-phy";
 				reg = <0x2>;
@@ -232,8 +302,13 @@ ptp_clock@24e00 {
 		};
 
 		enet0: ethernet@24000 {
-			fixed-link = <1 1 1000 0 0>;
 			phy-connection-type = "rgmii-id";
+
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+				pause;
+			};
 		};
 
 		enet1: ethernet@25000 {
arch/powerpc/boot/dts/fsl/pq3-gpio-0.dtsi +1 -1
index a1b48546b02d..5181117ea6b5 100644
@@ -32,7 +32,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-gpio-controller@fc00 {
+gpio0: gpio-controller@fc00 {
 	#gpio-cells = <2>;
 	compatible = "fsl,pq3-gpio";
 	reg = <0xfc00 0x100>;
Signature · 1 line
2.34.1
#1 lore raw
Quoted 16 lines · Pawel Dembicki

P2020RDB contains multiple peripherals, which isn't added to devicetree:
- Switch: Microchip VSC7385
- PMIC: Renesas ZL2006
- Temperature sensor: Analog Devices ADT7461
- Two eeproms: 24C256 and 24C01
- GPIO expander: NXP PCA9557
- reset gpios of Ethernet PHYs

This commit adds it.

Some refreshments was done:
- fixed link in ethernet-node
- platform drivers nodes names
- added 'gpio0' label in pq3-gpio-0.dtsi

Quoted 6 lines
---
 arch/powerpc/boot/dts/fsl/p2020rdb.dts    | 85 +++++++++++++++++++++--
 arch/powerpc/boot/dts/fsl/pq3-gpio-0.dtsi |  2 +-
 2 files changed, 81 insertions(+), 6 deletions(-)

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 fsl/p2020rdb.dtb' for [email protected]:

arch/powerpc/boot/dts/fsl/p2020rdb.dts:326.22-329.4: Warning (pci_bridge): /pcie@ffe08000: missing ranges for PCI bridge (or not a bridge) arch/powerpc/boot/dts/fsl/p2020rdb.dtb: nor@0: $nodename:0: 'nor@0' does not match '^(flash|.*sram|nand)(@.*)?$'
from schema $id: http://devicetree.org/schemas/mtd/mtd-physmap.yaml#
arch/powerpc/boot/dts/fsl/p2020rdb.dtb: /localbus@ffe05000/nand@1: failed to match any schema with compatible: ['fsl,p2020-fcm-nand', 'fsl,elbc-fcm-nand'] arch/powerpc/boot/dts/fsl/p2020rdb.dtb: /localbus@ffe05000/nand@1: failed to match any schema with compatible: ['fsl,p2020-fcm-nand', 'fsl,elbc-fcm-nand'] arch/powerpc/boot/dts/fsl/p2020rdb.dtb: ethernet-switch@2: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected)
from schema $id: http://devicetree.org/schemas/net/dsa/vitesse,vsc73xx.yaml#
arch/powerpc/boot/dts/fsl/p2020rdb.dtb: /soc@ffe00000/i2c@3100/pmic@11: failed to match any schema with compatible: ['zl2006'] arch/powerpc/boot/dts/fsl/p2020rdb.dtb: gpio@18: 'gpio-controller' is a required property
from schema $id: http://devicetree.org/schemas/gpio/gpio-pca95xx.yaml#
arch/powerpc/boot/dts/fsl/p2020rdb.dtb: gpio@18: '#gpio-cells' is a required property
from schema $id: http://devicetree.org/schemas/gpio/gpio-pca95xx.yaml#

maintainer
#2 lore raw
In reply to Pawel Dembicki
Quoted 1 line · Pawel Dembicki

On the subject, every patch is an 'update'. Please make it more specific. If you have a hard time coming up with something specific, that's a sign your patch is making too many separate changes.

Quoted 35 lines

P2020RDB contains multiple peripherals, which isn't added to devicetree:
- Switch: Microchip VSC7385
- PMIC: Renesas ZL2006
- Temperature sensor: Analog Devices ADT7461
- Two eeproms: 24C256 and 24C01
- GPIO expander: NXP PCA9557
- reset gpios of Ethernet PHYs

This commit adds it.

Some refreshments was done:
- fixed link in ethernet-node
- platform drivers nodes names
- added 'gpio0' label in pq3-gpio-0.dtsi

---
 arch/powerpc/boot/dts/fsl/p2020rdb.dts    | 85 +++++++++++++++++++++--
 arch/powerpc/boot/dts/fsl/pq3-gpio-0.dtsi |  2 +-
 2 files changed, 81 insertions(+), 6 deletions(-)
arch/powerpc/boot/dts/fsl/p2020rdb.dts +1 -0
index 3acd3890b397..d563d37b91f1 100644
@@ -6,6 +6,7 @@
  */
 
 /include/ "p2020si-pre.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        model = "fsl,P2020RDB";

arch/powerpc/boot/dts/fsl/p2020rdb.dts lbc: localbus@ffe05000 { · line 37

Quoted 5 lines
arch/powerpc/boot/dts/fsl/p2020rdb.dts +1 -1
@@ -33,7 +34,7 @@ lbc: localbus@ffe05000 {
                          0x1 0x0 0x0 0xffa00000 0x00040000
                          0x2 0x0 0x0 0xffb00000 0x00020000>;
 
-               nor@0,0 {
+               nor@0 {

Make these clean-ups a separate patch.

Quoted 13 lines
arch/powerpc/boot/dts/fsl/p2020rdb.dts +1 -1
                        #address-cells = <1>;
                        #size-cells = <1>;
                        compatible = "cfi-flash";
@@ -79,7 +80,7 @@ partition@f00000 {
                        };
                };
 
-               nand@1,0 {
+               nand@1 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        compatible = "fsl,p2020-fcm-nand",

arch/powerpc/boot/dts/fsl/p2020rdb.dts partition@1100000 { · line 135

Quoted 9 lines
arch/powerpc/boot/dts/fsl/p2020rdb.dts +2 -2
@@ -128,11 +129,49 @@ partition@1100000 {
                        };
                };
 
-               L2switch@2,0 {
+               ethernet-switch@2 {
                        #address-cells = <1>;
                        #size-cells = <1>;
-                       compatible = "vitesse-7385";
+                       compatible = "vitesse,vsc7385";

There are 7 occurrences of this. Please fix them all. (And again, separate patch).

Quoted 55 lines
arch/powerpc/boot/dts/fsl/p2020rdb.dts +47 -0
                        reg = <0x2 0x0 0x20000>;
+                       reset-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@1 {
+                                       reg = <1>;
+                                       label = "lan1";
+                               };
+                               port@2 {
+                                       reg = <2>;
+                                       label = "lan2";
+                               };
+                               port@3 {
+                                       reg = <3>;
+                                       label = "lan3";
+                               };
+                               port@4 {
+                                       reg = <4>;
+                                       label = "lan4";
+                               };
+                               vsc: port@6 {
+                                       reg = <6>;
+                                       label = "cpu";
+                                       ethernet = <&enet0>;
+                                       phy-mode = "rgmii";
+                                       rx-internal-delay-ps = <1400>;
+                                       tx-internal-delay-ps = <2000>;
+
+                                       fixed-link {
+                                               speed = <1000>;
+                                               full-duplex;
+                                               pause;
+                                       };
+                               };
+                       };
+
                };
 
        };
@@ -141,12 +180,39 @@ soc: soc@ffe00000 {
                ranges = <0x0 0x0 0xffe00000 0x100000>;
 
                i2c@3000 {
+                       temperature-sensor@4c {
+                               compatible = "adi,adt7461";
+                               reg = <0x4c>;
+                       };
+
+                       eeprom@50 {
+                               compatible = "atmel,24c256";
+                               reg = <0x50>;
+                       };

arch/powerpc/boot/dts/fsl/p2020rdb.dts soc: soc@ffe00000 { · line 201

Quoted 10 lines
arch/powerpc/boot/dts/fsl/p2020rdb.dts +4 -0
+
                        rtc@68 {
                                compatible = "dallas,ds1339";
                                reg = <0x68>;
                        };
                };
 
+               i2c@3100 {
+                       pmic@11 {
+                               compatible = "zl2006";

Missing vendor prefix.

Quoted 64 lines
arch/powerpc/boot/dts/fsl/p2020rdb.dts +24 -1
+                               reg = <0x11>;
+                       };
+
+                       gpio@18 {
+                               compatible = "nxp,pca9557";
+                               reg = <0x18>;
+                       };
+
+                       eeprom@52 {
+                               compatible = "atmel,24c01";
+                               reg = <0x52>;
+                       };
+               };
+
                spi@7000 {
                        flash@0 {
                                #address-cells = <1>;
@@ -200,11 +266,15 @@ mdio@24520 {
                        phy0: ethernet-phy@0 {
                                interrupts = <3 1 0 0>;
                                reg = <0x0>;
+                               reset-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
                        };
+
                        phy1: ethernet-phy@1 {
                                interrupts = <3 1 0 0>;
                                reg = <0x1>;
+                               reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
                        };
+
                        tbi-phy@2 {
                                device_type = "tbi-phy";
                                reg = <0x2>;
@@ -232,8 +302,13 @@ ptp_clock@24e00 {
                };
 
                enet0: ethernet@24000 {
-                       fixed-link = <1 1 1000 0 0>;
                        phy-connection-type = "rgmii-id";
+
+                       fixed-link {
+                               speed = <1000>;
+                               full-duplex;
+                               pause;
+                       };
                };
 
                enet1: ethernet@25000 {
arch/powerpc/boot/dts/fsl/pq3-gpio-0.dtsi +1 -2
index a1b48546b02d..5181117ea6b5 100644
@@ -32,7 +32,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-gpio-controller@fc00 {
+gpio0: gpio-controller@fc00 {
        #gpio-cells = <2>;
        compatible = "fsl,pq3-gpio";
        reg = <0xfc00 0x100>;
--

2.34.1