Patchwork Numonyx N25Q064 (second try)

login
register
about
Submitter David Hendricks
Date 2012-07-25 23:08:58
Message ID <CAKOoyUd+b202OtOoi1FNiKdfM7xJMLmB4WX7D9wP02ci11==pw@mail.gmail.com>
Download mbox | patch
Permalink /patch/3697/
State Accepted
Commit r1612
Headers show

Comments

David Hendricks - 2012-07-25 23:08:58
This patch differentiates between the N25Q064 1.8V version and 3.0V version
which have different JEDEC IDs.

It extends the chip name to include the first few characters in the part
number. The first two of those characters indicate the process technology
(65nm) and feature set, neither of which matter for Flashrom. The third and
fourth characters specify voltage and block/sector size and uniformity,
which are important.

To abstract the irrelevant portions of the part number leading up to the
characters we care about, dots are used. This helps prevent unwanted
changes in chip name that can break fragile scripts and confuse people.
More about this schema here:
http://www.flashrom.org/pipermail/flashrom/2012-July/009595.html

Signed-off-by: David Hendricks <dhendrix@google.com>

 #define SYNCMOS_MVC_ID         0x40    /* SyncMOS (SM) and Mosel Vitelic
Corporation (MVC) */
 #define MVC_V29C51000T         0x00
Stefan Tauner - 2012-07-27 03:48:35
On Wed, 25 Jul 2012 16:08:58 -0700
David Hendricks <dhendrix@google.com> wrote:

> This patch differentiates between the N25Q064 1.8V version and 3.0V version
> which have different JEDEC IDs.
> 
> It extends the chip name to include the first few characters in the part
> number. The first two of those characters indicate the process technology
> (65nm) and feature set, neither of which matter for Flashrom. The third and
> fourth characters specify voltage and block/sector size and uniformity,
> which are important.
> 
> To abstract the irrelevant portions of the part number leading up to the
> characters we care about, dots are used. This helps prevent unwanted
> changes in chip name that can break fragile scripts and confuse people.
> More about this schema here:
> http://www.flashrom.org/pipermail/flashrom/2012-July/009595.html
> 
> Signed-off-by: David Hendricks <dhendrix@google.com>
> 
> Index: flashchips.c
> ===================================================================
> --- flashchips.c        (revision 1553)
> +++ flashchips.c        (working copy)
> @@ -5425,12 +5425,16 @@
> 
>         {
>                 .vendor         = "Numonyx",
> -               .name           = "N25Q064",
> +               /* ..1E = 1.8V, uniform 64KB/4KB blocks/sectors */
> +               .name           = "N25Q064..1E",
>                 .bustype        = BUS_SPI,
>                 .manufacture_id = ST_ID,
> -               .model_id       = ST_N25Q064,
> +               .model_id       = ST_N25Q064__1E,
>                 .total_size     = 8192,
>                 .page_size      = 256,
> +               /* supports SFDP */
> +               /* OTP: 64B total; read 0x4B, write 0x42 */
> +               .feature_bits   = FEATURE_WRSR_WREN | FEATURE_OTP,
>                 .tested         = TEST_OK_PREW,

did you really test the 1.8V version too?

>                 .probe          = probe_spi_rdid,
>                 .probe_timing   = TIMING_ZERO,
> @@ -5450,9 +5454,44 @@
>                 .unlock         = spi_disable_blockprotect,
>                 .write          = spi_chip_write_256,
>                 .read           = spi_chip_read,
> +               .voltage        = {1700, 2000},
>         },
> 
>         {
> +               .vendor         = "Numonyx",
> +               /* ..3E = 3V, uniform 64KB/4KB blocks/sectors */
> +               .name           = "N25Q064..3E",
> +               .bustype        = BUS_SPI,
> +               .manufacture_id = ST_ID,
> +               .model_id       = ST_N25Q064__3E,
> +               .total_size     = 8192,
> +               .page_size      = 256,
> +               /* supports SFDP */

Does it work as expected (testable by removing the chip definition)?


There are a number of other N25Q* chips available apparently. Do you
plan to add them too (NB: http://patchwork.coreboot.org/patch/3652/)?
Anyone else? Steven, our datasheet muncher maybe? :)
David Hendricks - 2012-10-04 03:40:44
On Thu, Jul 26, 2012 at 8:48 PM, Stefan Tauner <
stefan.tauner@student.tuwien.ac.at> wrote:

> did you really test the 1.8V version too?
>

Nope. We can set that to UNTESTED if you prefer, though I don't think
there's much reason to suspect it will fail when the 3V version works.

On Thu, Jul 26, 2012 at 8:48 PM, Stefan Tauner <
stefan.tauner@student.tuwien.ac.at> wrote:

>
> >                 .probe          = probe_spi_rdid,
> >                 .probe_timing   = TIMING_ZERO,
> > @@ -5450,9 +5454,44 @@
> >                 .unlock         = spi_disable_blockprotect,
> >                 .write          = spi_chip_write_256,
> >                 .read           = spi_chip_read,
> > +               .voltage        = {1700, 2000},
> >         },
> >
> >         {
> > +               .vendor         = "Numonyx",
> > +               /* ..3E = 3V, uniform 64KB/4KB blocks/sectors */
> > +               .name           = "N25Q064..3E",
> > +               .bustype        = BUS_SPI,
> > +               .manufacture_id = ST_ID,
> > +               .model_id       = ST_N25Q064__3E,
> > +               .total_size     = 8192,
> > +               .page_size      = 256,
> > +               /* supports SFDP */
>
> Does it work as expected (testable by removing the chip definition)?
>

Obviously not or I wouldn't have bothered to make a patch for it :-)

On Thu, Jul 26, 2012 at 8:48 PM, Stefan Tauner <
stefan.tauner@student.tuwien.ac.at> wrote:

> There are a number of other N25Q* chips available apparently. Do you
> plan to add them too (NB: http://patchwork.coreboot.org/patch/3652/)?
> Anyone else? Steven, our datasheet muncher maybe? :)
>

Would if I had more time...
Stefan Tauner - 2012-10-04 14:49:34
On Wed, 3 Oct 2012 20:40:44 -0700
David Hendricks <dhendrix@google.com> wrote:

> On Thu, Jul 26, 2012 at 8:48 PM, Stefan Tauner <
> stefan.tauner@student.tuwien.ac.at> wrote:
> 
> > did you really test the 1.8V version too?
> >
> 
> Nope. We can set that to UNTESTED if you prefer, though I don't think
> there's much reason to suspect it will fail when the 3V version works.

Nope, but i don't trust any vendor too much. We have burned often
enough (SFDP compatibility for example... ;)

> On Thu, Jul 26, 2012 at 8:48 PM, Stefan Tauner <
> stefan.tauner@student.tuwien.ac.at> wrote:
> 
> >
> > >                 .probe          = probe_spi_rdid,
> > >                 .probe_timing   = TIMING_ZERO,
> > > @@ -5450,9 +5454,44 @@
> > >                 .unlock         = spi_disable_blockprotect,
> > >                 .write          = spi_chip_write_256,
> > >                 .read           = spi_chip_read,
> > > +               .voltage        = {1700, 2000},
> > >         },
> > >
> > >         {
> > > +               .vendor         = "Numonyx",
> > > +               /* ..3E = 3V, uniform 64KB/4KB blocks/sectors */
> > > +               .name           = "N25Q064..3E",
> > > +               .bustype        = BUS_SPI,
> > > +               .manufacture_id = ST_ID,
> > > +               .model_id       = ST_N25Q064__3E,
> > > +               .total_size     = 8192,
> > > +               .page_size      = 256,
> > > +               /* supports SFDP */
> >
> > Does it work as expected (testable by removing the chip definition)?
> >
> 
> Obviously not or I wouldn't have bothered to make a patch for it :-)

In case you ever get the chance to test this again, i would really like
to see the SFDP debug output. The SFDP implementation is still not
tested very much, so there still might be bugs, even if faulty chips are
more likely imo.

Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
and committed in r1612, thanks!

Patch

Index: flashchips.c
===================================================================
--- flashchips.c        (revision 1553)
+++ flashchips.c        (working copy)
@@ -5425,12 +5425,16 @@ 

        {
                .vendor         = "Numonyx",
-               .name           = "N25Q064",
+               /* ..1E = 1.8V, uniform 64KB/4KB blocks/sectors */
+               .name           = "N25Q064..1E",
                .bustype        = BUS_SPI,
                .manufacture_id = ST_ID,
-               .model_id       = ST_N25Q064,
+               .model_id       = ST_N25Q064__1E,
                .total_size     = 8192,
                .page_size      = 256,
+               /* supports SFDP */
+               /* OTP: 64B total; read 0x4B, write 0x42 */
+               .feature_bits   = FEATURE_WRSR_WREN | FEATURE_OTP,
                .tested         = TEST_OK_PREW,
                .probe          = probe_spi_rdid,
                .probe_timing   = TIMING_ZERO,
@@ -5450,9 +5454,44 @@ 
                .unlock         = spi_disable_blockprotect,
                .write          = spi_chip_write_256,
                .read           = spi_chip_read,
+               .voltage        = {1700, 2000},
        },

        {
+               .vendor         = "Numonyx",
+               /* ..3E = 3V, uniform 64KB/4KB blocks/sectors */
+               .name           = "N25Q064..3E",
+               .bustype        = BUS_SPI,
+               .manufacture_id = ST_ID,
+               .model_id       = ST_N25Q064__3E,
+               .total_size     = 8192,
+               .page_size      = 256,
+               /* supports SFDP */
+               /* OTP: 64B total; read 0x4B, write 0x42 */
+               .feature_bits   = FEATURE_WRSR_WREN | FEATURE_OTP,
+               .tested         = TEST_OK_PREW,
+               .probe          = probe_spi_rdid,
+               .probe_timing   = TIMING_ZERO,
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = { {4 * 1024, 2048 } },
+                               .block_erase = spi_block_erase_20,
+                       }, {
+                               .eraseblocks = { {64 * 1024, 128} },
+                               .block_erase = spi_block_erase_d8,
+                       }, {
+                               .eraseblocks = { {8 * 1024 * 1024, 1} },
+                               .block_erase = spi_block_erase_c7,
+                       }
+               },
+               .unlock         = spi_disable_blockprotect,
+               .write          = spi_chip_write_256,
+               .read           = spi_chip_read,
+               .voltage        = {2700, 3600},
+       },
+
+       {
                .vendor         = "PMC",
                .name           = "Pm25LV010",
                .bustype        = BUS_SPI,
Index: flashchips.h
===================================================================
--- flashchips.h        (revision 1553)
+++ flashchips.h        (working copy)
@@ -586,7 +586,8 @@ 
 #define ST_M29W010B            0x23
 #define ST_M29W040B            0xE3
 #define ST_M29W512B            0x27
-#define ST_N25Q064             0xBA17
+#define ST_N25Q064__3E         0xBA17  /* N25Q064, 3V, 64KB/4KB
blocks/sectors */
+#define ST_N25Q064__1E         0xBB17  /* N25Q064, 1.8V, 64KB/4KB
blocks/sectors */