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
ath79: add support for ALFA Network AP121F #2199
Conversation
Thanks for you work, tested and works on my (SDcard less) device. |
Do you have a production or a sample device?
Sure, will do it. BTW. Please, use Cheers, |
So, is the +1 for eth0 your invention or is it also found in stock firmware? |
I got it from @aparcar, I guess it must be a sample device (he has one, with the same issue, BTW).
Thank you very much.
Sure, I'll change it. |
The place under the art partition where the eth0 MAC address should be is blank (0xFFs), so I assumed adding +1 to the wlan MAC would be neat. But as Piotr suggested, I might have ended up getting a sample rather than a production device. In this case, I'll try to reach the manufacturer. |
If that is one if the devices I gave to Paul last summer then it should be production. |
BTW, that would mean that |
Apparently, yes. I will add it to the commit, but first I would like to understand where MACs are stored. @KCinJP, do you know if there is any way to get the vendor's stock firmware? I've searched through https://files.alfa.com.tw/ with no luck. I've renamed alfa=>alfa-network as indicated and rebased master. Best, |
1d1fbef
to
b6ae06f
Compare
I have two correct MAC addresses (with ALFA OUI) at the begin of ART... but at least in case of the device I have here the MAC address inside calibration data is incorrect/fake (00:c0:ca:00:00:01) - looks like generic ART, before calibration and MAC assignment. I will double check that with someone in ALFA. This device doesn't have a dedicated/custom vendor firmware, AFAIK its sold with generic OpenWrt image. BTW could you send me your device ART dump? Cheers, |
@rogerpueyo one more thing, if you can open the case (be careful with plastic locks!), could you check if there is a sticker/label on the DRAM, with MAC address and some other code? Thanks! |
@pepe2k I went through the whole flash and found the "00 C0 CA XX XX XX" pattern twice:
The sticker on the RAM reads AGJDBD and the same MAC as on the external sticker and at 0x1000 in art. Thanks! |
Piotr, Thanks for the information. I've tweaked the art partition and now have a standard device :) I'll be updating the PR in a few minutes. Can I upload your images and instructions for the USB mod to the OpenWrt's wiki? Best, |
1a359b7
to
ac4e2d1
Compare
Rebased master; good to go, I think. Shall I add the "label-mac-device = &wmac;" thing for #2159? |
OK then. The PR already includes it, so it's #2159-ready :) |
Just had another look at it, I fear that since you do not set mtd-mac-address for wmac (which you do not need normally), the MAC address will not be available via device tree. |
This commit ports to the ALFA Network AP121F, a pocket-size router with 1 Ethernet and 2.4 GHz WiFi based on the AR9331 SoC, to the ath79 target (it was already supported in ar71xx; see commit 0c6165d for more details). Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Correct, nothing related to wmac:
I have to explicitly set the |
@rogerpueyo Okay, keep the label-mac-device, it is still correct, though it is not helpful at the moment. After my PR is through, I might simply add |
@rogerpueyo I have merged your changes (with some minor fixes) into my staging tree. If you have time, please test image on your device. And feel free to use the photos on the Wiki! Cheers, |
Thank you, @pepe2k! I've just given your staging tree a try. I didn't test it thoroughly, but I can confirm board detection, Ethernet, WiFi are working. 👍 |
@rogerpueyo Only one NIC is connected. Which one is it and why didn't you disable the other one? |
If I remember correctly: |
In d421a8b ("ath79: read label MAC address from flash instead of using phy0/phy1") the source of the label MAC address was changed for devices just reading it from phy0. To get rid of the dependency from phy startup, addresses were read directly from the flash locations that are used to initialize the phy MAC addresses. Unfortunately, it turned out that Ubiquiti XM devices seem to have different flash locations than expected, and also seem to have specific locations for different devices (all in art/EEPROM): 0xe012 AR9280 Nanostation M2 - 0x120c 0xe035 AR9280 Nanostation M3 - 0x120c 0xe1b2 AR9280 Rocket M2 - 0x120c 0xe1c3 AR9280 Rocket M3 - 0x120c 0xe1b5 AR9280 Rocket M5 - 0x120c 0xe2d5 AR9280 Bullet M2 Titanium - 0x120c 0xe2b5 AR9280 Nanobridge M5 - 0x120c 0xe202 AR9280 Bullet M2 - 0x120c 0xe232 AR9287 Nanobridge M2 - 0x110c 0xe4a2 AR9285 AirRouter - 0xa0bf Picostation M2 - 0x120c and 0xa0bf Nanostation Loco M2 - not in 0x120c, other locations not checked An additional problem of the Ubiquiti device support in OpenWrt is that we provide images that match several subvariants of the devices, which might have different MAC address locations. Given that reading the address from phy0 in 02_network _is_ working for the ath79 target in general, it does not seem reasonable to rebuild a complex MAC address retrieval mechanism which is already present in the ath9k driver. So, this patch reverts the label MAC address source for Ubiquiti XM devices (and the Unifi AP) to /sys/class/ieee80211/phy0/macaddress. This doesn't affect XW and Unifi AC devices, where the label MAC address source is defined via device tree. For alfa-network,ap121f the location 0x1002 is kept, as this has been verified during device support preparation in PR openwrt#2199. Fixes: d421a8b ("ath79: read label MAC address from flash instead of using phy0/phy1") Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
In d421a8b ("ath79: read label MAC address from flash instead of using phy0/phy1") the source of the label MAC address was changed for devices just reading it from phy0. To get rid of the dependency from phy startup, addresses were read directly from the flash locations that are used to initialize the phy MAC addresses. Unfortunately, it turned out that Ubiquiti XM devices seem to have different flash locations than expected, and also seem to have specific locations for different devices (all in art/EEPROM): 0xe012 AR9280 Nanostation M2 - 0x120c 0xe035 AR9280 Nanostation M3 - 0x120c 0xe1b2 AR9280 Rocket M2 - 0x120c 0xe1c3 AR9280 Rocket M3 - 0x120c 0xe1b5 AR9280 Rocket M5 - 0x120c 0xe2d5 AR9280 Bullet M2 Titanium - 0x120c 0xe2b5 AR9280 Nanobridge M5 - 0x120c 0xe202 AR9280 Bullet M2 - 0x120c 0xe232 AR9287 Nanobridge M2 - 0x110c 0xe4a2 AR9285 AirRouter - 0xa0bf Picostation M2 - 0x120c and 0xa0bf Nanostation Loco M2 - not in 0x120c, other locations not checked An additional problem of the Ubiquiti device support in OpenWrt is that we provide images that match several subvariants of the devices, which might have different MAC address locations. Given that reading the address from phy0 in 02_network _is_ working for the ath79 target in general, it does not seem reasonable to rebuild a complex MAC address retrieval mechanism which is already present in the ath9k driver. So, this patch reverts the label MAC address source for Ubiquiti XM devices (and the Unifi AP) to /sys/class/ieee80211/phy0/macaddress. This doesn't affect XW and Unifi AC devices, where the label MAC address source is defined via device tree. For alfa-network,ap121f the location 0x1002 is kept, as this has been verified during device support preparation in PR #2199. Fixes: d421a8b ("ath79: read label MAC address from flash instead of using phy0/phy1") Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit ports to the ALFA Network AP121F, a pocket-size router with 1 Ethernet and 2.4 GHz WiFi based on the AR9331 SoC, to the ath79 target (it was already supported in ar71xx; see commit
0c6165d for more details).
Notes:
caldata. Use the same MAC, +1, for eth0 (previously, on ar71xx, it
got a randomly-generated one).
not currently available, but could be added in a latter commit.
@aparcar Could you please check the commit and test it on the actual device?
@pepe2k If you have the microSD optional board (I don't have it), would you please mind completing the code?