From 1b7504496a5debfb08406fad120de1150311e6bc Mon Sep 17 00:00:00 2001 From: rmilecki Date: Tue, 26 Apr 2016 12:36:34 +0000 Subject: [PATCH] bcm53xx: support JEDEC incompatible w25q128 in spi-nor MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49259 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- ...-detect-JEDEC-incompatible-w25q128-using-.patch | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 target/linux/bcm53xx/patches-4.4/405-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch diff --git a/target/linux/bcm53xx/patches-4.4/405-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch b/target/linux/bcm53xx/patches-4.4/405-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch new file mode 100644 index 0000000000..2b3773f0a2 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.4/405-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch @@ -0,0 +1,34 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: [PATCH] mtd: spi-nor: detect JEDEC incompatible w25q128 using 0x90 + command +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some w25q128 chipsets don't support RDID (0x9f) command, they reply with +0xff-s only. To suppose such flashes fallback to the 0x90 command. + +Signed-off-by: Rafał Miłecki +--- + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -869,6 +869,18 @@ static const struct flash_info *spi_nor_read_id(struct spi_nor *nor) + } + dev_err(nor->dev, "unrecognized JEDEC id bytes: %02x, %2x, %2x\n", + id[0], id[1], id[2]); ++ ++ tmp = nor->read_reg(nor, 0x90, id, SPI_NOR_MAX_ID_LEN); ++ if (tmp < 0) { ++ dev_dbg(nor->dev, " error %d reading JEDEC ID\n", tmp); ++ return ERR_PTR(tmp); ++ } ++ dev_info(nor->dev, "using Read Manufacturer / Device ID command (0x%02x) returned %02x %02x\n", ++ 0x90, id[0x03], id[0x04]); ++ if (id[0x03] == 0xef && id[0x04] == 0x17) { ++ return spi_nor_match_id("w25q128"); ++ } ++ + return ERR_PTR(-ENODEV); + } + -- 2.11.0