diff options
author | Furquan Shaikh <furquan@chromium.org> | 2016-11-17 16:17:37 -0800 |
---|---|---|
committer | Furquan Shaikh <furquan@google.com> | 2016-11-22 17:33:33 +0100 |
commit | dc34fb60b4151a7fad3882cc85dac4379f2d8dd8 (patch) | |
tree | e1ef39bd00fa5c252fb200a231d6e67915db73fa /src/drivers | |
parent | c28984d9ea08e7d995ef9fc8064c10ec0c0d9d77 (diff) | |
download | coreboot-dc34fb60b4151a7fad3882cc85dac4379f2d8dd8.tar.xz |
spi: Get rid of max_transfer_size parameter in spi_slave structure
max_transfer_size is a property of the SPI controller and not of the spi
slave. Also, this is used only on one SoC currently. There is no need to
handle this at the spi flash layer.
This change moves the handling of max_transfer_size to SoC SPI driver
and gets rid of the max_transfer_size parameter.
BUG=None
BRANCH=None
TEST=Compiles successfully.
Change-Id: I19a1d0a83395a58c2bc1614b24518a3220945a60
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/17463
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/spi/spi_flash.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c index 7ca6822ba1..baa1f1aeab 100644 --- a/src/drivers/spi/spi_flash.c +++ b/src/drivers/spi/spi_flash.c @@ -123,25 +123,8 @@ static int spi_flash_cmd_read_array(struct spi_slave *spi, u8 *cmd, size_t cmd_len, u32 offset, size_t len, void *data) { - while (len) { - size_t transfer_size; - - if (spi->max_transfer_size) - transfer_size = min(len, spi->max_transfer_size); - else - transfer_size = len; - - spi_flash_addr(offset, cmd); - - if (spi_flash_cmd_read(spi, cmd, cmd_len, data, transfer_size)) - break; - - offset += transfer_size; - data = (void *)((uintptr_t)data + transfer_size); - len -= transfer_size; - } - - return len != 0; + spi_flash_addr(offset, cmd); + return spi_flash_cmd_read(spi, cmd, cmd_len, data, len); } int spi_flash_cmd_read_fast(const struct spi_flash *flash, u32 offset, |