Skip to contentSkip to conversation

dt-bindings: net: dsa: ksz9477: add sample of switch bindings managed in i2c mode

PATCH In review Sergio Paracuellos 3 participants 7 messages Dec 17, 2018 – Dec 19, 2018

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

PATCH v3 2/2 dt-bindings: net: dsa: ksz9477: add sample of switch bindings managed in i2c mode

Add device-tree binding example of the ksz9477 switch managed in i2c mode.

---
Changes v3:
- No changes. Just resent patches together.

Changes v2:
- Use generic name for label of the switch and make sure reg and @X have the same value.

 .../devicetree/bindings/net/dsa/ksz.txt       | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
Documentation/devicetree/bindings/net/dsa/ksz.txt +50 -0
index 0f407fb371ce..d3c4b9d4f416 100644
@@ -74,3 +74,53 @@ Ethernet switch connected via SPI to the host, CPU port wired to eth0:
                                                              };
                                              };
                              };
+
+Ethernet switch connected via I2C to the host, CPU port wired to eth0:
+
+                             eth0: ethernet@10001000 {
+                                             fixed-link {
+                                                             speed = <1000>;
+                                                             full-duplex;
+                                             };
+                             };
+
+                             i2c0: i2c@f8008000 {
+                                             switch: ksz9897@5f {
+                                                             compatible = "microchip,ksz9897";
+                                                             reg = <5f>;
+
+                                                             ports {
+                                                                             #address-cells = <1>;
+                                                                             #size-cells = <0>;
+                                                                             port@0 {
+                                                                                             reg = <0>;
+                                                                                             label = "lan1";
+                                                                             };
+                                                                             port@1 {
+                                                                                             reg = <1>;
+                                                                                             label = "lan2";
+                                                                             };
+                                                                             port@2 {
+                                                                                             reg = <2>;
+                                                                                             label = "lan3";
+                                                                             };
+                                                                             port@3 {
+                                                                                             reg = <3>;
+                                                                                             label = "lan4";
+                                                                             };
+                                                                             port@4 {
+                                                                                             reg = <4>;
+                                                                                             label = "lan5";
+                                                                             };
+                                                                             port@6 {
+                                                                                             reg = <6>;
+                                                                                             label = "cpu";
+                                                                                             ethernet = <&eth0>;
+                                                                                             fixed-link {
+                                                                                                             speed = <1000>;
+                                                                                                             full-duplex;
+                                                                                             };
+                                                                             };
+                                                             };
+                                             };
+                             };
Signature · 1 line
2.19.1
#2 lore raw

Hi Florian,

Quoted 9 lines · Florian Fainelli
Quoted 4 lines · Sergio Paracuellos

Add device-tree binding example of the ksz9477 switch managed in i2c mode.

This looks good, although it looks like you have 2x the amount of tabs necessary.

Yes, I know but the original spi sample included in the same file was created with that indentation, so I only followed the same file style.

Quoted 2 lines

--
Florian

Best regards,
Sergio Paracuellos

maintainer
#3 lore raw
In reply to Sergio Paracuellos
Quoted 20 lines · Sergio Paracuellos

Add device-tree binding example of the ksz9477 switch managed in i2c mode.

---
Changes v3:
- No changes. Just resent patches together.

Changes v2:
- Use generic name for label of the switch and make sure reg and @X have the same value.

 .../devicetree/bindings/net/dsa/ksz.txt       | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
Documentation/devicetree/bindings/net/dsa/ksz.txt +0 -0
index 0f407fb371ce..d3c4b9d4f416 100644

Documentation/devicetree/bindings/net/dsa/ksz.txt Ethernet switch connected via SPI to the host, CPU port wired to eth0: · line 80

Quoted 7 lines
Documentation/devicetree/bindings/net/dsa/ksz.txt +4 -0
@@ -74,3 +74,53 @@ Ethernet switch connected via SPI to the host, CPU port wired to eth0:
                                                              };
                                              };
                              };
+
+Ethernet switch connected via I2C to the host, CPU port wired to eth0:
+
+                             eth0: ethernet@10001000 {

Why do we have all this indentation? Please remove. And use tab chars, not spaces.

Quoted 49 lines
Documentation/devicetree/bindings/net/dsa/ksz.txt +46 -0
+                                             fixed-link {
+                                                             speed = <1000>;
+                                                             full-duplex;
+                                             };
+                             };
+
+                             i2c0: i2c@f8008000 {
+                                             switch: ksz9897@5f {
+                                                             compatible = "microchip,ksz9897";
+                                                             reg = <5f>;
+
+                                                             ports {
+                                                                             #address-cells = <1>;
+                                                                             #size-cells = <0>;
+                                                                             port@0 {
+                                                                                             reg = <0>;
+                                                                                             label = "lan1";
+                                                                             };
+                                                                             port@1 {
+                                                                                             reg = <1>;
+                                                                                             label = "lan2";
+                                                                             };
+                                                                             port@2 {
+                                                                                             reg = <2>;
+                                                                                             label = "lan3";
+                                                                             };
+                                                                             port@3 {
+                                                                                             reg = <3>;
+                                                                                             label = "lan4";
+                                                                             };
+                                                                             port@4 {
+                                                                                             reg = <4>;
+                                                                                             label = "lan5";
+                                                                             };
+                                                                             port@6 {
+                                                                                             reg = <6>;
+                                                                                             label = "cpu";
+                                                                                             ethernet = <&eth0>;
+                                                                                             fixed-link {
+                                                                                                             speed = <1000>;
+                                                                                                             full-duplex;
+                                                                                             };
+                                                                             };
+                                                             };
+                                             };
+                             };
Signature · 1 line
2.19.1
#4 lore raw

Hi Rob,

Quoted 17 lines · Rob Herring
Quoted 15 lines · Sergio Paracuellos

Add device-tree binding example of the ksz9477 switch managed in i2c mode.

---
Changes v3:
- No changes. Just resent patches together.

Changes v2:
- Use generic name for label of the switch and make sure reg and @X have the same value.

 .../devicetree/bindings/net/dsa/ksz.txt       | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
Quoted 15 lines

Documentation/devicetree/bindings/net/dsa/ksz.txt Ethernet switch connected via SPI to the host, CPU port wired to eth0: · line 80

Quoted 12 lines
Documentation/devicetree/bindings/net/dsa/ksz.txt +4 -0
index 0f407fb371ce..d3c4b9d4f416 100644
@@ -74,3 +74,53 @@ Ethernet switch connected via SPI to the host, CPU port wired to eth0:
                                                              };
                                              };
                              };
+
+Ethernet switch connected via I2C to the host, CPU port wired to eth0:
+
+                             eth0: ethernet@10001000 {

Why do we have all this indentation? Please remove. And use tab chars, not spaces.

The original file format is using all of this indentation. So I think we would need a patch to change de format of the original file and another with this new changes properly formatted.

Quoted 42 lines
Quoted 42 lines
Documentation/devicetree/bindings/net/dsa/ksz.txt +41 -0
+                                             fixed-link {
+                                                             speed = <1000>;
+                                                             full-duplex;
+                                             };
+                             };
+
+                             i2c0: i2c@f8008000 {
+                                             switch: ksz9897@5f {
+                                                             compatible = "microchip,ksz9897";
+                                                             reg = <5f>;
+
+                                                             ports {
+                                                                             #address-cells = <1>;
+                                                                             #size-cells = <0>;
+                                                                             port@0 {
+                                                                                             reg = <0>;
+                                                                                             label = "lan1";
+                                                                             };
+                                                                             port@1 {
+                                                                                             reg = <1>;
+                                                                                             label = "lan2";
+                                                                             };
+                                                                             port@2 {
+                                                                                             reg = <2>;
+                                                                                             label = "lan3";
+                                                                             };
+                                                                             port@3 {
+                                                                                             reg = <3>;
+                                                                                             label = "lan4";
+                                                                             };
+                                                                             port@4 {
+                                                                                             reg = <4>;
+                                                                                             label = "lan5";
+                                                                             };
+                                                                             port@6 {
+                                                                                             reg = <6>;
+                                                                                             label = "cpu";
+                                                                                             ethernet = <&eth0>;
+                                                                                             fixed-link {
+                                                                                                             speed = <1000>;
+                                                                                                             full-duplex;
Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/net/dsa/ksz.txt +5 -1
+                                                                                             };
+                                                                             };
+                                                             };
+                                             };
+                             };
--

2.19.1

Best regards,
Sergio Paracuellos

#5 lore raw
Quoted 36 lines · Sergio Paracuellos

Hi Rob,

Quoted 17 lines · Rob Herring
Quoted 15 lines · Sergio Paracuellos

Add device-tree binding example of the ksz9477 switch managed in i2c mode.

---
Changes v3:
- No changes. Just resent patches together.

Changes v2:
- Use generic name for label of the switch and make sure reg and @X have the same value.

 .../devicetree/bindings/net/dsa/ksz.txt       | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
Quoted 15 lines

Documentation/devicetree/bindings/net/dsa/ksz.txt Ethernet switch connected via SPI to the host, CPU port wired to eth0: · line 80

Quoted 12 lines
Documentation/devicetree/bindings/net/dsa/ksz.txt +4 -0
index 0f407fb371ce..d3c4b9d4f416 100644
@@ -74,3 +74,53 @@ Ethernet switch connected via SPI to the host, CPU port wired to eth0:
                                                              };
                                              };
                              };
+
+Ethernet switch connected via I2C to the host, CPU port wired to eth0:
+
+                             eth0: ethernet@10001000 {

Why do we have all this indentation? Please remove. And use tab chars, not spaces.

Quoted 3 lines

The original file format is using all of this indentation. So I think we would need a patch to change de format of the original file and another with this new changes properly formatted.

The original formatting should be fixed, but your changes should adopt the correct style from the first time they are submitted. Do you mind resubmitting with only one tab? We can fix the original examples as a follow-up patch.

Thanks!

Signature · 1 line
Florian
#6 lore raw
Quoted 38 lines · Florian Fainelli
Quoted 36 lines · Sergio Paracuellos

Hi Rob,

Quoted 32 lines · Rob Herring
Quoted 20 lines · Sergio Paracuellos

Add device-tree binding example of the ksz9477 switch managed in i2c mode.

---
Changes v3:
- No changes. Just resent patches together.

Changes v2:
- Use generic name for label of the switch and make sure reg and @X have the same value.

 .../devicetree/bindings/net/dsa/ksz.txt       | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
Documentation/devicetree/bindings/net/dsa/ksz.txt +0 -0
index 0f407fb371ce..d3c4b9d4f416 100644

Documentation/devicetree/bindings/net/dsa/ksz.txt Ethernet switch connected via SPI to the host, CPU port wired to eth0: · line 80

Quoted 7 lines
Documentation/devicetree/bindings/net/dsa/ksz.txt +4 -0
@@ -74,3 +74,53 @@ Ethernet switch connected via SPI to the host, CPU port wired to eth0:
                                                              };
                                              };
                              };
+
+Ethernet switch connected via I2C to the host, CPU port wired to eth0:
+
+                             eth0: ethernet@10001000 {

Why do we have all this indentation? Please remove. And use tab chars, not spaces.

Quoted 8 lines
Quoted 3 lines

The original file format is using all of this indentation. So I think we would need a patch to change de format of the original file and another with this new changes properly formatted.

The original formatting should be fixed, but your changes should adopt the correct style from the first time they are submitted. Do you mind resubmitting with only one tab? We can fix the original examples as a follow-up patch.

I see. Thanks for let me know. I'll be more careful from now.

v4 actually sent with changes proposed here.

Quoted 4 lines

Thanks!
--
Florian

Best regards,
Sergio Paracuellos