ramips: mt76x8: fix bogus mediatek,portmap
authorSungbo Eo <mans0n@gorani.run>
Wed, 1 Jan 2020 12:34:10 +0000 (21:34 +0900)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Tue, 21 Jan 2020 12:54:18 +0000 (13:54 +0100)
mt76x8 uses esw_rt3050 driver, which does not accept mediatek,portmap with
string values. Convert the strings to integers to make it work.

According to its switch setup, WRTnode 2P/2R have a WAN port at port 0,
so the correct value should be 0x3e.

tplink_8m.dtsi uses "llllw", but it does not match switch setups of any
device using the DTSI. Remove it from the DTSI and add correct value to DTS
for each device.

These devices have a WAN port at port 0. Set the value to 0x3e.
- tplink,archer-c20-v4
- tplink,archer-c50-v3
- tplink,tl-mr3420-v5
- tplink,tl-wr840n-v4
- tplink,tl-wr841n-v13
- tplink,tl-wr842n-v5

These devices have only one ethernet port. They don't need portmap setting.
- tplink,tl-wa801nd-v5
- tplink,tl-wr802n-v4
- tplink,tl-wr902ac-v3

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(backported from commit 7a387bf9a0d73f7c581e2c9aeae6476588100e2c)
[removed TL-WR841N v14 which is not present in 19.07]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
17 files changed:
target/linux/ramips/dts/ArcherC20v4.dts
target/linux/ramips/dts/ArcherC50V3.dts
target/linux/ramips/dts/MAC1200RV2.dts
target/linux/ramips/dts/TL-MR3420V5.dts
target/linux/ramips/dts/TL-WR802NV4.dts
target/linux/ramips/dts/TL-WR840NV4.dts
target/linux/ramips/dts/TL-WR840NV5.dts
target/linux/ramips/dts/TL-WR841NV13.dts
target/linux/ramips/dts/TL-WR842NV5.dts
target/linux/ramips/dts/TPLINK-8M-SPLIT-UBOOT.dtsi
target/linux/ramips/dts/TPLINK-8M.dtsi
target/linux/ramips/dts/WL-WN570HA1.dts
target/linux/ramips/dts/WL-WN575A3.dts
target/linux/ramips/dts/WR1000.dts
target/linux/ramips/dts/WRTNODE2.dtsi
target/linux/ramips/dts/ZBT-WE1226.dts
target/linux/ramips/dts/ki_rb.dts

index 1103573641955cb0cacef0cc6e671d23824c6e64..b2a1591df98d5633849f574326101ca38df5150b 100644 (file)
@@ -79,8 +79,8 @@
        mtd-mac-address-increment = <(-2)>;
 };
 
-&ethernet {
-       mediatek,portmap = "wllll";
+&esw {
+       mediatek,portmap = <0x3e>;
 };
 
 &pinctrl {
index cc4e72819f9a2bf5055174b7f8bcd7091f82281b..0aa03b814b48f5ff44fbbfcc2a933f067e65eaa7 100644 (file)
        };
 };
 
+&esw {
+       mediatek,portmap = <0x3e>;
+};
+
 &pcie {
        status = "okay";
 };
index 7d13621135c79386dc5cb68020bc126d47479c0a..190dcf1b0da907d11028e3fd3deac20e6704df8f 100644 (file)
 &ethernet {
        pinctrl-names = "default";
        mtd-mac-address = <&factory 0xd>;
-       mediatek,portmap = "llllw";
+};
+
+&esw {
+       mediatek,portmap = <0x2f>;
 };
 
 &wmac {
index a528152d38aa859ac5a9a49e80092c660f1517ca..dc3f980ae663ea63a5c7935acb4684d8186a9073 100644 (file)
@@ -91,3 +91,7 @@
                };
        };
 };
+
+&esw {
+       mediatek,portmap = <0x3e>;
+};
index 668da700c3040a11c033233dba9e2c4463cf879e..c1324212e8d3dcf75f9c430493b8417ffbd56dc5 100644 (file)
@@ -49,5 +49,4 @@
 
 &ethernet {
        mtd-mac-address = <&factory 0xf100>;
-       mediatek,portmap = "l";
 };
index 5f5bb4fa47fb25d4ccfa8b678544b37a5ae9bc48..431bba7485d7dff690c45e6fdc2bfc1485d3cc21 100644 (file)
@@ -65,3 +65,7 @@
                };
        };
 };
+
+&esw {
+       mediatek,portmap = <0x3e>;
+};
index 773839098bfe0d6fc7d9e5b6b3ed975c4d58a672..849d264723917b2b047d5d21c23ea91eb53bbd22 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0xf100>;
-       mediatek,portmap = "wllll";
+};
+
+&esw {
+       mediatek,portmap = <0x3e>;
 };
 
 &pinctrl {
index 3dea06328630af78d5ec78ebeab5c59b4e7e8ddc..ded09407a942def310c2b8921532ea99558e7682 100644 (file)
@@ -91,3 +91,7 @@
                };
        };
 };
+
+&esw {
+       mediatek,portmap = <0x3e>;
+};
index 0610b2025071dc2f1940b2ddd427f36c468173ba..b1352a2ee6ae7e8a669fd5fcf18015ea93d74243 100644 (file)
@@ -91,3 +91,7 @@
                };
        };
 };
+
+&esw {
+       mediatek,portmap = <0x3e>;
+};
index 1014e48782367e1359a22c5bbffcff4953b478a7..ff98da79fa56f36f81896f3eb9bf07de0e8335a2 100644 (file)
@@ -85,5 +85,8 @@
 
 &ethernet {
        mtd-mac-address = <&rom 0xf100>;
-       mediatek,portmap = "wllll";
+};
+
+&esw {
+       mediatek,portmap = <0x3e>;
 };
index 9f7f7ccd6c78c9f2b321ab08dccbfdceda320231..8ae75ab50687609ce0e5e995bf59e66f13ffcd71 100644 (file)
@@ -67,5 +67,4 @@
 
 &ethernet {
        mtd-mac-address = <&factory 0xf100>;
-       mediatek,portmap = "llllw";
 };
index a07490b8535855b793108a4781813c809d526823..3336a383415a00360477adafde4d128ba6bcbd91 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0x2e>;
-       mediatek,portmap = "llllw";
+};
+
+&esw {
+       mediatek,portmap = <0x2f>;
 };
index 76923d5cf60f2ceb21edb745a21781578e7c9255..8cadd7e427f18115f696ec18309cbf3ebd1d4685 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0x28>;
-       mediatek,portmap = "llllw";
+};
+
+&esw {
+       mediatek,portmap = <0x2f>;
 };
index a582172aca42397100ad470d2076d6e24dc1d7b7..c06f9b8f724c30febeeb0e02bf84388f7fb34c6f 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0x2e>;
-       mediatek,portmap = "llllw";
+};
+
+&esw {
+       mediatek,portmap = <0x2f>;
 };
index 9bac82287242f93ab28bb0bde2ddc9236497b62b..471533b48de4e5846cea84f6b8d362e2d888c63b 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0x4>;
-       mediatek,portmap = "llllw";
+};
+
+&esw {
+       mediatek,portmap = <0x3e>;
 };
 
 &sdhci {
index e5873def0af36c1045abdedbc8954cd98bdb81ce..52de96b5547946b48e8017eb56dc1eecd1be29b4 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0x2e>;
-       mediatek,portmap = "llllw";
+};
+
+&esw {
+       mediatek,portmap = <0x2f>;
 };
index 56912a786e9cfd4bad1dc3d279869c3e6f65b69d..7a647f96c9fa695905994ecf6306028d5d806f25 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0x4>;
-       mediatek,portmap = "wllll";
+};
+
+&esw {
+       mediatek,portmap = <0x3e>;
 };
 
 &wmac {