|
17 | 17 | SPI_MEM_OP_NO_DUMMY, \
|
18 | 18 | SPI_MEM_OP_DATA_OUT(1, buf, 0))
|
19 | 19 |
|
| 20 | +static int |
| 21 | +w25q128_post_bfpt_fixups(struct spi_nor *nor, |
| 22 | + const struct sfdp_parameter_header *bfpt_header, |
| 23 | + const struct sfdp_bfpt *bfpt) |
| 24 | +{ |
| 25 | + /* |
| 26 | + * Zetta ZD25Q128C is a clone of the Winbond device. But the encoded |
| 27 | + * size is really wrong. It seems that they confused Mbit with MiB. |
| 28 | + * Thus the flash is discovered as a 2MiB device. |
| 29 | + */ |
| 30 | + if (bfpt_header->major == SFDP_JESD216_MAJOR && |
| 31 | + bfpt_header->minor == SFDP_JESD216_MINOR && |
| 32 | + nor->params->size == SZ_2M && |
| 33 | + nor->params->erase_map.regions[0].size == SZ_2M) { |
| 34 | + nor->params->size = SZ_16M; |
| 35 | + nor->params->erase_map.regions[0].size = SZ_16M; |
| 36 | + } |
| 37 | + |
| 38 | + return 0; |
| 39 | +} |
| 40 | + |
| 41 | +static const struct spi_nor_fixups w25q128_fixups = { |
| 42 | + .post_bfpt = w25q128_post_bfpt_fixups, |
| 43 | +}; |
| 44 | + |
20 | 45 | static int
|
21 | 46 | w25q256_post_bfpt_fixups(struct spi_nor *nor,
|
22 | 47 | const struct sfdp_parameter_header *bfpt_header,
|
@@ -108,6 +133,7 @@ static const struct flash_info winbond_nor_parts[] = {
|
108 | 133 | .size = SZ_16M,
|
109 | 134 | .flags = SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB,
|
110 | 135 | .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
|
| 136 | + .fixups = &w25q128_fixups, |
111 | 137 | }, {
|
112 | 138 | .id = SNOR_ID(0xef, 0x40, 0x19),
|
113 | 139 | .name = "w25q256",
|
|
0 commit comments