PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : New tool: fortis_eeprom



Audioniek
17.04.2019, 17:41
The bootloaders 6.?6, 6.?7, 7.?6 and 7.?7 have a bug: they do not convey the receivers' MAC address to the kernel command line when set to USB boot. This problem only occurs when booting from an USB medium; when booting from flash the MAC is transferred correctly. As a result, USB images tend to have the problem of having a different IP number after restarting when the network is set to DHCP. I have solved this in the following manner.

All Fortis receivers have a small EEPROM on the main board in which the factory has written the MAC address. It resides at I2C addres 0x57 and is 256 bytes large. The bootloader fetches the MAC address from it and stores it in the bootarg variable ethaddr when setting the default bootargs. The bootargs then can use the MAC address through $ethaddr. Because of the bug, the kernel has no way of knowing the MAC address, other than reading it from the EEPROM. This would mean adding a lot of code to the kernel which also has limited resources to begin with.

An easier approach was to correct the MAC address in the startup routine rcS, before the network was initialized. Commands to do this are readily available and standard, so the only thing to do was read out the EEPOM to retrieve the MAC address. Help was close, as the apps git already had the tool ipbox_eeprom. This tool was stripped of all unnecessary stuff and some code was added to output the MAC address as a string. As a bonus I also added an option to dump the contents of the EEPROM in hex.

The result of all this is reflected in my gits: in apps you can find the source code, in buildsystem the modified rcS routines can be found (in root/release). The tool is only built with DESTINATION=USB and only on hs7xxx models.

Regards,

Audioniek.