[U-Boot] Bug: Support for EON NOR SPI is broken

Champ, Andy andycham at amazon.co.uk
Fri Oct 7 15:27:58 CEST 2016


... or at least I'm pretty sure it is. I'm raising a bug, not fixing it, because I don't have an Eon device; I was only looking into this trying to understand how the code works.

JEDEC publication #106 contains the manufacturer IDs for JEDEC registered devices. They are coded a bit like UTF-8 - there's an extension field, which takes you to the next table. If the first ID byte is 0x7f then you look up the next byte in the second page. If the second byte too is 0x7f then you look in the 3rd table- and so on.

Way back in 2013 (which is why you shouldn't get too excited about this!) commit 4d5e29a680fc68f02b069a0780d7c71063219b18 divided the spi_flash into multiple parts. Before that change there was this block of code in drivers/mtd/spi/spi_flash.c:

-       /* count the number of continuation bytes */
-       for (shift = 0, idp = idcode;
-            shift < IDCODE_CONT_LEN && *idp == 0x7f;
-            ++shift, ++idp)
-               continue;

That searches for the right page. I haven't been able to work out exactly where the code got lost - but these days there are a several references to CMD_READ_ID in the code base, and none that I can see that search beyond the first page.

Given that the second entry in spi_flash_params in sf_params.c is for Eon, that could be a problem for someone... not me though. Sorry, I don't have time to fix it.

Andy


More information about the U-Boot mailing list