Skip to contentSkip to conversation

dts: mediatek: add Cudy WR3000 V1 wireless router

PATCH Superseded Rafał Miłecki 3 participants 12 messages Feb 21, 2024

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover dts: mediatek: add Cudy WR3000 V1 wireless router

From: Rafał Miłecki <[email protected]>

Cudy WR3000 V1 is a MediaTek Filogic 820 based 802.11ax wireless router.

https://www.cudy.com/productinfo/1637722.html

Rafał Miłecki (4):
dt-bindings: vendor-prefixes: add Cudy
dt-bindings: arm64: dts: mediatek: Add Cudy WR3000 V1 router
arm64: dts: mediatek: mt7981: add pinctrl
arm64: dts: mediatek: Add Cudy WR3000 V1

 .../devicetree/bindings/arm/mediatek.yaml     |  1 +
 .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
 arch/arm64/boot/dts/mediatek/Makefile         |  1 +
 .../dts/mediatek/mt7981b-cudy-wr3000-v1.dts   | 74 +++++++++++++++++++
 arch/arm64/boot/dts/mediatek/mt7981b.dtsi     | 37 ++++++++++
 5 files changed, 115 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts
Signature · 1 line
2.35.3
#1 lore raw

PATCH 1/4 dt-bindings: vendor-prefixes: add Cudy

From: Rafał Miłecki <[email protected]>

Cudy is a Chinese company providing networking products.

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 2dbcdc5f5d7d..cb4dd176bf41 100644
@@ -332,6 +332,8 @@ patternProperties:
     description: Czech Technical University in Prague
   "^cubietech,.*":
     description: Cubietech, Ltd.
+  "^cudy,.*":
+    description: Shenzhen Cudy Technology Co., Ltd.
   "^cui,.*":
     description: CUI Devices
   "^cypress,.*":
Signature · 1 line
2.35.3
#3 lore raw

PATCH 2/4 dt-bindings: arm64: dts: mediatek: Add Cudy WR3000 V1 router

In reply to Rafał Miłecki

From: Rafał Miłecki <[email protected]>

Cudy WR3000 V1 is an MT7981B (AKA Filogic 820) based wireless router.

---
 Documentation/devicetree/bindings/arm/mediatek.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/mediatek.yaml +1 -0
index 09f9ffd3ff7b..1cf47db94c57 100644
@@ -85,6 +85,7 @@ properties:
           - const: mediatek,mt7629
       - items:
           - enum:
+              - cudy,wr3000-v1
               - xiaomi,ax3000t
           - const: mediatek,mt7981b
       - items:
Signature · 1 line
2.35.3
#6 lore raw

PATCH 3/4 arm64: dts: mediatek: mt7981: add pinctrl

In reply to Rafał Miłecki

From: Rafał Miłecki <[email protected]>

MT7981 contains on-SoC PIN controller that is also a GPIO provider.

---
 arch/arm64/boot/dts/mediatek/mt7981b.dtsi | 37 +++++++++++++++++++++++
 1 file changed, 37 insertions(+)
arch/arm64/boot/dts/mediatek/mt7981b.dtsi +37 -0
index 4feff3d1c5f4..fdd5c22cfc9c 100644
@@ -86,6 +86,43 @@ pwm@10048000 {
 			#pwm-cells = <2>;
 		};
 
+		pio: pinctrl@11d00000 {
+			compatible = "mediatek,mt7981-pinctrl";
+			reg = <0 0x11d00000 0 0x1000>,
+			      <0 0x11c00000 0 0x1000>,
+			      <0 0x11c10000 0 0x1000>,
+			      <0 0x11d20000 0 0x1000>,
+			      <0 0x11e00000 0 0x1000>,
+			      <0 0x11e20000 0 0x1000>,
+			      <0 0x11f00000 0 0x1000>,
+			      <0 0x11f10000 0 0x1000>,
+			      <0 0x1000b000 0 0x1000>;
+			reg-names = "gpio", "iocfg_rt", "iocfg_rm", "iocfg_rb", "iocfg_lb",
+				    "iocfg_bl", "iocfg_tm", "iocfg_tl", "eint";
+			interrupt-controller;
+			interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-parent = <&gic>;
+			gpio-ranges = <&pio 0 0 56>;
+			gpio-controller;
+			#gpio-cells = <2>;
+			#interrupt-cells = <2>;
+
+			mdio-pins {
+				mux {
+					function = "eth";
+					groups = "smi_mdc_mdio";
+				};
+			};
+
+			spi0-pins {
+				mux {
+					function = "spi";
+					groups = "spi0", "spi0_wp_hold";
+				};
+			};
+
+		};
+
 		clock-controller@15000000 {
 			compatible = "mediatek,mt7981-ethsys", "syscon";
 			reg = <0 0x15000000 0 0x1000>;
Signature · 1 line
2.35.3
#7 lore raw

Re: [PATCH 3/4] arm64: dts: mediatek: mt7981: add pinctrl

Il 21/02/24 08:35, Rafał Miłecki ha scritto:

Quoted 30 lines

From: Rafał Miłecki <[email protected]>

MT7981 contains on-SoC PIN controller that is also a GPIO provider.

---
  arch/arm64/boot/dts/mediatek/mt7981b.dtsi | 37 +++++++++++++++++++++++
  1 file changed, 37 insertions(+)
arch/arm64/boot/dts/mediatek/mt7981b.dtsi +13 -0
index 4feff3d1c5f4..fdd5c22cfc9c 100644
@@ -86,6 +86,43 @@ pwm@10048000 {
  			#pwm-cells = <2>;
  		};
 
+		pio: pinctrl@11d00000 {
+			compatible = "mediatek,mt7981-pinctrl";
+			reg = <0 0x11d00000 0 0x1000>,
+			      <0 0x11c00000 0 0x1000>,
+			      <0 0x11c10000 0 0x1000>,
+			      <0 0x11d20000 0 0x1000>,
+			      <0 0x11e00000 0 0x1000>,
+			      <0 0x11e20000 0 0x1000>,
+			      <0 0x11f00000 0 0x1000>,
+			      <0 0x11f10000 0 0x1000>,
+			      <0 0x1000b000 0 0x1000>;
+			reg-names = "gpio", "iocfg_rt", "iocfg_rm", "iocfg_rb", "iocfg_lb",
+				    "iocfg_bl", "iocfg_tm", "iocfg_tl", "eint";

arch/arm64/boot/dts/mediatek/mt7981b.dtsi pwm@10048000 { · line 111

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7981b.dtsi +10 -0
+			interrupt-controller;
+			interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-parent = <&gic>;
+			gpio-ranges = <&pio 0 0 56>;
+			gpio-controller;
+			#gpio-cells = <2>;
+			#interrupt-cells = <2>;
+
+			mdio-pins {
+				mux {

That's board specific. MDIO and SPI0 pins can be used as GPIO instead of, respectively, ETH and SPI.

Must go to your board devicetree, not here: please move both.

Cheers,
Angelo

Quoted 17 lines
arch/arm64/boot/dts/mediatek/mt7981b.dtsi +14 -0
+					function = "eth";
+					groups = "smi_mdc_mdio";
+				};
+			};
+
+			spi0-pins {
+				mux {
+					function = "spi";
+					groups = "spi0", "spi0_wp_hold";
+				};
+			};
+
+		};
+
  		clock-controller@15000000 {
  			compatible = "mediatek,mt7981-ethsys", "syscon";
  			reg = <0 0x15000000 0 0x1000>;
#8 lore raw

PATCH 4/4 arm64: dts: mediatek: Add Cudy WR3000 V1

In reply to Rafał Miłecki

From: Rafał Miłecki <[email protected]>

Cudy WR3000 V1 is an MT7981B (AKA Filogic 820) based wireless router. It has 256 MiB of RAM, some LEDs & buttons and (not described yet) 4 Ethernet ports.

---
 arch/arm64/boot/dts/mediatek/Makefile         |  1 +
 .../dts/mediatek/mt7981b-cudy-wr3000-v1.dts   | 74 +++++++++++++++++++
 2 files changed, 75 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts
arch/arm64/boot/dts/mediatek/Makefile +1 -0
index 37b4ca3a87c9..96da4ad640aa 100644
@@ -8,6 +8,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-evb.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-x20-dev.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-rfb1.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-bananapi-bpi-r64.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7981b-cudy-wr3000-v1.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7981b-xiaomi-ax3000t.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-acelink-ew-7886cax.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3.dtb
arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts new file +74 -0

74 lines not on this page · raw message

Signature · 1 line
2.35.3
#9 lore raw

Re: [PATCH 4/4] arm64: dts: mediatek: Add Cudy WR3000 V1

Il 21/02/24 08:35, Rafał Miłecki ha scritto:

Quoted 62 lines

From: Rafał Miłecki <[email protected]>

Cudy WR3000 V1 is an MT7981B (AKA Filogic 820) based wireless router. It has 256 MiB of RAM, some LEDs & buttons and (not described yet) 4 Ethernet ports.

---
  arch/arm64/boot/dts/mediatek/Makefile         |  1 +
  .../dts/mediatek/mt7981b-cudy-wr3000-v1.dts   | 74 +++++++++++++++++++
  2 files changed, 75 insertions(+)

create mode 100644 arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts

arch/arm64/boot/dts/mediatek/Makefile +1 -0
index 37b4ca3a87c9..96da4ad640aa 100644
@@ -8,6 +8,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-evb.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-x20-dev.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-rfb1.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-bananapi-bpi-r64.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7981b-cudy-wr3000-v1.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7981b-xiaomi-ax3000t.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-acelink-ew-7886cax.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3.dtb
arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts new file +31 -0
new file mode 100644
index 000000000000..cb36a089518a
@@ -0,0 +1,74 @@
+// SPDX-License-Identifier: GPL-2.0-only OR MIT
+
+/dts-v1/;
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+
+#include "mt7981b.dtsi"
+
+/ {
+	compatible = "cudy,wr3000-v1", "mediatek,mt7981b";
+	model = "Cudy WR3000 V1";
+
+	memory@40000000 {
+		reg = <0 0x40000000 0 0x10000000>;
+		device_type = "memory";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		key-wps {
+			label = "WPS";
+			gpios = <&pio 0 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+
+		key-reset {
+			label = "RESET";
+			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;

arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts line 41

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts new file +10 -0
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led-0 {
+			function = LED_FUNCTION_WAN;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 5 GPIO_ACTIVE_LOW>;

Can we please order those properties alphabetically, as it doesn't impact on human readability in any way?
Just a nitpick, anyway.

color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WAN;
gpios = <&pio 5 GPIO_ACTIVE_LOW>;

Quoted 18 lines
arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts new file +18 -0
+		};
+
+		led-1 {
+			function = LED_FUNCTION_WLAN_2GHZ;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 6 GPIO_ACTIVE_LOW>;
+		};
+
+		led-2 {
+			function = LED_FUNCTION_WLAN_5GHZ;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 7 GPIO_ACTIVE_LOW>;
+		};
+
+		led-3 {
+			function = LED_FUNCTION_LAN;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 9 GPIO_ACTIVE_LOW>;

arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts line 69

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts new file +10 -0
+		};
+
+		led-4 {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 10 GPIO_ACTIVE_LOW>;
+		};
+
+		led-5 {
+			function = "online";

Uhm, what does "online" mean?

Are you sure that you can't use any of the LED_FUNCTION_XXX standard definitions?

Cheers,
Angelo

#10 lore raw

Re: [PATCH 4/4] arm64: dts: mediatek: Add Cudy WR3000 V1

Quoted 78 lines · AngeloGioacchino Del Regno

Il 21/02/24 08:35, Rafał Miłecki ha scritto:

Quoted 62 lines

From: Rafał Miłecki <[email protected]>

Cudy WR3000 V1 is an MT7981B (AKA Filogic 820) based wireless router. It has 256 MiB of RAM, some LEDs & buttons and (not described yet) 4 Ethernet ports.

---
  arch/arm64/boot/dts/mediatek/Makefile         |  1 + .../dts/mediatek/mt7981b-cudy-wr3000-v1.dts   | 74 +++++++++++++++++++

  2 files changed, 75 insertions(+)

  create mode 100644 arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts

arch/arm64/boot/dts/mediatek/Makefile +0 -0
index 37b4ca3a87c9..96da4ad640aa 100644
@@ -8,6 +8,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-evb.dtb

  dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-x20-dev.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-rfb1.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-bananapi-bpi-r64.dtb +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7981b-cudy-wr3000-v1.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7981b-xiaomi-ax3000t.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-acelink-ew-7886cax.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3.dtb

arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts new file +31 -0
new file mode 100644
index 000000000000..cb36a089518a
@@ -0,0 +1,74 @@
+// SPDX-License-Identifier: GPL-2.0-only OR MIT
+
+/dts-v1/;
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+
+#include "mt7981b.dtsi"
+
+/ {
+    compatible = "cudy,wr3000-v1", "mediatek,mt7981b";
+    model = "Cudy WR3000 V1";
+
+    memory@40000000 {
+        reg = <0 0x40000000 0 0x10000000>;
+        device_type = "memory";
+    };
+
+    keys {
+        compatible = "gpio-keys";
+
+        key-wps {
+            label = "WPS";
+            gpios = <&pio 0 GPIO_ACTIVE_LOW>;
+            linux,code = <KEY_WPS_BUTTON>;
+        };
+
+        key-reset {
+            label = "RESET";
+            gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+            linux,code = <KEY_RESTART>;

arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts line 41

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts new file +10 -0
+        };
+    };
+
+    leds {
+        compatible = "gpio-leds";
+
+        led-0 {
+            function = LED_FUNCTION_WAN;
+            color = <LED_COLOR_ID_BLUE>;
+            gpios = <&pio 5 GPIO_ACTIVE_LOW>;

Can we please order those properties alphabetically, as it doesn't impact on human readability in any way?
Just a nitpick, anyway.

Quoted 3 lines

color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WAN;
gpios = <&pio 5 GPIO_ACTIVE_LOW>;

If I understand [1] correctly alphabetical / alpha-numerical order applies to non-addresses nodes only.

Here I put "function" first as that seemed more important than a color.

Perhaps you could suggest an addition to Devicetree Sources (DTS) Coding Style or point me to the missed part, please?

[1] https://www.kernel.org/doc/html/next/devicetree/bindings/dts-coding-style.html#order-of-properties-in-device-node

Quoted 31 lines
Quoted 18 lines
arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts new file +18 -0
+        };
+
+        led-1 {
+            function = LED_FUNCTION_WLAN_2GHZ;
+            color = <LED_COLOR_ID_BLUE>;
+            gpios = <&pio 6 GPIO_ACTIVE_LOW>;
+        };
+
+        led-2 {
+            function = LED_FUNCTION_WLAN_5GHZ;
+            color = <LED_COLOR_ID_BLUE>;
+            gpios = <&pio 7 GPIO_ACTIVE_LOW>;
+        };
+
+        led-3 {
+            function = LED_FUNCTION_LAN;
+            color = <LED_COLOR_ID_BLUE>;
+            gpios = <&pio 9 GPIO_ACTIVE_LOW>;

arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts line 69

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts new file +10 -0
+        };
+
+        led-4 {
+            function = LED_FUNCTION_STATUS;
+            color = <LED_COLOR_ID_BLUE>;
+            gpios = <&pio 10 GPIO_ACTIVE_LOW>;
+        };
+
+        led-5 {
+            function = "online";

Uhm, what does "online" mean?

Quoted 1 line

Are you sure that you can't use any of the LED_FUNCTION_XXX standard definitions?

This device has:
1. "WAN Port" LED that indicates "WAN Port has connection" state
2. "Internet" LED that indicates "Connected to the Internet" state

I couldn't find any define that would fit Internet access LED case.

#11 lore raw

Re: [PATCH 4/4] arm64: dts: mediatek: Add Cudy WR3000 V1

Il 21/02/24 11:18, Rafał Miłecki ha scritto:

Quoted 86 lines · AngeloGioacchino Del Regno
Quoted 78 lines

Il 21/02/24 08:35, Rafał Miłecki ha scritto:

Quoted 62 lines

From: Rafał Miłecki <[email protected]>

Cudy WR3000 V1 is an MT7981B (AKA Filogic 820) based wireless router. It has 256 MiB of RAM, some LEDs & buttons and (not described yet) 4 Ethernet ports.

---
  arch/arm64/boot/dts/mediatek/Makefile         |  1 + .../dts/mediatek/mt7981b-cudy-wr3000-v1.dts   | 74 +++++++++++++++++++

  2 files changed, 75 insertions(+)

  create mode 100644 arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts

arch/arm64/boot/dts/mediatek/Makefile +0 -0
index 37b4ca3a87c9..96da4ad640aa 100644
@@ -8,6 +8,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-evb.dtb

  dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-x20-dev.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-rfb1.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-bananapi-bpi-r64.dtb +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7981b-cudy-wr3000-v1.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7981b-xiaomi-ax3000t.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-acelink-ew-7886cax.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3.dtb

arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts new file +31 -0
new file mode 100644
index 000000000000..cb36a089518a
@@ -0,0 +1,74 @@
+// SPDX-License-Identifier: GPL-2.0-only OR MIT
+
+/dts-v1/;
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+
+#include "mt7981b.dtsi"
+
+/ {
+    compatible = "cudy,wr3000-v1", "mediatek,mt7981b";
+    model = "Cudy WR3000 V1";
+
+    memory@40000000 {
+        reg = <0 0x40000000 0 0x10000000>;
+        device_type = "memory";
+    };
+
+    keys {
+        compatible = "gpio-keys";
+
+        key-wps {
+            label = "WPS";
+            gpios = <&pio 0 GPIO_ACTIVE_LOW>;
+            linux,code = <KEY_WPS_BUTTON>;
+        };
+
+        key-reset {
+            label = "RESET";
+            gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+            linux,code = <KEY_RESTART>;

arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts line 41

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts new file +10 -0
+        };
+    };
+
+    leds {
+        compatible = "gpio-leds";
+
+        led-0 {
+            function = LED_FUNCTION_WAN;
+            color = <LED_COLOR_ID_BLUE>;
+            gpios = <&pio 5 GPIO_ACTIVE_LOW>;

Can we please order those properties alphabetically, as it doesn't impact on human readability in any way?
Just a nitpick, anyway.

Quoted 3 lines

color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WAN;
gpios = <&pio 5 GPIO_ACTIVE_LOW>;

If I understand [1] correctly alphabetical / alpha-numerical order applies to non-addresses nodes only.

Quoted 8 lines

Here I put "function" first as that seemed more important than a color.

Perhaps you could suggest an addition to Devicetree Sources (DTS) Coding Style or point me to the missed part, please?

[1] https://www.kernel.org/doc/html/next/devicetree/bindings/dts-coding-style.html#order-of-properties-in-device-node

I didn't say that this was *mandatory*, but since alphanumeric ordering in device trees is actually a thing for nodes, this could be as well applied to properties inside when this doesn't impact on human readability.

As far as I'm aware, I'm not the only maintainer asking for that (am I?!)

If you've got any *strong opinion* about having function as the first property, I'm full ears, and I will be okay with that. No problem on my side, I'm open for alternatives when those make sense.

Quoted 32 lines
Quoted 32 lines
Quoted 19 lines
arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts new file +18 -0
+        };
+
+        led-1 {
+            function = LED_FUNCTION_WLAN_2GHZ;
+            color = <LED_COLOR_ID_BLUE>;
+            gpios = <&pio 6 GPIO_ACTIVE_LOW>;
+        };
+
+        led-2 {
+            function = LED_FUNCTION_WLAN_5GHZ;
+            color = <LED_COLOR_ID_BLUE>;
+            gpios = <&pio 7 GPIO_ACTIVE_LOW>;
+        };
+
+        led-3 {
+            function = LED_FUNCTION_LAN;
+            color = <LED_COLOR_ID_BLUE>;
+            gpios = <&pio 9 GPIO_ACTIVE_LOW>;

arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts line 69

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7981b-cudy-wr3000-v1.dts new file +10 -0
+        };
+
+        led-4 {
+            function = LED_FUNCTION_STATUS;
+            color = <LED_COLOR_ID_BLUE>;
+            gpios = <&pio 10 GPIO_ACTIVE_LOW>;
+        };
+
+        led-5 {
+            function = "online";

Uhm, what does "online" mean?

Quoted 4 lines
Quoted 1 line

Are you sure that you can't use any of the LED_FUNCTION_XXX standard definitions?

This device has:
1. "WAN Port" LED that indicates "WAN Port has connection" state

Just a curiosity: is the WAN port ethernet, fiber or what?
(to entirely clarify in my brain if that LED is a carrier detect indicator, but doesn't matter for this patch, it's really just a personal curiosity and nothing else)

Quoted 3 lines

2. "Internet" LED that indicates "Connected to the Internet" state

I couldn't find any define that would fit Internet access LED case.

I was imagining something like that, but wasn't sure, so asking you was the best choice.

I wonder if it makes sense to add a "wan-online" or "wan-connected" or .. I don't know, some definition that makes common sense, to dt-bindings/leds/common.h to somewhat standardize the function for that usecase?

One thing I'm (mostly) sure of, it makes sense to have the "wan-" prefix before any word (because you can have sorts of authenticated LANs as well).

I don't think that there's anything hugely restrictive that would prevent you from doing that: there are even "player-[1-5]" definitions for game controllers, and yours is not the first router that I physically see with my own eyes that has such a LED for that state.

After all, what's going to turn on that LED is userspace, and if we can get one that works for all (without custom functions for each router), why not :-)