@@ -77,6 +77,7 @@ xiaomi,redmi-router-ax6000-ubootmod)
glinet,gl-mt3000)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"
;;
+glinet,gl-mt2500|\
glinet,gl-mt6000)
local envdev=$(find_mmc_part "u-boot-env")
ubootenv_add_uci_config "$envdev" "0x0" "0x80000"
new file mode 100644
@@ -0,0 +1,149 @@
+/dts-v1/;
+#include "mt7981.dtsi"
+/ {
+ model = "GL.iNet GL-MT2500";
+ compatible = "glinet,gl-mt2500", "mediatek,mt7981";
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ bootargs-append = " root=PARTLABEL=rootfs rootwait";
+ };
+
+ aliases {
+ led-boot = &led_blue;
+ led-failsafe = &led_blue;
+ led-running = &led_white;
+ led-upgrade = &led_blue;
+ serial0 = &uart0;
+ };
+
+ 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;
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ reset {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ gpio-export {
+ compatible = "gpio-export";
+
+ usb_power {
+ gpio-export,name = "usb_power";
+ gpio-export,output = <1>;
+ gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led@0 {
+ label = "vpn";
+ gpios = <&pio 31 GPIO_ACTIVE_LOW>;
+ };
+
+ led_white: led@1 {
+ label = "white:system";
+ gpios = <&pio 30 GPIO_ACTIVE_LOW>;
+ };
+
+ led_blue: led@2 {
+ label = "blue:system";
+ gpios = <&pio 29 GPIO_ACTIVE_LOW>;
+ default-state = "on";
+ };
+ };
+};
+
+&uart0 {
+ status = "okay";
+};
+
+&watchdog {
+ status = "okay";
+};
+
+&mmc0 {
+ pinctrl-names = "default", "state_uhs";
+ pinctrl-0 = <&mmc0_pins_default>;
+ pinctrl-1 = <&mmc0_pins_uhs>;
+ bus-width = <8>;
+ max-frequency = <52000000>;
+ cap-mmc-highspeed;
+ vmmc-supply = <®_3p3v>;
+ non-removable;
+ status = "okay";
+ #address-cells = <1>;
+ #size-cells = <0>;
+};
+
+ð {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mdio_pins>;
+
+ status = "okay";
+
+ gmac0: mac@0 {
+ compatible = "mediatek,eth-mac";
+ reg = <0>;
+ phy-mode = "2500base-x";
+ phy-handle = <&phy0>;
+ };
+
+ gmac1: mac@1 {
+ compatible = "mediatek,eth-mac";
+ 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>;
+
+ phy0: ethernet-phy@5 {
+ reg = <5>;
+ compatible = "ethernet-phy-ieee802.3-c45";
+ phy-mode = "2500base-x";
+ };
+};
+
+&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";
+ };
+ };
+};
+
+&usb_phy {
+ status = "okay";
+};
+
+&xhci {
+ mediatek,u3p-dis-msk = <0x0>;
+ phys = <&u2port0 PHY_TYPE_USB2>,
+ <&u3port0 PHY_TYPE_USB3>;
+ status = "okay";
+};
@@ -32,6 +32,7 @@ mediatek_setup_interfaces()
h3c,magic-nx30-pro)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1
;;
+ glinet,gl-mt2500|\
glinet,gl-mt3000)
ucidef_set_interfaces_lan_wan eth1 eth0
;;
@@ -109,6 +110,11 @@ mediatek_setup_macs()
;;
esac
;;
+ glinet,gl-mt2500)
+ label_mac=$(get_mac_binary /dev/mmcblk0boot1 0xa)
+ wan_mac=$label_mac
+ lan_mac=$(macaddr_add "$label_mac" 1)
+ ;;
glinet,gl-mt6000)
label_mac=$(mmc_get_mac_binary factory 0x0a)
wan_mac=$label_mac
@@ -97,6 +97,7 @@ platform_do_upgrade() {
cudy,wr3000-v1)
default_do_upgrade "$1"
;;
+ glinet,gl-mt2500|\
glinet,gl-mt6000)
CI_KERNPART="kernel"
CI_ROOTPART="rootfs"
@@ -176,6 +177,7 @@ platform_copy_config() {
;;
esac
;;
+ glinet,gl-mt2500|\
glinet,gl-mt6000|\
ubnt,unifi-6-plus)
emmc_copy_config
@@ -274,6 +274,17 @@ define Device/cudy_wr3000-v1
endef
TARGET_DEVICES += cudy_wr3000-v1
+define Device/glinet_gl-mt2500
+ DEVICE_VENDOR := GL.iNet
+ DEVICE_MODEL := GL-MT2500
+ DEVICE_DTS := mt7981b-glinet-gl-mt2500
+ DEVICE_DTS_DIR := ../dts
+ SUPPORTED_DEVICES += glinet,mt2500-emmc
+ DEVICE_PACKAGES := e2fsprogs f2fsck mkf2fs kmod-usb3 -kmod-mt7915e -wpad-basic-mbedtls
+ IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
+endef
+TARGET_DEVICES += glinet_gl-mt2500
+
define Device/glinet_gl-mt3000
DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := GL-MT3000