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?

2
  • Welcome @Dakkaron. Could you please clarify what you're trying to do? Are you trying to find the serial number of your Compute Module? The serial number of your LAN9512 controller? Where's this EEPROM that you're talking about? According to the device's datasheet your device only has a controller to interface to an external EEPROM.
    – David
    Apr 4, 2019 at 1:54
  • Yes, that is what I mean. I have this setup: CM3 <- [USB] -> LAN9512 <- [SPI] -> External EEPROM. According to the datasheet the LAN9512 should be able to forward the EEPROM's contents to the CM3. But the USB connection is managed by a driver on the CM side of things, so I don't think I am able to issue USB commands directly. I would ideally like to be able to dump the whole EEPROM's contents, but if that is not possible I would at least like to dump the content of the serial number field of thr EEPROM (as defined by the LAN9512 which uses this field as it's serial number)
    – Dakkaron
    Apr 4, 2019 at 7:48

1 Answer 1

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.

1
  • Pretty awesome^^ I don't work at the place any more where I had that project, but I'll forward your answer to my old colleagues!
    – Dakkaron
    Aug 10, 2023 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.