diff mbox series

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

Message ID 20200226033744.GA28953@centurylink.net
State Superseded
Headers show
Series [OpenWrt-Devel] ramips: add TRENDnet TEW-810DR support -corrected | expand

Commit Message

Heppler, J. Scott Feb. 26, 2020, 3:37 a.m. UTC
Signed-off-by: J. Scott Heppler <shep971@centurylink.net>

ramips: add support for TRENDnet TEW-810DR

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

Specification:

 * MediaTek MT7620A (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 for either the TEW-810DR or DIR-810L and is located at
source/user/wolf/cameo/ncc/hostTools
The invocation is:
ncc_att_hwid -f tew-810-squashfs-factory.bin -a -m “TEW-810DR”
 -H “1.0R” -r “WW” -c “1.0”
More information is available in the device page for TEW-810DR.
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

Comments

Adrian Schmutzler Feb. 26, 2020, 1:07 p.m. UTC | #1
Hi,

> --- 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"
>  		;;

This tells me that you built your patch based on an outdated OpenWrt version, as this file has been removed a few months ago.

Please base your patch on latest master an submit again.

BTW: the expected way to send "updated" patches via the list is to add a version to them; so this would have been "v2" then. You can do this automatically with the "-v" parameter:

git format-patch -v2 ...

> 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

If this is a clone of another device (as you say), please create a DTSI file for the shared parts.

Best

Adrian
diff mbox series

Patch

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@0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <10000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "u-boot";
+				reg = <0x0 0x30000>;
+				read-only;
+			};
+
+			partition@30000 {
+				label = "u-boot-env";
+				reg = <0x30000 0x10000>;
+				read-only;
+			};
+
+			factory: partition@40000 {
+				label = "factory";
+				reg = <0x40000 0x10000>;
+				read-only;
+			};
+
+			factory5g: partition@50000 {
+				label = "factory5g";
+				reg = <0x50000 0x10000>;
+				read-only;
+			};
+
+			partition@60000 {
+				label = "Wolf_Config";
+				reg = <0x60000 0x10000>;
+				read-only;
+			};
+
+			partition@70000 {
+				label = "MyDlink";
+				reg = <0x70000 0x80000>;
+				read-only;
+			};
+
+			partition@e0000 {
+				label = "Jffs2";
+				reg = <0xe0000 0x80000>;
+				read-only;
+			};
+
+			partition@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@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)