New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ramips: add initial support for TP-LINK TL-WR840N v4 #974
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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|\ | ||
|
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 9 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", "p0led_an", "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"; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
# MT7628 Profiles | ||
# | ||
|
||
define Build/prepend-to | ||
dd bs=1 seek=$(1) if=$@ of=$@.new && mv $@.new $@ | ||
endef | ||
|
||
define Device/mt7628 | ||
DTS := MT7628 | ||
BLOCKSIZE := 64k | ||
|
@@ -26,6 +30,17 @@ define Device/miwifi-nano | |
endef | ||
TARGET_DEVICES += miwifi-nano | ||
|
||
define Device/tl-wr840n-v4 | ||
DTS := TL-WR840NV4 | ||
IMAGE_SIZE := 7808k | ||
DEVICE_TITLE := TP-Link TL-WR840N v4 | ||
DEVICE_PACKAGES := | ||
KERNEL := $(KERNEL_DTB) | prepend-to 448 | uImage lzma | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please use the existing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm afraid it's not possible. |
||
IMAGES += factory.bin | ||
IMAGE/factory.bin := pad-extra 131072 | $$(sysupgrade_bin) | ||
endef | ||
TARGET_DEVICES += tl-wr840n-v4 | ||
|
||
define Device/vocore2 | ||
DTS := VOCORE2 | ||
IMAGE_SIZE := $(ralink_default_fw_size_16M) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to investigate poor wireless performance, which was described by @sanitariu
The thing I noticed here is that the EEPROM address was not defined, so it uses default value from mt7628an.dtsi, which is wrong for this hardware:
mediatek,mtd-eeprom = <&factory 0x0000>;
Real EEPROM is located in radio partition, so we must declare this:
But performance is still bad though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you make some patch for the correct eeprom ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are the author of this https://raxp.ru/index.php/2017/06/21/lede-for-wr841n-v13wr840n-v4-ru/ ?
Can share the developments?