summaryrefslogtreecommitdiff
path: root/src/drivers/spi/spansion.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2020-01-23 11:45:30 -0700
committerAaron Durbin <adurbin@chromium.org>2020-01-28 14:44:37 +0000
commitfc7b953366b776aa3eaaf0539af06086facda14e (patch)
tree52ae47be248bed559c27128e97a51d24b8d3d3c6 /src/drivers/spi/spansion.c
parent98eeb961353d187a26085a07889bd0414cdaa910 (diff)
downloadcoreboot-fc7b953366b776aa3eaaf0539af06086facda14e.tar.xz
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/spansion.c')
-rw-r--r--src/drivers/spi/spansion.c65
1 files changed, 36 insertions, 29 deletions
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,