summaryrefslogtreecommitdiffstats
path: root/linux_spi.c
Commit message (Collapse)AuthorAgeFilesLines
* Let the programmer driver decide how to do AAI transfersNico Huber2012-06-151-0/+1
| | | | | | | | | | | | | | | | 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>
* Make the presence of Linux SPI headers mandatory for linux_spiStefan Tauner2012-03-131-0/+5
| | | | | | | | | | | 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>
* Prevent submission of empty read requests in linux_spiMichael Karcher2012-03-061-2/+14
| | | | | | | | | | | | | | 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>
* linux_spi.c: set SPI mode, bit order and bits per word on initStefan Tauner2012-03-031-3/+19
| | | | | | | | | | | | | | 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>
* Add struct flashctx * parameter to all functions accessing flash chipsCarl-Daniel Hailfinger2011-12-181-6/+12
| | | | | | | | | | | | | | | | 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>
* Use struct flashctx instead of struct flashchip for flash chip accessCarl-Daniel Hailfinger2011-12-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | 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>
* Unsignify lengths and addresses in chip functions and structsStefan Tauner2011-11-231-8/+8
| | | | | | | | | | 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>
* Small fixes for the linux_spi programmer codeSven Schnelle2011-09-071-7/+12
| | | | | | | Corresponding to flashrom svn r1432. Signed-off-by: Sven Schnelle <svens@stackframe.org> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Fix linux_spi.c build on 32bit systemsUwe Hermann2011-09-061-2/+2
| | | | | | | Corresponding to flashrom svn r1428. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Add support for the Linux SPI subsystem (spidev)Sven Schnelle2011-09-031-0/+139
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>
OpenPOWER on IntegriCloud