openwrt/target/linux/ramips/dts/mt7620a_trendnet_tha103ac.dts
Die Peter Pan 9e78db0229 ramips: mt7620: add support for THA-103AC (Version v1.0R)
Hardware
* Mediatek MT7620A + Mediatek MT7610EN
* 64MB RAM
* 8MB NAND (Winbond 25064FVSIG )

Both 2.4GHZ and 5GHZ are working, it is enabled by default since there is no
physical ethernet port in the device.

All LED's and buttons work.

UART: 57600 8N1 3.3V

Installation
Upload the openwrt-ramips-mt7620-trendnet_tha103ac-initramfs-kernel.bin via
the manufacturer firmware upgrade page on the device.

Upon reboot wait +- 3 mins until the green power LED is not flashing anymore
(do not be tempted to switch the device off while the LED is flashing, unless
you are ready for soldering and TTL) and then press the WPS button to enable
the default OpenWrt Wifi AP, the BLUE wifi LED will start flash.

Then install openwrt-ramips-mt7620-trendnet_tha103ac-squashfs-sysupgrade.bin
via OpenWrt.

The integrated power monitoring and relay do not work in OpenWrt as the PL7223
chip source/documentation is unavailable.

Recovery
Mis-configuration can be dealt with using the RESET button to reset to factory,
worst case scenario will require some serious work and soldering, there's pads
on the PCB for both the UART and ETH0, and I soldered and tested that it does
work.

You will have to power the board using the header pins GND & 5V, see the 8-pin
header socket.

Signed-off-by: Die Peter Pan <diepeterpan@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17114
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-13 15:29:04 +01:00

202 lines
3.7 KiB
Plaintext

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
compatible = "trendnet,tha103ac", "ralink,mt7620a-soc";
model = "TRENDNET THA-103AC (EU)";
aliases {
label-mac-device = &ethernet;
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};
keys: keys {
compatible = "gpio-keys";
button_reset {
label = "reset";
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
/* wps button reassigned to rfkill */
button_rfkill {
label = "wifi on/off";
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RFKILL>;
};
};
leds {
compatible = "gpio-leds";
led-0 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WPS;
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
};
led_power: led-1 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_POWER;
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
default-state = "on";
};
led-2 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WLAN;
gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
};
led-3 {
color = <LED_COLOR_ID_BLUE>;
/* LED_FUNCTION_RSSILOW isn't implemented yet */
function = "rssilow";
gpios = <&gpio2 16 GPIO_ACTIVE_LOW>;
};
led-4 {
color = <LED_COLOR_ID_BLUE>;
/* LED_FUNCTION_RSSIMEDLOW isn't implemented yet */
function = "rssimedlow";
gpios = <&gpio2 17 GPIO_ACTIVE_LOW>;
};
led-5 {
color = <LED_COLOR_ID_BLUE>;
/* LED_FUNCTION_RSSIMEDIUM isn't implemented yet */
function = "rssimedium";
gpios = <&gpio2 18 GPIO_ACTIVE_LOW>;
};
led-6 {
color = <LED_COLOR_ID_BLUE>;
/* LED_FUNCTION_RSSIHIGH isn't implemented yet */
function = "rssihigh";
gpios = <&gpio2 19 GPIO_ACTIVE_LOW>;
};
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <50000000>;
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;
};
partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
eeprom_factory_0: eeprom@0 {
reg = <0x0 0x200>;
};
eeprom_factory_8000: eeprom@8000 {
reg = <0x8000 0x200>;
};
macaddr_factory_4: macaddr@4 {
compatible = "mac-base";
reg = <0x4 0x6>;
#nvmem-cell-cells = <1>;
};
macaddr_factory_28: macaddr@28 {
compatible = "mac-base";
reg = <0x28 0x6>;
#nvmem-cell-cells = <1>;
};
macaddr_factory_8004: macaddr@8004 {
compatible = "mac-base";
reg = <0x8004 0x6>;
#nvmem-cell-cells = <1>;
};
};
};
partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0x7b0000>;
};
};
};
};
&state_default {
gpio {
groups = "i2c", "uartf", "ephy";
function = "gpio";
};
};
&ethernet {
nvmem-cells = <&macaddr_factory_28 0>;
nvmem-cell-names = "mac-address";
mediatek,portmap = "wl";
};
&gpio1 {
status = "okay";
};
&gpio2 {
status = "okay";
};
&wmac {
nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4 0>;
nvmem-cell-names = "eeprom", "mac-address";
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
reg = <0x0000 0 0 0 0>;
ieee80211-freq-limit = <5000000 6000000>;
nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_8004 0>;
nvmem-cell-names = "eeprom", "mac-address";
};
};