1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-26 22:52:34 +02:00

10 Commits

Author SHA1 Message Date
Nico Huber
7bca126561 Let the programmer driver decide how to do AAI transfers
Currently spi_aai_write() is implemented without an abstraction
mechanism for the programmer driver. This adds another function
pointer 'write_aai' to struct spi_programmer, which is set to
default_spi_write_aai (renamed spi_aai_write) for all programmers
for now.

A patch which utilises this abstraction in the dediprog driver will
follow.

Corresponding to flashrom svn r1543.

Signed-off-by: Nico Huber <nico.huber@secunet.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-06-15 22:28:12 +00:00
Stefan Tauner
8868db37b7 Make the presence of Linux SPI headers mandatory for linux_spi
This solution is copied from ft2232_spi and is equally hacky.
Thanks to M.K. for investigating the history of <linux/spi/spidev.h>, which
led to a hopefully more robust check.

Corresponding to flashrom svn r1517.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
2012-03-13 00:18:19 +00:00
Michael Karcher
8371d7238a Prevent submission of empty read requests in linux_spi
The submission of zero-sized read requests in a write-only transaction
fails at least for omap2_mcspi drivers and is pointless in general.

This patch does not address the implementation of zero-sized writes (which
would need to skip the write command), as there are no flash transactions
not starting with a command.

Corresponding to flashrom svn r1513.

Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-03-06 22:17:06 +00:00
Stefan Tauner
2c3e9d5f57 linux_spi.c: set SPI mode, bit order and bits per word on init
Previously we relied on a correctly set up state.

Also, we start to rely on the shutdown function for cleanup after
registering it, i.e. we no longer explicitly call close(fd) after
register_shutdown().

Corresponding to flashrom svn r1512.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Tested-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-03-03 18:09:33 +00:00
Carl-Daniel Hailfinger
8a3c60cdd0 Add struct flashctx * parameter to all functions accessing flash chips
All programmer access function prototypes except init have been made
static and moved to the respective file.

A few internal functions in flash chip drivers had chipaddr parameters
which are no longer needed.

The lines touched by flashctx changes have been adjusted to 80 columns
except in header files.

Corresponding to flashrom svn r1474.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
2011-12-18 15:01:24 +00:00
Carl-Daniel Hailfinger
63fd9026f1 Use struct flashctx instead of struct flashchip for flash chip access
Struct flashchip is used only for the flashchips array and for
operations which do not access hardware, e.g. printing a list of
supported flash chips.

struct flashctx (flash context) contains all data available in
struct flashchip, but it also contains runtime information like
mapping addresses. struct flashctx is expected to grow additional
members over time, a prime candidate being programmer info.
struct flashctx contains all of struct flashchip with identical
member layout, but struct flashctx has additional members at the end.

The separation between struct flashchip/flashctx shrinks the memory
requirement of the big flashchips array and allows future extension
of flashctx without having to worry about bloat.

Corresponding to flashrom svn r1473.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
2011-12-14 22:25:15 +00:00
Stefan Tauner
c69c9c84e0 Unsignify lengths and addresses in chip functions and structs
Push those changes forward where needed to prevent new sign
conversion warnings where possible.

Corresponding to flashrom svn r1470.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2011-11-23 09:13:48 +00:00
Sven Schnelle
cb24ddbe12 Small fixes for the linux_spi programmer code
Corresponding to flashrom svn r1432.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2011-09-07 20:48:34 +00:00
Uwe Hermann
48446c86ff Fix linux_spi.c build on 32bit systems
Corresponding to flashrom svn r1428.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2011-09-06 18:17:02 +00:00
Sven Schnelle
5ce5f70ed3 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>
2011-09-03 18:37:52 +00:00