public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Cédric Le Goater" <clg@kaod.org>,
	"Marek Vasut" <marek.vasut@gmail.com>,
	linux-mtd@lists.infradead.org
Cc: Cyrille Pitchen <cyrille.pitchen@atmel.com>,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	Joel Stanley <joel@jms.id.au>, Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH 10/10] mtd: spi-nor: aspeed: optimize read mode
Date: Wed, 19 Apr 2017 08:41:47 +1000	[thread overview]
Message-ID: <1492555307.25766.95.camel@kernel.crashing.org> (raw)
In-Reply-To: <a99e6d1e-2dd2-5672-3ff5-adaea69bee75@kaod.org>

On Tue, 2017-04-18 at 17:46 +0200, Cédric Le Goater wrote:
> On 04/15/2017 12:42 AM, Benjamin Herrenschmidt wrote:
> > On Sat, 2017-04-15 at 00:25 +0200, Marek Vasut wrote:
> > > That sounds like a good option, yes. And if it's just forcing
> > > fixed
> > > speed, that's awesome, but I think there are more values that
> > > might need
> > > to be passed ... I think that's what Cedric can answer.
> > 
> > Yes, fixed and delay. Not a huge deal.
> 
> Do we really need to specify the delays in the DT ? As we loop on 
> the different delay settings, if a setting is bogus, we can just 
> pick the following HCLK divider. No ? I don't think it is worth 
> adding black magic properties like this in the DT. We never had to 
> tune it manually AFAICT and anyway, we can always add that later 
> if needed. 
> 
> So, that would leave two properties :
> 
>   - safe divider for "normal/write/erase" commands
>   - speedy divider for "read" commands

When the properties are present, we don't calibrate. So we need the
delay being specified. There's no "black magic" about it, it's about
specifying the appropriate configuration of the controller for the
given motherboard layout/flashchip/speed.

> If the property is not present, we would keep the low HW default, 
> which is /16. 

No misunderstood. The default is to calibrate. The properties allow you
to specify a fixed speed/delay combination in case the system has been
fully calibrated in the factory.

> If there is such a property, the divider value would be considered 
> as a max. The range should be 1..5. Let's introduce "literal" values 
> like "min" and "max" for 1 and 5 ?  
> 
> Do we care for the other HCLK settings < 5 for which we can not set
> any delay ?  

> > Also a module parameter makes it hard to specify different settings
> > for
> > different instances of the device/flash. IE, there can be multiple
> > flash controllers and each of them can have multiple chip selects.
> > 
> > The DT is the only sane way for that.
> 
> Yes. Can we keep the global module parameter as a global chicken 
> switch to deactivate the algo ? It could be useful, some chips tend
> to freak out when hammered on a bit too much. 

Yes, that's useful for diagnosis when things go wrong.

Cheers,
Ben.

> Thanks,
> 
> C.
> 
> 
> > > > That becomes akin to what we do with Ethernet PHYs for example
> > > > :)
> > > 
> > > Even better, I recall seeing some speed DT props in the SPI
> > > binding
> > > docs, so we already have those in place.
> > 
> > Right though the gate delay is rather IP block specific but that's
> > not a huge issue.
> > 
> > Cheers,
> > Ben.
> > 

      parent reply	other threads:[~2017-04-18 22:43 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06 16:56 [PATCH 00/10] mtd: spi-nor: aspeed: support extensions Cédric Le Goater
2017-04-06 16:56 ` [PATCH 01/10] mtd: spi-nor: aspeed: fix the AST2400 SMC window size Cédric Le Goater
2017-04-06 19:17   ` Marek Vasut
2017-04-11 10:18     ` Cédric Le Goater
2017-04-11 10:42       ` Marek Vasut
2017-04-11 16:10         ` Cédric Le Goater
2017-04-06 16:56 ` [PATCH 02/10] mtd: spi-nor: aspeed: remove dummies from keep mask Cédric Le Goater
2017-04-06 16:56 ` [PATCH 03/10] mtd: spi-nor: aspeed: add DMA support Cédric Le Goater
2017-04-06 19:07   ` Cyrille Pitchen
2017-04-06 19:13     ` Cyrille Pitchen
2017-04-19 14:36     ` Cédric Le Goater
2017-04-06 16:56 ` [PATCH 04/10] mtd: spi-nor: aspeed: add support for SPI dual IO read mode Cédric Le Goater
2017-04-06 19:21   ` Marek Vasut
2017-04-11  8:53     ` Cédric Le Goater
2017-04-11 10:43       ` Marek Vasut
2017-04-06 16:56 ` [PATCH 05/10] mtd: spi-nor: Add support for Macronix mx66l1g45g spi flash Cédric Le Goater
2017-04-06 19:21   ` Marek Vasut
2017-04-06 16:56 ` [PATCH 06/10] mtd: spi-nor: add SPI_NOR_DUAL_READ to some flash devices Cédric Le Goater
2017-04-06 19:22   ` Marek Vasut
2017-04-11  8:15     ` Cédric Le Goater
2017-04-06 16:56 ` [PATCH 07/10] mtd: spi-nor: aspeed: configure chip window on AHB bus Cédric Le Goater
2017-04-06 19:25   ` Marek Vasut
2017-04-11 10:20     ` Cédric Le Goater
2017-04-11 10:44       ` Marek Vasut
2017-04-06 16:56 ` [PATCH 08/10] mtd: spi-nor: aspeed: use command mode for reads Cédric Le Goater
2017-04-06 16:56 ` [PATCH 09/10] mtd: spi-nor: aspeed: link controller with the ahb clock Cédric Le Goater
2017-04-06 16:56 ` [PATCH 10/10] mtd: spi-nor: aspeed: optimize read mode Cédric Le Goater
2017-04-06 19:28   ` Marek Vasut
2017-04-11  8:13     ` Cédric Le Goater
2017-04-11  8:23       ` Benjamin Herrenschmidt
2017-04-14 16:18       ` Marek Vasut
2017-04-14 21:40         ` Benjamin Herrenschmidt
2017-04-14 21:51           ` Marek Vasut
2017-04-14 22:11             ` Benjamin Herrenschmidt
2017-04-14 22:25               ` Marek Vasut
2017-04-14 22:42                 ` Benjamin Herrenschmidt
2017-04-16 18:46                   ` Marek Vasut
2017-04-18 15:46                   ` Cédric Le Goater
2017-04-18 16:51                     ` Marek Vasut
2017-04-18 22:41                     ` Benjamin Herrenschmidt [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=1492555307.25766.95.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=boris.brezillon@free-electrons.com \
    --cc=clg@kaod.org \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@atmel.com \
    --cc=dwmw2@infradead.org \
    --cc=joel@jms.id.au \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    --cc=robh+dt@kernel.org \
    /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