public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Lior Amsalem <alior@marvell.com>,
	Jason Cooper <jason@lakedaemon.net>,
	Artem Bityutskiy <dedekind1@gmail.com>,
	Daniel Mack <zonque@gmail.com>,
	linux-mtd@lists.infradead.org,
	Gregory Clement <gregory.clement@free-electrons.com>,
	David Woodhouse <dwmw2@infradead.org>, Willy Tarreau <w@1wt.eu>
Subject: Re: [PATCH v3 05/15] mtd: nand: pxa3xx: Support command buffer #3
Date: Mon, 12 Aug 2013 12:38:20 -0300	[thread overview]
Message-ID: <20130812153819.GB2413@localhost> (raw)
In-Reply-To: <20130811023317.GA15447@norris.computersforpeace.net>

On Sat, Aug 10, 2013 at 07:33:18PM -0700, Brian Norris wrote:
> On Sat, Aug 10, 2013 at 11:48:14PM +0200, Thomas Petazzoni wrote:
> > On Sat, 10 Aug 2013 16:34:55 -0300, Ezequiel Garcia wrote:
> > > Some newer controllers support a fourth command buffer. This additional
> > > command buffer allows to set an arbitrary length count, using the
> > > NDCB3.NDLENCNT field, to perform non-standard length operations
> > > such as the ONFI parameter page read.
> > > 
> > > In controllers without this register, the operation has no effect.
> > 
> > Are you sure this is true? I thought you had this statement in earlier
> > revisions of your patch set, but one of the comment was precisely that
> > this patch was breaking platforms that did not have this register, and
> > this lead you to introduce the separate compatible string.
> 
> It appears as if he didn't change the commit message properly. He does
> now protect the fourth command buffer (?) with this:
> 
> +		/* NDCB3 register is available in NFCv2 (Armada 370/XP SoC) */
> +		if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)
> +			nand_writel(info, NDCB0, info->ndcb3);
> 

Indeed, I just forgot to update the commit message.

I'll prepare a new version to fix this.

> > I must admit, I'm also a bit confused by the existing code:
> > 
> >  		nand_writel(info, NDCB0, info->ndcb0);
> >  		nand_writel(info, NDCB0, info->ndcb1);
> >  		nand_writel(info, NDCB0, info->ndcb2);
> > 

In fact, I got confused as well when I first saw it.

However this behavior is specified in the Armada 370 (I can't find it in the public
PXA specs), which says that software must write either 12 or 16 bytes directly to
NDCB0, four bytes at a time to load the commands in NDCB0, NDCB1, NDCB2, (and optionally
NDCB3).

Writes to NDCB1, NDCB2 and NDCB3 are ignored but each NDCBx register can be read.

I'll add this information as a comment to the above confusing sequence
in the next soon to come version.
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com

  reply	other threads:[~2013-08-12 15:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-10 19:34 [PATCH v3 00/15] pxa3xx-nand patches to support mvebu builds Ezequiel Garcia
2013-08-10 19:34 ` [PATCH v3 01/15] mtd: nand: pxa3xx: Remove unneeded ifdef CONFIG_OF Ezequiel Garcia
2013-08-10 19:34 ` [PATCH v3 02/15] mtd: nand: pxa3xx: Introduce 'marvell, armada370-nand' compatible string Ezequiel Garcia
2013-08-10 19:34 ` [PATCH v3 03/15] mtd: nand: pxa3xx: Handle ECC and DMA enable/disable properly Ezequiel Garcia
2013-08-10 19:34 ` [PATCH v3 04/15] mtd: nand: pxa3xx: Allow to set/clear the 'spare enable' field Ezequiel Garcia
2013-08-10 19:34 ` [PATCH v3 05/15] mtd: nand: pxa3xx: Support command buffer #3 Ezequiel Garcia
2013-08-10 20:53   ` Brian Norris
2013-08-10 21:48   ` Thomas Petazzoni
2013-08-11  2:33     ` Brian Norris
2013-08-12 15:38       ` Ezequiel Garcia [this message]
2013-08-10 19:34 ` [PATCH v3 06/15] mtd: nand: pxa3xx: Use 'length override' in ONFI paramater page read Ezequiel Garcia
2013-08-10 19:34 ` [PATCH v3 07/15] mtd: nand: pxa3xx: Add a local loop variable Ezequiel Garcia
2013-08-10 19:34 ` [PATCH v3 08/15] mtd: nand: pxa3xx: Remove hardcoded mtd name Ezequiel Garcia
2013-08-10 19:34 ` [PATCH v3 09/15] mtd: nand: pxa3xx: Remove uneeded internal cmdset Ezequiel Garcia
2013-08-10 19:35 ` [PATCH v3 10/15] mtd: nand: pxa3xx: Move cached registers to info structure Ezequiel Garcia
2013-08-10 19:35 ` [PATCH v3 11/15] mtd: nand: pxa3xx: Make dma code dependent on dma capable platforms Ezequiel Garcia
2013-08-10 19:35 ` [PATCH v3 12/15] mtd: nand: pxa3xx: Add __maybe_unused keyword to enable_int() Ezequiel Garcia
2013-08-10 19:35 ` [PATCH v3 13/15] mtd: nand: pxa3xx: Allow devices with no dma resources Ezequiel Garcia
2013-08-10 19:35 ` [PATCH v3 14/15] mtd: nand: pxa3xx: Increase data buffer size Ezequiel Garcia
2013-08-11  3:30   ` Brian Norris
2013-08-12 15:48     ` Ezequiel Garcia
2013-08-10 19:35 ` [PATCH v3 15/15] mtd: nand: Allow to build pxa3xx_nand on Orion platforms Ezequiel Garcia

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=20130812153819.GB2413@localhost \
    --to=ezequiel.garcia@free-electrons.com \
    --cc=alior@marvell.com \
    --cc=computersforpeace@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=gregory.clement@free-electrons.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-mtd@lists.infradead.org \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=w@1wt.eu \
    --cc=zonque@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