[PATCH] [MTD] [RFC] New Solarflare NIC EEPROM/Flash driver

Robert Stonehouse rstonehouse at solarflare.com
Thu Jan 10 13:51:13 EST 2008


Hi,

The company I work for (Solarflare Communications) produces a 10Gbit
network adapter and PHYs. We have a network driver (sfc.ko) which we are
currently in the process of submitting to linux-netdev.

One part of this is an MTD driver (sfc_mtd.ko) that gives access to the
EEPROM and flash parts on all our board designs. These should be useful
externally  e.g. programming the flash would be useful for people that want
to flash a PXE image onto the board for network booting.

One unusual aspect is that the MTD driver relies on HW initialisation from
the main network driver (as the registers needed to access the flash and
EEPROM are within a shared PCI BAR). There is a small API (that is named
driverlink in the code) that allows the sfc_mtd driver to detect when a
Solarflare NIC is present and to shutdown when it is removed.

In the last submission that we made to linux-netdev it was requested that
people knowledgeable about MTD drivers look over the code ... so I am sure
  I am in the right place

The thread mentioned was:
     http://marc.info/?l=linux-netdev&m=119825632209357&w=2

The complete network driver is a little too large to post to the list so:
     https://support.solarflare.com/netdev/4/net-2.6.25-sfc-2.2.0038.tgz
And for verification there is:
     https://support.solarflare.com/netdev/4/MD5SUMS

drivers/net/sfc/mtd.c contains the body of the MTD code. As the network
driver uses SPI itself (to read config data from the EEPROM) the MTD driver
uses the same access routines (in falcon.c and spi.h). falcon.c fills in a
struct efx_spi_device which includes function pointers for SPI reads and
writes an well as sizing info and this can be read after a NIC has been
detected, initialised and advertised to driverlink clients.

I would be very interested if anyone has the time to review this.

Many thanks

-- 
Rob Stonehouse



More information about the linux-mtd mailing list