diff options
author | Aaron Durbin <adurbin@chromium.org> | 2020-01-23 11:45:30 -0700 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2020-01-28 14:44:37 +0000 |
commit | fc7b953366b776aa3eaaf0539af06086facda14e (patch) | |
tree | 52ae47be248bed559c27128e97a51d24b8d3d3c6 /src/drivers/spi/spi_flash_internal.h | |
parent | 98eeb961353d187a26085a07889bd0414cdaa910 (diff) |
drivers/spi/spi_flash: remove spi flash names
The names of each spi flash cause quite a bit of bloat in the text
size of each stage/program. Remove the name entirely from spi flash
in order to reduce overhead. In order to pack space as closely as
possible the previous 32-bit id and mask were split into 2 16-bit
ids and masks.
On Chrome OS build of Aleena there's a savings of >2.21KiB in each
of verstage, romstage, and ramstage.
Change-Id: Ie98f7e1c7d116c5d7b4bf78605f62fee89dee0a5
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38380
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/drivers/spi/spi_flash_internal.h')
-rw-r--r-- | src/drivers/spi/spi_flash_internal.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/drivers/spi/spi_flash_internal.h b/src/drivers/spi/spi_flash_internal.h index bd52d66075..0842961be7 100644 --- a/src/drivers/spi/spi_flash_internal.h +++ b/src/drivers/spi/spi_flash_internal.h @@ -73,10 +73,12 @@ int spi_flash_cmd_read(const struct spi_flash *flash, u32 offset, size_t len, vo int stmicro_release_deep_sleep_identify(const struct spi_slave *spi, u8 *idcode); struct spi_flash_part_id { - /* rdid command constructs a 32-bit id using the following method - * for matching: 31 | id[3] | id[4] | id[1] | id[2] | 0 */ - uint32_t id; - const char *name; + /* rdid command constructs 2x 16-bit id using the following method + * for matching after reading 5 bytes (1st byte is manuf id): + * id[0] = (id[1] << 8) | id[2] + * id[1] = (id[3] << 8) | id[4] + */ + uint16_t id[2]; /* Log based 2 total number of sectors. */ uint16_t nr_sectors_shift: 4; uint16_t fast_read_dual_output_support : 1; @@ -104,7 +106,7 @@ struct spi_flash_vendor_info { uint8_t sector_size_kib_shift : 4; uint16_t nr_part_ids; const struct spi_flash_part_id *ids; - uint32_t match_id_mask; /* matching bytes of the id for this set*/ + uint16_t match_id_mask[2]; /* matching bytes of the id for this set*/ const struct spi_flash_ops_descriptor *desc; const struct spi_flash_protection_ops *prot_ops; /* Returns 0 on success. !0 otherwise. */ |