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>
This commit is contained in:
Aaron Durbin
2020-01-23 11:45:30 -07:00
parent 98eeb96135
commit fc7b953366
16 changed files with 349 additions and 339 deletions

View File

@@ -41,63 +41,63 @@
static const struct spi_flash_part_id flash_table[] = { static const struct spi_flash_part_id flash_table[] = {
{ {
.id = 0x4218, /* AT25SL128A */
.name = "AT25SL128A", .id[0] = 0x4218,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
}, },
{ {
.id = 0x4501, /* AT25DF081A Yes, 81A id < 81 */
.name = "AT25DF081A", /* Yes, 81A id < 81 */ .id[0] = 0x4501,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
{ {
.id = 0x4502, /* AT25DF081 */
.name = "AT25DF081", .id[0] = 0x4502,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
{ {
.id = 0x4602, /* AT25DF161 */
.name = "AT25DF161", .id[0] = 0x4602,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x4603, /* AT25DL161 */
.name = "AT25DL161", .id[0] = 0x4603,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x4700, /* AT25DF321 */
.name = "AT25DF321", .id[0] = 0x4700,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = 0x4701, /* AT25DF321A */
.name = "AT25DF321A", .id[0] = 0x4701,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = 0x4800, /* AT25DF641 */
.name = "AT25DF641", .id[0] = 0x4800,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
{ {
.id = 0x8501, /* AT25SF081 */
.name = "AT25SF081", .id[0] = 0x8501,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
{ {
.id = 0x8600, /* AT25DQ161 */
.name = "AT25DQ161", .id[0] = 0x8600,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x8601, /* AT25SF161 */
.name = "AT25SF161", .id[0] = 0x8601,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x8700, /* AT25DQ321 */
.name = "AT25DQ321", .id[0] = 0x8700,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
}; };
@@ -106,7 +106,7 @@ const struct spi_flash_vendor_info spi_flash_adesto_vi = {
.id = VENDOR_ID_ADESTO, .id = VENDOR_ID_ADESTO,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_shift = 2, .sector_size_kib_shift = 2,
.match_id_mask = 0xffff, .match_id_mask[0] = 0xffff,
.ids = flash_table, .ids = flash_table,
.nr_part_ids = ARRAY_SIZE(flash_table), .nr_part_ids = ARRAY_SIZE(flash_table),
.desc = &spi_flash_pp_0x20_sector_desc, .desc = &spi_flash_pp_0x20_sector_desc,

View File

@@ -36,48 +36,48 @@
static const struct spi_flash_part_id flash_table[] = { static const struct spi_flash_part_id flash_table[] = {
{ {
.id = 0x2015, /* A25L16PU */
.name = "A25L16PU", .id[0] = 0x2015,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x2025, /* A25L16PT */
.name = "A25L16PT", .id[0] = 0x2025,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x3014, /* A25L080 */
.name = "A25L080", .id[0] = 0x3014,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
{ {
.id = 0x3015, /* A25L016 */
.name = "A25L016", .id[0] = 0x3015,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x3016, /* A25L032 */
.name = "A25L032", .id[0] = 0x3016,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = 0x4014, /* A25LQ080 */
.name = "A25LQ080", .id[0] = 0x4014,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
{ {
.id = 0x4015, /* A25LQ16 */
.name = "A25LQ16", .id[0] = 0x4015,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x4016, /* A25LQ032 */
.name = "A25LQ032", .id[0] = 0x4016,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = 0x4017, /* A25LQ64 */
.name = "A25LQ64", .id[0] = 0x4017,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
}; };
@@ -86,7 +86,7 @@ const struct spi_flash_vendor_info spi_flash_amic_vi = {
.id = VENDOR_ID_AMIC, .id = VENDOR_ID_AMIC,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_shift = 2, .sector_size_kib_shift = 2,
.match_id_mask = 0xffff, .match_id_mask[0] = 0xffff,
.ids = flash_table, .ids = flash_table,
.nr_part_ids = ARRAY_SIZE(flash_table), .nr_part_ids = ARRAY_SIZE(flash_table),
.desc = &spi_flash_pp_0x20_sector_desc, .desc = &spi_flash_pp_0x20_sector_desc,

View File

@@ -36,38 +36,38 @@
static const struct spi_flash_part_id flash_table[] = { static const struct spi_flash_part_id flash_table[] = {
{ {
.id = 0x3015, /* AT25X16 */
.name = "AT25X16", .id[0] = 0x3015,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x47, /* AT25DF32 */
.name = "AT25DF32", .id[0] = 0x47,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = 0x3017, /* AT25X64 */
.name = "AT25X64", .id[0] = 0x3017,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
{ {
.id = 0x4015, /* AT25Q16 */
.name = "AT25Q16", .id[0] = 0x4015,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x4016, /* AT25Q32 */
.name = "AT25Q32", .id[0] = 0x4016,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = 0x4017, /* AT25Q64 */
.name = "AT25Q64", .id[0] = 0x4017,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
{ {
.id = 0x4018, /* AT25Q128 */
.name = "AT25Q128", .id[0] = 0x4018,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
}, },
}; };
@@ -76,7 +76,7 @@ const struct spi_flash_vendor_info spi_flash_atmel_vi = {
.id = VENDOR_ID_ATMEL, .id = VENDOR_ID_ATMEL,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_shift = 2, .sector_size_kib_shift = 2,
.match_id_mask = 0xffff, .match_id_mask[0] = 0xffff,
.ids = flash_table, .ids = flash_table,
.nr_part_ids = ARRAY_SIZE(flash_table), .nr_part_ids = ARRAY_SIZE(flash_table),
.desc = &spi_flash_pp_0x20_sector_desc, .desc = &spi_flash_pp_0x20_sector_desc,

View File

@@ -57,108 +57,108 @@
static const struct spi_flash_part_id flash_table[] = { static const struct spi_flash_part_id flash_table[] = {
{ {
.id = EON_ID_EN25B80, /* EN25B80 */
.name = "EN25B80", .id[0] = EON_ID_EN25B80,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
{ {
.id = EON_ID_EN25B16, /* EN25B16 */
.name = "EN25B16", .id[0] = EON_ID_EN25B16,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = EON_ID_EN25B32, /* EN25B32 */
.name = "EN25B32", .id[0] = EON_ID_EN25B32,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = EON_ID_EN25B64, /* EN25B64 */
.name = "EN25B64", .id[0] = EON_ID_EN25B64,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
{ {
.id = EON_ID_EN25F80, /* EN25F80 */
.name = "EN25F80", .id[0] = EON_ID_EN25F80,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
{ {
.id = EON_ID_EN25F16, /* EN25F16 */
.name = "EN25F16", .id[0] = EON_ID_EN25F16,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = EON_ID_EN25F32, /* EN25F32 */
.name = "EN25F32", .id[0] = EON_ID_EN25F32,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = EON_ID_EN25F64, /* EN25F64 */
.name = "EN25F64", .id[0] = EON_ID_EN25F64,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
{ {
.id = EON_ID_EN25Q80, /* EN25Q80(A) */
.name = "EN25Q80(A)", .id[0] = EON_ID_EN25Q80,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
{ {
.id = EON_ID_EN25Q16, /* EN25Q16(D16) */
.name = "EN25Q16(D16)", .id[0] = EON_ID_EN25Q16,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = EON_ID_EN25Q32, /* EN25Q32(A/B) */
.name = "EN25Q32(A/B)", .id[0] = EON_ID_EN25Q32,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = EON_ID_EN25Q64, /* EN25Q64 */
.name = "EN25Q64", .id[0] = EON_ID_EN25Q64,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
{ {
.id = EON_ID_EN25Q128, /* EN25Q128 */
.name = "EN25Q128", .id[0] = EON_ID_EN25Q128,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
}, },
{ {
.id = EON_ID_EN25QH16, /* EN25QH16 */
.name = "EN25QH16", .id[0] = EON_ID_EN25QH16,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = EON_ID_EN25QH32, /* EN25QH32 */
.name = "EN25QH32", .id[0] = EON_ID_EN25QH32,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = EON_ID_EN25QH64, /* EN25QH64 */
.name = "EN25QH64", .id[0] = EON_ID_EN25QH64,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
{ {
.id = EON_ID_EN25QH128, /* EN25QH128 */
.name = "EN25QH128", .id[0] = EON_ID_EN25QH128,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
}, },
{ {
.id = EON_ID_EN25S80, /* EN25S80 */
.name = "EN25S80", .id[0] = EON_ID_EN25S80,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
{ {
.id = EON_ID_EN25S16, /* EN25S16 */
.name = "EN25S16", .id[0] = EON_ID_EN25S16,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = EON_ID_EN25S32, /* EN25S32 */
.name = "EN25S32", .id[0] = EON_ID_EN25S32,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = EON_ID_EN25S64, /* EN25S64 */
.name = "EN25S64", .id[0] = EON_ID_EN25S64,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
}; };
@@ -167,7 +167,7 @@ const struct spi_flash_vendor_info spi_flash_eon_vi = {
.id = VENDOR_ID_EON, .id = VENDOR_ID_EON,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_shift = 2, .sector_size_kib_shift = 2,
.match_id_mask = 0xffff, .match_id_mask[0] = 0xffff,
.ids = flash_table, .ids = flash_table,
.nr_part_ids = ARRAY_SIZE(flash_table), .nr_part_ids = ARRAY_SIZE(flash_table),
.desc = &spi_flash_pp_0x20_sector_desc, .desc = &spi_flash_pp_0x20_sector_desc,

View File

@@ -36,79 +36,79 @@
static const struct spi_flash_part_id flash_table[] = { static const struct spi_flash_part_id flash_table[] = {
{ {
.id = 0x3114, /* GD25T80 */
.name = "GD25T80", .id[0] = 0x3114,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
{ {
.id = 0x4014, /* GD25Q80 */
.name = "GD25Q80", .id[0] = 0x4014,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, /* also GD25Q80B */ }, /* also GD25Q80B */
{ {
.id = 0x4015, /* GD25Q16 */
.name = "GD25Q16", .id[0] = 0x4015,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, /* also GD25Q16B */ }, /* also GD25Q16B */
{ {
.id = 0x4016, /* GD25Q32B */
.name = "GD25Q32B", .id[0] = 0x4016,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, /* also GD25Q32B */ }, /* also GD25Q32B */
{ {
.id = 0x4017, /* GD25Q64 */
.name = "GD25Q64", .id[0] = 0x4017,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, /* also GD25Q64B, GD25B64C */ }, /* also GD25Q64B, GD25B64C */
{ {
.id = 0x4018, /* GD25Q128 */
.name = "GD25Q128", .id[0] = 0x4018,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, /* also GD25Q128B */ }, /* also GD25Q128B */
{ {
.id = 0x4214, /* GD25VQ80C */
.name = "GD25VQ80C", .id[0] = 0x4214,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, },
{ {
.id = 0x4215, /* GD25VQ16C */
.name = "GD25VQ16C", .id[0] = 0x4215,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, },
{ {
.id = 0x6014, /* GD25LQ80 */
.name = "GD25LQ80", .id[0] = 0x6014,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, },
{ {
.id = 0x6015, /* GD25LQ16 */
.name = "GD25LQ16", .id[0] = 0x6015,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, },
{ {
.id = 0x6016, /* GD25LQ32 */
.name = "GD25LQ32", .id[0] = 0x6016,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, },
{ {
.id = 0x6017, /* GD25LQ64C */
.name = "GD25LQ64C", .id[0] = 0x6017,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, /* also GD25LB64C */ }, /* also GD25LB64C */
{ {
.id = 0x6018, /* GD25LQ128 */
.name = "GD25LQ128", .id[0] = 0x6018,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, },
@@ -118,7 +118,7 @@ const struct spi_flash_vendor_info spi_flash_gigadevice_vi = {
.id = VENDOR_ID_GIGADEVICE, .id = VENDOR_ID_GIGADEVICE,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_shift = 2, .sector_size_kib_shift = 2,
.match_id_mask = 0xffff, .match_id_mask[0] = 0xffff,
.ids = flash_table, .ids = flash_table,
.nr_part_ids = ARRAY_SIZE(flash_table), .nr_part_ids = ARRAY_SIZE(flash_table),
.desc = &spi_flash_pp_0x20_sector_desc, .desc = &spi_flash_pp_0x20_sector_desc,

View File

@@ -38,98 +38,98 @@
static const struct spi_flash_part_id flash_table[] = { static const struct spi_flash_part_id flash_table[] = {
{ {
.id = 0x2014, /* MX25L8005 */
.name = "MX25L8005", .id[0] = 0x2014,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
{ {
.id = 0x2015, /* MX25L1605D */
.name = "MX25L1605D", .id[0] = 0x2015,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x2016, /* MX25L3205D */
.name = "MX25L3205D", .id[0] = 0x2016,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = 0x2017, /* MX25L6405D */
.name = "MX25L6405D", .id[0] = 0x2017,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
{ {
.id = 0x2018, /* MX25L12805D */
.name = "MX25L12805D", .id[0] = 0x2018,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
}, },
{ {
.id = 0x2019, /* MX25L25635F */
.name = "MX25L25635F", .id[0] = 0x2019,
.nr_sectors_shift = 13, .nr_sectors_shift = 13,
}, },
{ {
.id = 0x201a, /* MX66L51235F */
.name = "MX66L51235F", .id[0] = 0x201a,
.nr_sectors_shift = 14, .nr_sectors_shift = 14,
}, },
{ {
.id = 0x2415, /* MX25L1635D */
.name = "MX25L1635D", .id[0] = 0x2415,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x2515, /* MX25L1635E */
.name = "MX25L1635E", .id[0] = 0x2515,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x2534, /* MX25U8032E */
.name = "MX25U8032E", .id[0] = 0x2534,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
{ {
.id = 0x2535, /* MX25U1635E */
.name = "MX25U1635E", .id[0] = 0x2535,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x2536, /* MX25U3235E */
.name = "MX25U3235E", .id[0] = 0x2536,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = 0x2537, /* MX25U6435F */
.name = "MX25U6435F", .id[0] = 0x2537,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
{ {
.id = 0x2538, /* MX25U12835F */
.name = "MX25U12835F", .id[0] = 0x2538,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
}, },
{ {
.id = 0x2539, /* MX25U25635F */
.name = "MX25U25635F", .id[0] = 0x2539,
.nr_sectors_shift = 13, .nr_sectors_shift = 13,
}, },
{ {
.id = 0x253a, /* MX25U51245G */
.name = "MX25U51245G", .id[0] = 0x253a,
.nr_sectors_shift = 14, .nr_sectors_shift = 14,
}, },
{ {
.id = 0x2618, /* MX25L12855E */
.name = "MX25L12855E", .id[0] = 0x2618,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
}, },
{ {
.id = 0x5e16, /* MX25L3235D/MX25L3225D/MX25L3236D/MX25L3237D */
.name = "MX25L3235D", /* MX25L3225D/MX25L3236D/MX25L3237D */ .id[0] = 0x5e16,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = 0x9517, /* MX25L6495F */
.name = "MX25L6495F", .id[0] = 0x9517,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
}; };
@@ -138,7 +138,7 @@ const struct spi_flash_vendor_info spi_flash_macronix_vi = {
.id = VENDOR_ID_MACRONIX, .id = VENDOR_ID_MACRONIX,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_shift = 2, .sector_size_kib_shift = 2,
.match_id_mask = 0xffff, .match_id_mask[0] = 0xffff,
.ids = flash_table, .ids = flash_table,
.nr_part_ids = ARRAY_SIZE(flash_table), .nr_part_ids = ARRAY_SIZE(flash_table),
.desc = &spi_flash_pp_0x20_sector_desc, .desc = &spi_flash_pp_0x20_sector_desc,

View File

@@ -51,74 +51,79 @@
static const struct spi_flash_part_id flash_table_ext[] = { static const struct spi_flash_part_id flash_table_ext[] = {
{ {
.id = SPSN_ID_S25FL008A, /* S25FL008A */
.name = "S25FL008A", .id[0] = SPSN_ID_S25FL008A,
.nr_sectors_shift = 4, .nr_sectors_shift = 4,
}, },
{ {
.id = SPSN_ID_S25FL016A, /* S25FL016A */
.name = "S25FL016A", .id[0] = SPSN_ID_S25FL016A,
.nr_sectors_shift = 5, .nr_sectors_shift = 5,
}, },
{ {
.id = SPSN_ID_S25FL032A, /* S25FL032A */
.name = "S25FL032A", .id[0] = SPSN_ID_S25FL032A,
.nr_sectors_shift = 6, .nr_sectors_shift = 6,
}, },
{ {
.id = SPSN_ID_S25FL064A, /* S25FL064A */
.name = "S25FL064A", .id[0] = SPSN_ID_S25FL064A,
.nr_sectors_shift = 7, .nr_sectors_shift = 7,
}, },
{ {
.id = (SPSN_EXT_ID_S25FL128P_64KB << 16) | SPSN_ID_S25FL128P, /* S25FL128P_64K */
.name = "S25FL128P_64K", .id[0] = SPSN_ID_S25FL128P,
.id[1] = SPSN_EXT_ID_S25FL128P_64KB,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
{ {
.id = (SPSN_EXT_ID_S25FLXXS_64KB << 16) | SPSN_ID_S25FL128S, /* S25FL128S_256K */
.name = "S25FL128S_256K", .id[0] = SPSN_ID_S25FL128S,
.id[1] = SPSN_EXT_ID_S25FLXXS_64KB,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = (SPSN_EXT_ID_S25FL032P << 16) | SPSN_ID_S25FL032A, /* S25FL032P */
.name = "S25FL032P", .id[0] = SPSN_ID_S25FL032A,
.id[1] = SPSN_EXT_ID_S25FL032P,
.nr_sectors_shift = 6, .nr_sectors_shift = 6,
}, },
{ {
.id = (SPSN_EXT_ID_S25FLXXS_64KB << 16) | SPSN_ID_S25FL128P, /* S25FS128S */
.name = "S25FS128S", .id[0] = SPSN_ID_S25FL128P,
.id[1] = SPSN_EXT_ID_S25FLXXS_64KB,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
}; };
static const struct spi_flash_part_id flash_table_256k_sector[] = { static const struct spi_flash_part_id flash_table_256k_sector[] = {
{ {
.id = (SPSN_EXT_ID_S25FL128P_256KB << 16) | SPSN_ID_S25FL128P, /* S25FL128P_256K */
.name = "S25FL128P_256K", .id[0] = SPSN_ID_S25FL128P,
.id[1] = SPSN_EXT_ID_S25FL128P_256KB,
.nr_sectors_shift = 6, .nr_sectors_shift = 6,
}, },
}; };
static const struct spi_flash_part_id flash_table[] = { static const struct spi_flash_part_id flash_table[] = {
{ {
.id = SPSN_ID_S25FL208K, /* S25FL208K */
.name = "S25FL208K", .id[0] = SPSN_ID_S25FL208K,
.nr_sectors_shift = 4, .nr_sectors_shift = 4,
}, },
{ {
.id = SPSN_ID_S25FL116K, /* S25FL116K_16M */
.name = "S25FL116K_16M", .id[0] = SPSN_ID_S25FL116K,
.nr_sectors_shift = 5, .nr_sectors_shift = 5,
}, },
{ {
.id = SPSN_ID_S25FL132K, /* S25FL132K */
.name = "S25FL132K", .id[0] = SPSN_ID_S25FL132K,
.nr_sectors_shift = 6, .nr_sectors_shift = 6,
}, },
{ {
.id = SPSN_ID_S25FL164K, /* S25FL164K */
.name = "S25FL164K", .id[0] = SPSN_ID_S25FL164K,
.nr_sectors_shift = 7, .nr_sectors_shift = 7,
}, },
}; };
@@ -127,7 +132,8 @@ const struct spi_flash_vendor_info spi_flash_spansion_ext1_vi = {
.id = VENDOR_ID_SPANSION, .id = VENDOR_ID_SPANSION,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_shift = 6, .sector_size_kib_shift = 6,
.match_id_mask = 0xffffffff, .match_id_mask[0] = 0xffff,
.match_id_mask[1] = 0xffff,
.ids = flash_table_ext, .ids = flash_table_ext,
.nr_part_ids = ARRAY_SIZE(flash_table_ext), .nr_part_ids = ARRAY_SIZE(flash_table_ext),
.desc = &spi_flash_pp_0xd8_sector_desc, .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, .id = VENDOR_ID_SPANSION,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_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, .ids = flash_table_256k_sector,
.nr_part_ids = ARRAY_SIZE(flash_table_256k_sector), .nr_part_ids = ARRAY_SIZE(flash_table_256k_sector),
.desc = &spi_flash_pp_0xd8_sector_desc, .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, .id = VENDOR_ID_SPANSION,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_shift = 6, .sector_size_kib_shift = 6,
.match_id_mask = 0xffff, .match_id_mask[0] = 0xffff,
.ids = flash_table, .ids = flash_table,
.nr_part_ids = ARRAY_SIZE(flash_table), .nr_part_ids = ARRAY_SIZE(flash_table),
.desc = &spi_flash_pp_0xd8_sector_desc, .desc = &spi_flash_pp_0xd8_sector_desc,

View File

@@ -355,8 +355,7 @@ static int fill_spi_flash(const struct spi_slave *spi, struct spi_flash *flash,
{ {
memcpy(&flash->spi, spi, sizeof(*spi)); memcpy(&flash->spi, spi, sizeof(*spi));
flash->vendor = vi->id; flash->vendor = vi->id;
flash->model = part->id; flash->model = part->id[0];
flash->name = part->name;
flash->page_size = 1U << vi->page_size_shift; flash->page_size = 1U << vi->page_size_shift;
flash->sector_size = (1U << vi->sector_size_kib_shift) * KiB; flash->sector_size = (1U << vi->sector_size_kib_shift) * KiB;
@@ -379,14 +378,19 @@ static int fill_spi_flash(const struct spi_slave *spi, struct spi_flash *flash,
} }
static const struct spi_flash_part_id *find_part(const struct spi_flash_vendor_info *vi, static const struct spi_flash_part_id *find_part(const struct spi_flash_vendor_info *vi,
uint32_t id) uint16_t id[2])
{ {
size_t i; size_t i;
const uint16_t lid[2] = {
[0] = id[0] & vi->match_id_mask[0],
[1] = id[1] & vi->match_id_mask[1],
};
for (i = 0; i < vi->nr_part_ids; i++) { for (i = 0; i < vi->nr_part_ids; i++) {
const struct spi_flash_part_id *part = &vi->ids[i]; const struct spi_flash_part_id *part = &vi->ids[i];
if (part->id == id) if (part->id[0] == lid[0] && part->id[1] == lid[1])
return part; return part;
} }
@@ -394,7 +398,7 @@ static const struct spi_flash_part_id *find_part(const struct spi_flash_vendor_i
} }
static int find_match(const struct spi_slave *spi, struct spi_flash *flash, static int find_match(const struct spi_slave *spi, struct spi_flash *flash,
uint8_t manuf_id, uint32_t id) uint8_t manuf_id, uint16_t id[2])
{ {
int i; int i;
@@ -407,7 +411,7 @@ static int find_match(const struct spi_slave *spi, struct spi_flash *flash,
if (manuf_id != vi->id) if (manuf_id != vi->id)
continue; continue;
part = find_part(vi, id & vi->match_id_mask); part = find_part(vi, id);
if (part == NULL) if (part == NULL)
continue; continue;
@@ -424,7 +428,7 @@ int spi_flash_generic_probe(const struct spi_slave *spi,
int ret, i; int ret, i;
u8 idcode[IDCODE_LEN]; u8 idcode[IDCODE_LEN];
u8 manuf_id; u8 manuf_id;
u32 id; u16 id[2];
/* Read the ID codes */ /* Read the ID codes */
ret = spi_flash_cmd(spi, CMD_READ_ID, idcode, sizeof(idcode)); ret = spi_flash_cmd(spi, CMD_READ_ID, idcode, sizeof(idcode));
@@ -450,7 +454,8 @@ int spi_flash_generic_probe(const struct spi_slave *spi,
manuf_id = idcode[0]; manuf_id = idcode[0];
} }
id = (idcode[3] << 24) | (idcode[4] << 16) | (idcode[1] << 8) | idcode[2]; id[0] = (idcode[1] << 8) | idcode[2];
id[1] = (idcode[3] << 8) | idcode[4];
return find_match(spi, flash, manuf_id, id); return find_match(spi, flash, manuf_id, id);
} }
@@ -483,8 +488,8 @@ int spi_flash_probe(unsigned int bus, unsigned int cs, struct spi_flash *flash)
if (flash->flags.dual_spi && spi.ctrlr->xfer_dual) if (flash->flags.dual_spi && spi.ctrlr->xfer_dual)
mode_string = " (Dual SPI mode)"; mode_string = " (Dual SPI mode)";
printk(BIOS_INFO, printk(BIOS_INFO,
"SF: Detected %s with sector size 0x%x, total 0x%x%s\n", "SF: Detected %02x %04x with sector size 0x%x, total 0x%x%s\n",
flash->name, flash->sector_size, flash->size, mode_string); flash->vendor, flash->model, flash->sector_size, flash->size, mode_string);
if (bus == CONFIG_BOOT_DEVICE_SPI_FLASH_BUS if (bus == CONFIG_BOOT_DEVICE_SPI_FLASH_BUS
&& flash->size != CONFIG_ROM_SIZE) { && flash->size != CONFIG_ROM_SIZE) {
printk(BIOS_ERR, "SF size 0x%x does not correspond to" printk(BIOS_ERR, "SF size 0x%x does not correspond to"

View File

@@ -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); int stmicro_release_deep_sleep_identify(const struct spi_slave *spi, u8 *idcode);
struct spi_flash_part_id { struct spi_flash_part_id {
/* rdid command constructs a 32-bit id using the following method /* rdid command constructs 2x 16-bit id using the following method
* for matching: 31 | id[3] | id[4] | id[1] | id[2] | 0 */ * for matching after reading 5 bytes (1st byte is manuf id):
uint32_t id; * id[0] = (id[1] << 8) | id[2]
const char *name; * id[1] = (id[3] << 8) | id[4]
*/
uint16_t id[2];
/* Log based 2 total number of sectors. */ /* Log based 2 total number of sectors. */
uint16_t nr_sectors_shift: 4; uint16_t nr_sectors_shift: 4;
uint16_t fast_read_dual_output_support : 1; uint16_t fast_read_dual_output_support : 1;
@@ -104,7 +106,7 @@ struct spi_flash_vendor_info {
uint8_t sector_size_kib_shift : 4; uint8_t sector_size_kib_shift : 4;
uint16_t nr_part_ids; uint16_t nr_part_ids;
const struct spi_flash_part_id *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_ops_descriptor *desc;
const struct spi_flash_protection_ops *prot_ops; const struct spi_flash_protection_ops *prot_ops;
/* Returns 0 on success. !0 otherwise. */ /* Returns 0 on success. !0 otherwise. */

View File

@@ -46,56 +46,56 @@
static const struct spi_flash_part_id flash_table_ai[] = { static const struct spi_flash_part_id flash_table_ai[] = {
{ {
.id = 0x8d, /* SST25VF040B */
.name = "SST25VF040B", .id[0] = 0x8d,
.nr_sectors_shift = 7, .nr_sectors_shift = 7,
},{ },{
.id = 0x8e, /* SST25VF080B */
.name = "SST25VF080B", .id[0] = 0x8e,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
},{ },{
.id = 0x80, /* SST25VF080 */
.name = "SST25VF080", .id[0] = 0x80,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
},{ },{
.id = 0x41, /* SST25VF016B */
.name = "SST25VF016B", .id[0] = 0x41,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
},{ },{
.id = 0x4a, /* SST25VF032B */
.name = "SST25VF032B", .id[0] = 0x4a,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
},{ },{
.id = 0x01, /* SST25WF512 */
.name = "SST25WF512", .id[0] = 0x01,
.nr_sectors_shift = 4, .nr_sectors_shift = 4,
},{ },{
.id = 0x02, /* SST25WF010 */
.name = "SST25WF010", .id[0] = 0x02,
.nr_sectors_shift = 5, .nr_sectors_shift = 5,
},{ },{
.id = 0x03, /* SST25WF020 */
.name = "SST25WF020", .id[0] = 0x03,
.nr_sectors_shift = 6, .nr_sectors_shift = 6,
},{ },{
.id = 0x04, /* SST25WF040 */
.name = "SST25WF040", .id[0] = 0x04,
.nr_sectors_shift = 7, .nr_sectors_shift = 7,
},{ },{
.id = 0x05, /* SST25WF080 */
.name = "SST25WF080", .id[0] = 0x05,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
},{ },{
.id = 0x14, /* SST25WF080B */
.name = "SST25WF080B", .id[0] = 0x14,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
}; };
static const struct spi_flash_part_id flash_table_pp256[] = { static const struct spi_flash_part_id flash_table_pp256[] = {
{ {
.id = 0x4b, /* SST25VF064C */
.name = "SST25VF064C", .id[0] = 0x4b,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
}; };
@@ -254,7 +254,7 @@ static const struct spi_flash_ops_descriptor descai = {
const struct spi_flash_vendor_info spi_flash_sst_ai_vi = { const struct spi_flash_vendor_info spi_flash_sst_ai_vi = {
.id = VENDOR_ID_SST, .id = VENDOR_ID_SST,
.sector_size_kib_shift = 2, .sector_size_kib_shift = 2,
.match_id_mask = 0xff, .match_id_mask[0] = 0xff,
.ids = flash_table_ai, .ids = flash_table_ai,
.nr_part_ids = ARRAY_SIZE(flash_table_ai), .nr_part_ids = ARRAY_SIZE(flash_table_ai),
.desc = &descai, .desc = &descai,
@@ -265,7 +265,7 @@ const struct spi_flash_vendor_info spi_flash_sst_vi = {
.id = VENDOR_ID_SST, .id = VENDOR_ID_SST,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_shift = 2, .sector_size_kib_shift = 2,
.match_id_mask = 0xff, .match_id_mask[0] = 0xff,
.ids = flash_table_pp256, .ids = flash_table_pp256,
.nr_part_ids = ARRAY_SIZE(flash_table_pp256), .nr_part_ids = ARRAY_SIZE(flash_table_pp256),
.desc = &spi_flash_pp_0x20_sector_desc, .desc = &spi_flash_pp_0x20_sector_desc,

View File

@@ -66,142 +66,142 @@
static const struct spi_flash_part_id flash_table_se32k[] = { static const struct spi_flash_part_id flash_table_se32k[] = {
{ {
.id = STM_ID_M25P10, /* M25P10 */
.name = "M25P10", .id[0] = STM_ID_M25P10,
.nr_sectors_shift = 2, .nr_sectors_shift = 2,
}, },
}; };
static const struct spi_flash_part_id flash_table_se64k[] = { static const struct spi_flash_part_id flash_table_se64k[] = {
{ {
.id = STM_ID_M25P16, /* M25P16 */
.name = "M25P16", .id[0] = STM_ID_M25P16,
.nr_sectors_shift = 5, .nr_sectors_shift = 5,
}, },
{ {
.id = STM_ID_M25P20, /* M25P20 */
.name = "M25P20", .id[0] = STM_ID_M25P20,
.nr_sectors_shift = 2, .nr_sectors_shift = 2,
}, },
{ {
.id = STM_ID_M25P32, /* M25P32 */
.name = "M25P32", .id[0] = STM_ID_M25P32,
.nr_sectors_shift = 6, .nr_sectors_shift = 6,
}, },
{ {
.id = STM_ID_M25P40, /* M25P40 */
.name = "M25P40", .id[0] = STM_ID_M25P40,
.nr_sectors_shift = 3, .nr_sectors_shift = 3,
}, },
{ {
.id = STM_ID_M25P64, /* M25P64 */
.name = "M25P64", .id[0] = STM_ID_M25P64,
.nr_sectors_shift = 7, .nr_sectors_shift = 7,
}, },
{ {
.id = STM_ID_M25P80, /* M25P80 */
.name = "M25P80", .id[0] = STM_ID_M25P80,
.nr_sectors_shift = 4, .nr_sectors_shift = 4,
}, },
{ {
.id = STM_ID_M25PX80, /* M25PX80 */
.name = "M25PX80", .id[0] = STM_ID_M25PX80,
.nr_sectors_shift = 4, .nr_sectors_shift = 4,
}, },
{ {
.id = STM_ID_M25PX16, /* M25PX16 */
.name = "M25PX16", .id[0] = STM_ID_M25PX16,
.nr_sectors_shift = 5, .nr_sectors_shift = 5,
}, },
{ {
.id = STM_ID_M25PX32, /* M25PX32 */
.name = "M25PX32", .id[0] = STM_ID_M25PX32,
.nr_sectors_shift = 6, .nr_sectors_shift = 6,
}, },
{ {
.id = STM_ID_M25PX64, /* M25PX64 */
.name = "M25PX64", .id[0] = STM_ID_M25PX64,
.nr_sectors_shift = 7, .nr_sectors_shift = 7,
}, },
{ {
.id = STM_ID_M25PE80, /* M25PE80 */
.name = "M25PE80", .id[0] = STM_ID_M25PE80,
.nr_sectors_shift = 4, .nr_sectors_shift = 4,
}, },
{ {
.id = STM_ID_M25PE16, /* M25PE16 */
.name = "M25PE16", .id[0] = STM_ID_M25PE16,
.nr_sectors_shift = 5, .nr_sectors_shift = 5,
}, },
{ {
.id = STM_ID_M25PE32, /* M25PE32 */
.name = "M25PE32", .id[0] = STM_ID_M25PE32,
.nr_sectors_shift = 6, .nr_sectors_shift = 6,
}, },
{ {
.id = STM_ID_M25PE64, /* M25PE64 */
.name = "M25PE64", .id[0] = STM_ID_M25PE64,
.nr_sectors_shift = 7, .nr_sectors_shift = 7,
}, },
}; };
static const struct spi_flash_part_id flash_table_se256k[] = { static const struct spi_flash_part_id flash_table_se256k[] = {
{ {
.id = STM_ID_M25P128, /* M25P128 */
.name = "M25P128", .id[0] = STM_ID_M25P128,
.nr_sectors_shift = 6, .nr_sectors_shift = 6,
}, },
}; };
static const struct spi_flash_part_id flash_table_sse[] = { static const struct spi_flash_part_id flash_table_sse[] = {
{ {
.id = STM_ID_N25Q016__3E, /* N25Q016..3E */
.name = "N25Q016..3E", .id[0] = STM_ID_N25Q016__3E,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = STM_ID_N25Q032__3E, /* N25Q032..3E */
.name = "N25Q032..3E", .id[0] = STM_ID_N25Q032__3E,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = STM_ID_N25Q064__3E, /* N25Q064..3E */
.name = "N25Q064..3E", .id[0] = STM_ID_N25Q064__3E,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
{ {
.id = STM_ID_N25Q128__3E, /* N25Q128..3E */
.name = "N25Q128..3E", .id[0] = STM_ID_N25Q128__3E,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
}, },
{ {
.id = STM_ID_N25Q256__3E, /* N25Q256..3E */
.name = "N25Q256..3E", .id[0] = STM_ID_N25Q256__3E,
.nr_sectors_shift = 13, .nr_sectors_shift = 13,
}, },
{ {
.id = STM_ID_N25Q016__1E, /* N25Q016..1E */
.name = "N25Q016..1E", .id[0] = STM_ID_N25Q016__1E,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = STM_ID_N25Q032__1E, /* N25Q032..1E */
.name = "N25Q032..1E", .id[0] = STM_ID_N25Q032__1E,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = STM_ID_N25Q064__1E, /* N25Q064..1E */
.name = "N25Q064..1E", .id[0] = STM_ID_N25Q064__1E,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
}, },
{ {
.id = STM_ID_N25Q128__1E, /* N25Q128..1E */
.name = "N25Q128..1E", .id[0] = STM_ID_N25Q128__1E,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
}, },
{ {
.id = STM_ID_N25Q256__1E, /* N25Q256..1E */
.name = "N25Q256..1E", .id[0] = STM_ID_N25Q256__1E,
.nr_sectors_shift = 13, .nr_sectors_shift = 13,
}, },
}; };
@@ -228,7 +228,7 @@ const struct spi_flash_vendor_info spi_flash_stmicro1_vi = {
.id = VENDOR_ID_STMICRO, .id = VENDOR_ID_STMICRO,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_shift = 5, .sector_size_kib_shift = 5,
.match_id_mask = 0xffff, .match_id_mask[0] = 0xffff,
.ids = flash_table_se32k, .ids = flash_table_se32k,
.nr_part_ids = ARRAY_SIZE(flash_table_se32k), .nr_part_ids = ARRAY_SIZE(flash_table_se32k),
.desc = &spi_flash_pp_0xd8_sector_desc, .desc = &spi_flash_pp_0xd8_sector_desc,
@@ -238,7 +238,7 @@ const struct spi_flash_vendor_info spi_flash_stmicro2_vi = {
.id = VENDOR_ID_STMICRO, .id = VENDOR_ID_STMICRO,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_shift = 6, .sector_size_kib_shift = 6,
.match_id_mask = 0xffff, .match_id_mask[0] = 0xffff,
.ids = flash_table_se64k, .ids = flash_table_se64k,
.nr_part_ids = ARRAY_SIZE(flash_table_se64k), .nr_part_ids = ARRAY_SIZE(flash_table_se64k),
.desc = &spi_flash_pp_0xd8_sector_desc, .desc = &spi_flash_pp_0xd8_sector_desc,
@@ -248,7 +248,7 @@ const struct spi_flash_vendor_info spi_flash_stmicro3_vi = {
.id = VENDOR_ID_STMICRO, .id = VENDOR_ID_STMICRO,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_shift = 8, .sector_size_kib_shift = 8,
.match_id_mask = 0xffff, .match_id_mask[0] = 0xffff,
.ids = flash_table_se256k, .ids = flash_table_se256k,
.nr_part_ids = ARRAY_SIZE(flash_table_se256k), .nr_part_ids = ARRAY_SIZE(flash_table_se256k),
.desc = &spi_flash_pp_0xd8_sector_desc, .desc = &spi_flash_pp_0xd8_sector_desc,
@@ -258,7 +258,7 @@ const struct spi_flash_vendor_info spi_flash_stmicro4_vi = {
.id = VENDOR_ID_STMICRO, .id = VENDOR_ID_STMICRO,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_shift = 2, .sector_size_kib_shift = 2,
.match_id_mask = 0xffff, .match_id_mask[0] = 0xffff,
.ids = flash_table_sse, .ids = flash_table_sse,
.nr_part_ids = ARRAY_SIZE(flash_table_sse), .nr_part_ids = ARRAY_SIZE(flash_table_sse),
.desc = &spi_flash_pp_0x20_sector_desc, .desc = &spi_flash_pp_0x20_sector_desc,

View File

@@ -81,141 +81,141 @@ struct status_regs {
static const struct spi_flash_part_id flash_table[] = { static const struct spi_flash_part_id flash_table[] = {
{ {
.id = 0x2014, /* W25P80 */
.name = "W25P80", .id[0] = 0x2014,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
}, },
{ {
.id = 0x2015, /* W25P16 */
.name = "W25P16", .id[0] = 0x2015,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
}, },
{ {
.id = 0x2016, /* W25P32 */
.name = "W25P32", .id[0] = 0x2016,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
}, },
{ {
.id = 0x3014, /* W25X80 */
.name = "W25X80", .id[0] = 0x3014,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, },
{ {
.id = 0x3015, /* W25X16 */
.name = "W25X16", .id[0] = 0x3015,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, },
{ {
.id = 0x3016, /* W25X32 */
.name = "W25X32", .id[0] = 0x3016,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, },
{ {
.id = 0x3017, /* W25X64 */
.name = "W25X64", .id[0] = 0x3017,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, },
{ {
.id = 0x4014, /* W25Q80_V */
.name = "W25Q80_V", .id[0] = 0x4014,
.nr_sectors_shift = 8, .nr_sectors_shift = 8,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
}, },
{ {
.id = 0x4015, /* W25Q16_V */
.name = "W25Q16_V", .id[0] = 0x4015,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
.protection_granularity_shift = 16, .protection_granularity_shift = 16,
.bp_bits = 3, .bp_bits = 3,
}, },
{ {
.id = 0x6015, /* W25Q16DW */
.name = "W25Q16DW", .id[0] = 0x6015,
.nr_sectors_shift = 9, .nr_sectors_shift = 9,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
.protection_granularity_shift = 16, .protection_granularity_shift = 16,
.bp_bits = 3, .bp_bits = 3,
}, },
{ {
.id = 0x4016, /* W25Q32_V */
.name = "W25Q32_V", .id[0] = 0x4016,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
.protection_granularity_shift = 16, .protection_granularity_shift = 16,
.bp_bits = 3, .bp_bits = 3,
}, },
{ {
.id = 0x6016, /* W25Q32DW */
.name = "W25Q32DW", .id[0] = 0x6016,
.nr_sectors_shift = 10, .nr_sectors_shift = 10,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
.protection_granularity_shift = 16, .protection_granularity_shift = 16,
.bp_bits = 3, .bp_bits = 3,
}, },
{ {
.id = 0x4017, /* W25Q64_V */
.name = "W25Q64_V", .id[0] = 0x4017,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
.protection_granularity_shift = 17, .protection_granularity_shift = 17,
.bp_bits = 3, .bp_bits = 3,
}, },
{ {
.id = 0x6017, /* W25Q64DW */
.name = "W25Q64DW", .id[0] = 0x6017,
.nr_sectors_shift = 11, .nr_sectors_shift = 11,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
.protection_granularity_shift = 17, .protection_granularity_shift = 17,
.bp_bits = 3, .bp_bits = 3,
}, },
{ {
.id = 0x4018, /* W25Q128_V */
.name = "W25Q128_V", .id[0] = 0x4018,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
.protection_granularity_shift = 18, .protection_granularity_shift = 18,
.bp_bits = 3, .bp_bits = 3,
}, },
{ {
.id = 0x6018, /* W25Q128FW */
.name = "W25Q128FW", .id[0] = 0x6018,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
.protection_granularity_shift = 18, .protection_granularity_shift = 18,
.bp_bits = 3, .bp_bits = 3,
}, },
{ {
.id = 0x7018, /* W25Q128J */
.name = "W25Q128J", .id[0] = 0x7018,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
.protection_granularity_shift = 18, .protection_granularity_shift = 18,
.bp_bits = 3, .bp_bits = 3,
}, },
{ {
.id = 0x8018, /* W25Q128JW */
.name = "W25Q128JW", .id[0] = 0x8018,
.nr_sectors_shift = 12, .nr_sectors_shift = 12,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
.protection_granularity_shift = 18, .protection_granularity_shift = 18,
.bp_bits = 3, .bp_bits = 3,
}, },
{ {
.id = 0x4019, /* W25Q256_V */
.name = "W25Q256_V", .id[0] = 0x4019,
.nr_sectors_shift = 13, .nr_sectors_shift = 13,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
.protection_granularity_shift = 16, .protection_granularity_shift = 16,
.bp_bits = 4, .bp_bits = 4,
}, },
{ {
.id = 0x7019, /* W25Q256J */
.name = "W25Q256J", .id[0] = 0x7019,
.nr_sectors_shift = 13, .nr_sectors_shift = 13,
.fast_read_dual_output_support = 1, .fast_read_dual_output_support = 1,
.protection_granularity_shift = 16, .protection_granularity_shift = 16,
@@ -551,7 +551,7 @@ const struct spi_flash_vendor_info spi_flash_winbond_vi = {
.id = VENDOR_ID_WINBOND, .id = VENDOR_ID_WINBOND,
.page_size_shift = 8, .page_size_shift = 8,
.sector_size_kib_shift = 2, .sector_size_kib_shift = 2,
.match_id_mask = 0xffff, .match_id_mask[0] = 0xffff,
.ids = flash_table, .ids = flash_table,
.nr_part_ids = ARRAY_SIZE(flash_table), .nr_part_ids = ARRAY_SIZE(flash_table),
.desc = &spi_flash_pp_0x20_sector_desc, .desc = &spi_flash_pp_0x20_sector_desc,

View File

@@ -104,7 +104,6 @@ struct spi_flash {
}; };
} flags; } flags;
u16 model; u16 model;
const char *name;
u32 size; u32 size;
u32 sector_size; u32 sector_size;
u32 page_size; u32 page_size;

View File

@@ -301,7 +301,6 @@ static int fast_spi_flash_probe(const struct spi_slave *dev,
flash->size = (flash_bits >> 3) + 1; flash->size = (flash_bits >> 3) + 1;
memcpy(&flash->spi, dev, sizeof(*dev)); memcpy(&flash->spi, dev, sizeof(*dev));
flash->name = "FAST_SPI Hardware Sequencer";
/* Can erase both 4 KiB and 64 KiB chunks. Declare the smaller size. */ /* Can erase both 4 KiB and 64 KiB chunks. Declare the smaller size. */
flash->sector_size = 4 * KiB; flash->sector_size = 4 * KiB;

View File

@@ -240,7 +240,6 @@ int mtk_spi_flash_probe(const struct spi_slave *spi,
write32(&mt8173_nor->wrprot, SFLASH_COMMAND_ENABLE); write32(&mt8173_nor->wrprot, SFLASH_COMMAND_ENABLE);
memcpy(&flash->spi, spi, sizeof(*spi)); memcpy(&flash->spi, spi, sizeof(*spi));
flash->name = "mt8173 flash controller";
flash->sector_size = 0x1000; flash->sector_size = 0x1000;
flash->erase_cmd = SECTOR_ERASE_CMD; flash->erase_cmd = SECTOR_ERASE_CMD;
flash->size = CONFIG_ROM_SIZE; flash->size = CONFIG_ROM_SIZE;

View File

@@ -932,7 +932,6 @@ static int spi_flash_programmer_probe(const struct spi_slave *spi,
return 0; return 0;
memcpy(&flash->spi, spi, sizeof(*spi)); memcpy(&flash->spi, spi, sizeof(*spi));
flash->name = "Opaque HW-sequencing";
ich_hwseq_set_addr(0); ich_hwseq_set_addr(0);
switch ((cntlr.hsfs >> 3) & 3) { switch ((cntlr.hsfs >> 3) & 3) {