From d701ef7475fe6d015a61cd91410391c3e0902f53 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 27 Dec 2019 15:16:17 -0700 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/37963 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Marshall Dawson --- src/include/spi_flash.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/include') diff --git a/src/include/spi_flash.h b/src/include/spi_flash.h index 3a0c383676..1a5a82934e 100644 --- a/src/include/spi_flash.h +++ b/src/include/spi_flash.h @@ -104,6 +104,8 @@ struct spi_flash { u32 page_size; u8 erase_cmd; u8 status_cmd; + u8 pp_cmd; /* Page program command. */ + u8 wren_cmd; /* Write Enable command. */ const struct spi_flash_ops *ops; const void *driver_private; }; -- cgit v1.2.3