Skip to content

Commit

Permalink
Revert "generic: 5.4: Add 4B_OPCODES flag to w25q256"
Browse files Browse the repository at this point in the history
This reverts commit d7f2194.

Winbond W25Q256FV and W25Q256JV both uses 0xef4019 as JEDEC ID,
but only the latter has proper 4B_OPCODES support.
W25Q256FV has all 4B read instructions but it lacks a 4B page program
instruction, causing the entire flash to be read-only.

Signed-off-by: Chuanhong Guo <[email protected]>
  • Loading branch information
981213 committed Apr 5, 2020
1 parent d24e43a commit f0f35fd
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 35 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <[email protected]>

--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -2706,7 +2706,7 @@ static int spi_nor_write(struct mtd_info
@@ -2704,7 +2704,7 @@ static int spi_nor_write(struct mtd_info

write_enable(nor);
ret = spi_nor_write_data(nor, addr, page_remain, buf + i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Signed-off-by: Felix Fietkau <[email protected]>

--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -4886,6 +4886,7 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -4884,6 +4884,7 @@ int spi_nor_scan(struct spi_nor *nor, co
*/
if (JEDEC_MFR(nor->info) == SNOR_MFR_ATMEL ||
JEDEC_MFR(nor->info) == SNOR_MFR_INTEL ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ Signed-off-by: Matthias Schiffer <[email protected]>

--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -4399,6 +4399,7 @@ static void st_micron_set_default_init(s
@@ -4397,6 +4397,7 @@ static void st_micron_set_default_init(s

static void winbond_set_default_init(struct spi_nor *nor)
{
+ nor->flags |= SNOR_F_HAS_LOCK;
nor->params.set_4byte = winbond_set_4byte;
}

@@ -4888,6 +4889,7 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -4886,6 +4887,7 @@ int spi_nor_scan(struct spi_nor *nor, co
JEDEC_MFR(nor->info) == SNOR_MFR_INTEL ||
JEDEC_MFR(nor->info) == SNOR_MFR_MACRONIX ||
JEDEC_MFR(nor->info) == SNOR_MFR_SST ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ Signed-off-by: Felix Fietkau <[email protected]>
depends on OF && (ARM || ARM64 || COMPILE_TEST)
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -4466,6 +4466,7 @@ static void spi_nor_info_init_params(str
@@ -4464,6 +4464,7 @@ static void spi_nor_info_init_params(str
struct spi_nor_erase_map *map = &params->erase_map;
const struct flash_info *info = nor->info;
struct device_node *np = spi_nor_get_flash_node(nor);
+ struct mtd_info *mtd = &nor->mtd;
u8 i, erase_mask;

/* Initialize legacy flash parameters and settings. */
@@ -4529,6 +4530,21 @@ static void spi_nor_info_init_params(str
@@ -4527,6 +4528,21 @@ static void spi_nor_info_init_params(str
*/
erase_mask = 0;
i = 0;
Expand All @@ -69,7 +69,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
if (info->flags & SECT_4K_PMC) {
erase_mask |= BIT(i);
spi_nor_set_erase_type(&map->erase_type[i], 4096u,
@@ -4540,6 +4556,7 @@ static void spi_nor_info_init_params(str
@@ -4538,6 +4554,7 @@ static void spi_nor_info_init_params(str
SPINOR_OP_BE_4K);
i++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Signed-off-by: Daniel Golle <[email protected]>

--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -2506,6 +2506,9 @@ static const struct flash_info spi_nor_i
@@ -2504,6 +2504,9 @@ static const struct flash_info spi_nor_i
/* XMC (Wuhan Xinxin Semiconductor Manufacturing Corp.) */
{ "XM25QH64A", INFO(0x207017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "XM25QH128A", INFO(0x207018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
Expand Down

0 comments on commit f0f35fd

Please sign in to comment.