Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ramips: add initial support for TP-LINK TL-WR840N v4
This patch adds initial support for wireless router TP-LINK TL-WR840N v4. Specification: - SoC: MediaTek MT7628NN (580MHz) - RAM: 64 MiB (Winbond W9751G6JB-25) - Flash: 8 MiB (GigaDevice GD25Q64CSIG) - LAN: 4x 100M - WAN: 1x 100M - Antennas: 2x non-detachable - LED: 5x green - Buttons: 1x reset Instalation: TP-Link firmware uses recent firmware v3 header, please see https://github.com/xdarklight/mktplinkfw3. Therefore direct upgrade from TP-Link web UI is not supported yet. Upgrade from the TP-Link firmware is possible using common TFTP recovery mode. Rename file lede-ramips-mt7628-tl-wr840n-v4-squashfs-factory.bin to tp_recovery.bin and put it on a TFTP server with IP 192.168.0.66. Hold reset buton when connecting power until TFTP transfer begins. For upgrade from LEDE use generic sysupgrade method. LEDE uses uImage firmware header instead of the TP-Link v3 firmware header. In order to recover the original TP-Link firmware please use TFTP recovery mode. The header has to be removed from the original firmware: dd if=TL-WR840Nv4_0.9.1_3.16_up_boot\(161011\).bin \ bs=512 skip=1 > tp_recovery.bin Currently not working: The only LAN LED indicates activity only on LAN port 2. The LAN LED seems to be hardwired to the internal switch, port 2. Signed-off-by: Vaclav Svoboda <svoboda@neng.cz>
- Loading branch information
1 parent
2f09a1e
commit f9afa6e
Showing
7 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ get_status_led() { | |
nbg-419n2|\ | ||
pwh2004|\ | ||
r6220|\ | ||
tl-wr840n-v4|\ | ||
vr500|\ | ||
wnce2001|\ | ||
wndr3700v5|\ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
/dts-v1/; | ||
|
||
#include <dt-bindings/gpio/gpio.h> | ||
#include <dt-bindings/input/input.h> | ||
|
||
#include "mt7628an.dtsi" | ||
|
||
/ { | ||
compatible = "tplink,tl-wr840n-v4", "mediatek,mt7628an-soc"; | ||
model = "TP-LINK TL-WR840N v4"; | ||
|
||
chosen { | ||
bootargs = "console=ttyS0,115200"; | ||
}; | ||
|
||
memory@0 { | ||
device_type = "memory"; | ||
reg = <0x0 0x4000000>; | ||
}; | ||
|
||
gpio-keys-polled { | ||
compatible = "gpio-keys-polled"; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
poll-interval = <20>; | ||
|
||
reset { | ||
label = "reset"; | ||
gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; | ||
linux,code = <KEY_RESTART>; | ||
}; | ||
}; | ||
|
||
gpio-leds { | ||
compatible = "gpio-leds"; | ||
|
||
power { | ||
label = "tl-wr840n-v4:green:power"; | ||
gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; | ||
}; | ||
|
||
wireless { | ||
label = "tl-wr840n-v4:green:wireless"; | ||
gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; | ||
}; | ||
|
||
ethernet { | ||
label = "tl-wr840n-v4:green:lan"; | ||
gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; | ||
}; | ||
|
||
internet { | ||
label = "tl-wr840n-v4:green:wan"; | ||
gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; | ||
}; | ||
|
||
wps { | ||
label = "tl-wr840n-v4:green:wps"; | ||
gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; | ||
}; | ||
}; | ||
}; | ||
|
||
&pinctrl { | ||
state_default: pinctrl0 { | ||
gpio { | ||
ralink,group = "i2c", "i2s", "uart1", "uart2", "p2led_an" ; | ||
ralink,function = "gpio"; | ||
}; | ||
}; | ||
}; | ||
|
||
&spi0 { | ||
status = "okay"; | ||
|
||
m25p80@0 { | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
compatible = "jedec,spi-nor"; | ||
reg = <0>; | ||
spi-max-frequency = <10000000>; | ||
m25p,chunked-io = <32>; | ||
|
||
partition@0 { | ||
label = "boot"; | ||
reg = <0x0 0x20000>; | ||
read-only; | ||
}; | ||
|
||
partition@20000 { | ||
label = "firmware"; | ||
reg = <0x20000 0x7a0000>; | ||
}; | ||
|
||
partition@7c0000 { | ||
label = "config"; | ||
reg = <0x7c0000 0x10000>; | ||
read-only; | ||
}; | ||
|
||
factory: partition@07d0000 { | ||
label = "romfile"; | ||
reg = <0x7d0000 0x10000>; | ||
read-only; | ||
}; | ||
|
||
partition@07e0000 { | ||
label = "rom"; | ||
reg = <0x7e0000 0x10000>; | ||
read-only; | ||
}; | ||
|
||
partition@07f0000 { | ||
label = "radio"; | ||
reg = <0x7f0000 0x10000>; | ||
read-only; | ||
}; | ||
}; | ||
}; | ||
|
||
&usbphy { | ||
status = "disabled"; | ||
}; | ||
|
||
&ehci { | ||
status = "disabled"; | ||
}; | ||
|
||
&ohci { | ||
status = "disabled"; | ||
}; | ||
|
||
&wmac { | ||
status = "okay"; | ||
mtd-mac-address = <&factory 0xf100>; | ||
}; | ||
|
||
ðernet { | ||
mtd-mac-address = <&factory 0xf100>; | ||
mediatek,portmap = "llllw"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters