mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-29 18:19:02 +00:00
2138956bdc
the OOB layout in MTK SNFI uses the 2nd byte, and anything using OOB will make the block a bad-block in spi-nand driver. Hack it for now. We need a proper solution upstream. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
21 lines
645 B
Diff
21 lines
645 B
Diff
--- a/drivers/mtd/nand/spi/core.c
|
|
+++ b/drivers/mtd/nand/spi/core.c
|
|
@@ -715,7 +715,7 @@ static int spinand_mtd_write(struct mtd_
|
|
static bool spinand_isbad(struct nand_device *nand, const struct nand_pos *pos)
|
|
{
|
|
struct spinand_device *spinand = nand_to_spinand(nand);
|
|
- u8 marker[2] = { };
|
|
+ u8 marker[1] = { };
|
|
struct nand_page_io_req req = {
|
|
.pos = *pos,
|
|
.ooblen = sizeof(marker),
|
|
@@ -726,7 +726,7 @@ static bool spinand_isbad(struct nand_de
|
|
|
|
spinand_select_target(spinand, pos->target);
|
|
spinand_read_page(spinand, &req);
|
|
- if (marker[0] != 0xff || marker[1] != 0xff)
|
|
+ if (marker[0] != 0xff)
|
|
return true;
|
|
|
|
return false;
|