On Wed, 4 Sep 2013 18:47:19 +0200 Ricardo Ribalda Delgado ricardo.ribalda@gmail.com wrote:
Hello
We are building a set of cameras with intel 82580 Gigabit chipset.
Instead of using the intel eeupdate tool to init the card and the mac I plan to use flashrom.
The eeprom is accessed with something similar to spi, but AFAIK it does not follow the jedec standard.
To probe it, there are some bits on the network card that I can use, that will tell me if the chip is there and the size.
I havent digged too much into the code, but I believe that I have to make a new chip and a new programmer.
Before starting the work I would like to know if there is something similar on flashrom that I can use as a example, and if you are interested on such a patch.
There is 0 code for EEPROMs in flashrom yet and we do not plan to work actively on supporting them, but for your approach adding two files, one for the programmer and one for the chip might be a good start :) In the past support for single chips or chip families converged into files with generic functions that support a wide range of different manufacturers, so there is probably no exact template for what you need to do regarding the chip, but that shouldnt be a big issue, just implement the needed functions in a new file, hook it up in chipdrivers.h and add a new entry to flashchips.c.
The programmer code will be harder to get right without understanding flashrom's architecture, but maybe you can use Carl-Daniel's script or at least be inspired by it: http://patchwork.coreboot.org/patch/3836/ Alternatively you could take one of the two existing intel nic drivers and just change it where needed. That would not lead to a mergeable patch but might be easier for you (OTOH you would miss to see some implementation details of a new programmer that are under the hood, for example where it needs to be hooked up). I am not sure if we would merge an EEPROM driver anyway, so getting something that works for you should be priority. There might be pre-existing alternatives for what you want... the Intel cards are very widespread and eeupdate is a PITA AFAIK, but I have never looked for a linux application to replace eeupdate...
HTH for now. I am looking forward to see any results.
Hello Stefan,
Thank you very much for your detailed reply.
After reading out the code I have decided to use the opaque register interface.
I have send a patch for review. It works much faster than eeupdate :)
The only problem that I have encounter so far is that the card re-reads the eeprom after a powercycle, a reboot is not enough... But I am researching a bit how to avoid that.
Thanks for your help
On Wed, Sep 4, 2013 at 9:46 PM, Stefan Tauner stefan.tauner@student.tuwien.ac.at wrote:
On Wed, 4 Sep 2013 18:47:19 +0200 Ricardo Ribalda Delgado ricardo.ribalda@gmail.com wrote:
Hello
We are building a set of cameras with intel 82580 Gigabit chipset.
Instead of using the intel eeupdate tool to init the card and the mac I plan to use flashrom.
The eeprom is accessed with something similar to spi, but AFAIK it does not follow the jedec standard.
To probe it, there are some bits on the network card that I can use, that will tell me if the chip is there and the size.
I havent digged too much into the code, but I believe that I have to make a new chip and a new programmer.
Before starting the work I would like to know if there is something similar on flashrom that I can use as a example, and if you are interested on such a patch.
There is 0 code for EEPROMs in flashrom yet and we do not plan to work actively on supporting them, but for your approach adding two files, one for the programmer and one for the chip might be a good start :) In the past support for single chips or chip families converged into files with generic functions that support a wide range of different manufacturers, so there is probably no exact template for what you need to do regarding the chip, but that shouldnt be a big issue, just implement the needed functions in a new file, hook it up in chipdrivers.h and add a new entry to flashchips.c.
The programmer code will be harder to get right without understanding flashrom's architecture, but maybe you can use Carl-Daniel's script or at least be inspired by it: http://patchwork.coreboot.org/patch/3836/ Alternatively you could take one of the two existing intel nic drivers and just change it where needed. That would not lead to a mergeable patch but might be easier for you (OTOH you would miss to see some implementation details of a new programmer that are under the hood, for example where it needs to be hooked up). I am not sure if we would merge an EEPROM driver anyway, so getting something that works for you should be priority. There might be pre-existing alternatives for what you want... the Intel cards are very widespread and eeupdate is a PITA AFAIK, but I have never looked for a linux application to replace eeupdate...
HTH for now. I am looking forward to see any results.
Kind regards/Mit freundlichen Grüßen, Stefan Tauner