mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 22:43:17 +02:00
Add support for the Linux SPI subsystem (spidev)
See http://www.kernel.org/doc/Documentation/spi/spidev for an introduction. Usage is as follows: flashrom -p linux_spi:dev=/dev/spidevX.Y where X is the bus number, and Y device. It accepts an optional parameter 'speed' which allows to set the SPI clock speed in kHz. Tested on an Atmel AVR32AP7000 board (NGW100 Network Gateway Kit), see below, which was used to program a ThinkPad X60, but it should work on every other Linux system, too. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4102) Corresponding to flashrom svn r1427. Signed-off-by: Sven Schnelle <svens@stackframe.org> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
This commit is contained in:

committed by
Uwe Hermann

parent
ad470347fd
commit
5ce5f70ed3
21
flashrom.c
21
flashrom.c
@ -104,6 +104,9 @@ enum programmer programmer =
|
||||
#if CONFIG_SATAMV == 1
|
||||
PROGRAMMER_SATAMV
|
||||
#endif
|
||||
#if CONFIG_LINUX_SPI == 1
|
||||
PROGRAMMER_LINUX_SPI
|
||||
#endif
|
||||
;
|
||||
#endif
|
||||
|
||||
@ -451,6 +454,24 @@ const struct programmer_entry programmer_table[] = {
|
||||
},
|
||||
#endif
|
||||
|
||||
#if CONFIG_LINUX_SPI == 1
|
||||
{
|
||||
.name = "linux_spi",
|
||||
.init = linux_spi_init,
|
||||
.map_flash_region = fallback_map,
|
||||
.unmap_flash_region = fallback_unmap,
|
||||
.chip_readb = noop_chip_readb,
|
||||
.chip_readw = fallback_chip_readw,
|
||||
.chip_readl = fallback_chip_readl,
|
||||
.chip_readn = fallback_chip_readn,
|
||||
.chip_writeb = noop_chip_writeb,
|
||||
.chip_writew = fallback_chip_writew,
|
||||
.chip_writel = fallback_chip_writel,
|
||||
.chip_writen = fallback_chip_writen,
|
||||
.delay = internal_delay,
|
||||
},
|
||||
#endif
|
||||
|
||||
{}, /* This entry corresponds to PROGRAMMER_INVALID. */
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user