After installing OpenWRT I found the following in the dmesg:
EEPROM data check failed: 0000
Invalid MAC address, using random address xx:xx:xx:xx:xx:xx
According to https://openwrt.org/toh/netgear/r6220 this could be a problem with bad erase blocks resulting different wifi calibration data location, The problem is supposed to have bean fixed on 19.07. I tried 19.07.0, 19.07.10 and 21.02.3. No luck. After reverting to stock firmware, router gets proper MAC. Thus, the problem seems to be related to OpenWRT only.
I do not know if this is significant but the OpenWRT description mentions:
EEPROM data check failed: ffff
but I get
EEPROM data check failed: 0000
Any suggestions how to get proper MAC and calibration data?
I dumped mtd using both, stock firmware and OpenWRT. When using stock dumping mtd10 (factory) and mtd18 (ML6) was impossible. That is why I dumped mtdblock instead. All dumps are available at http://yen.ipipan.waw.pl/~gs159090/MTD.txz
I do not know to much about calibration data. Compering the contents of Factory (mtdblock10@stock vs. mtd4@OpenWRT) I noticed that the contents of mtdblock10@stock is at the offset 0x20000 of mtd4@OpenWRT.
However, it looks like the factory partition is supposed to be at 0x2e00000, not 0x20000, so the addresses OpenWrt expects the calibration data to be at would be 0x2e00000 and 0x2e08000 respectively (taking the offsets into account), if I'm not mistaken:
copy with scp mtd10-modified to /tmp/tmp
cd /tmp/tmp
mtd write mtd10_modified factory
reboot
*
I have already used this method to change the MAC addresses of several boxes that had MAC address that did not correspond to the product label like my NewIfi D2
If you cannot add kmod-mtd-rw to build the module outside the OpenWRT-build-system, use
$ make CONFIG_MTD_RW=m
make -j4
flash
Thanks for the announce. The patch was applied to mtd-next. I backported it to 5.10 and 5.15 kernel in this PR. We need a reviewer from OpenWrt team. After that we can apply the patch to all necessary devices.
Would be better to open a separate PR for the backport, since you're widening the scope of the existing one. Will be more difficult to trace commits, too, and lots of other devices will benefit from this.
Nice idea. I can also make a PR applies the changes to R6260. I need someone who have the device with bad blocks and ready to make tests.
upd. ready - https://github.com/openwrt/openwrt/pull/10038