linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: Jagan Teki <jteki@openedev.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Marek Vasut <marex@denx.de>
Subject: Re: [PATCH 03/10] mtd: spi-nor: add SPI NOR manufacturer IDs
Date: Sun, 27 Sep 2015 17:46:44 -0700	[thread overview]
Message-ID: <20150928004644.GD34421@google.com> (raw)
In-Reply-To: <CAD6G_RTpucYCnbNxnTs1xionz4pYukAmvys6x45EjYc=n7PNFw@mail.gmail.com>

On Fri, Sep 25, 2015 at 01:47:18AM +0530, Jagan Teki wrote:
> On 2 September 2015 at 01:27, Brian Norris <computersforpeace@gmail.com> wrote:
> > These are often similar for CFI (parallel NOR) and for SPI NOR, but they
> > aren't always the same, for various reasons (different namespaces,
> > company acquisitions and renames, etc.). And some don't have CFI_MFR_*
> > entries at all.
> >
> > So let's make a proper place to list the SPI NOR IDs, with all the SPI
> > NOR specific assumptions and comments.
> >
> > Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> > ---
> >  include/linux/mtd/spi-nor.h | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> >
> > diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
> > index 321a055bc266..8558793cc0f7 100644
> > --- a/include/linux/mtd/spi-nor.h
> > +++ b/include/linux/mtd/spi-nor.h
> > @@ -11,6 +11,21 @@
> >  #define __LINUX_MTD_SPI_NOR_H
> >
> >  #include <linux/bitops.h>
> > +#include <linux/mtd/cfi.h>
> > +
> > +/*
> > + * Manufacturer IDs
> > + *
> > + * The first byte returned from the flash after sending opcode SPINOR_OP_RDID.
> > + * Sometimes these are the same as CFI IDs, but sometimes they aren't.
> > + */
> > +#define SNOR_MFR_ATMEL         CFI_MFR_ATMEL
> > +#define SNOR_MFR_INTEL         CFI_MFR_INTEL
> > +#define SNOR_MFR_MICRON                CFI_MFR_ST /* ST Micro <--> Micron */
> > +#define SNOR_MFR_MACRONIX      CFI_MFR_MACRONIX
> > +#define SNOR_MFR_SPANSION      CFI_MFR_AMD
> > +#define SNOR_MFR_SST           CFI_MFR_SST
> > +#define SNOR_MFR_WINBOND       0xef
> 
> Ideally company names same but looks like winbond is the only diff as
> of now, why can't we define WIN and re-use the same from CFI?

I'm not quite sure what you're suggesting. Are you suggesting we make up
a new Winbond CFI ID? There already is one, and it doesn't match their
SPI NOR, so we can't use it:

#define CFI_MFR_WINBOND         0x00DA

The whole point of this patch is that some mfrs use different IDs for
different classes of flash, so we shouldn't force our programming
patterns into looking like CFI (i.e., parallel NOR [1]) when we're
talking about serial NOR.

If you'd rather, I can just copy the values into this header (e.g.,
0x01, 0x89, etc.) and completely remove all references to CFI.

Brian

[1] Actually, I've seen some serial flash which have CFI parameter
tables. But that's a different subject.

  reply	other threads:[~2015-09-28  0:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 19:57 [PATCH 00/10] mtd: spi-nor: cleanups + block protection support updates Brian Norris
2015-09-01 19:57 ` [PATCH 01/10] mtd: spi-nor: make implicit <linux/bitops.h> dependency explicit Brian Norris
2015-09-01 19:57 ` [PATCH 02/10] mtd: spi-nor: make bitfield constants more consistent Brian Norris
2015-09-01 19:57 ` [PATCH 03/10] mtd: spi-nor: add SPI NOR manufacturer IDs Brian Norris
2015-09-24 20:17   ` Jagan Teki
2015-09-28  0:46     ` Brian Norris [this message]
2015-09-28  9:12       ` Jagan Teki
2015-09-28 23:13         ` Brian Norris
2015-10-01  8:12           ` Jagan Teki
2015-10-01 18:43             ` Brian Norris
2015-09-01 19:57 ` [PATCH 04/10] mtd: spi-nor: use SNOR_MFR_* instead of CFI_MFR_* Brian Norris
2015-09-01 19:57 ` [PATCH 05/10] mtd: spi-nor: fixup kernel-doc for flash lock/unlock function pointers Brian Norris
2015-09-01 19:57 ` [PATCH 06/10] mtd: spi-nor: refactor block protection functions Brian Norris
2015-09-01 19:57 ` [PATCH 07/10] mtd: spi-nor: add mtd_is_locked() support Brian Norris
2015-09-02  9:01   ` Marek Vasut
2015-09-02 20:30     ` Brian Norris
2015-09-03  9:43       ` Marek Vasut
2015-09-03 20:29         ` Brian Norris
2015-10-01  9:00   ` Jagan Teki
2015-10-12 16:49     ` Brian Norris
2015-09-01 19:57 ` [PATCH 08/10] mtd: spi-nor: add DUAL_READ for w25q{32,64}dw Brian Norris
2015-09-01 19:57 ` [PATCH 09/10] mtd: spi-nor: support lock/unlock/is_locked for Winbond Brian Norris
2015-09-01 19:57 ` [PATCH 10/10] mtd: spi-nor: disable protection for Winbond flash at startup Brian Norris
2015-10-14  1:29 ` [PATCH 00/10] mtd: spi-nor: cleanups + block protection support updates Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150928004644.GD34421@google.com \
    --to=computersforpeace@gmail.com \
    --cc=jteki@openedev.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marex@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).