devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: boris brezillon <b.brezillon@overkiz.com>
To: Rob Herring <robherring2@gmail.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>,
	Rob Landley <rob@landley.net>,
	Russell King <linux@arm.linux.org.uk>,
	David Woodhouse <dwmw2@infradead.org>,
	Grant Likely <grant.likely@linaro.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	dev@linux-sunxi.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-mtd@lists.infradead.org,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [RFC PATCH 3/9] of: mtd: add NAND timings retrieval support
Date: Wed, 08 Jan 2014 17:36:34 +0100	[thread overview]
Message-ID: <52CD7E92.3070903@overkiz.com> (raw)
In-Reply-To: <CAL_Jsq+PT9MzEpHwuiSU2oeqzzqajGdBKgdxCZ8S+9W2mPN+tA@mail.gmail.com>

On 08/01/2014 17:30, Rob Herring wrote:
> On Wed, Jan 8, 2014 at 8:21 AM, Boris BREZILLON <b.brezillon@overkiz.com> wrote:
>> Add a function to retrieve NAND timings from a given DT node.
>>
>> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
>> ---
>>   drivers/of/of_mtd.c    |   47 +++++++++++++++++++++++++++++++++++++++++++++++
>>   include/linux/of_mtd.h |    9 +++++++++
>>   2 files changed, 56 insertions(+)
>>
>> diff --git a/drivers/of/of_mtd.c b/drivers/of/of_mtd.c
>> index a27ec94..52e07fd 100644
>> --- a/drivers/of/of_mtd.c
>> +++ b/drivers/of/of_mtd.c
>> @@ -83,3 +83,50 @@ bool of_get_nand_on_flash_bbt(struct device_node *np)
>>          return of_property_read_bool(np, "nand-on-flash-bbt");
>>   }
>>   EXPORT_SYMBOL_GPL(of_get_nand_on_flash_bbt);
>> +
>> +/**
>> + * of_get_nand_timings - Get nand timings for the given device_node
>> + * @np:        Pointer to the given device_node
>> + *
>> + * return 0 on success errno other wise
>> + */
>> +int of_get_nand_timings(struct device_node *np, struct nand_timings *timings)
>> +{
>> +       memset(timings, 0, sizeof(*timings));
>> +
>> +       of_property_read_u32(np, "tCLS-min", &timings->tCLS_min);
>> +       of_property_read_u32(np, "tCLH-min", &timings->tCLH_min);
>> +       of_property_read_u32(np, "tCS-min", &timings->tCS_min);
>> +       of_property_read_u32(np, "tCH-min", &timings->tCH_min);
>> +       of_property_read_u32(np, "tWP-min", &timings->tWP_min);
>> +       of_property_read_u32(np, "tALS-min", &timings->tALS_min);
>> +       of_property_read_u32(np, "tALH-min", &timings->tALH_min);
>> +       of_property_read_u32(np, "tDS-min", &timings->tDS_min);
>> +       of_property_read_u32(np, "tDH-min", &timings->tDH_min);
>> +       of_property_read_u32(np, "tWC-min", &timings->tWC_min);
>> +       of_property_read_u32(np, "tWH-min", &timings->tWH_min);
>> +       of_property_read_u32(np, "tR-max", &timings->tR_max);
>> +       of_property_read_u32(np, "tAR-min", &timings->tAR_min);
>> +       of_property_read_u32(np, "tCLR-min", &timings->tCLR_min);
>> +       of_property_read_u32(np, "tRR-min", &timings->tRR_min);
>> +       of_property_read_u32(np, "tRP-min", &timings->tRP_min);
>> +       of_property_read_u32(np, "tWB-max", &timings->tWB_max);
>> +       of_property_read_u32(np, "tRC-min", &timings->tRC_min);
>> +       of_property_read_u32(np, "tREA-max", &timings->tREA_max);
>> +       of_property_read_u32(np, "tRHZ-max", &timings->tRHZ_max);
>> +       of_property_read_u32(np, "tCHZ-max", &timings->tCHZ_max);
>> +       of_property_read_u32(np, "tRHOH-min", &timings->tRHOH_min);
>> +       of_property_read_u32(np, "tRLOH-min", &timings->tRLOH_min);
>> +       of_property_read_u32(np, "tCOH-min", &timings->tCOH_min);
>> +       of_property_read_u32(np, "tREH-min", &timings->tREH_min);
>> +       of_property_read_u32(np, "tWHR-min", &timings->tWHR_min);
>> +       of_property_read_u32(np, "tRHW-min", &timings->tRHW_min);
>> +       of_property_read_u32(np, "tIR-min", &timings->tIR_min);
>> +       of_property_read_u32(np, "tCR-min", &timings->tCR_min);
>> +       of_property_read_u32(np, "tADL-min", &timings->tADL_min);
>> +       of_property_read_u32(np, "tRST-max", &timings->tRST_max);
>> +       of_property_read_u32(np, "tWW-min", &timings->tWW_min);
> These all need to be documented.
They're document in PATCH 4/9 (but the description might be a bit
light).
> These apply to which compatible
> strings?
Actually this could apply to any nand chips.
The NAND Flash Controller driver is then responsible for converting
these values to use it.
> They should also be suffixed with the unit the property is in
> (i.e. -ms, -us, -ns).

Sure, I'll add the unit (which is -ns BTW).

Thanks.

Best Regards,

Boris
>
> Rob


  reply	other threads:[~2014-01-08 16:36 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08 14:21 [RFC PATCH 0/9] mtd: nand: add sunxi NAND Flash Controller support Boris BREZILLON
     [not found] ` < 1389190924-26226-4-git-send-email-b.brezillon@overkiz.com>
2014-01-08 14:21 ` [RFC PATCH 1/9] mtd: nand: retrieve ECC requirements from Hynix READ ID byte 4 Boris BREZILLON
2014-01-23  1:49   ` Brian Norris
2014-01-29 10:29     ` boris brezillon
2014-02-05 13:53     ` Boris BREZILLON
2014-01-08 14:21 ` [RFC PATCH 2/9] mtd: nand: define struct nand_timings Boris BREZILLON
2014-01-08 14:21 ` [RFC PATCH 3/9] of: mtd: add NAND timings retrieval support Boris BREZILLON
2014-01-08 16:30   ` Rob Herring
2014-01-08 16:36     ` boris brezillon [this message]
2014-01-08 18:34   ` Jason Gunthorpe
     [not found]     ` <20140108183418.GA12358-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2014-01-08 19:00       ` boris brezillon
     [not found]         ` <52CDA032.3010804-ZNYIgs0QAGpBDgjK7y7TUQ@public.gmane.org>
2014-01-08 19:13           ` Jason Gunthorpe
     [not found]             ` <20140108191339.GB12358-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2014-01-09  8:36               ` boris brezillon
     [not found]                 ` <52CE5F82.6070802-ZNYIgs0QAGpBDgjK7y7TUQ@public.gmane.org>
2014-01-09 17:35                   ` Jason Gunthorpe
     [not found]                     ` <20140109173505.GB8899-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2014-01-15 15:09                       ` boris brezillon
     [not found]                         ` <52D6A48D.4080302-ZNYIgs0QAGpBDgjK7y7TUQ@public.gmane.org>
2014-01-15 17:03                           ` boris brezillon
     [not found]                             ` <52D6BF45.80407-ZNYIgs0QAGpBDgjK7y7TUQ@public.gmane.org>
2014-01-21 22:57                               ` Jason Gunthorpe
2014-02-04 17:02                                 ` Grant Likely
2014-01-08 14:21 ` [RFC PATCH 4/9] of: mtd: add NAND timings bindings documentation Boris BREZILLON
2014-01-08 14:22 ` [RFC PATCH 5/9] mtd: nand: add sunxi NFC support Boris BREZILLON
2014-01-08 19:21   ` boris brezillon
2014-01-08 14:22 ` [RFC PATCH 6/9] mtd: nand: add sunxi NFC dt bindings doc Boris BREZILLON
2014-01-08 21:28   ` Arnd Bergmann
2014-01-09  8:31     ` boris brezillon
2014-01-09 10:00       ` Arnd Bergmann
2014-01-08 14:22 ` [RFC PATCH 7/9] ARM: dt/sunxi: add NFC node to Allwinner A20 SoC Boris BREZILLON
     [not found] ` <1389190924-26226-1-git-send-email-b.brezillon-ZNYIgs0QAGpBDgjK7y7TUQ@public.gmane.org>
2014-01-08 14:22   ` [RFC PATCH 8/9] ARM: dt/sunxi: add NFC pinctrl pin definitions Boris BREZILLON
2014-01-08 15:28   ` [RFC PATCH 9/9] ARM: sunxi/dt: enable NAND on cubietruck board Boris BREZILLON
2014-01-08 15:30     ` boris brezillon
2014-01-11 13:38   ` [RFC PATCH 0/9] mtd: nand: add sunxi NAND Flash Controller support boris brezillon
2014-01-23 15:22     ` Rob Herring
     [not found]       ` <CAL_JsqJNd_gtn-cCLbZxT=s5NkkXp0DZkJkZrBhWiaL6Js=woQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-01-29 10:20         ` boris brezillon

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=52CD7E92.3070903@overkiz.com \
    --to=b.brezillon@overkiz.com \
    --cc=dev@linux-sunxi.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    --cc=maxime.ripard@free-electrons.com \
    --cc=rob@landley.net \
    --cc=robherring2@gmail.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).