diff mbox series

ramips: do not use GPIO function on switch pins on certain devices

Message ID 20221019114259.11694-1-arinc.unal@arinc9.com
State Accepted, archived
Delegated to: Chuanhong Guo
Headers show
Series ramips: do not use GPIO function on switch pins on certain devices | expand

Commit Message

Arınç ÜNAL Oct. 19, 2022, 11:43 a.m. UTC
The pins of the MT7530 switch that translate to GPIO 0, 3, 6, 9 and 12 has
got a function, by default, which does the same thing as the netdev
trigger. Because of bridge offloading on DSA, the netdev trigger won't see
the frames between the switch ports whilst the default function will.

Do not use the GPIO function on switch pins on devices that fall under this
category.

Keep it for:

mt7621_belkin_rt1800.dts: There's only one LED which is for the wan
interface and there's no bridge offloading between the "wan" interface and
other interfaces.

mt7621_yuncore_ax820.dts: There's no bridge offloading between the "wan"
and "lan" interfaces.

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
---
 .../linux/ramips/dts/mt7621_linksys_e7350.dts | 37 -------------------
 .../ramips/dts/mt7621_netgear_wax202.dts      | 18 ---------
 .../ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi | 37 -------------------
 .../mt7621/base-files/etc/board.d/01_leds     | 17 ---------
 4 files changed, 109 deletions(-)

Comments

Chuanhong Guo Jan. 8, 2023, 4:41 a.m. UTC | #1
Hi!

On Wed, Oct 19, 2022 at 7:52 PM Arınç ÜNAL <arinc.unal@arinc9.com> wrote:
>
> The pins of the MT7530 switch that translate to GPIO 0, 3, 6, 9 and 12 has
> got a function, by default, which does the same thing as the netdev
> trigger. Because of bridge offloading on DSA, the netdev trigger won't see
> the frames between the switch ports whilst the default function will.
>
> Do not use the GPIO function on switch pins on devices that fall under this
> category.
>
> Keep it for:
>
> mt7621_belkin_rt1800.dts: There's only one LED which is for the wan
> interface and there's no bridge offloading between the "wan" interface and
> other interfaces.
>
> mt7621_yuncore_ax820.dts: There's no bridge offloading between the "wan"
> and "lan" interfaces.
>
> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>

Applied to master. Thanks!
diff mbox series

Patch

diff --git a/target/linux/ramips/dts/mt7621_linksys_e7350.dts b/target/linux/ramips/dts/mt7621_linksys_e7350.dts
index d7b8c214b9..ea8a684148 100644
--- a/target/linux/ramips/dts/mt7621_linksys_e7350.dts
+++ b/target/linux/ramips/dts/mt7621_linksys_e7350.dts
@@ -57,40 +57,6 @@ 
 			function = LED_FUNCTION_WAN;
 			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
 		};
-
-		led-wan2 {
-			color = <LED_COLOR_ID_BLUE>;
-			function = LED_FUNCTION_WAN;
-			gpios = <&switch0 0 GPIO_ACTIVE_LOW>;
-		};
-
-		led-lan4 {
-			color = <LED_COLOR_ID_BLUE>;
-			function = LED_FUNCTION_LAN;
-			function-enumerator = <4>;
-			gpios = <&switch0 3 GPIO_ACTIVE_LOW>;
-		};
-
-		led-lan3 {
-			color = <LED_COLOR_ID_BLUE>;
-			function = LED_FUNCTION_LAN;
-			function-enumerator = <3>;
-			gpios = <&switch0 6 GPIO_ACTIVE_LOW>;
-		};
-
-		led-lan2 {
-			color = <LED_COLOR_ID_BLUE>;
-			function = LED_FUNCTION_LAN;
-			function-enumerator = <2>;
-			gpios = <&switch0 9 GPIO_ACTIVE_HIGH>;
-		};
-
-		led-lan1 {
-			color = <LED_COLOR_ID_BLUE>;
-			function = LED_FUNCTION_LAN;
-			function-enumerator = <1>;
-			gpios = <&switch0 12 GPIO_ACTIVE_LOW>;
-		};
 	};
 };
 
@@ -185,9 +151,6 @@ 
 };
 
 &switch0 {
-	gpio-controller;
-	#gpio-cells = <2>;
-
 	ports {
 		port@1 {
 			status = "okay";
diff --git a/target/linux/ramips/dts/mt7621_netgear_wax202.dts b/target/linux/ramips/dts/mt7621_netgear_wax202.dts
index f17a805363..02f540d743 100644
--- a/target/linux/ramips/dts/mt7621_netgear_wax202.dts
+++ b/target/linux/ramips/dts/mt7621_netgear_wax202.dts
@@ -53,31 +53,16 @@ 
 			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
 		};
 
-		led_lan1_green: lan1_green {
-			label = "green:lan1";
-			gpios = <&switch0 3 GPIO_ACTIVE_LOW>;
-		};
-
 		led_lan1_orange: lan1_orange {
 			label = "orange:lan1";
 			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
 		};
 
-		led_lan2_green: lan2_green {
-			label = "green:lan2";
-			gpios = <&switch0 6 GPIO_ACTIVE_LOW>;
-		};
-
 		led_lan2_orange: lan2_orange {
 			label = "orange:lan2";
 			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
 		};
 
-		led_lan3_green: lan3_green {
-			label = "green:lan3";
-			gpios = <&switch0 12 GPIO_ACTIVE_LOW>;
-		};
-
 		led_lan3_orange: lan3_orange {
 			label = "orange:lan3";
 			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
@@ -256,9 +241,6 @@ 
 };
 
 &switch0 {
-	gpio-controller;
-	#gpio-cells = <2>;
-
 	ports {
 		port@1 {
 			status = "okay";
diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi
index f19cb4db17..59fab90ed1 100644
--- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi
+++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi
@@ -51,40 +51,6 @@ 
 			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
 			linux,default-trigger = "phy1tpt";
 		};
-
-		lan1 {
-			color = <LED_COLOR_ID_GREEN>;
-			function = LED_FUNCTION_LAN;
-			function-enumerator = <1>;
-			gpios = <&switch0 0 GPIO_ACTIVE_LOW>;
-		};
-
-		lan2 {
-			color = <LED_COLOR_ID_GREEN>;
-			function = LED_FUNCTION_LAN;
-			function-enumerator = <2>;
-			gpios = <&switch0 3 GPIO_ACTIVE_LOW>;
-		};
-
-		lan3 {
-			color = <LED_COLOR_ID_GREEN>;
-			function = LED_FUNCTION_LAN;
-			function-enumerator = <3>;
-			gpios = <&switch0 6 GPIO_ACTIVE_LOW>;
-		};
-
-		lan4 {
-			color = <LED_COLOR_ID_GREEN>;
-			function = LED_FUNCTION_LAN;
-			function-enumerator = <4>;
-			gpios = <&switch0 9 GPIO_ACTIVE_HIGH>;
-		};
-
-		wan {
-			color = <LED_COLOR_ID_GREEN>;
-			function = LED_FUNCTION_WAN;
-			gpios = <&switch0 12 GPIO_ACTIVE_LOW>;
-		};
 	};
 };
 
@@ -186,9 +152,6 @@ 
 };
 
 &switch0 {
-	gpio-controller;
-	#gpio-cells = <2>;
-
 	ports {
 		port@0 {
 			status = "okay";
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index 5ffa4ecb3a..b98cc623a6 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
@@ -73,13 +73,6 @@  gnubee,gb-pc2)
 linksys,e5600)
 	ucidef_set_led_netdev "wan" "wan link" "blue:wan" "wan" "link"
 	;;
-linksys,e7350)
-	ucidef_set_led_netdev "lan1" "lan1" "blue:lan-1" "lan1"
-	ucidef_set_led_netdev "lan2" "lan2" "blue:lan-2" "lan2"
-	ucidef_set_led_netdev "lan3" "lan4" "blue:lan-3" "lan3"
-	ucidef_set_led_netdev "lan4" "lan4" "blue:lan-4" "lan4"
-	ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan"
-	;;
 linksys,ea6350-v4|\
 linksys,ea7300-v1|\
 linksys,ea7300-v2|\
@@ -127,9 +120,6 @@  netgear,r7450)
 	;;
 netgear,wax202)
 	ucidef_set_led_netdev "internet" "Internet" "green:net" "wan"
-	ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "lan1"
-	ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "lan2"
-	ucidef_set_led_netdev "lan3" "LAN3" "green:lan3" "lan3"
 	;;
 oraybox,x3a)
 	ucidef_set_led_netdev "wan" "wan link" "red:status" "wan"
@@ -174,13 +164,6 @@  yuncore,ax820)
 	ucidef_set_led_netdev "lan" "LAN" "green:lan" "lan"
 	ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
 	;;
-zbtlink,zbt-wg1608-16m)
-	ucidef_set_led_netdev "lan1" "LAN1" "green:lan-1" "lan1"
-	ucidef_set_led_netdev "lan2" "LAN2" "green:lan-2" "lan2"
-	ucidef_set_led_netdev "lan3" "LAN3" "green:lan-3" "lan3"
-	ucidef_set_led_netdev "lan4" "LAN4" "green:lan-4" "lan4"
-	ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
-	;;
 zyxel,lte3301-plus)
 	ucidef_set_led_netdev "internet" "internet" "white:internet" "wwan0"
 	;;