From 8549797b3047add2f1700d9f288cebaf7b85f5b8 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Mon, 20 Apr 2015 10:14:19 +0200 Subject: 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 Reviewed-on: http://review.coreboot.org/9808 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/soc/imgtec/pistachio/spi.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/soc/imgtec') diff --git a/src/soc/imgtec/pistachio/spi.c b/src/soc/imgtec/pistachio/spi.c index 64d18a3ca0..3cae6af79e 100644 --- a/src/soc/imgtec/pistachio/spi.c +++ b/src/soc/imgtec/pistachio/spi.c @@ -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); +} -- cgit v1.2.3