public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
Cc: Yogesh Gaur <yogeshgaur.83@gmail.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Cyrille Pitchen <cyrille.pitchen@microchip.com>,
	Marek Vasut <marex@denx.de>
Subject: Re: Query Regarding NOR flash page size calculation s25fl512s
Date: Mon, 17 Sep 2018 13:41:12 +0200	[thread overview]
Message-ID: <20180917134112.293e13d7@bbrezillon> (raw)
In-Reply-To: <VI1PR04MB10387E1BDEFE07D998EA53BB991E0@VI1PR04MB1038.eurprd04.prod.outlook.com>

Hi Yogesh,

On Mon, 17 Sep 2018 10:05:27 +0000
Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> wrote:

> Hi All,
> 
> Please suggest how can we work for this flash, s25fl512s?
> Passing flag SPI_NOR_SKIP_SFDP would going to break functionality of 1-2-2/1-4-4 protocol mode, as only through SFDP parameter read we get information for the dummy cycles, mode bits etc for this flash.
> 
> But, page_size value is getting populated wrongly for case when value of CR3V[4] is 0 for this flash.
> 
> --
> Regards
> Yogesh Gaur
> 
> > -----Original Message-----
> > From: linux-mtd [mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of
> > Yogesh Gaur
> > Sent: Friday, August 31, 2018 10:28 AM
> > To: linux-mtd@lists.infradead.org
> > Subject: Query Regarding NOR flash page size calculation s25fl512s
> > 
> > Hi All,
> > 
> > I have query and concern regarding page_size calculation for the underlying
> > NOR flashes.
> > 
> > I have spansion, ‘s25fl512s’ flash connected on my target.
> > 
> > With SFDP param reading, page_size for this flash is assigned as 0x200 using
> > below routine.
> >    /* Page size: this field specifies 'N' so the page size = 2^N bytes. */
> >    params->page_size = bfpt.dwords[BFPT_DWORD(11)];
> >    params->page_size &= BFPT_DWORD11_PAGE_SIZE_MASK;
> >    params->page_size >>= BFPT_DWORD11_PAGE_SIZE_SHIFT;
> >    params->page_size = 1U << params->page_size;
> > 
> > As per the BG of S25FS512S_512_M flash and SFDP header info table above
> > calculation are correct.
> > 
> > But final value of the page_size for this flash is depends on the configuration
> > register CR3V[4], page buffer wrap, it can be either of
> > 256 byte (0) or 512 byte (1).
> > 
> > For my case, this value is 0 and page_size becomes 0x100 bytes but with SFDP
> > header read, value for this is being assigned as 0x200.
> > Due to this, I am getting data corruption.
> > 
> > Please suggest, how can we check and proceed in these case. I guess this is
> > specific to spansion family of flashes.

I guess we need some kind of ->fixup() hook that the core would call
after SFDP has been parsed, so that vendors can adjust SPI NOR params.

Marek, Cyrille, any opinion on that?

Thanks,

Boris

  reply	other threads:[~2018-09-17 11:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31  4:57 Query Regarding NOR flash page size calculation s25fl512s Yogesh Gaur
2018-09-17 10:05 ` Yogesh Narayan Gaur
2018-09-17 11:41   ` Boris Brezillon [this message]
2018-09-18 10:19     ` Cyrille Pitchen

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=20180917134112.293e13d7@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=cyrille.pitchen@microchip.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marex@denx.de \
    --cc=yogeshgaur.83@gmail.com \
    --cc=yogeshnarayan.gaur@nxp.com \
    /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