imgtec/pistachio: Add spi_crop_chunk()

This was added in upstream but not in Chromium OS where
pistachio support was developed.

Change-Id: I54f883776f19aa7bd357841731166e92d03145d8
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/9808
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Patrick Georgi 2015-04-20 10:14:19 +02:00 committed by Patrick Georgi
parent 4038a7f631
commit 8549797b30
1 changed files with 5 additions and 0 deletions

View File

@ -542,3 +542,8 @@ int spi_xfer(struct spi_slave *slave, const void *dout, unsigned int bytesout,
}
return spim_io(slave, &buff_0, (dout && din) ? &buff_1 : NULL);
}
unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len)
{
return min(IMGTEC_SPI_MAX_TRANSFER_SIZE, buf_len);
}