mediatek: filogic: fix for new GL.iNet GL-MT2500/GL-MT2500A hardware revision
authorMatthew Bilker <[email protected]>
Wed, 14 May 2025 04:12:53 +0000 (00:12 -0400)
committerHauke Mehrtens <[email protected]>
Tue, 3 Jun 2025 21:19:35 +0000 (23:19 +0200)
GL.iNet shipped a hardware change of the WAN PHY going from the MaxLinear
GPY211C to the Airoha EN8811H.

Signed-off-by: Matthew Bilker <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/18799
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500-v1.dts [new file with mode: 0644]
target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500-v2.dts [new file with mode: 0644]
target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts [deleted file]
target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dtsi [new file with mode: 0644]
target/linux/mediatek/image/filogic.mk

diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500-v1.dts b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500-v1.dts
new file mode 100644 (file)
index 0000000..fc7524c
--- /dev/null
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+#include "mt7981b-glinet-gl-mt2500.dtsi"
+
+&gmac0 {
+       phy-handle = <&phy5>;
+};
+
+&mdio_bus {
+       phy5: ethernet-phy@5 {
+               reg = <5>;
+               compatible = "ethernet-phy-ieee802.3-c45";
+       };
+};
diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500-v2.dts b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500-v2.dts
new file mode 100644 (file)
index 0000000..6f6c114
--- /dev/null
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+#include "mt7981b-glinet-gl-mt2500.dtsi"
+
+&gmac0 {
+       phy-handle = <&phy13>;
+};
+
+&mdio_bus {
+       phy13: ethernet-phy@13 {
+               reg = <13>;
+               compatible = "ethernet-phy-ieee802.3-c45";
+       };
+};
diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts
deleted file mode 100644 (file)
index bd0e039..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0 OR MIT)
-
-/dts-v1/;
-#include "mt7981b.dtsi"
-
-/ {
-       model = "GL.iNet GL-MT2500";
-       compatible = "glinet,gl-mt2500", "mediatek,mt7981";
-
-       aliases {
-               label-mac-device = &gmac0;
-               led-boot = &led_sys_white;
-               led-failsafe = &led_sys_blue;
-               led-running = &led_sys_white;
-               led-upgrade = &led_sys_blue;
-               serial0 = &uart0;
-       };
-
-       chosen {
-               stdout-path = "serial0:115200n8";
-               bootargs-append = " root=PARTLABEL=rootfs rootwait";
-       };
-
-       gpio-keys {
-               compatible = "gpio-keys";
-
-               reset {
-                       label = "reset";
-                       linux,code = <KEY_RESTART>;
-                       gpios = <&pio 1 GPIO_ACTIVE_LOW>;
-               };
-       };
-
-       leds {
-               compatible = "gpio-leds";
-
-               led-vpn {
-                       label = "white:vpn";
-                       gpios = <&pio 31 GPIO_ACTIVE_LOW>;
-               };
-
-               led_sys_white: led-system-white {
-                       label = "white:system";
-                       gpios = <&pio 30 GPIO_ACTIVE_LOW>;
-               };
-
-               led_sys_blue: led-system-blue {
-                       label = "blue:system";
-                       gpios = <&pio 29 GPIO_ACTIVE_LOW>;
-               };
-       };
-
-       usb_vbus: regulstor-usb {
-               compatible = "regulator-fixed";
-
-               regulator-name = "usb-vbus";
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-
-               gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
-               enable-active-high;
-               regulator-boot-on;
-       };
-
-       reg_3p3v: regulator-3p3v {
-               compatible = "regulator-fixed";
-               regulator-name = "fixed-3.3V";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-               regulator-boot-on;
-               regulator-always-on;
-       };
-};
-
-&pio {
-       mmc0_pins_default: mmc0-pins-default {
-               mux {
-                       function = "flash";
-                       groups = "emmc_45";
-               };
-       };
-       mmc0_pins_uhs: mmc0-pins-uhs {
-               mux {
-                       function = "flash";
-                       groups = "emmc_45";
-               };
-       };
-};
-
-&uart0 {
-       status = "okay";
-};
-
-&watchdog {
-       status = "okay";
-};
-
-&eth {
-       status = "okay";
-
-       pinctrl-names = "default";
-       pinctrl-0 = <&mdio_pins>;
-
-       gmac0: mac@0 {
-               compatible = "mediatek,eth-mac";
-               nvmem-cells = <&macaddr_boot1_a 0>;
-               nvmem-cell-names = "mac-address";
-               reg = <0>;
-
-               phy-mode = "2500base-x";
-               phy-handle = <&phy5>;
-       };
-
-       gmac1: mac@1 {
-               compatible = "mediatek,eth-mac";
-               nvmem-cells = <&macaddr_boot1_a 1>;
-               nvmem-cell-names = "mac-address";
-               reg = <1>;
-               phy-mode = "gmii";
-               phy-handle = <&int_gbe_phy>;
-       };
-};
-
-&mdio_bus {
-       reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>;
-       reset-delay-us = <600>;
-       reset-post-delay-us = <20000>;
-
-       phy5: ethernet-phy@5 {
-               reg = <5>;
-               compatible = "ethernet-phy-ieee802.3-c45";
-       };
-};
-
-&usb_phy {
-       status = "okay";
-};
-
-&xhci {
-       status = "okay";
-       vbus-supply = <&usb_vbus>;
-};
-
-&mmc0 {
-       status = "okay";
-
-       #address-cells = <1>;
-       #size-cells = <0>;
-       pinctrl-names = "default", "state_uhs";
-       pinctrl-0 = <&mmc0_pins_default>;
-       pinctrl-1 = <&mmc0_pins_uhs>;
-       bus-width = <8>;
-       max-frequency = <52000000>;
-       vmmc-supply = <&reg_3p3v>;
-       cap-mmc-highspeed;
-       non-removable;
-
-       card@0 {
-               compatible = "mmc-card";
-               reg = <0>;
-
-               block {
-                       compatible = "block-device";
-
-                       partitions {
-                               block-partition-u-boot-env {
-                                       partname = "u-boot-env";
-
-                                       nvmem-layout {
-                                               compatible = "u-boot,env";
-                                       };
-                               };
-                       };
-               };
-
-               boot1 {
-                       compatible = "block-device";
-
-                       nvmem-layout {
-                               compatible = "fixed-layout";
-                               #address-cells = <1>;
-                               #size-cells = <1>;
-
-                               macaddr_boot1_a: macaddr@a {
-                                       compatible = "mac-base";
-                                       reg = <0xa 0x6>;
-                                       #nvmem-cell-cells = <1>;
-                               };
-
-                               ddns@10 {
-                                       reg = <0x10 0x10>;
-                               };
-
-                               sn-bak@20 {
-                                       reg = <0x20 0x10>;
-                               };
-
-                               sn@30 {
-                                       reg = <0x30 0x10>;
-                               };
-
-                               country-code@88 {
-                                       reg = <0x88 0x10>;
-                               };
-                       };
-               };
-       };
-};
diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dtsi b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dtsi
new file mode 100644 (file)
index 0000000..1132ef8
--- /dev/null
@@ -0,0 +1,202 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+#include "mt7981b.dtsi"
+
+/ {
+       model = "GL.iNet GL-MT2500";
+       compatible = "glinet,gl-mt2500", "mediatek,mt7981";
+
+       aliases {
+               label-mac-device = &gmac0;
+               led-boot = &led_sys_white;
+               led-failsafe = &led_sys_blue;
+               led-running = &led_sys_white;
+               led-upgrade = &led_sys_blue;
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+               bootargs-append = " root=PARTLABEL=rootfs rootwait";
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               reset {
+                       label = "reset";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               led-vpn {
+                       label = "white:vpn";
+                       gpios = <&pio 31 GPIO_ACTIVE_LOW>;
+               };
+
+               led_sys_white: led-system-white {
+                       label = "white:system";
+                       gpios = <&pio 30 GPIO_ACTIVE_LOW>;
+               };
+
+               led_sys_blue: led-system-blue {
+                       label = "blue:system";
+                       gpios = <&pio 29 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       usb_vbus: regulstor-usb {
+               compatible = "regulator-fixed";
+
+               regulator-name = "usb-vbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+
+               gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               regulator-boot-on;
+       };
+
+       reg_3p3v: regulator-3p3v {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-3.3V";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+};
+
+&pio {
+       mmc0_pins_default: mmc0-pins-default {
+               mux {
+                       function = "flash";
+                       groups = "emmc_45";
+               };
+       };
+       mmc0_pins_uhs: mmc0-pins-uhs {
+               mux {
+                       function = "flash";
+                       groups = "emmc_45";
+               };
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&watchdog {
+       status = "okay";
+};
+
+&eth {
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&mdio_pins>;
+
+       gmac0: mac@0 {
+               compatible = "mediatek,eth-mac";
+               nvmem-cells = <&macaddr_boot1_a 0>;
+               nvmem-cell-names = "mac-address";
+               reg = <0>;
+
+               phy-mode = "2500base-x";
+       };
+
+       gmac1: mac@1 {
+               compatible = "mediatek,eth-mac";
+               nvmem-cells = <&macaddr_boot1_a 1>;
+               nvmem-cell-names = "mac-address";
+               reg = <1>;
+               phy-mode = "gmii";
+               phy-handle = <&int_gbe_phy>;
+       };
+};
+
+&mdio_bus {
+       reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>;
+       reset-delay-us = <600>;
+       reset-post-delay-us = <20000>;
+};
+
+&usb_phy {
+       status = "okay";
+};
+
+&xhci {
+       status = "okay";
+       vbus-supply = <&usb_vbus>;
+};
+
+&mmc0 {
+       status = "okay";
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+       pinctrl-names = "default", "state_uhs";
+       pinctrl-0 = <&mmc0_pins_default>;
+       pinctrl-1 = <&mmc0_pins_uhs>;
+       bus-width = <8>;
+       max-frequency = <52000000>;
+       vmmc-supply = <&reg_3p3v>;
+       cap-mmc-highspeed;
+       non-removable;
+
+       card@0 {
+               compatible = "mmc-card";
+               reg = <0>;
+
+               block {
+                       compatible = "block-device";
+
+                       partitions {
+                               block-partition-u-boot-env {
+                                       partname = "u-boot-env";
+
+                                       nvmem-layout {
+                                               compatible = "u-boot,env";
+                                       };
+                               };
+                       };
+               };
+
+               boot1 {
+                       compatible = "block-device";
+
+                       nvmem-layout {
+                               compatible = "fixed-layout";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               macaddr_boot1_a: macaddr@a {
+                                       compatible = "mac-base";
+                                       reg = <0xa 0x6>;
+                                       #nvmem-cell-cells = <1>;
+                               };
+
+                               ddns@10 {
+                                       reg = <0x10 0x10>;
+                               };
+
+                               sn-bak@20 {
+                                       reg = <0x20 0x10>;
+                               };
+
+                               sn@30 {
+                                       reg = <0x30 0x10>;
+                               };
+
+                               country-code@88 {
+                                       reg = <0x88 0x10>;
+                               };
+                       };
+               };
+       };
+};
index 8b18e252a19c2600505dd0a816982167c70d8261..93ba917d3a465219ff49c1a3a63145e9f422441a 100644 (file)
@@ -927,16 +927,31 @@ TARGET_DEVICES += gatonetworks_gdsp
 define Device/glinet_gl-mt2500
   DEVICE_VENDOR := GL.iNet
   DEVICE_MODEL := GL-MT2500
-  DEVICE_DTS := mt7981b-glinet-gl-mt2500
+  DEVICE_VARIANT := MaxLinear PHY
+  DEVICE_DTS := mt7981b-glinet-gl-mt2500-v1
   DEVICE_DTS_DIR := ../dts
   DEVICE_DTS_LOADADDR := 0x47000000
   DEVICE_PACKAGES := -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3
-  SUPPORTED_DEVICES += glinet,mt2500-emmc
+  SUPPORTED_DEVICES += glinet,mt2500-emmc glinet,gl-mt2500-airoha
   IMAGES := sysupgrade.bin
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
 endef
 TARGET_DEVICES += glinet_gl-mt2500
 
+define Device/glinet_gl-mt2500-airoha
+  DEVICE_VENDOR := GL.iNet
+  DEVICE_MODEL := GL-MT2500
+  DEVICE_VARIANT := Airoha PHY
+  DEVICE_DTS := mt7981b-glinet-gl-mt2500-v2
+  DEVICE_DTS_DIR := ../dts
+  DEVICE_DTS_LOADADDR := 0x47000000
+  DEVICE_PACKAGES := -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3 kmod-phy-airoha-en8811h airoha-en8811h-firmware
+  SUPPORTED_DEVICES += glinet,mt2500-emmc glinet,gl-mt2500
+  IMAGES := sysupgrade.bin
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
+endef
+TARGET_DEVICES += glinet_gl-mt2500-airoha
+
 define Device/glinet_gl-mt3000
   DEVICE_VENDOR := GL.iNet
   DEVICE_MODEL := GL-MT3000