u-boot/drivers
Kyle Moffett ce5207e191 e1000: Allow direct access to the E1000 SPI EEPROM device
As a part of the manufacturing process for some of our custom hardware,
we are programming the EEPROMs attached to our Intel 82571EB controllers
from software using U-Boot and Linux.

This code provides several conditionally-compiled features to assist in
our manufacturing process:

  CONFIG_CMD_E1000:
    This is a basic "e1000" command which allows querying the controller
    and (if other config options are set) performing EEPROM programming.
    In particular, with CONFIG_E1000_SPI this allows you to display a
    hex-dump of the EEPROM, copy to/from main memory, and verify/update
    the software checksum.

  CONFIG_E1000_SPI_GENERIC:
    Build a generic SPI driver providing the standard U-Boot SPI driver
    interface.  This allows commands such as "sspi" to access the bus
    attached to the E1000 controller.  Additionally, some E1000 chipsets
    can support user data in a reserved space in the E1000 EEPROM which
    could be used for U-Boot environment storage.

  CONFIG_E1000_SPI:
    The core SPI access code used by the above interfaces.

For example, the following commands allow you to program the EEPROM from
a USB device (assumes CONFIG_E1000_SPI and CONFIG_CMD_E1000 are enabled):
  usb start
  fatload usb 0 $loadaddr 82571EB_No_Mgmt_Discrete-LOM.bin
  e1000 0 spi program $loadaddr 0 1024
  e1000 0 spi checksum update

Please keep in mind that the Intel-provided .eep files are organized as
16-bit words.  When converting them to binary form for programming you
must byteswap each 16-bit word so that it is in little-endian form.

This means that when reading and writing words to the SPI EEPROM, the
bit ordering for each word looks like this on the wire:

  Time >>>
------------------------------------------------------------------
  ... [7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8], ...
------------------------------------------------------------------
  (MSB is 15, LSB is 0).

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Cc: Ben Warren <biggerbadderben@gmail.com>
2011-10-28 00:37:01 +02:00
..
bios_emulator Replace space and tab checks with isblank 2011-10-17 22:25:34 +02:00
block GCC4.6: Squash warnings in sata_sil3114.c 2011-10-27 23:54:05 +02:00
dma omap3: Add interface for omap3 DMA 2011-10-27 21:56:34 +02:00
fpga GCC4.6: Squash warnings in lattice.c 2011-10-27 23:54:07 +02:00
gpio gpio: mvmfp: reduce include platform file 2011-10-27 21:56:33 +02:00
hwmon hwmon: do not init sensors on startup 2011-08-04 23:30:38 +02:00
i2c I2C: Add i2c_get/set_speed() to mxc_i2c.c 2011-10-27 21:56:30 +02:00
input Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
misc misc: pmic: drop old Freescale's pmic driver 2011-10-27 21:56:32 +02:00
mmc Merge branch 'master' of git://git.denx.de/u-boot-arm 2011-10-28 00:15:19 +02:00
mtd GCC4.6: Use debug() instead of debugX() in s3c24xx_nand.c 2011-10-27 23:54:08 +02:00
net e1000: Allow direct access to the E1000 SPI EEPROM device 2011-10-28 00:37:01 +02:00
pci GCC4.6: Squash warnings in fsl_pci_init.c 2011-10-27 23:54:05 +02:00
pcmcia GCC4.6: Squash error in pcmcia/i82365.c 2011-10-27 23:54:05 +02:00
power mmc: omap: config VMMC, MMC1_PBIAS 2011-09-30 22:00:55 +02:00
qe fsl: Change fsl_phy_enet_if to phy_interface_t 2011-04-20 15:09:35 -05:00
rtc RTC: Switch mc13783 to generic pmic code 2011-10-27 21:56:31 +02:00
serial ARM:AM33XX: Add support for TI AM335X EVM 2011-10-27 21:56:36 +02:00
spi Merge branch 'master' of git://git.denx.de/u-boot-arm 2011-10-28 00:15:19 +02:00
twserial Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
usb Merge branch 'master' of git://git.denx.de/u-boot-arm 2011-10-28 00:15:19 +02:00
video GCC4.6: Squash warning in bus_vcxk.c 2011-10-27 23:54:07 +02:00
watchdog AT91: fix at91sam_wdt.c to reworked header files 2011-05-18 07:56:51 +02:00