diff mbox series

[OpenWrt-Devel,v5] ramips: add support for Trendnet TEW-810DR

Message ID 20200525235736.GA35779@centurylink.net
State Superseded
Headers show
Series [OpenWrt-Devel,v5] ramips: add support for Trendnet TEW-810DR | expand

Commit Message

Heppler, J. Scott May 25, 2020, 11:57 p.m. UTC
* MediaTek MT7620A (580 Mhz)
* 8 MB of FLASH
* 64 MB of RAM
* 2.4Ghz and 5.0Ghz radios both now functional
* 5x 10/100 Mbps Ethernet (1 WAN and 4 LAN)
* UART header on PCB (57600 8n1)
* Green/Orange Power LEDs illuminating a Power-Button Lens
   Green/Orange Internet LEDs GPIO controlled illuminating a Globe/Internet Lens
* 3x button - wps, power and reset
* U-boot bootloader

Installation:

The sysupgrade.bin image is reported to be OEM web flashed with an ncc_att_hwid
appended.  ncc_att_hwid is a 32bit binary 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-810dr-squashfs-factory.bin -a -m "TEW-810DR" -H "1.0R" -r "WW" -c "1.0"
This may need to be altered if your hardware version is "1.1R".
The image can also be directly flashed via serial tftp.
1.  Load *.sysupgrade.bin to your tftp server directory and rename for
convenience.
2.  Set a static ip 192.168.10.100.
3.  NIC cable to a lan port.
4.  Serial connection parameters 57600,8N1
5.  Power on the TEW-810 and press 4 for a u-boot command line prompt.
6.  Verify IP's with U-Boot command "printenv".
7.  Adjust tftp settings if needed per the tftp documentation
8.  Boot the tftp image to test the build.
9.  If the image loads, reset your server ip to 192.168.1.10 and restart network.
10. Log in to Luci, 192.168.1.1, and flash the *sysupgrade.bin image.

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

Summary v4 -> v5
1.  Enumerated installation steps and corrected grammar.
2.  Added SPDX License Identifier to *.dts.
3.  gpio-keys-polled -> gpio-keys in *.dts.
4.  gpio2 0 is actually behind a Globe/Internet lens - changed to wan.
5.  Increased spi-max-frequency 10000000 -> 50000000
6.  jffs2 partition 0xe0000 -> 0xf0000.
7.  &state_default groups; dropped mdio, rgmii1, wled.
8.  MAC assignments mirror DIR-810L code and verify in Luci.  Unchanged
02_network and *.dts.
9.  01_leds changed consistent with #4.
10. Removed SUPPORTED_DEVICES from image/mt7620.mk.  Note: the D-Link
DIR-810L has the same SUPPORTED_DEVICES entry in image/mt7620.mk.
11. Builds/Runs on my test Device.
---
  .../ramips/dts/mt7620a_trendnet_tew-810dr.dts | 166 ++++++++++++++++++
  target/linux/ramips/image/mt7620.mk           |   9 +
  .../mt7620/base-files/etc/board.d/01_leds     |   3 +
  .../mt7620/base-files/etc/board.d/02_network  |   8 +-
  4 files changed, 183 insertions(+), 3 deletions(-)
  create mode 100644 target/linux/ramips/dts/mt7620a_trendnet_tew-810dr.dts

Comments

Daniel Golle May 26, 2020, 12:05 a.m. UTC | #1
On Mon, May 25, 2020 at 04:57:36PM -0700, Heppler, J. Scott wrote:
> 
> * MediaTek MT7620A (580 Mhz)
> * 8 MB of FLASH
> * 64 MB of RAM
> * 2.4Ghz and 5.0Ghz radios both now functional
> * 5x 10/100 Mbps Ethernet (1 WAN and 4 LAN)
> * UART header on PCB (57600 8n1)
> * Green/Orange Power LEDs illuminating a Power-Button Lens
>   Green/Orange Internet LEDs GPIO controlled illuminating a Globe/Internet Lens
> * 3x button - wps, power and reset
> * U-boot bootloader
> 
> Installation:
> 
> The sysupgrade.bin image is reported to be OEM web flashed with an ncc_att_hwid
> appended.  ncc_att_hwid is a 32bit binary 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-810dr-squashfs-factory.bin -a -m "TEW-810DR" -H "1.0R" -r "WW" -c "1.0"
> This may need to be altered if your hardware version is "1.1R".
> The image can also be directly flashed via serial tftp.
> 1.  Load *.sysupgrade.bin to your tftp server directory and rename for
> convenience.
> 2.  Set a static ip 192.168.10.100.
> 3.  NIC cable to a lan port.
> 4.  Serial connection parameters 57600,8N1
> 5.  Power on the TEW-810 and press 4 for a u-boot command line prompt.
> 6.  Verify IP's with U-Boot command "printenv".
> 7.  Adjust tftp settings if needed per the tftp documentation
> 8.  Boot the tftp image to test the build.
> 9.  If the image loads, reset your server ip to 192.168.1.10 and restart network.
> 10. Log in to Luci, 192.168.1.1, and flash the *sysupgrade.bin image.
> 
> Signed-off-by: J. Scott Heppler <shep971@centurylink.net>
> 
> Summary v4 -> v5
> 1.  Enumerated installation steps and corrected grammar.
> 2.  Added SPDX License Identifier to *.dts.
> 3.  gpio-keys-polled -> gpio-keys in *.dts.
> 4.  gpio2 0 is actually behind a Globe/Internet lens - changed to wan.
> 5.  Increased spi-max-frequency 10000000 -> 50000000
> 6.  jffs2 partition 0xe0000 -> 0xf0000.
> 7.  &state_default groups; dropped mdio, rgmii1, wled.
> 8.  MAC assignments mirror DIR-810L code and verify in Luci.  Unchanged
> 02_network and *.dts.
> 9.  01_leds changed consistent with #4.
> 10. Removed SUPPORTED_DEVICES from image/mt7620.mk.  Note: the D-Link
> DIR-810L has the same SUPPORTED_DEVICES entry in image/mt7620.mk.
> 11. Builds/Runs on my test Device.
> ---
>  .../ramips/dts/mt7620a_trendnet_tew-810dr.dts | 166 ++++++++++++++++++
>  target/linux/ramips/image/mt7620.mk           |   9 +
>  .../mt7620/base-files/etc/board.d/01_leds     |   3 +
>  .../mt7620/base-files/etc/board.d/02_network  |   8 +-
>  4 files changed, 183 insertions(+), 3 deletions(-)
>  create mode 100644 target/linux/ramips/dts/mt7620a_trendnet_tew-810dr.dts
> 
> diff --git a/target/linux/ramips/dts/mt7620a_trendnet_tew-810dr.dts b/target/linux/ramips/dts/mt7620a_trendnet_tew-810dr.dts
> new file mode 100644
> index 0000000000..5012d39b51
> --- /dev/null
> +++ b/target/linux/ramips/dts/mt7620a_trendnet_tew-810dr.dts
> @@ -0,0 +1,166 @@
> +//SPDX-License-Identifier: GPL-2.0-or-later OR MIT
> +/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;
> +		label-mac-device = &ethernet;
> +	};
> +
> +	keys {
> +		compatible = "gpio-keys";
> +
> +		reset {
> +			label = "reset";
> +			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
> +			linux,code = <KEY_RESTART>;
> +		};
> +
> +		wps {
> +			label = "wps";
> +			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
> +			linux,code = <KEY_WPS_BUTTON>;
> +		};
> +	};
> +
> +	leds {
> +		compatible = "gpio-leds";
> +
> +		led_power_green: power_green {
> +			label = "tew-810dr:green:power";
> +			gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
> +		};
> +
> +		wan_orange: wan_orange {
> +			label = "tew-810dr:orange:wan";
> +			gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
> +		};
> +
> +		wan_green: wan_green {
> +			label = "tew-810dr:green:wan";
> +			gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		led_power_orange {
> +			label = "tew-810dr:orange:power";
> +			gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
> +		};
> +	};
> +};
> +
> +&spi0 {
> +	status = "okay";
> +

What kind of chip is doing 5GHz wifi? Are you sure you don't need to
define EEPROM and/or mac-adress from MTD in the device-tree as well?

The patch was cut here misses the other files, only the DTS was
partially sent :(


Cheers


Daniel
diff mbox series

Patch

diff --git a/target/linux/ramips/dts/mt7620a_trendnet_tew-810dr.dts b/target/linux/ramips/dts/mt7620a_trendnet_tew-810dr.dts
new file mode 100644
index 0000000000..5012d39b51
--- /dev/null
+++ b/target/linux/ramips/dts/mt7620a_trendnet_tew-810dr.dts
@@ -0,0 +1,166 @@ 
+//SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/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;
+		label-mac-device = &ethernet;
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power_green: power_green {
+			label = "tew-810dr:green:power";
+			gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
+		};
+
+		wan_orange: wan_orange {
+			label = "tew-810dr:orange:wan";
+			gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
+		};
+
+		wan_green: wan_green {
+			label = "tew-810dr:green:wan";
+			gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
+		};
+
+		led_power_orange {
+			label = "tew-810dr:orange:power";
+			gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&spi0 {
+	status = "okay";
+



-- 
J. Scott Heppler

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