linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: "Sverdlin, Alexander (Nokia - DE/Ulm)" <alexander.sverdlin@nokia.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Marek Vasut <marek.vasut@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	Tudor Ambarus <tudor.ambarus@microchip.com>
Subject: Re: [PATCH] mtd: spi-nor: Provide default address width and latency for map selection
Date: Mon, 3 Dec 2018 10:34:50 +0100	[thread overview]
Message-ID: <20181203103450.61a8d98f@bbrezillon> (raw)
In-Reply-To: <20181203100814.095a12f4@bbrezillon>

On Mon, 3 Dec 2018 10:08:14 +0100
Boris Brezillon <boris.brezillon@bootlin.com> wrote:

> On Mon, 3 Dec 2018 08:37:17 +0000
> "Sverdlin, Alexander (Nokia - DE/Ulm)" <alexander.sverdlin@nokia.com>
> wrote:
> 
> > Hi!
> > 
> > On 03/12/2018 09:23, Boris Brezillon wrote:  
> > >> This is the same instruction 65h which is used to read regs and which
> > >> appears in SMPT headers, it is a chicken-egg problem.    
> > > Oh, right, I remember now. Not a smart decision from Spansion :-/.
> > >     
> > >> Therefore, I don't know if it's possible to provide smarter heuristics
> > >> here.    
> > > Maybe:
> > > 
> > > ref_cr1 = read_CR1_using_RDCR()
> > > 
> > > for_each_possible_dummy_and_addr_width
> > > 	cr1 = read_CR1_using_RDAR()
> > > 	if (cr1 == ref_cr1)
> > > 		break;    
> > 
> > This will not work, as default value for CR1(N)V is 0 and that is the value
> > one gets with incorrect addr_width as well.
> >   
> 
> How about:
> 
> 	// set the WE bit in SR1 so that SR1 is not 0
> 	write_enable()
> 
> 	ref_sr1 = read_SR1_using_RDSR1()
> 	for_each_possible_dummy_and_addr_width
> 		sr1 = read_SR1_using_RDAR()
> 		if (sr1 == ref_sr1)
> 			break;

Oh, and you should read CR2 to make sure AL and RL fields match the
selected addr/dummy values.

> 
> 	write_disable()  

      reply	other threads:[~2018-12-03  9:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29 18:15 [PATCH] mtd: spi-nor: Provide default address width and latency for map selection Sverdlin, Alexander (Nokia - DE/Ulm)
2018-11-30 10:40 ` Boris Brezillon
2018-12-03  8:03   ` Sverdlin, Alexander (Nokia - DE/Ulm)
2018-12-03  8:23     ` Boris Brezillon
2018-12-03  8:34       ` Sverdlin, Alexander (Nokia - DE/Ulm)
2018-12-03  8:37       ` Sverdlin, Alexander (Nokia - DE/Ulm)
2018-12-03  9:08         ` Boris Brezillon
2018-12-03  9:34           ` Boris Brezillon [this message]

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=20181203103450.61a8d98f@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=alexander.sverdlin@nokia.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    --cc=tudor.ambarus@microchip.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;
as well as URLs for NNTP newsgroup(s).