linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: boris.brezillon@free-electrons.com (Boris Brezillon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/16] mtd: nand: sunxi: fix clk rate calculation
Date: Tue, 8 Mar 2016 16:20:40 +0100	[thread overview]
Message-ID: <20160308162040.7b659486@bbrezillon> (raw)
In-Reply-To: <20160308155803.1b0263eb@free-electrons.com>

On Tue, 8 Mar 2016 15:58:03 +0100
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:

> Boris,
> 
> On Mon,  7 Mar 2016 17:18:19 +0100, Boris Brezillon wrote:
> > Unlike what is specified in the Allwinner datasheets, the NAND clock rate
> > is not equal to 2/T but 1/T. Fix the clock rate selection accordingly.
> > 
> > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > ---
> >  drivers/mtd/nand/sunxi_nand.c | 8 +-------
> >  1 file changed, 1 insertion(+), 7 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
> > index 4d01e65..ab66d8d 100644
> > --- a/drivers/mtd/nand/sunxi_nand.c
> > +++ b/drivers/mtd/nand/sunxi_nand.c
> > @@ -1208,13 +1208,7 @@ static int sunxi_nand_chip_set_timings(struct sunxi_nand_chip *chip,
> >  	/* Convert min_clk_period from picoseconds to nanoseconds */
> >  	min_clk_period = DIV_ROUND_UP(min_clk_period, 1000);
> >  
> > -	/*
> > -	 * Convert min_clk_period into a clk frequency, then get the
> > -	 * appropriate rate for the NAND controller IP given this formula
> > -	 * (specified in the datasheet):
> > -	 * nand clk_rate = 2 * min_clk_rate
> > -	 */
> 
> When some HW works in a way that is *NOT* the one specified in the
> datasheet, I think you should rather add *more* comments about this
> aspect, rather than removing existing comments.

Fair enough (but you know how much I like documenting my code ;)). I'll
add a comment explaining why it differs from the datasheet
description :P.


-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2016-03-08 15:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07 16:18 [PATCH 00/16] mtd: nand: sunxi: various improvements/fixes Boris Brezillon
2016-03-07 16:18 ` [PATCH 01/16] mtd: nand: sunxi: fix call order in sunxi_nand_chip_init() Boris Brezillon
2016-03-07 16:18 ` [PATCH 02/16] mtd: nand: sunxi: fix clk rate calculation Boris Brezillon
2016-03-08 14:58   ` Thomas Petazzoni
2016-03-08 15:20     ` Boris Brezillon [this message]
2016-03-07 16:18 ` [PATCH 03/16] mtd: nand: sunxi: fix EDO mode selection Boris Brezillon
2016-03-07 16:18 ` [PATCH 04/16] mtd: nand: sunxi: adapt clk_rate to tWB, tADL, tWHR and tRHW timings Boris Brezillon
2016-03-07 16:18 ` [PATCH 05/16] mtd: nand: export default read/write oob functions Boris Brezillon
2016-03-07 16:18 ` [PATCH 06/16] mtd: nand: sunxi: implement ->read_oob()/->write_oob() Boris Brezillon
2016-03-07 16:18 ` [PATCH 07/16] mtd: nand: sunxi: implement ->read_subpage() Boris Brezillon
2016-03-07 16:20 ` [PATCH 08/16] mtd: nand: sunxi: improve ->cmd_ctrl() function Boris Brezillon
2016-03-07 16:20 ` [PATCH 09/16] mtd: nand: sunxi: let the NAND controller control the CE line Boris Brezillon
2016-03-07 16:21 ` [PATCH 10/16] mtd: nand: sunxi: fix the NFC_ECC_ERR_CNT() macro Boris Brezillon
2016-03-07 16:21   ` [PATCH 11/16] mtd: nand: sunxi: fix NFC_CTL setting Boris Brezillon
2016-03-07 16:21   ` [PATCH 12/16] mtd: nand: sunxi: disable clks on device removal Boris Brezillon
2016-03-07 16:21   ` [PATCH 13/16] mtd: nand: enable ECC pipelining Boris Brezillon
2016-03-07 16:21   ` [PATCH 14/16] mtd: nand: sunxi: fix ->dev_ready() implementation Boris Brezillon
2016-03-07 16:21   ` [PATCH 15/16] mtd: nand: sunxi: make use of readl_poll_timeout() Boris Brezillon
2016-03-07 16:21   ` [PATCH 16/16] mtd: nand: sunxi: poll for events instead of using interrupts Boris Brezillon
2016-04-13 15:27 ` [PATCH 00/16] mtd: nand: sunxi: various improvements/fixes 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=20160308162040.7b659486@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.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).