aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/spi/winbond.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/spi/winbond.c')
-rw-r--r--src/drivers/spi/winbond.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/drivers/spi/winbond.c b/src/drivers/spi/winbond.c
index d0ef3cd6e0..9e9bb00464 100644
--- a/src/drivers/spi/winbond.c
+++ b/src/drivers/spi/winbond.c
@@ -26,7 +26,9 @@
struct winbond_spi_flash_params {
uint16_t id;
- uint8_t l2_page_size_shift;
+ uint8_t dual_spi : 1;
+ uint8_t _reserved_for_flags : 3;
+ uint8_t l2_page_size_shift : 4;
uint8_t pages_per_sector_shift : 4;
uint8_t sectors_per_block_shift : 4;
uint8_t nr_blocks_shift;
@@ -123,6 +125,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 4,
.name = "W25X80",
+ .dual_spi = 1,
},
{
.id = 0x3015,
@@ -131,6 +134,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 5,
.name = "W25X16",
+ .dual_spi = 1,
},
{
.id = 0x3016,
@@ -139,6 +143,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 6,
.name = "W25X32",
+ .dual_spi = 1,
},
{
.id = 0x3017,
@@ -147,6 +152,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 7,
.name = "W25X64",
+ .dual_spi = 1,
},
{
.id = 0x4014,
@@ -155,6 +161,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 4,
.name = "W25Q80_V",
+ .dual_spi = 1,
},
{
.id = 0x4015,
@@ -163,6 +170,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 5,
.name = "W25Q16_V",
+ .dual_spi = 1,
.protection_granularity_shift = 16,
.bp_bits = 3,
},
@@ -173,6 +181,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 5,
.name = "W25Q16DW",
+ .dual_spi = 1,
.protection_granularity_shift = 16,
.bp_bits = 3,
},
@@ -183,6 +192,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 6,
.name = "W25Q32_V",
+ .dual_spi = 1,
.protection_granularity_shift = 16,
.bp_bits = 3,
},
@@ -193,6 +203,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 6,
.name = "W25Q32DW",
+ .dual_spi = 1,
.protection_granularity_shift = 16,
.bp_bits = 3,
},
@@ -203,6 +214,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 7,
.name = "W25Q64_V",
+ .dual_spi = 1,
.protection_granularity_shift = 17,
.bp_bits = 3,
},
@@ -213,6 +225,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 7,
.name = "W25Q64DW",
+ .dual_spi = 1,
.protection_granularity_shift = 17,
.bp_bits = 3,
},
@@ -223,6 +236,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 8,
.name = "W25Q128_V",
+ .dual_spi = 1,
.protection_granularity_shift = 18,
.bp_bits = 3,
},
@@ -233,6 +247,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 8,
.name = "W25Q128FW",
+ .dual_spi = 1,
.protection_granularity_shift = 18,
.bp_bits = 3,
},
@@ -243,6 +258,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 8,
.name = "W25Q128J",
+ .dual_spi = 1,
.protection_granularity_shift = 18,
.bp_bits = 3,
},
@@ -253,6 +269,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 9,
.name = "W25Q256_V",
+ .dual_spi = 1,
.protection_granularity_shift = 16,
.bp_bits = 4,
},
@@ -263,6 +280,7 @@ static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
.sectors_per_block_shift = 4,
.nr_blocks_shift = 9,
.name = "W25Q256J",
+ .dual_spi = 1,
.protection_granularity_shift = 16,
.bp_bits = 4,
},
@@ -681,6 +699,8 @@ int spi_flash_probe_winbond(const struct spi_slave *spi, u8 *idcode,
flash->erase_cmd = CMD_W25_SE;
flash->status_cmd = CMD_W25_RDSR;
+ flash->flags.dual_spi = params->dual_spi;
+
flash->ops = &spi_flash_ops;
flash->driver_private = params;