Nossiac / mtk-openwrt-feeds

mtk-openwrt-feeds
429 stars 204 forks source link

drivers for mt7613 #127

Open bricco1981 opened 1 year ago

bricco1981 commented 1 year ago

hi, thanks a lot for your help with this drivers. I'm try to understand how get drivers for mt7613be chipset, I cannot find any info. I'm talking about mtk and not mt76.should this card work with mt7615 drivers?

bricco1981 commented 1 month ago

root@OpenWrt:~# hexdump /lib/firmware/mt7663.bin 0000000 7663 0100 e1e0 6fa9 e458 7663 14c3 8000 0000010 0002 7663 14c3 0000 0000 0000 0000 0000 0000020 0000 0000 0000 0000 0000 0000 0000 00e3 0000030 0100 0080 0000 0000 0000 0000 0000 0000 0000040 0000 0000 0000 0000 0000 8089 9080 0001 0000050 0000 0000 0000 0000 0000 0000 0000 0000 0000070 c6c6 c4c4 c1c2 c200 c200 00c1 8100 8584 0000080 c2c2 81c1 8281 8685 c500 c2c5 00c2 00c3 0000090 c1c3 0000 8382 c384 c1c3 0000 8382 0084 00000a0 c3c3 00c1 8200 8483 0000 0000 0000 0000 00000b0 ded1 1b23 1b1b 0d15 0d0d 4040 4040 0000 00000c0 0000 0000 0000 0000 0000 0000 0000 0000 00000d0 0000 0000 0000 0000 0000 0000 0000 3c00 00000e0 4310 29be 0000 0000 0000 0000 0000 0000 00000f0 4310 29bd 0000 0000 0000 0000 0000 0000 0000100 0000 0000 0000 0000 0000 0000 0000 0000 0000150 0000 0000 0008 01e0 0000 0000 0000 0000 0000160 0000 0000 0000 0000 0000 0000 0000 0000 0000170 0000 0000 0000 0000 1000 2810 0000 0000 0000180 0000 0000 0000 0000 0000 0000 0000 0000 00001b0 1212 0002 0000 0500 0000 0000 0086 0000 00001c0 0000 0000 0000 0000 0000 0000 0000 0000 00001f0 d3cc d3cc d3cc d3cc d3cc d3cc d3cc d3cc 0000200 1623 1616 0a17 0a0a 4040 4040 0000 0000 0000210 0000 0000 0000 0000 0000 0000 0000 0000 0000230 0000 0000 0000 0000 0000 3a00 0000 0000 0000240 2020 4320 22c7 c743 4322 22c7 c743 c322 0000250 22c7 c7c3 4322 22c7 c6c3 0022 c2c2 c3c2 0000260 c4c4 c4c4 c4c4 c5c5 c6c5 cbc8 0000 0000 0000270 0000 0000 0000 0000 0000 0000 0000 0000 00002b0 2020 4320 22c7 c743 4322 22c7 c6c3 4322 00002c0 22c6 c743 4322 22c7 c743 0022 c3c3 c7c4 00002d0 c9c9 cbca cacb c9c9 c9c9 ccca 0000 0000 00002e0 0000 0000 0000 0000 0000 0000 0000 0000 * 0000600 root@OpenWrt:~#

vikingloudmouth commented 1 month ago

Seems right, first part is 7663 as expected. Slightly different to mine, but mine is also different every other one I found in the gpl code releases for different routers I was searching through.

Really don't think it will help, but here is mine mt7663.bin.

I did also see somewhere that suggested issues with radio calibration data can sometimes be resolved by flashing the full original stock firmware back on, and then reflashing openwrt. The idea was to restore the data back to what it should be with the stock firmware incase it had been unintentionally modified somehow.

vikingloudmouth commented 1 month ago

that's for luci mtk luci-lib-jquery-1-4_6_mipsel_24kc.zip

How do I add this to my build?

Realise I could just install the package once I have flashed my image, but would prefer to have everything cleanly built and included in the build process.

bricco1981 commented 1 month ago

unpack and add this in builroot /feeds/routing/ luci-app-bmx6.zip

do not warry about the warning

vikingloudmouth commented 1 month ago

and why i have wrong mac address?

Looks like the mac address come from the .bin file https://github.com/Nossiac/mtk-openwrt-feeds/issues/41. Just edit the hex file to be whatever you want

bricco1981 commented 1 month ago

i know that but i do not know why this hell of device have low signal, and the driver eat alot of memory

vikingloudmouth commented 1 month ago

device have low signal

I assume that you have checked this is a driver issue and that the stock firmware doesn't have this problem?

bricco1981 commented 1 month ago

i never used stock firmware, just to flash wrt

vikingloudmouth commented 1 month ago

i never used stock firmware, just to flash wrt

Might be worth checking, verify it isn't a device/hardware problem giving poor signal.

bricco1981 commented 1 month ago

i do not think so mt76 have better range on m7663 i'm starting to think something about antenna control

bricco1981 commented 1 month ago

have your device built in PA? power amplifier

vikingloudmouth commented 1 month ago

have your device built in PA? power amplifier

No idea. Driver worked for me, stopped looking any further. This is it: https://openwrt.org/toh/hwdata/tp-link/tp-link_archer_a6_v3.

bricco1981 commented 1 month ago

ok flash and ram as mine. can you tell me please free ram of your device? mine go 13%

vikingloudmouth commented 1 month ago

From the luci status page: ~20% available, ~68% used, ~15% cached.

bricco1981 commented 1 month ago

i have found a way to let load the bin whitout extracting it. this part is wrong

define flash_read(_ctrl, _ptr, _offset, _len) mt_mtd_read_nm_wifi("Factory", _offset, (size_t)_len, _ptr)

define flash_write(_ctrl, _ptr, _offset, _len) mt_mtd_write_nm_wifi("Factory", _offset, (size_t)_len, _ptr)

else

/*

extern int ra_mtd_write_nm(char name, loff_t to, size_t len, const u_char buf); extern int ra_mtd_read_nm(char name, loff_t from, size_t len, u_char buf);

define flash_read(_ctrl, _ptr, _offset, _len) ra_mtd_read_nm("Factory", _offset, (size_t)_len, _ptr)

define flash_write(_ctrl, _ptr, _offset, _len) ra_mtd_write_nm("Factory", _offset, (size_t)_len, _ptr)

just replacinf Factory with factory in embedded/common/ee_flash.c

vikingloudmouth commented 1 month ago

Good find. Assuming that you are going to change this and eventually put the driver up similarly to your other ones, keep in mind that not all devices have a factory partition. Mine doesn't, the data is in a radio partition. Would need to make this configurable or still allow a .bin file to be used so the driver can be used across devices..

bricco1981 commented 1 month ago

well if a device do not use factory it does nothing so it will be fine this change i think.

bricco1981 commented 1 month ago

i flashed the stock firmware and the range can go at 100 m it's very powerfull. i'll try wrt now

bricco1981 commented 1 month ago

well i think i need stop here. i have did all possible combination of settin, EFUSE eproom, flash, ipailna ipaelna epailna epaelna, calibrtion to bin file precalibration manual calcolation, nothing work. that's ok i'm happy if your device work. so other people with same device can use that. well that's a mystery why my devise have low signal.

bricco1981 commented 1 month ago

finaly i fixed it. you can try that too, for fix mac address.... as you said get the bin from luci, i think for you should be radio, for me is factory, rename it e2p and put it in lib/firmware. now for me is like stock firmware.

the bin should start with mt7603 and not with mt7663

bricco1981 commented 1 month ago

@ravichaudhary133 things look well done almost fixed, just last a few things to fix. anyway your device?

ravichaudhary133 commented 1 month ago

@bricco1981 my device is TP Link MR600 v2. After using the eeprom binary of another device with same wifi drivers, the issues are almost gone! Although the max wifi range seems to be 70-80% of original.

bricco1981 commented 1 month ago

@ravichaudhary133 are mac address correct with that bin?

ravichaudhary133 commented 1 month ago

I aint having issues with mac addresses. Btw i aint using the binary shared here. It was shared on openwrt forum.

bricco1981 commented 1 month ago

things are looking good, just some small fix. repeter mode and ap mode are working right. i'm on, just for fun, 4 ap and 1 sta in repeter mode.

Schermata da 2024-07-12 12-37-38

bricco1981 commented 1 month ago

@vikingloudmouth do you think i should add hardware nat on wireless or better leave it on openwrt mt7621 hardware nat? i'm not sure about cake, SQM.

vikingloudmouth commented 1 month ago

Hardware nat would be a nice feature, I've seen fairly high cpu use when the amount of traffic starts increasing. Can't comment on which option would be better from

hardware nat on wireless or better leave it on openwrt mt7621 hardware nat?

as I don't know what the differences are.


i'm not sure about cake, SQM.

Are you saying that hardware NAT with SQM could be an option in the driver itself? Think that would be great if possible.

If you are instead asking whether or you should not include hardware NAT so SQM could be used, I think hardware NAT should be made an option to be selected in the menuconfig. Let people choose depending on the network speeds / latency that they have so they can disable hardware NAT in order to allow SQM if they want to.

bricco1981 commented 1 month ago

well, the point of this devices, mt proprietary drivers, is the unique mode to use repeter, so all is right now. that's my opinion. but maybe alot openwrt users, need sta mode on firewall. so i'm not sure.

vikingloudmouth commented 1 month ago

well, the point of this devices, mt proprietary drivers, is the unique mode to use repeter

I use the proprietary drivers in AP mode because the default mt76 ones in openwrt don't work properly and drop connections a dozen times a day...

ravichaudhary133 commented 1 month ago

@vikingloudmouth man, could you guide me in compiling the drivers from your source?! Will it show up in the menuconfig like it did for mt7603?! And which version of openwrt source compiles without errors? Thanks again!

bricco1981 commented 1 month ago

@ravichaudhary133 wait a bit i'll make a test build, just give me some time. please repet the device in use.

vikingloudmouth commented 1 month ago

@ravichaudhary133 Yes it show up the same way as the mt7603 does. Probably better to wait for @bricco1981 to polish it up a bit though, I don't even have a page in luci to configure the driver. I used openwrt v23.05.03.

If you want to try just copy the mtk folder in my repo to the packages folder, and see this post for some more details.

ravichaudhary133 commented 1 month ago

@bricco1981 I am using tplink mr600 v2.

bricco1981 commented 1 month ago

@vikingloudmouth ,yes thanks for your work! now it's my turn! wait @ravichaudhary133 it's 45 celsius here.

bricco1981 commented 1 month ago

@ravichaudhary133 is that EU version?

ravichaudhary133 commented 1 month ago

Yupp, it is the EU version, further details about the device are in this thread https://forum.openwrt.org/t/tp-link-archer-mr600-exploration/65489

bricco1981 commented 1 month ago

you do not need any eeprom.bin, please let me know if mac address of 5g radio is the same as original firmware.

bricco1981 commented 1 month ago

@vikingloudmouth wait a bit too if you have no working luci.

ravichaudhary133 commented 1 month ago

Alright, will definitely give it a try right away!, thanks a lot!

ravichaudhary133 commented 1 month ago

@bricco1981 waiting for your file to get uploaded. Btw, i hope you considered the changes mentioned in the following post on openwrt forum before compiling, as otherwise it wont boot. https://forum.openwrt.org/t/tp-link-archer-mr600-exploration/65489/81 Thanks again!

bricco1981 commented 1 month ago

i don't know, this is 23.05.3, is that fixed on that?

bricco1981 commented 1 month ago

@vikingloudmouth please can you test this, @ravichaudhary133 looks sloow!

bricco1981 commented 1 month ago

please note wpa3 should be broken in luci but it work in profile.dat. please wait

bricco1981 commented 1 month ago

hi guys, i need know is the calibration data correct for your device? hello hello it's day time.

ravichaudhary133 commented 1 month ago

@bricco1981 man, the firmware which you provided is of some other device maybe mesh mr600, and now my device is bricked! Serial access loads ralink tftp server with 128 mb flash size. I think my device is fed up now. Any help would be greatly appreciated! Any way to flash default u-boot with serial access?!

ravichaudhary133 commented 1 month ago

@bricco1981 btw, the file name of the firmware shows default of my device. Dont know how it ended up changing the u-boot?

bricco1981 commented 1 month ago

it's not possible that the problem is u-boot

bricco1981 commented 1 month ago

i do not know, maybe it's soft bricked because it's not fixed in this kernel. i do not know. i wan hear from @vikingloudmouth

ravichaudhary133 commented 1 month ago

Oh sorry, the u-boot version is still the mt7621A! I accidentally read memory size as flash size. My bad. Now i got the problem. It shows bad magic after the flash. It is a know problem and can me fixed by editing the mk file in the source before compiling as given in the openwrt forum post i shared above.

ravichaudhary133 commented 1 month ago

@bricco1981 https://forum.openwrt.org/t/tp-link-archer-mr600-exploration/65489/81 this is the exact post which mentions the change to be done in "include/image-commands.mk" file from 0x4 to 0x10000, would appreciate your work!