After debugging the driver, it looked like it was not able to find the device tree node with the MAC address, and was therefore assigning a random MAC address. Further debugging showed that the device was actually being detected as an RPi3b instead of an RPi3b+:
Even though all firmware and device trees are the same. The only difference was that in UC22 we set os_prefix [1] to ask the firmware to load files from a different folder. After copying to the root of the seed partition kernel, initrd, device trees, and cmdline.txt files, I removed the os_prefix and rebooted. After that, an RPi3b+ is properly detected and the MAC has a fixed address. So, it turns out that this is a firmware bug in the implementation of os_prefix.
After debugging the driver, it looked like it was not able to find the device tree node with the MAC address, and was therefore assigning a random MAC address. Further debugging showed that the device was actually being detected as an RPi3b instead of an RPi3b+:
$ cat /proc/device- tree/compatible 3-model- b\0brcm, bcm2837\ 0
raspberrypi,
While in rpi jammy classic images you see:
$ cat /proc/device- tree/compatible 3-model- b-plus\ 0brcm,bcm2837\ 0
raspberrypi,
Even though all firmware and device trees are the same. The only difference was that in UC22 we set os_prefix [1] to ask the firmware to load files from a different folder. After copying to the root of the seed partition kernel, initrd, device trees, and cmdline.txt files, I removed the os_prefix and rebooted. After that, an RPi3b+ is properly detected and the MAC has a fixed address. So, it turns out that this is a firmware bug in the implementation of os_prefix.
[1] https:/ /www.raspberryp i.com/documenta tion/computers/ config_ txt.html# os_prefix