From fc7b953366b776aa3eaaf0539af06086facda14e Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Thu, 23 Jan 2020 11:45:30 -0700 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/38380 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/drivers/spi/spansion.c | 65 +++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 29 deletions(-) (limited to 'src/drivers/spi/spansion.c') diff --git a/src/drivers/spi/spansion.c b/src/drivers/spi/spansion.c index c694f4517e..29b7027b65 100644 --- a/src/drivers/spi/spansion.c +++ b/src/drivers/spi/spansion.c @@ -51,74 +51,79 @@ static const struct spi_flash_part_id flash_table_ext[] = { { - .id = SPSN_ID_S25FL008A, - .name = "S25FL008A", + /* S25FL008A */ + .id[0] = SPSN_ID_S25FL008A, .nr_sectors_shift = 4, }, { - .id = SPSN_ID_S25FL016A, - .name = "S25FL016A", + /* S25FL016A */ + .id[0] = SPSN_ID_S25FL016A, .nr_sectors_shift = 5, }, { - .id = SPSN_ID_S25FL032A, - .name = "S25FL032A", + /* S25FL032A */ + .id[0] = SPSN_ID_S25FL032A, .nr_sectors_shift = 6, }, { - .id = SPSN_ID_S25FL064A, - .name = "S25FL064A", + /* S25FL064A */ + .id[0] = SPSN_ID_S25FL064A, .nr_sectors_shift = 7, }, { - .id = (SPSN_EXT_ID_S25FL128P_64KB << 16) | SPSN_ID_S25FL128P, - .name = "S25FL128P_64K", + /* S25FL128P_64K */ + .id[0] = SPSN_ID_S25FL128P, + .id[1] = SPSN_EXT_ID_S25FL128P_64KB, .nr_sectors_shift = 8, }, { - .id = (SPSN_EXT_ID_S25FLXXS_64KB << 16) | SPSN_ID_S25FL128S, - .name = "S25FL128S_256K", + /* S25FL128S_256K */ + .id[0] = SPSN_ID_S25FL128S, + .id[1] = SPSN_EXT_ID_S25FLXXS_64KB, .nr_sectors_shift = 9, }, { - .id = (SPSN_EXT_ID_S25FL032P << 16) | SPSN_ID_S25FL032A, - .name = "S25FL032P", + /* S25FL032P */ + .id[0] = SPSN_ID_S25FL032A, + .id[1] = SPSN_EXT_ID_S25FL032P, .nr_sectors_shift = 6, }, { - .id = (SPSN_EXT_ID_S25FLXXS_64KB << 16) | SPSN_ID_S25FL128P, - .name = "S25FS128S", + /* S25FS128S */ + .id[0] = SPSN_ID_S25FL128P, + .id[1] = SPSN_EXT_ID_S25FLXXS_64KB, .nr_sectors_shift = 8, }, }; static const struct spi_flash_part_id flash_table_256k_sector[] = { { - .id = (SPSN_EXT_ID_S25FL128P_256KB << 16) | SPSN_ID_S25FL128P, - .name = "S25FL128P_256K", + /* S25FL128P_256K */ + .id[0] = SPSN_ID_S25FL128P, + .id[1] = SPSN_EXT_ID_S25FL128P_256KB, .nr_sectors_shift = 6, }, }; static const struct spi_flash_part_id flash_table[] = { { - .id = SPSN_ID_S25FL208K, - .name = "S25FL208K", + /* S25FL208K */ + .id[0] = SPSN_ID_S25FL208K, .nr_sectors_shift = 4, }, { - .id = SPSN_ID_S25FL116K, - .name = "S25FL116K_16M", + /* S25FL116K_16M */ + .id[0] = SPSN_ID_S25FL116K, .nr_sectors_shift = 5, }, { - .id = SPSN_ID_S25FL132K, - .name = "S25FL132K", + /* S25FL132K */ + .id[0] = SPSN_ID_S25FL132K, .nr_sectors_shift = 6, }, { - .id = SPSN_ID_S25FL164K, - .name = "S25FL164K", + /* S25FL164K */ + .id[0] = SPSN_ID_S25FL164K, .nr_sectors_shift = 7, }, }; @@ -127,7 +132,8 @@ const struct spi_flash_vendor_info spi_flash_spansion_ext1_vi = { .id = VENDOR_ID_SPANSION, .page_size_shift = 8, .sector_size_kib_shift = 6, - .match_id_mask = 0xffffffff, + .match_id_mask[0] = 0xffff, + .match_id_mask[1] = 0xffff, .ids = flash_table_ext, .nr_part_ids = ARRAY_SIZE(flash_table_ext), .desc = &spi_flash_pp_0xd8_sector_desc, @@ -137,7 +143,8 @@ const struct spi_flash_vendor_info spi_flash_spansion_ext2_vi = { .id = VENDOR_ID_SPANSION, .page_size_shift = 8, .sector_size_kib_shift = 8, - .match_id_mask = 0xffffffff, + .match_id_mask[0] = 0xffff, + .match_id_mask[1] = 0xffff, .ids = flash_table_256k_sector, .nr_part_ids = ARRAY_SIZE(flash_table_256k_sector), .desc = &spi_flash_pp_0xd8_sector_desc, @@ -147,7 +154,7 @@ const struct spi_flash_vendor_info spi_flash_spansion_vi = { .id = VENDOR_ID_SPANSION, .page_size_shift = 8, .sector_size_kib_shift = 6, - .match_id_mask = 0xffff, + .match_id_mask[0] = 0xffff, .ids = flash_table, .nr_part_ids = ARRAY_SIZE(flash_table), .desc = &spi_flash_pp_0xd8_sector_desc, -- cgit v1.2.3