From: Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Ezequiel Garcia
<ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: Alexander Shiyan <shc_work-JGs/UdohzUI@public.gmane.org>,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Ian Campbell
<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
Artem Bityutskiy
<dedekind1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
Haojian Zhuang
<haojian.zhuang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
Pekon Gupta <pekon-l0cyMroinI0@public.gmane.org>
Subject: Re: [PATCH v5 1/3] mtd: nand: gpio: Add DT property to automatically determine bus width
Date: Sat, 30 Nov 2013 10:35:37 -0800 [thread overview]
Message-ID: <20131130183537.GF29397@norris.computersforpeace.net> (raw)
In-Reply-To: <20131130111721.GA2330@localhost>
On Sat, Nov 30, 2013 at 08:17:22AM -0300, Ezequiel Garcia wrote:
> Brian,
>
> On Sat, Nov 30, 2013 at 01:15:56AM -0800, Brian Norris wrote:
> >
> > > Can anyone help me understand if there's *any* valid use case where we
> > > want to specify a-priori the bus width, considering it's completely
> > > discoverable at run-time?
> >
> > I think the primary use case should be to reflect a limitation in the
> > hardware (besides just the flash chip). It can mean that the controller
> > itself only supports one bus width, or that the board is only wired up
> > for x8, for instance.
> >
>
> What do you mean by "reflect a limitation" of the hardware?
Read the following sentence.
Limitations: the hardware could be hooked up only for 8 data lines; or
the controller could support only one particular bus width. Either of
these can only be reflected in device tree.
> Maybe I'm not really following you, but it sounds as you're mixing up
> the NAND device buswidth and the memory controller buswidth. At least
> I consider them as two different parameters for two different pieces
> of hardware.
Yes, maybe I'm combining two properties, but we only have one way to
express this for now. This should be resolved.
> Consider OMAP, just as an example. We currently have two DT properties:
>
> 1. nand-bus-width: not related to OMAP but kernel wide. It's supposed
> to specify the devices buswidth.
>
> 2. gpmc,device-width: It specifies how the controller should be
> configured (it doesn't really specify hardware, but configuration,
> sadly).
>
> I now realise maybe this piece of DT binding is not a good example of DT.
>
> Anyway, once again: Why would we need to set "nand-bus-width" to specify
> the flash device width given we can discover that as soon as the NAND
> is detected?
You've asked two different questions.
Question 1:
Can anyone help me understand if there's *any* valid use case where we
want to specify a-priori the bus width, considering it's completely
discoverable at run-time?
Question 2:
Why would we need to set "nand-bus-width" to specify the flash device
width given we can discover that as soon as the NAND is detected?
The first question is about the NAND core in general, where I strongly
believe that a NAND driver has the right to specify "a-priori" what its
supported bus width(s) is/are.
The second question is specifically about the nand-bus-width DT
property. I think the property is somewhat broken, since it describes
the flash chip and not exactly the board wiring or controller
capabilities.
So to keep this thread focused on Alexander's patch:
+- gpio-control-nand,bank-width-auto : Device bus width is determined
+ automatically by CFI/ONFI information from chip if "bank-width"
+ parameter is omitted (Boolean).
This description fits squarely into describing the flash chip (not the
board wiring or controller limitations), and so it seems superfluous (in
agreement with Ezequiel here, right?). But we have this property already
for GPIO:
- bank-width : Width (in bytes) of the device. If not present, the width
defaults to 1 byte.
This seems to describe the flash chip as well, and paints us into a
corner where we can't determine if it was used because of
board/controller limitations or because of the flash chip. We can get
out of this through the use of an additional property of some kind.
I think to describe the controller/board properly, we probably need
something like this for some drivers:
<manufacturer>,supported-bus-widths = <LIST>;
Where <LIST> can be one or more of 8 or 16, and it reflects any hardware
limitations outside of the flash chip (e.g., # of data lines; controller
limitations). And if <manufacturer>,supported-bus-widths is missing,
then we default to say that the hardware *only* supports the bus width
found in "nand-bus-width"/"bank-width"/similar. So we have this:
[I]
<manufacturer>,supported-bus-widths = <8>, <16>;
nand-bus-width = <don't care>;
===> This means the NAND driver could allow auto-detect of the flash
buswidth. The "nand-bus-width" (or "bank-width") can actually be
"deprecated" here.
[II]
<manufacturer>,supported-bus-widths = <X>; // X = 8 or 16
nand-bus-width = <Y>; // Y = 8 or 16 or missing
===> This means the NAND driver should only configure bus width to X.
If Y is missing, we're OK. If X != Y, then the device tree is
malformed.
[III]
<manufacturer>,supported-bus-widths is missing;
nand-bus-width = <Y>; // Y = 8 or 16 or missing
===> This means the NAND driver should only configure bus width to Y.
This covers the most general DT description, I think. But in the GPIO
case, the "controller" is so dead simple that we can probably represent
the "supported-bus-widths" simply through the # of connected data lines:
gpio,data-lines = <X>;
where X = 8 or 16. If X=16, that means it can support either x8 or x16
(and hence, auto-detection in the NAND core), but if X=8, we only
support x8 and no autodetection.
Brian
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-11-30 18:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-13 11:58 [PATCH v5 1/3] mtd: nand: gpio: Add DT property to automatically determine bus width Alexander Shiyan
2013-11-13 11:58 ` [PATCH v5 2/3] mtd: nand: gpio: Use devm_gpio_request_one() where possible Alexander Shiyan
2013-11-13 11:58 ` [PATCH v5 3/3] mtd: nand: gpio: Add support for multichip devices Alexander Shiyan
[not found] ` <1384343884-29622-1-git-send-email-shc_work-JGs/UdohzUI@public.gmane.org>
2013-11-27 1:21 ` [PATCH v5 1/3] mtd: nand: gpio: Add DT property to automatically determine bus width Brian Norris
[not found] ` <20131127012158.GR9468-bU/DPfM3abD4WzifrMjOTkcViWtcw2C0@public.gmane.org>
2013-11-27 1:23 ` Brian Norris
[not found] ` <20131127012338.GS9468-bU/DPfM3abD4WzifrMjOTkcViWtcw2C0@public.gmane.org>
2013-11-29 12:25 ` Ezequiel Garcia
2013-11-30 9:15 ` Brian Norris
[not found] ` <20131130091556.GD29397-7ciq9WCbhwJWVhifINYOO1poFGfAdsVx5NbjCUgZEJk@public.gmane.org>
2013-11-30 11:17 ` Ezequiel Garcia
2013-11-30 18:35 ` Brian Norris [this message]
2013-11-27 4:21 ` Alexander Shiyan
[not found] ` <1385526078.44550720-3vKlxj6uJRtsdVUOrk1QfQ@public.gmane.org>
2013-11-27 4:34 ` Brian Norris
2013-11-29 8:56 ` Alexander Shiyan
[not found] ` <1385715364.73252787-rvgK6QqyBjrWO3iv0lnsqw@public.gmane.org>
2013-11-30 9:17 ` Brian Norris
[not found] ` <20131130091738.GE29397-7ciq9WCbhwJWVhifINYOO1poFGfAdsVx5NbjCUgZEJk@public.gmane.org>
2013-12-05 2:18 ` Brian Norris
2013-12-05 7:45 ` Alexander Shiyan
2013-11-27 20:16 ` Gupta, Pekon
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=20131130183537.GF29397@norris.computersforpeace.net \
--to=computersforpeace-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=dedekind1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=haojian.zhuang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=pekon-l0cyMroinI0@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
--cc=shc_work-JGs/UdohzUI@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.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;
as well as URLs for NNTP newsgroup(s).