3

We are building a device around the Compute Module 3 and since it needs internet access we decided to go with the LAN9512 that was also used in the Raspberry Pi earlier.

The LAN9512 requires an EEPROM to function and that EEPROM has a field for a serial number. According to the LAN9512 datasheet the USB Host (meaning the Compute Module) should be able to read the EEPROM content, so we figured we could put the serial number of our device into the LAN9512 EEPROM. But I can't find a way to read the serial number (or better the whole EEPROM content) from the Compute Module.

How can I do that / where can I find more information on that?

Dakkaron
  • 143
  • 3

1 Answers1

1

I know I'm years late but I've been searching for an answer to this question today. I found an answer at Microchip website : https://microchip.my.site.com/s/article/LAN95xx-EEPROM-Programming-on-Linux

Using Linux command line utility ethtool, you can read/write the EEPROM connected to the LAN95xx component. Tested on a Raspberry CM4 plugged on a personnaly developped board including a Microchip LAN9514.

The following commands (from Microchip link above) allow you to read 256 bytes from the EEPROM, write a byte or write a 256 bytes file into the EEPROM.

$sudo ethtool –e eth0 offset 0 length 256
$sudo ethtool –E eth0 magic 0x9500 offset 0 length 1 value 0xA5
$sudo ethtool –E eth0 magic 0x9500 offset 0 length 256 < eeprom.bin

Adjust "eth0" to your needs: my board has two Ethernet interfaces. In my case eth0 is the gigabit ethernet of the CM4, eth1 is the LAN9514, so I have to use "ethtool -e eth1 ..." command lines.

CastorJ
  • 51
  • 2