From: Simon Quigley Date: Thu, 20 Dec 2018 16:47:52 +0000 (-0500) Subject: ramips: add support for DLINK DWR-922-E2 X-Git-Tag: v19.07.0-rc1~1727 X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=9f0e2335764674d0324dd90adb3e185cc8befe5f;hp=cb0f39c9cd698f089de8f0cacfbc5cc69655e430;p=openwrt%2Fopenwrt.git ramips: add support for DLINK DWR-922-E2 Very similar to the DWR-921-C1, except has a telephony/RJ11 port (not sure if supported, I didn't try), wireless router with QMI LTE embedded modem is based on the MT7620N SoC. Specification: * MediaTek MT7620N (580 Mhz) * 64 MB of RAM * 16 MB of FLASH * 802.11bgn radio * 5x 10/100 Mbps Ethernet (1 WAN and 4 LAN) * 2x external, detachable (LTE) antennas * UART header on PCB (57600 8n1) * 6x LED (GPIO-controlled) * 1x bi-color Signal Strength LED (GPIO-controlled) * 2x button * JBOOT bootloader The status led has been assigned to the dwr-922-e2:green:signalstrength (lte signal strength) led. At the end of the boot it is switched off and is available for lte operation. Works correctly also during sysupgrade operation. Installation: Apply factory image via d-link http web-gui, or via recovery interface: How to recover/revert to OEM firmware: 1.) Push and hold the reset button and turn on the power. Wait until all LEDs start rapidly blinking (~10sec.) 2.) DHCP should give you an IP in the 192.168.123.0/24 subnet, or set one manually 3.) Upload original factory image via JBOOT http interface at IP 192.168.123.254 4.) If http doesn't work, it can be done with curl command: curl -F FN=@XXXXX.bin http://192.168.123.254/upg where XXXXX.bin is name of firmware file. 5.) You can optionally telnet to 192.168.123.254 before or during the upload and it will report the flashing status, memory address etc. 6.) Once web UI and/or telnet says "Success", power cycle the router, or type "reboot" into the telnet session. Signed-off-by: Simon Quigley [squashed commits, word wrap commit message, rename signal strenght led name to match what is used for the DWR-921-C1 since they share the led configuration, add label referenced in the aliases node] Signed-off-by: Mathias Kresin --- diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds index 2e62073d3f..35a28174cc 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -124,9 +124,12 @@ dlink,dwr-118-a2) ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" set_wifi_led "$boardname:green:wlan2g" "wlan1" ;; -dlink,dwr-921-c1) +dlink,dwr-921-c1|\ +dlink,dwr-922-e2) set_wifi_led "$boardname:green:wifi" ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f" + ucidef_set_led_netdev "signalstrength" "signalstrength" "$boardname:green:sigstrength" "wwan0" "link" + ucidef_set_led_netdev "4g" "4g" "$boardname:green:4g" "wwan0" "tx rx" ;; dir-860l-b1) ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "eth0.2" diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index 797490aed4..f958ac2bd0 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -90,6 +90,7 @@ ramips_setup_interfaces() dir-810l|\ dlink,dwr-116-a1|\ dlink,dwr-921-c1|\ + dlink,dwr-922-e2|\ ew1200|\ firewrt|\ hc5661a|\ @@ -488,6 +489,7 @@ ramips_setup_macs() dlink,dwr-118-a1|\ dlink,dwr-118-a2|\ dlink,dwr-921-c1|\ + dlink,dwr-922-e2|\ lava,lr-25g001) wan_mac=$(jboot_config_read -m -i $(find_mtd_part "config") -o 0xE000) lan_mac=$(macaddr_add "$wan_mac" 1) diff --git a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom index 1d9de2d503..13a4687251 100644 --- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom +++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom @@ -58,6 +58,7 @@ case "$FIRMWARE" in dlink,dwr-118-a1|\ dlink,dwr-118-a2|\ dlink,dwr-921-c1|\ + dlink,dwr-922-e2|\ lava,lr-25g001) wan_mac=$(jboot_config_read -m -i $(find_mtd_part "config") -o 0xE000) wifi_mac=$(macaddr_add "$wan_mac" 1) diff --git a/target/linux/ramips/dts/DWR-922-E2.dts b/target/linux/ramips/dts/DWR-922-E2.dts new file mode 100644 index 0000000000..c2dd26a09d --- /dev/null +++ b/target/linux/ramips/dts/DWR-922-E2.dts @@ -0,0 +1,154 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7620n.dtsi" + +#include +#include + +/ { + compatible = "dlink,dwr-922-e2", "ralink,mt7620n-soc"; + model = "D-Link DWR-922 E2"; + + aliases { + led-boot = &sstrengthg; + led-failsafe = &sstrengthg; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + wps { + label = "wps"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + led-boot = &sstrengthg; + + sms { + label = "dwr-922-e2:green:sms"; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "dwr-922-e2:green:lan"; + gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; + }; + + sstrengthg: sstrengthg { + label = "dwr-922-e2:green:sigstrength"; + gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; + }; + + sstrengthr { + label = "dwr-922-e2:red:sigstrength"; + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; + }; + + 4g { + label = "dwr-922-e2:green:4g"; + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; + }; + + 3g { + label = "dwr-922-e2:green:3g"; + gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; + }; + + wifi { + label = "dwr-922-e2:green:wifi"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + lte_modem_enable { + gpio-export,name = "lte_modem_enable"; + gpio-export,output = <1>; + gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "jboot"; + reg = <0x0 0x10000>; + read-only; + }; + + partition@10000 { + compatible = "amit,jimage"; + label = "firmware"; + reg = <0x10000 0xfe0000>; + }; + + config: partition@ff0000 { + label = "config"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +ðernet { + port@4 { + status = "okay"; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + default { + ralink,group = "spi refclk", "i2c", "ephy", "wled"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 2f733b2ed9..6b65856281 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -228,6 +228,22 @@ define Device/dlink_dwr-921-c3 endef TARGET_DEVICES += dlink_dwr-921-c3 +define Device/dlink_dwr-922-e2 + DTS := DWR-922-E2 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := D-Link DWR-922 E2 + DLINK_ROM_ID := DLK6E2414005 + DLINK_FAMILY_MEMBER := 0x6E24 + DLINK_FIRMWARE_SIZE := 0xFE0000 + KERNEL := $(KERNEL_DTB) + IMAGES += factory.bin + IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata + IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory + DEVICE_PACKAGES := jboot-tools \ + kmod-usb2 kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi +endef +TARGET_DEVICES += dlink_dwr-922-e2 + define Device/e1700 DTS := E1700 IMAGES += factory.bin