summaryrefslogtreecommitdiff
path: root/src/soc/marvell/bg4cd
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2016-12-17 13:16:07 -0600
committerAaron Durbin <adurbin@chromium.org>2016-12-19 22:34:52 +0100
commit41f669023953b3d032078ffc17d80944880d1db7 (patch)
treeed5243a97c69a8d55c5fb7bd748fa158d36008a4 /src/soc/marvell/bg4cd
parent06cd903566b57af4698089de4a67dd49bf7e56ed (diff)
drivers/spi: fix flash writes at page boundaries
There was an assumption that all SPI controllers could consume a full page of data to write. However, that assumption doesn't hold when spi_crop_chunk() indicates sizes smaller than page size. If the requested offset isn't page aligned from the start then writes will fail corrupting data since a page boundary isn't honored. The spansion driver needed quite a bit more work to honor the spi_crop_chunk() result. It now mimics the other driver's code. Also, needed to add spi_crop_chunk() to marvell/bg4cd SoC to make google/cosmos build. SPI obviously doesn't work on that platform, but it fixes the build error. Change-Id: I93e24a5a717adcee45a017c164bd960f4592ad50 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/17910 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/soc/marvell/bg4cd')
-rw-r--r--src/soc/marvell/bg4cd/spi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/soc/marvell/bg4cd/spi.c b/src/soc/marvell/bg4cd/spi.c
index 188a6bd483..f9faf9504a 100644
--- a/src/soc/marvell/bg4cd/spi.c
+++ b/src/soc/marvell/bg4cd/spi.c
@@ -19,3 +19,8 @@ int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave)
{
return -1;
}
+
+unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len)
+{
+ return buf_len;
+}