diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-3040-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-3040-a1.dts new file mode 100644 index 00000000000000..51a440cb832c56 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-3040-a1.dts @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_dlink_dir-xx60-a1.dtsi" + +/ { + compatible = "dlink,dir-3040-a1", "mediatek,mt7621-soc"; + model = "D-Link DIR-3040 A1"; +}; + +&wps { + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; +}; + +&leds { + usb2_white { + label = "white:usb2"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + trigger-sources = <&ehci_port2>; + linux,default-trigger = "usbport"; + }; + + usb3_white { + label = "white:usb3"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + trigger-sources = <&xhci_ehci_port1>; + linux,default-trigger = "usbport"; + }; + + wlan2g { + label = "white:wlan2g"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0radio"; + }; + + wlan5glb { + label = "white:wlan5glb"; + gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1radio"; + }; + + wlan5ghb { + label = "white:wlan5ghb"; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy2radio"; + }; +}; + + +&wifi0 { + mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 1>; + nvmem-cell-names = "eeprom", "mac-address"; + ieee80211-freq-limit = <2400000 6000000>; +}; + +&wifi1 { + mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000 3>; + nvmem-cell-names = "eeprom", "mac-address"; +}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi index 6eb3f3cdd9bf7d..509975c316ef81 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi @@ -14,7 +14,7 @@ led-upgrade = &led_net_orange; }; - keys { + keys: keys { compatible = "gpio-keys"; reset { @@ -23,7 +23,7 @@ linux,code = ; }; - wps { + wps: wps { label = "wps"; gpios = <&gpio 18 GPIO_ACTIVE_LOW>; linux,code = ; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index ab1b829ba0086c..2790c5c2d9f092 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -783,6 +783,13 @@ define Device/dlink_dir-2660-a1 endef TARGET_DEVICES += dlink_dir-2660-a1 +define Device/dlink_dir-3040-a1 + $(Device/dlink_dir-xx60-a1) + DEVICE_MODEL := DIR-3040 + DEVICE_VARIANT := A1 +endef +TARGET_DEVICES += dlink_dir-3040-a1 + define Device/dlink_dir-3060-a1 $(Device/dlink_dir-xx60-a1) DEVICE_MODEL := DIR-3060 diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 1061de6f44443e..d732316f7ed7aa 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -95,6 +95,7 @@ dlink,dir-2640-a1|\ dlink,dir-2660-a1) ucidef_set_led_netdev "wan" "wan" "white:net" "wan" ;; +dlink,dir-3040-a1|\ dlink,dir-3060-a1) ucidef_set_led_netdev "net_white" "WAN Link" "white:net" "wan" "link" ucidef_set_led_netdev "net_orange" "WAN Activity" "orange:net" "wan" "tx rx" diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 40a2fb61dbb9c9..9695e8f858394b 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -68,6 +68,7 @@ platform_do_upgrade() { dlink,dir-1960-a1|\ dlink,dir-2640-a1|\ dlink,dir-2660-a1|\ + dlink,dir-3040-a1|\ dlink,dir-3060-a1|\ dlink,dir-853-a3|\ etisalat,s3|\