diff options
author | Aaron Durbin <adurbin@chromium.org> | 2020-01-11 11:44:47 -0700 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2020-01-16 15:20:49 +0000 |
commit | cb01aa586f45277043d36500d9694d750ed33190 (patch) | |
tree | f7dcf8fad5f2f747131fdb66ba734336e84f5ad2 /src/drivers/spi/amic.c | |
parent | 56258ff92bcd0e930c62b6ae47567ed9b3b7efaf (diff) |
drivers/spi/spi_flash: assume spi_flash read callback exists
spi_flash_erase() and spi_flash_write() already assume their
respective callbacks are supplied in the spi_flash_ops object.
Make the same assumption in spi_flash_read(). In order to do this
the spi_flash_ops objects from the drivers need to reference the
the previously used fallback read command, spi_flash_read_chunked().
This function is made global and renamed to spi_flash_cmd_read() for
consistency.
By doing this further dead code elimination can be achieved when the
spi flash drivers aren't included in the build.
A Hatch Chrome OS build achieves a further text segment reduction of
0.5KiB in verstage, romstage, and ramstage.
Change-Id: I7fee55e6ffc1983657c3adde025a0e8c9d12ca23
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38366
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/drivers/spi/amic.c')
-rw-r--r-- | src/drivers/spi/amic.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/drivers/spi/amic.c b/src/drivers/spi/amic.c index 54c03c05ac..fdaf1ba569 100644 --- a/src/drivers/spi/amic.c +++ b/src/drivers/spi/amic.c @@ -120,6 +120,7 @@ static const struct amic_spi_flash_params amic_spi_flash_table[] = { }; static const struct spi_flash_ops spi_flash_ops = { + .read = spi_flash_cmd_read, .write = spi_flash_cmd_write_page_program, .erase = spi_flash_cmd_erase, }; |