]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ramips: some minor FDT improvements for HiWiFi devices 18251/head
authorShiji Yang <yangshiji66@outlook.com>
Sat, 15 Mar 2025 02:00:10 +0000 (10:00 +0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 8 Jun 2025 17:37:49 +0000 (19:37 +0200)
This patch contains various minor FDT improvements for ramips
HiWiFi series devices:

* Add mt76 driver compatibles.
* Remove useless platform compatibles.
* Add default USB LED trigger for HC5861.
* Disable unused usbphy for HC5661, HC5661A and HC581B.
* Add switch port map properties based on 02_network scripts.
* Move aliases node to device dts because the LED nodes it
  references only exist in the device specific dts.
* Rename gpio-leds nodes to follow the upstream dt-bindings
  suggested pattern "(^led-[0-9a-f]$|led)".
* Convert deprecated LED label property to color and function.
  "system" LED has been renamed to "status", it is acceptable
  because these LEDs do not have text labels.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18251
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
12 files changed:
target/linux/ramips/dts/mt7620a_hiwifi_hc5661.dts
target/linux/ramips/dts/mt7620a_hiwifi_hc5761.dts
target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts
target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi
target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts
target/linux/ramips/dts/mt7628an_hiwifi_hc5611.dts
target/linux/ramips/dts/mt7628an_hiwifi_hc5661a.dts
target/linux/ramips/dts/mt7628an_hiwifi_hc5761a.dts
target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts
target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi
target/linux/ramips/mt7620/base-files/etc/board.d/01_leds
target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds

index 3d1c1697658763728d91cbfba29bc49d89499672..67a192b3e33af394a085eea0d1706b98c91fca41 100644 (file)
@@ -1,34 +1,41 @@
 #include "mt7620a_hiwifi_hc5x61.dtsi"
 
 / {
-       compatible = "hiwifi,hc5661", "hiwifi,hc5x61", "ralink,mt7620a-soc";
+       compatible = "hiwifi,hc5661", "ralink,mt7620a-soc";
        model = "HiWiFi HC5661";
 
        aliases {
                label-mac-device = &ethernet;
-               led-boot = &led_system;
-               led-failsafe = &led_system;
-               led-running = &led_system;
-               led-upgrade = &led_system;
+               led-boot = &led_status;
+               led-failsafe = &led_status;
+               led-running = &led_status;
+               led-upgrade = &led_status;
        };
 
        leds {
                compatible = "gpio-leds";
 
-               led_system: system {
-                       label = "blue:system";
+               led_status: led-0 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_STATUS;
                        gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
                };
 
-               internet {
-                       label = "blue:internet";
+               led-1 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WAN;
                        gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
                };
 
-               wlan2g {
-                       label = "blue:wlan2g";
+               led-2 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WLAN;
                        gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "phy0tpt";
                };
        };
 };
+
+&usbphy {
+       status = "disabled";
+};
index 7b5cd0675bbf20f6ce2b019fcf0692515b1fc89b..89dabb4ccfca1cb12d4c90b132147332ffee615c 100644 (file)
@@ -1,38 +1,42 @@
 #include "mt7620a_hiwifi_hc5x61.dtsi"
 
 / {
-       compatible = "hiwifi,hc5761", "hiwifi,hc5x61", "ralink,mt7620a-soc";
+       compatible = "hiwifi,hc5761", "ralink,mt7620a-soc";
        model = "HiWiFi HC5761";
 
        aliases {
                label-mac-device = &ethernet;
-               led-boot = &led_system;
-               led-failsafe = &led_system;
-               led-running = &led_system;
-               led-upgrade = &led_system;
+               led-boot = &led_status;
+               led-failsafe = &led_status;
+               led-running = &led_status;
+               led-upgrade = &led_status;
        };
 
        leds {
                compatible = "gpio-leds";
 
-               led_system: system {
-                       label = "blue:system";
+               led_status: led-0 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_STATUS;
                        gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
                };
 
-               internet {
-                       label = "blue:internet";
+               led-1 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WAN;
                        gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
                };
 
-               wlan2g {
-                       label = "blue:wlan2g";
+               led-2 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WLAN_2GHZ;
                        gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "phy1tpt";
                };
 
-               wlan5g {
-                       label = "blue:wlan5g";
+               led-3 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WLAN_5GHZ;
                        gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "phy0tpt";
                };
@@ -62,7 +66,8 @@
 };
 
 &pcie0 {
-       mt76@0,0 {
+       wifi@0,0 {
+               compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
                nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_18a 0>;
                nvmem-cell-names = "eeprom", "mac-address";
index 8b99655cdd7419079b5d1d4417f1351168ebb5e3..9fe7408ccb8c23c564bde51ea45384807e98daa0 100644 (file)
@@ -1,45 +1,52 @@
 #include "mt7620a_hiwifi_hc5x61.dtsi"
 
 / {
-       compatible = "hiwifi,hc5861", "hiwifi,hc5x61", "ralink,mt7620a-soc";
+       compatible = "hiwifi,hc5861", "ralink,mt7620a-soc";
        model = "HiWiFi HC5861";
 
        aliases {
                label-mac-device = &ethernet;
-               led-boot = &led_system;
-               led-failsafe = &led_system;
-               led-running = &led_system;
-               led-upgrade = &led_system;
+               led-boot = &led_status;
+               led-failsafe = &led_status;
+               led-running = &led_status;
+               led-upgrade = &led_status;
        };
 
        leds {
                compatible = "gpio-leds";
 
-               led_system: system {
-                       label = "blue:system";
+               led_status: led-0 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_STATUS;
                        gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
                };
 
-               wlan2g {
-                       label = "blue:wlan2g";
+               led-1 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WLAN_2GHZ;
                        gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "phy1tpt";
                };
 
-               internet {
-                       label = "blue:internet";
+               led-2 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WAN;
                        gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
                };
 
-               wlan5g {
-                       label = "blue:wlan5g";
+               led-3 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WLAN_5GHZ;
                        gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "phy0tpt";
                };
 
-               turbo {
-                       label = "blue:turbo";
+               led-4 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_USB;
                        gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "usbport";
+                       trigger-sources = <&ohci_port1>, <&ehci_port1>;
                };
        };
 
 
 &pcie0 {
        wifi@0,0 {
-               compatible = "pci14c3,7662";
+               compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
                nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_18a 0>;
                nvmem-cell-names = "eeprom", "mac-address";
index 34412cd7f412789367322227db0cd5ed03d0a994..6ab34ede2e71429642d9ef224e70da9a144d0347 100644 (file)
@@ -2,10 +2,9 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
-       compatible = "hiwifi,hc5x61", "ralink,mt7620a-soc";
-
        chosen {
                bootargs = "console=ttyS0,115200";
        };
index ade82efa3931608723142ad60098815d74a220b9..d496e72bf5fdab1d9ff9a3cd7a9f366cc09c52e8 100644 (file)
 
        aliases {
                label-mac-device = &gmac0;
-               led-boot = &led_system;
-               led-failsafe = &led_system;
-               led-running = &led_status;
-               led-upgrade = &led_status;
+               led-boot = &led_status_red;
+               led-failsafe = &led_status_red;
+               led-running = &led_status_white;
+               led-upgrade = &led_status_white;
        };
 
        chosen {
        leds {
                compatible = "gpio-leds";
 
-               led_status: status {
-                       function = LED_FUNCTION_STATUS;
+               led_status_white: led-0 {
                        color = <LED_COLOR_ID_WHITE>;
+                       function = LED_FUNCTION_STATUS;
                        gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
                };
 
-               led_system: system {
-                       label = "red:system";
+               led_status_red: led-1 {
+                       color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_STATUS;
                        gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
                        panic-indicator;
                };
 };
 
 &pcie0 {
-       mt76@0,0 {
+       wifi@0,0 {
+               compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
                nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_18a 0>;
                nvmem-cell-names = "eeprom", "mac-address";
 };
 
 &pcie1 {
-       mt76@0,0 {
+       wifi@0,0 {
+               compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
                nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_18a 0>;
                nvmem-cell-names = "eeprom", "mac-address";
index 17de299b3cbc4366a9dc1bac47fc7ba846d84d97..2243f0779b12815bc1f7c76392c4f6c6401946b7 100644 (file)
@@ -6,17 +6,27 @@
        compatible = "hiwifi,hc5611", "mediatek,mt7628an-soc";
        model = "HiWiFi HC5611";
 
+       aliases {
+               label-mac-device = &ethernet;
+               led-boot = &led_status;
+               led-failsafe = &led_status;
+               led-running = &led_status;
+               led-upgrade = &led_status;
+       };
+
        leds {
                compatible = "gpio-leds";
 
-               led_system: system {
-                       label = "green:system";
+               led_status: led-0 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_STATUS;
                        gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
                        default-state = "on";
                };
 
-               internet {
-                       label = "red:internet";
+               led-1 {
+                       color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_WAN;
                        gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
                };
        };
index 52cd3afac89a3fcfa2750e2c97e2141addc18d41..170bbfc0fe2d0f37b948c73ed3bdf1151b864873 100644 (file)
@@ -6,27 +6,43 @@
        compatible = "hiwifi,hc5661a", "mediatek,mt7628an-soc";
        model = "HiWiFi HC5661A";
 
+       aliases {
+               label-mac-device = &ethernet;
+               led-boot = &led_status;
+               led-failsafe = &led_status;
+               led-running = &led_status;
+               led-upgrade = &led_status;
+       };
+
        leds {
                compatible = "gpio-leds";
 
-               led_system: system {
-                       label = "blue:system";
+               led_status: led-0 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_STATUS;
                        gpios = <&gpio 37 GPIO_ACTIVE_HIGH>;
                };
 
-               internet {
-                       label = "blue:internet";
+               led-1 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WAN;
                        gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
                };
 
-               wlan2g {
-                       label = "blue:wlan2g";
+               led-2 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WLAN;
                        gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "phy0tpt";
                };
        };
 };
 
+&esw {
+       mediatek,portmap = <0x2f>;
+       mediatek,portdisable = <0x20>;
+};
+
 &pinctrl {
        ephy-analog;
 
@@ -57,3 +73,7 @@
 &ohci {
        status = "disabled";
 };
+
+&usbphy {
+       status = "disabled";
+};
index 44086698c5742036a5bd4cf5f8d4fba8e05c948a..40a2bd33158d3e1516981f4aa41f29d2bdd2dc67 100644 (file)
@@ -6,27 +6,39 @@
        compatible = "hiwifi,hc5761a", "mediatek,mt7628an-soc";
        model = "HiWiFi HC5761A";
 
+       aliases {
+               label-mac-device = &ethernet;
+               led-boot = &led_status;
+               led-failsafe = &led_status;
+               led-running = &led_status;
+               led-upgrade = &led_status;
+       };
+
        leds {
                compatible = "gpio-leds";
 
-               led_system: system {
-                       label = "blue:system";
+               led_status: led-0 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_STATUS;
                        gpios = <&gpio 37 GPIO_ACTIVE_HIGH>;
                };
 
-               internet {
-                       label = "blue:internet";
+               led-1 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WAN;
                        gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
                };
 
-               wlan2g {
-                       label = "blue:wlan2g";
+               led-2 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WLAN_2GHZ;
                        gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "phy0tpt";
                };
 
-               wlan5g {
-                       label = "blue:wlan5g";
+               led-3 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_WLAN_5GHZ;
                        gpios = <&gpio 40 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "phy1tpt";
                };
        };
 };
 
+&esw {
+       mediatek,portmap = <0x2f>;
+       mediatek,portdisable = <0x2c>;
+};
+
 &pinctrl {
        ephy-analog;
 
@@ -72,6 +89,7 @@
 
 &pcie0 {
        wifi@0,0 {
+               compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
                nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_18a 0>;
                nvmem-cell-names = "eeprom", "mac-address";
index 7db5a6bc4332d0214bf3f7914834cd8a6e802836..963eda4e0d647fe154d91270eb063632e2104e9f 100644 (file)
@@ -4,22 +4,37 @@
        compatible = "hiwifi,hc5861b", "mediatek,mt7628an-soc";
        model = "HiWiFi HC5861B";
 
+       aliases {
+               label-mac-device = &ethernet;
+               led-boot = &led_status;
+               led-failsafe = &led_status;
+               led-running = &led_status;
+               led-upgrade = &led_status;
+       };
+
        leds {
                compatible = "gpio-leds";
 
-               led_system: system {
-                       label = "green:system";
+               led_status: led-0 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_STATUS;
                        gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
                };
 
-               wlan2g {
-                       label = "green:wlan2g";
+               led-1 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_WLAN_2GHZ;
                        gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "phy0tpt";
                };
        };
 };
 
+&esw {
+       mediatek,portmap = <0x3e>;
+       mediatek,portdisable = <0x20>;
+};
+
 &state_default {
        gpio {
                groups = "refclk", "wdt", "wled_an";
        status = "disabled";
 };
 
+&usbphy {
+       status = "disabled";
+};
+
 &pcie {
        status = "okay";
 };
 
 &pcie0 {
        wifi@0,0 {
+               compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
                ieee80211-freq-limit = <5000000 6000000>;
                nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_18a 0>;
index 99fc46d351abe1f4e717e64bac5bac72e8ae0d15..a41f0f42bc192fc432f14abc5214bd0dc3314101 100644 (file)
@@ -4,18 +4,9 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
-       compatible = "hiwifi,hc5x61a", "mediatek,mt7628an-soc";
-
-       aliases {
-               label-mac-device = &ethernet;
-               led-boot = &led_system;
-               led-failsafe = &led_system;
-               led-running = &led_system;
-               led-upgrade = &led_system;
-       };
-
        chosen {
                bootargs = "console=ttyS0,115200";
        };
index ff5d3debfd9f89ccf0bb1d5c8f59a86808127348..af7632018a16a04db82be2bcbdf71f192695670a 100644 (file)
@@ -137,10 +137,10 @@ glinet,gl-mt750)
        ;;
 hiwifi,hc5661|\
 hiwifi,hc5761)
-       ucidef_set_led_switch "internet" "internet" "blue:internet" "switch0" "0x01"
+       ucidef_set_led_switch "wan" "WAN" "blue:wan" "switch0" "0x01"
        ;;
 hiwifi,hc5861)
-       ucidef_set_led_switch "internet" "internet" "blue:internet" "switch0" "0x20"
+       ucidef_set_led_switch "wan" "WAN" "blue:wan" "switch0" "0x20"
        ;;
 hnet,c108)
        ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
index ffa64f50f896ac19e41d17f9828e37a52d981694..187821b083f4f149ea0319c44f1915abdd34c65a 100644 (file)
@@ -52,11 +52,11 @@ hilink,hlk-7688a)
        ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt"
        ;;
 hiwifi,hc5611)
-       ucidef_set_led_netdev "internet" "internet" "red:internet" "br-lan" "tx rx"
+       ucidef_set_led_netdev "wan" "WAN" "red:wan" "br-lan" "tx rx"
        ;;
 hiwifi,hc5661a|\
 hiwifi,hc5761a)
-       ucidef_set_led_switch "internet" "internet" "blue:internet" "switch0" "0x10"
+       ucidef_set_led_switch "wan" "WAN" "blue:wan" "switch0" "0x10"
        ;;
 keenetic,kn-1221|\
 keenetic,kn-1613|\