-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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 support for ASUS RT-AC54U #3017
Conversation
Hi, in your commit message, I'd prefer to replace the tab indent by something requiring less space; either one/two spaces, bullet points or no indent at all. Despite, you should wrap your lines so each line has less than 75 characters. |
flash@0{ | ||
compatible = "jedec,spi-nor"; | ||
reg = <0>; | ||
spi-max-frequency = <10000000>; |
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.
Can this be increased?
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.
How do I know how much to increase?
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.
Have a look at the datasheets (if you find some) and/or try increasing and see whether it's stable. You may also check which other recently added devices have the same flash, as we started to request this quite frequently.
Most of the older devices just always copied 10 MHz from some other DTS, and this is considerably slower than necessary.
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.
datasheet says it's 50MHz when doing normal read. I will start with that
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 may try that with and without m25p,fast-read;
. Just benchmark with a simple dd if the device is booting. Normally, only certain steps are possible for the frequency, so you might only see a performance change if you double etc.
You may also try 80 MHz with fast-read if the specs state it's supported and recovery is not too painful.
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.
specs say read 50MHz
fast read 104MHz
datasheet (Table 13. AC CHARACTERISTICS)
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 may try 100 MHz for fun, but I don't think it will boot.
Based on you evaluation, I'd take the 50 with fast-read ...
|
||
ðernet { | ||
status = "okay"; | ||
mtd-mac-address = <&factory 0x4>; |
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.
Is there a proper address in 0x28, 0x2e, 0xe000 or 0xe006?
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.
0x4, 0x22, 0x28 have addresses.
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.
Then please give an overview over the addresses in flash and the addresses on vendor firmware, so we can assign them properly.
FYI: https://openwrt.org/docs/guide-developer/mac.address
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.
factory 0x4, 0x28: WAN, 2.4G (both addresses have the same value)
factory 0x22: LAN, 5G
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.
Ah, perfect. Then, please use the 0x22 for ðernet and the 0x28 for wan_mac in the lower part of 02_network (instead of the increment). The 5g address should also be in 0x8004, as this is what's read automatically with mediatek,mtd-eeprom, like 0x4 is automatically read for 2g ...
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.
If your label shows LAN address, then you should add label-mac-device = ðernet;
to the aliases section.
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.
LAN(label): aa:bb:cc:dd:ee:6c
WAN: aa:bb:cc:dd:ee:68
so the offset should be -4?
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.
yes, exactly.
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 changed as above now 5G doesn't get the right address
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.
Maybe just push your latest state so I can have a look.
@@ -37,6 +37,9 @@ asus,rp-n53) | |||
ucidef_set_led_netdev "eth" "Network" "$boardname:white:back" "eth0" | |||
set_wifi_led "$boardname:blue:wifi" | |||
;; | |||
asus,rt-ac54u) | |||
ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$boardname:blue:wifi" "wlan1" |
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.
Please check whether you can use a device tree trigger instead.
Since your DTS is essentially mostly a copy of the one for rt-ac51u, please create a shared DTSI for them. |
@@ -235,6 +236,7 @@ ramips_setup_macs() | |||
case $board in | |||
aigale,ai-br100|\ | |||
asus,rt-ac51u|\ | |||
asus,rt-ac54u|\ |
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.
Please check whether the WAN MAC address you find in vendor firmware is also found in flash (check the locations given in my comment above).
What's the MAC address assignment on vendor firmware (LAN, WAN, 2g, 5g)?
&pcie0 { | ||
wifi@0,0 { | ||
reg = <0x0000 0 0 0 0>; | ||
mediatek,mtd-eeprom = <&factory 0x8004>; |
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.
This should be 0x8000. The MAC address is automatically read from offset +4, so caldata at 0x8000 will have the address read from 0x8004.
Following the same mechanism, wmac gets the address at 0x4 because mtd-eeprom start at 0x0 ...
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.
ok I will fix it
wifi { | ||
label = "rt-ac54u:blue:wifi"; | ||
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; | ||
linux,default-trigger = "phy1tpt"; |
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 state the device has two Wifi LEDs? I assume 5g is controlled by driver, so this is 2g?
If yes, you should rename label and node wifi->wifi2g ...
And please double-check that phy1tpt is the correct trigger then (different from the one added as member of pcie0 ...)
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.
Yes that's 2.4G wifi.
I am sure phy1tpt works. I just tested.
|
looks like 50 and fast-read to me. :-) Might have been easier if you just had used dd with fixed size on a single mtd partition. But you should clearly see why I forced you to do this if you compare 10 and 50 MHz results. |
Specification: -CPU: MTK MT7620A -RAM: 64MB -ROM: 16MB SPI Flash Macronix MX25L12835E -WiFi1: MediaTek MT7620A -WiFi2: MediaTek MT7612E -Button: reset, wps -LED: 9 LEDs:Power, WiFi 2.4G,WiFi 5G, USB, LAN1, LAN2, LAN3, LAN4, WAN -Ethernet: 5 ports, 4 LAN + 1 WAN -Other: 1x UART 1x USB2.0 Installation: Update using ASUS Firmware Restoration Tool: 1. Download the ASUS Firmware Restoration Tool but don't open it yet 2. Unplug your computer from the router 3. Put the router into Rescue Mode by: turning the power off, using a pin to press and hold the reset button, then turning the router back on while keeping the reset button pressed for ~5 secs until the power LED starts flashing slowly (which indicates the router has entered Rescue Mode) 4. Important (if you don't do this next step the Asus Firmware Restoration Tool will wrongly assume that the router is not in Rescue Mode and will refuse to flash it): go to the Windows Control Panel and temporarily disable ALL other network adapters except the one you will use to connect your computer to the router 5. For the single adapter you left enabled, temporarily give it the static IP 192.168.1.10 and the subnet mask 255.255.255.0 6. Connect a LAN cable between your computer (make sure to use the Ethernet port of the adapter you've just set up) and port 1 of the router (not the router's WAN port) 7. Rename sysupgrade.bin to factory.trx 8. Open the Asus Firmware Restoration Tool, locate factory.trx and click upload (if Windows shows a compatibility prompt, confirm that the tool worked fine) 9. Flashing and reboot is finished when the power LED stops blinking and stays on MAC assignment based on vendor firmware: 2g 0x4 label 5g 0x8004 label + 4 lan 0x22 label + 4 wan 0x28 label Signed-off-by: Zhijun You <hujy652@gmail.com>
I found that command in one of the spi-max-frequency related commit. |
I should make the DTSI in a separated PR right? |
No, I'd have preferred to do it together with adding device support here. But to not make things more complicated than necessary, it might be easier if you just keep the separate DTS (= current state) for now and I will do the DTSI myself when merging this to my staging tree... |
Gotcha. Thanks for your help! |
I thought lan was the label address? |
No sorry didn't mention it earlier. WAN is the label address. |
I've pushed my DTS split and a rebase of your patch to my staging tree here: Please give it another test and report any issues or comments. |
@Redfoxymoon @LorenzoBianconi @DavideFioravanti I've pushed a patch with improvements for RT-AC51U based on the findings for RT-AC54U here to my staging tree: Would one you test these and report whether this is working (flash speed increase, Wifi LEDs for 2g and 5g)? Despite, can you report the MAC addresses in factory partition (full partition dump or just retrieve 0x4, 0x22, 0x28, 0x2e, 0x8004). If possible, the corresponding MAC assignment from vendor OS would be quite helpful. I assume this would end up with the same setup as AC51U ... |
@Redfoxymoon <https://github.com/Redfoxymoon> @LorenzoBianconi
<https://github.com/LorenzoBianconi> @DavideFioravanti
<https://github.com/DavideFioravanti> I've pushed a patch with improvements
for RT-AC51U based on the findings for RT-AC54U here to my staging tree:
RT-AC54U runs mt76x2 IIUC, right?
… Would one you test these and report whether this is working (flash speed
increase, Wifi LEDs for 2g and 5g)?
Despite, can you report the MAC addresses in factory partition (full
partition dump or just retrieve 0x4, 0x22, 0x28, 0x2e, 0x8004). If
possible, the corresponding MAC assignment from vendor OS would be quite
helpful. I assume this would end up with the same setup as AC51U ...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3017 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOA2COE7JBSICW7UXKXBTDRRPZXLANCNFSM4M625MCA>
.
--
UNIX is Sexy: who | grep -i blonde | talk; cd ~; wine; talk; touch; unzip;
touch; strip; gasp; finger; gasp; mount; fsck; more; yes; gasp; umount;
make clean; sleep
|
Ah, that's right. However, there are some mt76x0e devices with similar (yet different) 5g LED setup as well:
So, this would need some additional testing on RT-AC51U ... |
Everything is working fine. Tested: LEDs, both WiFi, MAC address, LAN & WAN ports, USB port |
I will test these changes on a RT-AC51U tomorrow 😉 |
Flash is working.
Currently the Openwrt has these addresses: On the factory partitions there are these addresses: I don't remember the OEM implementation. However, reading the openwrt wiki I think that I will be able to come back to stock fw and let you know 😉 |
Did you try with |
Can you check whether 2g LED really shows 2g activity by selectively enabling that? I'm not perfectly sure whether phy1tpt is correct here (because that would mean it was wrong before, as 01_leds uses phy0tpt ...) |
@DavideFioravanti I plan to merge the flash frequency increase separately from the rest, can I add your tested-by there? |
So, I've merge the device support itself now, but kept both devices to 10 MHz SPI freq. I have built a separate patch to increase SPI freq on both devices, which is only waiting for Davide's testing by now. The rest will be sorted out after further feedback ... |
Yes, but I can't be sure if I tried every combination of
I will test this too.
Yes, sure! 😉 |
@adrianschmutzler Moreover I confirm that phy1tpt is the right one for 2G wifi. phy0tpt is referred to 5G wireless interface. |
@DavideFioravanti Thanks. So this device won't get a 5G led for now. So, the only thing missing now is the OEM MAC assignment. :-) |
Ok I flashed the OEM FW. Here you are (Just to recall, mac address on the label is XX:XX:XX:XX:XX:38) |
Thanks again for your help, I will merge the rest during the next hour. |
Like for the RT-AC54U, this uses a DT trigger for WiFi also at the RT-AC51U. While at it, rename node and label to wifi2g. Note that the 5g WiFi LED still isn't supported (see PR #3017 for further details: #3017 ) Tested-by: Davide Fioravanti <pantanastyle@gmail.com> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Like for the RT-AC54U, this uses a DT trigger for WiFi also at the RT-AC51U. While at it, rename node and label to wifi2g. Note that the 5g WiFi LED still isn't supported (see PR #3017 for further details: openwrt/openwrt#3017 ) Tested-by: Davide Fioravanti <pantanastyle@gmail.com> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Like for the RT-AC54U, this uses a DT trigger for WiFi also at the RT-AC51U. While at it, rename node and label to wifi2g. Note that the 5g WiFi LED still isn't supported (see PR #3017 for further details: openwrt/openwrt#3017 ) Tested-by: Davide Fioravanti <pantanastyle@gmail.com> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Like for the RT-AC54U, this uses a DT trigger for WiFi also at the RT-AC51U. While at it, rename node and label to wifi2g. Note that the 5g WiFi LED still isn't supported (see PR #3017 for further details: openwrt/openwrt#3017 ) Tested-by: Davide Fioravanti <pantanastyle@gmail.com> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Specification:
Installation:
Update using ASUS Firmware Restoration Tool:
to press and hold the reset button, then turning the router back on while
keeping the reset button pressed for ~5 secs until the power LED starts
flashing slowly (which indicates the router has entered Rescue Mode)
Restoration Tool will wrongly assume that the router is not in Rescue Mode
and will refuse to flash it): go to the Windows Control Panel and
temporarily disable ALL other network adapters except the one you will use
to connect your computer to the router
static IP 192.168.1.10 and the subnet mask 255.255.255.0
Ethernet port of the adapter you've just set up) and port 1 of the router
(not the router's WAN port)
upload (if Windows shows a compatibility prompt, confirm that the tool worked fine)
stays on
MAC assignment based on vendor firmware:
2g 0x4 label
5g 0x8004 label + 4
lan 0x22 label + 4
wan 0x28 label
Signed-off-by: Zhijun You hujy652@gmail.com