From 7a387bf9a0d73f7c581e2c9aeae6476588100e2c Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Wed, 1 Jan 2020 21:34:10 +0900 Subject: [PATCH] ramips: mt76x8: fix bogus mediatek,portmap 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 --- target/linux/ramips/dts/mt7628an_cudy_wr1000.dts | 5 ++++- target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts | 5 ++++- target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi | 5 ++++- target/linux/ramips/dts/mt7628an_tplink_8m.dtsi | 1 - target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts | 4 ++-- target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts | 4 ++++ target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts | 4 ++++ target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts | 1 - target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts | 4 ++++ target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts | 5 ++++- target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts | 4 ++++ target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts | 5 ++++- target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts | 4 ++++ target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts | 5 ++++- target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts | 5 ++++- target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi | 5 ++++- target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts | 5 ++++- target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts | 5 ++++- 18 files changed, 62 insertions(+), 14 deletions(-) diff --git a/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts b/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts index acaffecf8ddf..71aefcb525b0 100644 --- a/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts +++ b/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts @@ -136,5 +136,8 @@ ðernet { mtd-mac-address = <&factory 0x28>; - mediatek,portmap = "llllw"; +}; + +&esw { + mediatek,portmap = <0x2f>; }; diff --git a/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts b/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts index 715f4d1ff74b..22a8b566e2dc 100644 --- a/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts +++ b/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts @@ -82,7 +82,10 @@ ðernet { pinctrl-names = "default"; mtd-mac-address = <&factory 0xd>; - mediatek,portmap = "llllw"; +}; + +&esw { + mediatek,portmap = <0x2f>; }; &wmac { diff --git a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi index 8807f7f27488..22290603478b 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi @@ -84,5 +84,8 @@ ðernet { mtd-mac-address = <&rom 0xf100>; - mediatek,portmap = "wllll"; +}; + +&esw { + mediatek,portmap = <0x3e>; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi index ba3350ed0248..5269fd668b99 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi @@ -66,5 +66,4 @@ ðernet { mtd-mac-address = <&factory 0xf100>; - mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts index 8e3df9c67639..3f02b7af3c8c 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts @@ -78,8 +78,8 @@ mtd-mac-address-increment = <(-2)>; }; -ðernet { - mediatek,portmap = "wllll"; +&esw { + mediatek,portmap = <0x3e>; }; &state_default { diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts index e0b025d20db1..92f581d1ef8b 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts @@ -80,6 +80,10 @@ }; }; +&esw { + mediatek,portmap = <0x3e>; +}; + &pcie { status = "okay"; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts index 279f9ec69af9..76cf0ca2495e 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts @@ -88,3 +88,7 @@ ralink,function = "gpio"; }; }; + +&esw { + mediatek,portmap = <0x3e>; +}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts index fcb483594ad5..3c615e60611d 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts @@ -46,5 +46,4 @@ ðernet { mtd-mac-address = <&factory 0xf100>; - mediatek,portmap = "l"; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts index 1fc2316d703d..3f901d3a7c85 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts @@ -62,3 +62,7 @@ ralink,function = "gpio"; }; }; + +&esw { + mediatek,portmap = <0x3e>; +}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts index c0ae199d224f..3de58a71f6ae 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts @@ -95,7 +95,10 @@ ðernet { mtd-mac-address = <&factory 0xf100>; - mediatek,portmap = "wllll"; +}; + +&esw { + mediatek,portmap = <0x3e>; }; &state_default { diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts index eedce357c7e9..89e2923c9c3f 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts @@ -88,3 +88,7 @@ ralink,function = "gpio"; }; }; + +&esw { + mediatek,portmap = <0x3e>; +}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts index 6268bd13cc7f..1654e1819fed 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts @@ -109,7 +109,10 @@ ðernet { mtd-mac-address = <&factory 0xf100>; - mediatek,portmap = "wllll"; +}; + +&esw { + mediatek,portmap = <0x3e>; }; &state_default { diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts index 10bfe2d65594..a0adb160d3a3 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts @@ -88,3 +88,7 @@ ralink,function = "gpio"; }; }; + +&esw { + mediatek,portmap = <0x3e>; +}; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts index 2c0815fba4bb..a38907400cc6 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts @@ -123,5 +123,8 @@ ðernet { mtd-mac-address = <&factory 0x2e>; - mediatek,portmap = "llllw"; +}; + +&esw { + mediatek,portmap = <0x2f>; }; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts index 13f045f13f97..330ae58074b3 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts @@ -118,5 +118,8 @@ ðernet { mtd-mac-address = <&factory 0x28>; - mediatek,portmap = "llllw"; +}; + +&esw { + mediatek,portmap = <0x2f>; }; diff --git a/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi b/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi index 206da8b16886..89b37f6b37d7 100644 --- a/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi +++ b/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi @@ -71,7 +71,10 @@ ðernet { mtd-mac-address = <&factory 0x4>; - mediatek,portmap = "llllw"; +}; + +&esw { + mediatek,portmap = <0x3e>; }; &sdhci { diff --git a/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts b/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts index b558a0057fcf..fb620eae3ea1 100644 --- a/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts +++ b/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts @@ -107,5 +107,8 @@ ðernet { mtd-mac-address = <&factory 0x2e>; - mediatek,portmap = "llllw"; +}; + +&esw { + mediatek,portmap = <0x2f>; }; diff --git a/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts index 5b44808fc63f..0fd8c56d03d6 100644 --- a/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts +++ b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts @@ -179,7 +179,10 @@ ðernet { mtd-mac-address = <&factory 0x4>; - mediatek,portmap = "wllll"; +}; + +&esw { + mediatek,portmap = <0x3e>; }; &wmac { -- 2.30.2