[OpenWrt-Devel] [PATCH] ramips: add TRENDnet TEW-810DR support

Heppler, J. Scott shep971 at centurylink.net
Tue Feb 25 20:09:42 EST 2020


Signed-off-by: J. Scott Heppler <shep971 at centurylink.net>

ramips: add support for TRENDnet TEW-810DR

Exact hardware clone for the D-Link DIR-810L.

Specification:

  * MediaTek MT7620N (580 Mhz)
  * 8 MB of FLASH
  * 64 MB of RAM
  * 5x 10/100 Mbps Ethernet (1 WAN and 4 LAN)
  * UART header on PCB (57600 8n1)
  * 2x BiColor LED (GPIO-controlled)
  * 2x button - power and reset
  * U-boot bootloader

Installation:

The sysupgrade.bin image needs to have a cameo hardware ID appended
with ncc_att_hwid.  ncc_att_hwid is available in the GPL Source
download in either the TEW-810DR or DIR-810L and is located at
source/user/wolf/cameo/ncc/hostTools
The appended image can then be flash via the Web rescue interface
192.168.10.1 or TFTP's to the same IP address.  Subsequent upgrades
can be done using the Luci web interface or the ssh command line per the
OpenWRT documentation.

---
 .../ramips/base-files/etc/board.d/02_network  |   1 +
 target/linux/ramips/base-files/lib/ramips.sh  |   3 +
 target/linux/ramips/dts/TEW-810DR.dts         | 159 ++++++++++++++++++
 target/linux/ramips/image/mt7620.mk           |   8 +
 4 files changed, 171 insertions(+)
 create mode 100644 target/linux/ramips/dts/TEW-810DR.dts

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 f743ce851a..a692ef6ea4 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -116,6 +116,7 @@ ramips_setup_interfaces()
 	sap-g3200u3|\
 	sk-wb8|\
 	telco-electronics,x1|\
+	tew-810dr|\
 	totolink,lr1200|\
 	unielec,u7621-06-256m-16m|\
 	unielec,u7621-06-512m-64m|\
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 093303892c..3ce42421ee 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -478,6 +478,9 @@ ramips_board_detect() {
 	*"TEW-714TRU")
 		name="tew-714tru"
 		;;
+	*"TEW-810DR")
+                name="tew-810dr"
+                ;;
 	*"Timecloud")
 		name="timecloud"
 		;;
diff --git a/target/linux/ramips/dts/TEW-810DR.dts b/target/linux/ramips/dts/TEW-810DR.dts
new file mode 100644
index 0000000000..6be20c1dda
--- /dev/null
+++ b/target/linux/ramips/dts/TEW-810DR.dts
@@ -0,0 +1,159 @@
+/dts-v1/;
+
+#include "mt7620a.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "trendnet,tew-810dr", "ralink,mt7620a-soc";
+	model = "TRENDnet TEW-810DR";
+
+	aliases {
+		led-boot = &led_power_green;
+		led-failsafe = &led_power_green;
+		led-running = &led_power_green;
+		led-upgrade = &led_power_green;
+	};
+
+	keys {
+		compatible = "gpio-keys-polled";
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+			linux,code = <BTN_0>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
+			linux,code = <BTN_0>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power_green: power {
+			label = "tew-810dr:green:power";
+			gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
+		};
+
+		wan {
+			label = "tew-810dr:orange:wan";
+			gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
+		};
+
+		power2 {
+			label = "tew-810dr:orange:power";
+			gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	m25p80 at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <10000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0 0x30000>;
+				read-only;
+			};
+
+			partition at 30000 {
+				label = "u-boot-env";
+				reg = <0x30000 0x10000>;
+				read-only;
+			};
+
+			factory: partition at 40000 {
+				label = "factory";
+				reg = <0x40000 0x10000>;
+				read-only;
+			};
+
+			factory5g: partition at 50000 {
+				label = "factory5g";
+				reg = <0x50000 0x10000>;
+				read-only;
+			};
+
+			partition at 60000 {
+				label = "Wolf_Config";
+				reg = <0x60000 0x10000>;
+				read-only;
+			};
+
+			partition at 70000 {
+				label = "MyDlink";
+				reg = <0x70000 0x80000>;
+				read-only;
+			};
+
+			partition at e0000 {
+				label = "Jffs2";
+				reg = <0xe0000 0x80000>;
+				read-only;
+			};
+
+			partition at 170000 {
+				compatible = "denx,uimage";
+				label = "firmware";
+				reg = <0x170000 0x690000>;
+			};
+		};
+	};
+};
+
+&pinctrl {
+	state_default: pinctrl0 {
+		gpio {
+			ralink,group = "mdio", "rgmii1", "i2c", "wled", "uartf";
+			ralink,function = "gpio";
+		};
+	};
+};
+
+&ethernet {
+	mtd-mac-address = <&factory 0x28>;
+	mediatek,portmap = "llllw";
+};
+
+&gsw {
+	mediatek,port4 = "ephy";
+	pinctrl-names = "default";
+	pinctrl-0 = <&ephy_pins>;
+};
+
+&pcie {
+	status = "okay";
+};
+
+&wmac {
+	ralink,mtd-eeprom = <&factory 0x0>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pa_pins>;
+	mtd-mac-address = <&factory 0x28>;
+};
+
+&pcie0 {
+	wifi at 0,0 {
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x8000>;
+		ieee80211-freq-limit = <5000000 6000000>;
+		mtd-mac-address = <&factory 0x28>;
+		mtd-mac-address-increment = <2>;
+	};
+};
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index fff10425a7..0bc6111946 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -651,6 +651,14 @@ define Device/tplink_c20-v1
 endef
 TARGET_DEVICES += tplink_c20-v1
 
+define Device/tew-810dr
+  DTS := TEW-810DR
+  DEVICE_PACKAGES := kmod-mt76x0e
+  DEVICE_TITLE := TRENDnet TEW-810DR
+  IMAGE_SIZE := 6720k
+endef
+TARGET_DEVICES += tew-810dr
+
 define Device/vonets_var11n-300
   DTS := VAR11N-300
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
-- 
2.20.1


-- 
J. Scott Heppler

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list