ramips: some minor FDT improvements for HiWiFi devices

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>
This commit is contained in:
Shiji Yang 2025-03-15 10:00:10 +08:00 committed by Hauke Mehrtens
parent 9e08350b10
commit dd0476aca0
12 changed files with 169 additions and 89 deletions

View 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";
};

View 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";

View 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>;
};
};
@ -94,7 +101,7 @@
&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";

View 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";
};

View file

@ -10,10 +10,10 @@
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 {
@ -23,14 +23,15 @@
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;
};
@ -143,7 +144,8 @@
};
&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";
@ -152,7 +154,8 @@
};
&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";

View 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>;
};
};

View 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";
};

View 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";
};
@ -43,6 +55,11 @@
};
};
&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";

View 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";
@ -35,12 +50,17 @@
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>;

View 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";
};

View 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"

View 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|\