Repository navigation
ramips: add TP-LINK TL-WR902AC v4 - #13877
Conversation
|
I create this pull request, because I could not deal with unwanted 'merge commit' in #13849 |
| ieee80211-freq-limit = <5000000 6000000>; | ||
| nvmem-cells = <&macaddr_factory_f100>; | ||
| nvmem-cell-names = "mac-address"; | ||
| mac-address-increment = <(-1)>; |
There was a problem hiding this comment.
Hmm nvm. I was looking at 5850265 but looks like I was mistaken.
There was a problem hiding this comment.
Original change:
br-lan Link encap:Ethernet HWaddr 40:ED:00:CF:B9:9B
eth0 Link encap:Ethernet HWaddr 40:ED:00:CF:B9:9B
eth0.1 Link encap:Ethernet HWaddr 40:ED:00:CF:B9:9B
phy0-ap0 Link encap:Ethernet HWaddr 40:ED:00:CF:B9:9B
phy1-ap0 Link encap:Ethernet HWaddr 40:ED:00:CF:B9:9A
When I changed to :
&pcie0 {
mt76@0,0 {
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x28000>;
ieee80211-freq-limit = <5000000 6000000>;
nvmem-cells = <&macaddr_factory_f100 (-1)>;
nvmem-cell-names = "mac-address";
};
};
all addresses were 40:ED:00:CF:B9:9B (also phy1-ap0) I am not sure if this is proper behavior.
( <&macaddr_factory_f100 -1> did not compile)
There was a problem hiding this comment.
Nvmem layout change is needed too.
There was a problem hiding this comment.
Correct me if I am wrong:
This need to be changed in mt7628an_tplink_8m.dtsi file, but as this file is used in many places I have
- create copy of dtsi (or use its contents directly) file and made changes, OR
- made much bigger PR with changes in all files used this dtsi
Taking into account that I have very little (next to none) experience with dts files it seems, that 1. is only option (or even close this PR)
There was a problem hiding this comment.
oh that is unfortunate. I guess this can stay as is.
| &pcie0 { | ||
| mt76@0,0 { | ||
| reg = <0x0000 0 0 0 0>; | ||
| mediatek,mtd-eeprom = <&factory 0x28000>; |
There was a problem hiding this comment.
@kjonca This part can be changed like this:
&eeprom_factory_28000 {
/* tl-wr902ac-v4 has different eeprom size '0x4da8' for MT7613 */
reg = <0x28000 0x4da8>;
};
&pcie0 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
ieee80211-freq-limit = <5000000 6000000>;
nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100>;
nvmem-cell-names = "eeprom", "mac-address";
mac-address-increment = <(-1)>;
};
};
There was a problem hiding this comment.
hm.
Error: ../dts/mt7628an_tplink_tl-wr902ac-v4.dts:98.1-22 Label or path eeprom_factory_28000 not found
FATAL ERROR: Syntax error parsing input tree
make[5]: *** [Makefile:235: /home/kjonca/tmp/openwrt/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/image-mt7628an_tplink_tl-wr902ac-v4.dtb] Error 1
There was a problem hiding this comment.
This change can only be applied to the main branch.
There was a problem hiding this comment.
Sorry, I do not understand.
Are you compiling this branch?
https://github.com/kjonca/openwrt/tree/tp-link-tplink_tl-wr902ac-v4
I can find the missing label in your error log:
https://github.com/kjonca/openwrt/blob/abd900830752d4bfc7ecd89b1c03b52f0ddfddc3/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi#L63
There was a problem hiding this comment.
Sorry, I do not understand.
It's possible that the suggested change depends on a feature very recently committed to the code, so your tree needs to be brought up to date (using git rebase) for it to work.
There was a problem hiding this comment.
Ok, I (probably) understand - I compiled v23.05.0 with my patch. When I upgrade to main - it started to compile. My fault.
| }; | ||
|
|
||
| led_power: power { | ||
| label = "green:power"; |
There was a problem hiding this comment.
not needed (auto-created from color and function).
But this needs #13837 to work with the aliases above.
There was a problem hiding this comment.
renamed to led-x, I left label for now. Not sure if I may marked it as resolved.
There was a problem hiding this comment.
I believe that the other PR will be merged soon; you could just wait and see when it does and then fix.
There was a problem hiding this comment.
Please create a follow up PR after #13837 was merged
There was a problem hiding this comment.
It has just been merged, so labels may be dropped now.
7a2ae66 to
abd9008
Compare
|
Never merge, always rebase. |
b2956f2 to
468d194
Compare
DragonBluep
left a comment
There was a problem hiding this comment.
If there are no new changes, you don't need to frequently rebase it. It is not helpful for merging this PR.
| @@ -0,0 +1,112 @@ | |||
| #include "mt7628an_tplink_8m.dtsi" | |||
There was a problem hiding this comment.
Please add the GPL license here. // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
There was a problem hiding this comment.
Well, I have one doubt. This is modified copy of mt7628an_tplink_tl-wr902ac-v3.dts and in that file there were no copyright information. So maybe I had no right to use it here :( ?
There was a problem hiding this comment.
It's okay. And inserting a new line after license would be better.
Lines 1 to 12 in 36b1dd7
3f86046 to
dd07d88
Compare
dd07d88 to
799c116
Compare
|
I think you have to add some handling for this device into the Are the LEDs working correctly? |
|
Please describe the install method in the commit message and also mention the MT7613BE wifi device in the commit message. |
|
For now, I rebased to 78d259e commit (with my changes) and I am not able to have working image - after sysupgrade router is nonfunctioning. I can only enter into failsafe mode, but I have no idea what is broken ... PS. |
@kjonca The master branch seems to have broken recent days. Please try again next week. |
799c116 to
a62dd59
Compare
|
a23fc95 to
f99789e
Compare
No I have some rubbish from my old 'v3' router and they accidentally makes leds in v4 work. I tried to play with kmod-mt* modules but with no luck. Any hint? |
Well. To be honest I was hit by #9545 - now image works (except wifi 2.4GHz mentioned in other comment) |
f99789e to
8c234e4
Compare
|
|
||
| led-0 { | ||
| color = <LED_COLOR_ID_GREEN>; | ||
| function = LED_FUNCTION_LAN; |
There was a problem hiding this comment.
The product image shows it doesn't have LAN LED?
https://static.tp-link.com/upload/product-overview/2023/202306/20230601/TL-WR902AC(EU&US)4.0_Datasheet.pdf
| compatible = "mediatek,mt76"; | ||
| reg = <0x0000 0 0 0 0>; | ||
| ieee80211-freq-limit = <5000000 6000000>; | ||
| nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100>; |
There was a problem hiding this comment.
| nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100>; | |
| nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100 (-1)>; |
Hi! Please apply this change and remove mac-address-increment = <(-1)>;.
And add this node to the end to enable 2 GHz WiFi (change the mac address setting to match your device behavior):
&wmac {
status = "okay";
nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>;
nvmem-cell-names = "eeprom", "mac-address";
};
| comfast,cf-wr758ac-v1|\ | ||
| comfast,cf-wr758ac-v2|\ | ||
| tplink,tl-wr902ac-v3|\ | ||
| tplink,tl-wr902ac-v4|\ |
There was a problem hiding this comment.
If your device only has one ethernet port, you can move it to the first case to use ucidef_set_interface_lan "eth0". I don't know why a single port switch is needed here. Looking forward to your feedback if there are some strange behaviors.
There was a problem hiding this comment.
See new commit. I connected phone via wifi and I was able to ping it from computer connected by eth. So I think it works.
| TPLINK_HWREV := 0x89 | ||
| TPLINK_HWREVADD := 0x1 | ||
| DEVICE_PACKAGES := kmod-mt7615e kmod-mt7663-firmware-ap kmod-usb2 kmod-usb-ohci \ | ||
| kmod-usb-ledtrig-usbport |
There was a problem hiding this comment.
Please show me the shell output of dmesg |grep -i mt.
There was a problem hiding this comment.
Please show me the shell output of
dmesg |grep -i mt.
[ 0.000000] SoC Type: MediaTek MT7628AN ver:1 eco:2
[ 0.698106] mt7621_gpio 10000600.gpio: registering 32 gpios
[ 0.703972] mt7621_gpio 10000600.gpio: registering 32 gpios
[ 0.709574] mt7621_gpio 10000600.gpio: registering 32 gpios
[ 0.755441] spi-mt7621 10000b00.spi: sys_freq: 193333333
[ 0.781925] 4 fixed-partitions partitions found on MTD device spi0.0
[ 0.803711] Creating 4 MTD partitions on "spi0.0":
[ 0.824029] 2 tplink-fw partitions found on MTD device firmware
[ 0.830070] Creating 2 MTD partitions on "firmware":
[ 0.840187] mtd: partition "kernel" doesn't end on an erase/write block -- force read-only
[ 0.856876] mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only
[ 0.867506] mtd: setting mtd3 (rootfs) as root device
[ 0.873874] 1 squashfs-split partitions found on MTD device rootfs
[ 0.970387] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[ 14.924539] mt76_wmac 10300000.wmac: ASIC revision: 76280001
[ 16.034740] mt76_wmac 10300000.wmac: Firmware Version: 20151201
[ 16.040784] mt76_wmac 10300000.wmac: Build Time: 20151201183641
[ 16.093434] mt76_wmac 10300000.wmac: firmware init done
[ 16.315698] mt7615e 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
[ 17.804773] mt7615e 0000:01:00.0: mediatek/mt7663pr2h.bin not found, switching to mediatek/mt7663pr2h_rebb.bin
[ 18.383466] mt7615e 0000:01:00.0: HW/SW Version: 0x65322d31, Build Time: 2009041715da1a1
[ 18.893895] mt7615e 0000:01:00.0: N9 Firmware Version: 7663mp1827, Build Time: 20200904171623
[ 18.902581] mt7615e 0000:01:00.0: Region number: 0x3
[ 18.907644] mt7615e 0000:01:00.0: Parsing tailer Region: 0
[ 18.966419] mt7615e 0000:01:00.0: Region 0, override_addr = 0x00112c00
[ 18.973087] mt7615e 0000:01:00.0: Parsing tailer Region: 1
[ 19.029104] mt7615e 0000:01:00.0: Parsing tailer Region: 2
[ 19.063649] mt7615e 0000:01:00.0: override_addr = 0x00112c00, option = 3
[ 37.471987] jffs2_build_filesystem(): unlocking the mtd device...
DragonBluep
left a comment
There was a problem hiding this comment.
Generally, looks good to me. But it would be better to sort the dts nodes by alphabet and add some mac address explanations to the commit message. example:f7f9203
|
|
||
|
|
||
|
|
||
| &state_default { |
There was a problem hiding this comment.
There are two same state_default nodes. Please drop one of them and the unnecessary new lines.
|
From your dmesg:
MT7628
MT7663, AKA MT7613E |
e330247 to
787a522
Compare
Seems to be very similar to: https://openwrt.org/toh/tp-link/tl-wr902ac_v3 1 x usb 1 x eth Powered by mini usb port. Installation: Can use TFTP method to install: 1. establish TFTP server at 192.168.0.66 2. provide tp_recover.bin file to the TFTP server 3. turn on router with reset button pressed 4. wait for led blinking, then release reset Specification based on dmesg from already flashed device: SoC Type: MediaTek MT7628AN ver:1 eco:2 CPU0 revision is: 00019655 (MIPS 24KEc) Memory: 56028K/65536K available CPU Clock: 580MHz WiFi: MT7613BE MAC addresses are all the same, except wifi5g which last part is decrement by one, ie.: eth0 40:ed:00:cf:b9:9b br-lan 40:ed:00:cf:b9:9b phy0-ap0 40:ed:00:cf:b9:9b phy1-ap0 40:ed:00:cf:b9:9a Signed-off-by: Kamil Jońca <[email protected]>
787a522 to
ffa40fc
Compare
|
Hi, I would like to confirm the real efficiency of the router's 5ghz interface, is it possible to have a compiled release? Thanks |

Seems to be very similar to: https://openwrt.org/toh/tp-link/tl-wr902ac_v3
1 x usb
1 x eth
Powered by mini usb port.
Can use the same TFTP method to install.
Based on dmesg from already flashed device:
SoC Type: MediaTek MT7628AN ver:1 eco:2
CPU0 revision is: 00019655 (MIPS 24KEc)
Memory: 56028K/65536K available
CPU Clock: 580MHz