spi: support controllers with limited transfer size capabilities
Some SPI controllers (like Imgtec Pistachio), have a hard limit on SPI
read and write transactions. Limiting transfer size in the wrapper
allows to provide the API user with unlimited transfer size
transactions.
The tranfer size limitation is added to the spi_slave structure, which
is set up by the controller driver. The value of zero in this field
means 'unlimited transfer size'. It will work with existion drivers,
as they all either keep structures in the bss segment, or initialize
them to all zeros.
This patch addresses the problem for reads only, as coreboot is not
expected to require to write long chunks into SPI devices.
BRANCH=none
BUG=chrome-os-partner:32441, chrome-os-partner:31438
TEST=set transfer size limit to artificially low value (4K) and
observed proper operation on both Pistachio and ipq8086: both
Storm and Urara booted through romstage and ramstage.
Change-Id: I9df24f302edc872bed991ea450c0af33a1c0ff7b
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/232239
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
This commit is contained in:
parent
a1577c5532
commit
4f064fdca5
4 changed files with 40 additions and 34 deletions
|
|
@ -43,11 +43,16 @@
|
|||
* bus: ID of the bus that the slave is attached to.
|
||||
* cs: ID of the chip select connected to the slave.
|
||||
* rw: Read or Write flag
|
||||
* max_transfer_size: maximum amount of bytes which can be sent in a single
|
||||
* read or write transaction, usually this is a controller
|
||||
* property, kept in the slave structure for convenience. Zero in
|
||||
* this field means 'unlimited'.
|
||||
*/
|
||||
struct spi_slave {
|
||||
unsigned int bus;
|
||||
unsigned int cs;
|
||||
unsigned int rw;
|
||||
unsigned bus;
|
||||
unsigned cs;
|
||||
unsigned rw;
|
||||
unsigned max_transfer_size;
|
||||
};
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue