[PATCH] Revert "mtd: spi-nor: disable protection for Winbond flash at startup"

Felix Fietkau nbd at openwrt.org
Sat Nov 28 03:59:43 EST 2015


On 2015-11-27 23:27, Brian Norris wrote:
> Hi Felix,
> 
> On Thu, Nov 26, 2015 at 05:27:01PM +0100, Felix Fietkau wrote:
>> This reverts commit c6fc2171b249e73745c497b578b417a2946f1b2f.
>> 
>> This commit is breaking read access on at least s25fl064k, but also
>> possibly other Spansion flash chips.
> 
> This makes no sense. This patch is about Winbond flash, but you're
> referencing Spansion flash in the commit subject. I suspect you have
> either some more explaining, or some better investigation to do, because
> I don't understand how the commit in question could be the problem for
> you.
Take a look at these Spansion flash ids:

    { "s25fl004k",  INFO(0xef4013,      0,  64 * 1024,   8, SECT_4K |
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
    { "s25fl008k",  INFO(0xef4014,      0,  64 * 1024,  16, SECT_4K |
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
    { "s25fl016k",  INFO(0xef4015,      0,  64 * 1024,  32, SECT_4K |
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
    { "s25fl064k",  INFO(0xef4017,      0,  64 * 1024, 128, SECT_4K) },

Note how they start with 0xef (SNOR_MFR_WINBOND).

>> Any mtd read seems to succeed, but simply returns a zero-filled buffer.
> 
> If this is the symptom you're looking at, I doubt you have the right
> fix. Wild guess: something similar to this patch:
> 
>   http://patchwork.ozlabs.org/patch/547367/
>   "mtd: spi-nor: wait until lock/unlock operations are ready"
When I have access to a similar device again, I can give this fix a try.
If that doesn't work, then maybe we need to add an extra check to
exclude Spansion flashes from the codepath that checks for SNOR_MFR_WINBOND.

- Felix



More information about the linux-mtd mailing list