BPI-R3 MAC addresses

I’m curious about the R3’s MAC address. The firmware for the onboard WiFi appears to have a MAC address set (bytes 5-10), however with OpenWrt it never appears to get used. Interesting, the firmware for both PHY’s have the same MAC address.

It makes me wonder if every board has the same MAC. Mine is 00:0C:43:26:60:00 - can anyone verify if theirs is different? You can check it with:

for EEPROM in $(find /sys -name eeprom); do hexdump -n 10 -e '16/1 "%02x:""\n"' $EEPROM | cut -d ":" -f 5-10; done

Yes, same here. I’m sure there was something posted about this earlier.

Yours has the same address in the eeprom?

Mine is 00:0C:43:26:60:00, so yes, it is the same.

Also, speaking about MAC addresses… Is it OK that radio0 and radio1 BSSIDs are identical? Every WIFI router I previously owned had different BSSIDs for 2.4GHz and 5GHz networks.

Searching around the internet, 00:0C:43:26:60:00 is a very common default address for Ralink (now MediaTek) development devices.

It depends on your topology. If, for example, your SSIDs are the same and you are letting your clients pick which one they want, then yes, it can matter. Or for mesh.

I’d change it. If you change the mac address on the advanced tab in LuCI’s wireless config it will use that as the BSSID. I’d change both, so neither of them are that default devel one.

is the mac the one from the firmware-file or taken from anywhere else?

do you change it in firmware file or via userspace-tools (systemd,iproute2,…)?

The MAC address is what the driver is loading. Where it’s loading from, I don’t yet know. If you look at the eeprom in /sys, that’s the MAC it comes up with:

for EEPROM in $(find /sys -name eeprom); do hexdump -n 10 -e '16/1 "%02x:""\n"' $EEPROM | cut -d ":" -f 5-10; done

The same MAC is found in eeprom files: /lib/firmware/mediatek/mt7986_eeprom_mt7975_dual.bin and mt7986_eeprom_mt7976_dual.bin

The thing is, if I change the MAC in those files, it makes no difference. It still reverts to 00:0C:43:26:60:00. So I don’t know where it’s being loaded from. I doubt there is any eeprom in the hardware.

You use openwrt? The eeprom is in dt too…this dt property is loaded before the firmware-files

https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/mediatek/dts/mt7986a-bananapi-bpi-r3.dts;h=4d118b0fbc1d11fe288cd1afc8432f79d4e11db1;hb=HEAD#l454

Right. I keep forgetting that.

OpenWrt’s firmware for the 7986 provides two eeprom files:

-rw-r--r--    1 root     root          4096 Apr 10 21:25 mt7986_eeprom_mt7975_dual.bin
-rw-r--r--    1 root     root          4096 Apr 10 21:13 mt7986_eeprom_mt7976_dual.bin

When the device tree eeprom is present it is loaded for both radios and its MAC address is set for both radios.

If I delete the device tree eeprom, then the first eeprom file above (mt7986_eeprom_mt7975_dual.bin) is loaded for both radios. The second eeprom file is never loaded.

If I use your patch on mt76 for loading eeproms (which I put on all my builds now, btw), then it is only ever called once at boot time because the driver is loaded once.

So, as far as I can tell, there is no way to have a different MAC address for both radios at boot time. You have to manually set the MAC for at least one of the radios when the radio is brought up. This isn’t good for novice users who don’t know that they need to change the mac address for one of the radios.

I wonder if it would be better to set the MAC address in the device tree to 00:00:00:00:00:00, at least this way the kernel will choose random MAC addresses at boot and both radios won’t have the same address.

@dangowrt what are your thoughts?

mt76 driver has included a similar function for mt7986 (and the mt791x frontends), so here you do not need “my” patch…it should also read eeprom if you unload and reload the wifi-driver (mt76-core) module. i’m not sure if both device use same mac-portion of the eeprom to set mac or if they have multiple sections (for each phy) which are currently set to same address…have not digged into eeprom-code/data yet

Yes, that is what the two EEPROM files I mentioned are for. Unfortunately, only one of them is loaded, and it is only loaded if the EEPROM doesn’t exist in the DT.

The fact that OpenWrt includes both EEPROMs means that someone thinks they both get loaded. Which is not the case. Each EEPROM only has one MAC.

Bpi-r3 uses mt7975 frontend and not mt7976,but maybe other boards using the other chip so openwrt includes both.

Btw openwrt also has dt eerom so files are not loaded