forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "generic: 5.4: Add 4B_OPCODES flag to w25q256"
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
Showing
6 changed files
with
8 additions
and
35 deletions.
There are no files selected for viewing
27 changes: 0 additions & 27 deletions
27
target/linux/generic/backport-5.4/464-v5.6-mtd-spi-nor-Add-4B_OPCODES-flag-to-w25q256.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 || | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 || | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 = ¶ms->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; | ||
|
@@ -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++; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) }, | ||
|