Beaglebone green gateway connman assigns new mac on reboot

Everytime power cycle the device connman generates a new mac on the beaglebone green gateway.

Does anyone else have the same problem?

=================================================

Testing on latest debian image

Reading after first install

debian@beaglebone:~$ sudo connmanctl services
*AO Wired ethernet_3ca308379d74_cable
wifi_64694e7e839d_hidden_managed_psk
bassg wifi_64694e7e839d_6261737367_managed_psk
DIRECT-25710_PT-P950NW wifi_64694e7e839d_4449524543542d32353731305f50542d503935304e57_managed_psk
BTHnetwork wifi_64694e7e839d_4254486e6574776f726b_managed_psk
SpectrumSetup-A0 wifi_64694e7e839d_537065637472756d53657475702d4130_managed_psk
wifi_64694e7e839d_hidden_managed_ieee8021x
Covid 19 wifi_64694e7e839d_436f766964203139_managed_psk
debian@beaglebone:~$

After power cycle

debian@beaglebone:~$
debian@beaglebone:~$
debian@beaglebone:~$ sudo connmanctl services
[sudo] password for debian:
*AO Wired ethernet_0e81258cd817_cable
wifi_64694e7e839d_hidden_managed_psk
bassg wifi_64694e7e839d_6261737367_managed_psk
DIRECT-25710_PT-P950NW wifi_64694e7e839d_4449524543542d32353731305f50542d503935304e57_managed_psk
BTHnetwork wifi_64694e7e839d_4254486e6574776f726b_managed_psk
SpectrumSetup-A0 wifi_64694e7e839d_537065637472756d53657475702d4130_managed_psk
wifi_64694e7e839d_hidden_managed_ieee8021x
debian@beaglebone:~$

==========================================

[sudo] password for debian: [ 562.118135] reboot: Power down

U-Boot SPL 2019.04-00002-g07d5700e21 (Mar 06 2020 - 11:24:55 -0600)
Trying to boot from MMC1
Loading Environment from EXT4… ** File not found /boot/uboot.env **

** Unable to read “/boot/uboot.env” from mmc0:1 **

U-Boot 2019.04-00002-g07d5700e21 (Mar 06 2020 - 11:24:55 -0600), Build: jenkins-github_Bootloader-Builder-137

CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver ‘omap_hsmmc’
No match for driver ‘omap_hsmmc’
Some drivers were not found
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4… ** File not found /boot/uboot.env **

** Unable to read “/boot/uboot.env” from mmc0:1 **
Board: BeagleBone Black
not set. Validating first E-fuse MAC
BeagleBone Black:
Model: SeeedStudio BeagleBone Green Gateway:
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net: eth0: MII MODE
cpsw, usb_ether
Press SPACE to abort autoboot in 0 seconds
board_name=[A335BNLT] …
board_rev=[GG1A] …
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1…
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt …
Checking for: /boot.scr …
Checking for: /boot/boot.scr …
Checking for: /boot/uEnv.txt …
gpio: pin 55 (gpio 55) value is 1
2062 bytes read in 22 ms (90.8 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt…
gpio: pin 56 (gpio 56) value is 1
Running uname_boot …
loading /boot/vmlinuz-4.19.94-ti-r42 …
10095592 bytes read in 654 ms (14.7 MiB/s)
debug: [enable_uboot_overlays=1] …
debug: [enable_uboot_cape_universal=1] …
debug: [uboot_base_dtb_univ=am335x-boneblack-uboot-univ.dtb] …
uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot-univ.dtb] …
uboot_overlays: Switching too: dtb=am335x-boneblack-uboot-univ.dtb …
loading /boot/dtbs/4.19.94-ti-r42/am335x-boneblack-uboot-univ.dtb …
162266 bytes read in 43 ms (3.6 MiB/s)
uboot_overlays: [fdt_buffer=0x60000] …
uboot_overlays: loading /lib/firmware/M-BB-BBGG-00A0.dtbo …
1931 bytes read in 409 ms (3.9 KiB/s)
uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo …
867 bytes read in 115 ms (6.8 KiB/s)
uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo …
1584 bytes read in 231 ms (5.9 KiB/s)
uboot_overlays: loading /lib/firmware/BB-BBGG-WL1835-00A0.dtbo …
3504 bytes read in 450 ms (6.8 KiB/s)
uboot_overlays: loading /lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo …
3801 bytes read in 318 ms (10.7 KiB/s)
loading /boot/initrd.img-4.19.94-ti-r42 …
6589689 bytes read in 435 ms (14.4 MiB/s)
debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet] …
debug: [bootz 0x82000000 0x88080000:648cf9 88000000] …

Flattened Device Tree blob at 88000000

Booting using the fdt blob at 0x88000000
Loading Ramdisk to 8f9b7000, end 8ffffcf9 … OK
Loading Device Tree to 8f92b000, end 8f9b6fff … OK

Starting kernel …

[ 0.002180] timer_probe: no matching timers found
[ 0.196570] l4_wkup_cm:clk:0010:0: failed to disable
[ 1.516525] omap_voltage_late_init: Voltage driver support not added

Debian GNU/Linux 10 beaglebone ttyS0

BeagleBoard.org Debian Buster IoT Image 2020-04-06

Support: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

default username:password is [debian:temppwd]

beaglebone login: debian
Password:
Last login: Thu Aug 19 18:53:11 UTC 2021 from 10.10.20.58 on pts/2

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

debian@beaglebone:~$
debian@beaglebone:~$
debian@beaglebone:~$ sudo connmanctl services
[sudo] password for debian:
*AO Wired ethernet_0e81258cd817_cable
wifi_64694e7e839d_hidden_managed_psk
bassg wifi_64694e7e839d_6261737367_managed_psk
DIRECT-25710_PT-P950NW wifi_64694e7e839d_4449524543542d32353731305f50542d503935304e57_managed_psk
BTHnetwork wifi_64694e7e839d_4254486e6574776f726b_managed_psk
SpectrumSetup-A0 wifi_64694e7e839d_537065637472756d53657475702d4130_managed_psk
wifi_64694e7e839d_hidden_managed_ieee8021x
debian@beaglebone:~$

yes, and it looks like a priming mistake by seeedstudio that is easily fixable.
(the 10 we bought last year all show the same broken behaviour.)

what’s wrong: they use an smsc95xx usb-to-ethernet chip, which has its own eeprom - but that eeprom ships EMPTY, for some stupid reason. the linux driver looks in the device tree for a mac address to set (uboot doesn’t pass one or not in a suitable spot), or in the chip’s eeprom (which is blank) and then falls back to a random mac.

solution: install ethtool and set the driver’s eeprom to something suitable.
for our boards we’ve fixed that this way:

ethtool -E eth0 magic 0x9500 offset 1 length 6 < /proc/device-tree/ocp/ethernet@4a100000/slave@4a100200/mac-address

this one-liner takes the mac address associated with the unused internal-to-the-core 10/100 ethernet and bonks it into the smsc’s eeprom. next boot you’ll see that same mac for your ethernet, and it’ll stay that way. (the manufacturer prefix is be 98:5D:AD, which belongs to TI).

as an aside, in the primary beagle eeprom at offset 60 you’ll also find a mac address with a seeedstudio-prefix, which nobody and nothing uses (that i know of) as that is a reserved block according to beaglebone docs. for our 10 bbgg boards that mac address is useless because they burned the same one on all boards,
see hexdump -C -n 4096 /sys/bus/i2c/devices/0-0050/eeprom which likely will show an identical ‘2CF7F1060001’ address.