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>
Sat, 18 Jan 2020 11:00:29 +0000 (12:00 +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>
18 files changed:
target/linux/ramips/dts/mt7628an_cudy_wr1000.dts
target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts
target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi
target/linux/ramips/dts/mt7628an_tplink_8m.dtsi
target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts
target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts
target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts
target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts
target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts
target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts
target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts
target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts
target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts
target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts
target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts
target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi
target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts
target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts

index acaffecf8ddf9cf1d8d08d514d3682543850d3a9..71aefcb525b0a9f2bdd508eed2bdbdacf1c883ec 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0x28>;
-       mediatek,portmap = "llllw";
+};
+
+&esw {
+       mediatek,portmap = <0x2f>;
 };
index 715f4d1ff74b3fd9f07522ee49eecd7a263439d8..22a8b566e2dcd0738439641c853aa8179e3d5a23 100644 (file)
 &ethernet {
        pinctrl-names = "default";
        mtd-mac-address = <&factory 0xd>;
-       mediatek,portmap = "llllw";
+};
+
+&esw {
+       mediatek,portmap = <0x2f>;
 };
 
 &wmac {
index 8807f7f27488031d92710efdf70f21c89f9df99e..22290603478b7d02b1763bcc73ac4aad9bc1aa4b 100644 (file)
@@ -84,5 +84,8 @@
 
 &ethernet {
        mtd-mac-address = <&rom 0xf100>;
-       mediatek,portmap = "wllll";
+};
+
+&esw {
+       mediatek,portmap = <0x3e>;
 };
index ba3350ed024835a9a07fe1155195d8ec73432ddd..5269fd668b998586147b1602d6bc1434e8355def 100644 (file)
@@ -66,5 +66,4 @@
 
 &ethernet {
        mtd-mac-address = <&factory 0xf100>;
-       mediatek,portmap = "llllw";
 };
index 8e3df9c67639972a3fb2f1dbf1069ffb07b29a6d..3f02b7af3c8c8aa7545cb854a55ee4ba03b31d33 100644 (file)
@@ -78,8 +78,8 @@
        mtd-mac-address-increment = <(-2)>;
 };
 
-&ethernet {
-       mediatek,portmap = "wllll";
+&esw {
+       mediatek,portmap = <0x3e>;
 };
 
 &state_default {
index e0b025d20db141e43b086687caf5928d95739f19..92f581d1ef8bd92cc2a6eb7ff8985c4819fdef71 100644 (file)
        };
 };
 
+&esw {
+       mediatek,portmap = <0x3e>;
+};
+
 &pcie {
        status = "okay";
 };
index 279f9ec69af95535ed4cc6cb84102d5708866bbd..76cf0ca2495e25d58a3eda1c8cd5c236baabe095 100644 (file)
@@ -88,3 +88,7 @@
                ralink,function = "gpio";
        };
 };
+
+&esw {
+       mediatek,portmap = <0x3e>;
+};
index fcb483594ad58f2ef9bfeeef574834ab9ae444d0..3c615e60611d3b586706891e6a07ad5307f5cdb0 100644 (file)
@@ -46,5 +46,4 @@
 
 &ethernet {
        mtd-mac-address = <&factory 0xf100>;
-       mediatek,portmap = "l";
 };
index 1fc2316d703d776a0ca1ce2831090c416a43d9e5..3f901d3a7c85a801622f0f662a6f47d37ad496bb 100644 (file)
@@ -62,3 +62,7 @@
                ralink,function = "gpio";
        };
 };
+
+&esw {
+       mediatek,portmap = <0x3e>;
+};
index c0ae199d224f2c9db3b62ab97919432684b57e40..3de58a71f6ae7f452cb18357312bb1803acad9c4 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0xf100>;
-       mediatek,portmap = "wllll";
+};
+
+&esw {
+       mediatek,portmap = <0x3e>;
 };
 
 &state_default {
index eedce357c7e96a55685d2f1bf0db3b82167d9d16..89e2923c9c3f872e9b837916d20df47bc6b9444e 100644 (file)
@@ -88,3 +88,7 @@
                ralink,function = "gpio";
        };
 };
+
+&esw {
+       mediatek,portmap = <0x3e>;
+};
index 6268bd13cc7f0e350cd0f72ce1d6f79878991518..1654e1819fed5f385a730be3b827cf5fc010068c 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0xf100>;
-       mediatek,portmap = "wllll";
+};
+
+&esw {
+       mediatek,portmap = <0x3e>;
 };
 
 &state_default {
index 10bfe2d65594ec72dcf8ac26159a2a5afbf46dc8..a0adb160d3a3228c649861ba594d078e88eb860c 100644 (file)
@@ -88,3 +88,7 @@
                ralink,function = "gpio";
        };
 };
+
+&esw {
+       mediatek,portmap = <0x3e>;
+};
index 2c0815fba4bb0a4393b70c9cebd8048bdf70b46a..a38907400cc6f8a1c7858eb57698c706eded17b7 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0x2e>;
-       mediatek,portmap = "llllw";
+};
+
+&esw {
+       mediatek,portmap = <0x2f>;
 };
index 13f045f13f970de1f55487f4cf1311ceba864f16..330ae58074b3abeee92f7b9a40692902cdab08e0 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0x28>;
-       mediatek,portmap = "llllw";
+};
+
+&esw {
+       mediatek,portmap = <0x2f>;
 };
index 206da8b16886d76f9c3af41d24f340f1f00af90e..89b37f6b37d711a5e3a57a117622c36c34ce298e 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0x4>;
-       mediatek,portmap = "llllw";
+};
+
+&esw {
+       mediatek,portmap = <0x3e>;
 };
 
 &sdhci {
index b558a0057fcfb8480ce6dfff8b11919a263a287e..fb620eae3ea174e64a3cf58e383b39ed1485145c 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0x2e>;
-       mediatek,portmap = "llllw";
+};
+
+&esw {
+       mediatek,portmap = <0x2f>;
 };
index 5b44808fc63f5c5194bffc9840bf49c245684cbc..0fd8c56d03d62e6dfb31c7f3bc2e617bf5295a6b 100644 (file)
 
 &ethernet {
        mtd-mac-address = <&factory 0x4>;
-       mediatek,portmap = "wllll";
+};
+
+&esw {
+       mediatek,portmap = <0x3e>;
 };
 
 &wmac {