aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/spi/spi_flash_internal.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2019-12-27 15:16:17 -0700
committerAaron Durbin <adurbin@chromium.org>2020-01-06 15:00:50 +0000
commitd701ef7475fe6d015a61cd91410391c3e0902f53 (patch)
treea3b1aaaaa6490b62ef7c71e9a119a41bd32d825a /src/drivers/spi/spi_flash_internal.h
parent9e877ec60d177565776b20e3d61f723a9552ee34 (diff)
drives/spi_flash: add spi_flash_cmd_write_page_program()
The SPI flashes that support page programming mode had duplicated the logic for writing in every driver. Add spi_flash_cmd_write_page_program() and use the common implementation to reduce code size that comes from duplication. The savings is ~2.5KiB per stage where the spi flash drivers are utilized. Change-Id: Ie6db03fa8ad33789f1d07a718a769e4ca8bffe1d Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37963 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Diffstat (limited to 'src/drivers/spi/spi_flash_internal.h')
-rw-r--r--src/drivers/spi/spi_flash_internal.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/drivers/spi/spi_flash_internal.h b/src/drivers/spi/spi_flash_internal.h
index 36fa66d67c..f99c90ed36 100644
--- a/src/drivers/spi/spi_flash_internal.h
+++ b/src/drivers/spi/spi_flash_internal.h
@@ -62,6 +62,10 @@ int spi_flash_cmd_erase(const struct spi_flash *flash, u32 offset, size_t len);
/* Read status register. */
int spi_flash_cmd_status(const struct spi_flash *flash, u8 *reg);
+/* Write to flash utilizing page program semantics. */
+int spi_flash_cmd_write_page_program(const struct spi_flash *flash, u32 offset,
+ size_t len, const void *buf);
+
/* Manufacturer-specific probe functions */
int spi_flash_probe_spansion(const struct spi_slave *spi, u8 *idcode,
struct spi_flash *flash);