|
8 | 8 |
|
9 | 9 | #include "core.h"
|
10 | 10 |
|
| 11 | +static int |
| 12 | +w25q256_post_bfpt_fixups(struct spi_nor *nor, |
| 13 | + const struct sfdp_parameter_header *bfpt_header, |
| 14 | + const struct sfdp_bfpt *bfpt, |
| 15 | + struct spi_nor_flash_parameter *params) |
| 16 | +{ |
| 17 | + /* |
| 18 | + * W25Q256JV supports 4B opcodes but W25Q256FV does not. |
| 19 | + * Unfortunately, Winbond has re-used the same JEDEC ID for both |
| 20 | + * variants which prevents us from defining a new entry in the parts |
| 21 | + * table. |
| 22 | + * To differentiate between W25Q256JV and W25Q256FV check SFDP header |
| 23 | + * version: only JV has JESD216A compliant structure (version 5). |
| 24 | + */ |
| 25 | + if (bfpt_header->major == SFDP_JESD216_MAJOR && |
| 26 | + bfpt_header->minor == SFDP_JESD216A_MINOR) |
| 27 | + nor->flags |= SNOR_F_4B_OPCODES; |
| 28 | + |
| 29 | + return 0; |
| 30 | +} |
| 31 | + |
| 32 | +static struct spi_nor_fixups w25q256_fixups = { |
| 33 | + .post_bfpt = w25q256_post_bfpt_fixups, |
| 34 | +}; |
| 35 | + |
11 | 36 | static const struct flash_info winbond_parts[] = {
|
12 | 37 | /* Winbond -- w25x "blocks" are 64K, "sectors" are 4KiB */
|
13 | 38 | { "w25x05", INFO(0xef3010, 0, 64 * 1024, 1, SECT_4K) },
|
@@ -53,8 +78,8 @@ static const struct flash_info winbond_parts[] = {
|
53 | 78 | { "w25q80bl", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) },
|
54 | 79 | { "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) },
|
55 | 80 | { "w25q256", INFO(0xef4019, 0, 64 * 1024, 512,
|
56 |
| - SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | |
57 |
| - SPI_NOR_4B_OPCODES) }, |
| 81 | + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) |
| 82 | + .fixups = &w25q256_fixups }, |
58 | 83 | { "w25q256jvm", INFO(0xef7019, 0, 64 * 1024, 512,
|
59 | 84 | SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
|
60 | 85 | { "w25q256jw", INFO(0xef6019, 0, 64 * 1024, 512,
|
|
0 commit comments