All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: "Gupta, Pekon" <pekon@ti.com>
Cc: Brian Norris <computersforpeace@gmail.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"Balbi, Felipe" <balbi@ti.com>,
	"marek.belisko@gmail.com" <marek.belisko@gmail.com>
Subject: Re: [PATCH 0/1] Fix OMAP2 NAND ONFI device detection
Date: Wed, 6 Nov 2013 18:18:34 -0300	[thread overview]
Message-ID: <20131106211833.GB12624@localhost> (raw)
In-Reply-To: <20980858CB6D3A4BAE95CA194937D5E73EA31B19@DBDE04.ent.ti.com>

On Wed, Nov 06, 2013 at 08:54:56PM +0000, Gupta, Pekon wrote:
> > From: Ezequiel Garcia [mailto:ezequiel.garcia@free-electrons.com]
> > > On Wed, Oct 30, 2013 at 09:18:53PM +0000, Gupta, Pekon wrote:
> > > >
> > > > I'm not sure, of course, but I don't see why not. It's more likely to
> > > > break for x16 than it is for x8.
> > > >
> > > Another question here is ..
> > > The above patch assumes that user has configured GPMC bus-width
> > > correctly, so if user is already providing GPMC bus-width information
> > > via DT, then do we really need to detect NAND device bus-width again
> > > using NAND_BUSWIDTH_AUTO ?
> > >
> > 
> > Hm.. I think you're forgetting the original motivation for this patch,
> > which was initially explained by you :-) The problem is ONFI doesn't work
> > in 16-bit mode.
> > 
> > Let me clarify. Since GPMC and NAND widths *must* match (otherwise, it
> > wouldn't make much sense, right?) we don't really need to autodetect the
> > NAND width.
> > 
> > However, since ONFI doesn't work in 16-bit mode, we would have to do
> > something like this (untested pseudo code):
> > 
> >   nand_scan_ident(...);
> > 
> >   if (platform_data->devsize == 16)
> >   	nand_chip->options |= NAND_BUSWIDTH_16;
> > 
> > And in some cases we might even get away with such solution. However,
> > we can't guarantee nand_scan_ident() doesn't need to swith to 16-bit mode
> > inside to perform other commands (maybe some ONFI extended parameter
> > page).
> > 
> > Therefore, and given the width can be autodetected in any case (array
> > or ONFI based carry such information) it's much cleaner to simply do:
> > 
> >   nand_chip->options |= NAND_BUSWIDTH_AUTOMAGIC;
> >   nand_scan_ident(...);
> > 
> > See? Much cleaner, no?
> > 
> but still dependent on DT property for GPMC configurations...
> I preferred NAND bus-width detection to be completely independent
> of 'any' DT property.
> 

I think we're still mixing GPMC and NAND, and I don't think it's sane.

> > And remember: the fact that we must know the device width to configure
> > the GPMC correctly (which being a hardware parameter belongs to the DT)
> > is OMAP specific. Other SoCs might not have such memory controller
> > and thus won't need such knowledge before hand, although that sounds
> > unlikely to me.
> > 
> > The outcome of this discussion seems to be that no driver should ever
> > need to specify the 'nand-bus-width' DT property, as Brian
> > previously suggested, right?
> > 
> Right.. And this is where I'm suggesting that in-order to completely
> eliminate the dependency on 'nand-bus-width' DT property, you need
> to also update GPMC driver, so that its registers can be re-configured with
> correct NAND bus-width after nand_scan_ident().
> 


Well, as I said: I don't think there's any technical reason why you
can't just export a GPMC function to re-configure it from the NAND
driver. I just think it's ugly, and not useful.

So, I think you (or me, or anybody else) can push an RFC/PATCH to see
how ugly would that really be. Maybe it's not so bad.

But: on the other hand, I'd really like you to convince me as to
why is it so bad to require the DTB to have the proper GPMC bus width.

Once again:
1. the NAND devices aren't hot-pluggable
2. the "user" (who is actually an engineer, not some regular dummy user)
knows perfectly well the width of the device.

What's the problem with describing the hardware in the DT and saving us
lots of runtime re-configuration trouble?
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: "Gupta, Pekon" <pekon@ti.com>
Cc: "marek.belisko@gmail.com" <marek.belisko@gmail.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	Brian Norris <computersforpeace@gmail.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"Balbi, Felipe" <balbi@ti.com>
Subject: Re: [PATCH 0/1] Fix OMAP2 NAND ONFI device detection
Date: Wed, 6 Nov 2013 18:18:34 -0300	[thread overview]
Message-ID: <20131106211833.GB12624@localhost> (raw)
In-Reply-To: <20980858CB6D3A4BAE95CA194937D5E73EA31B19@DBDE04.ent.ti.com>

On Wed, Nov 06, 2013 at 08:54:56PM +0000, Gupta, Pekon wrote:
> > From: Ezequiel Garcia [mailto:ezequiel.garcia@free-electrons.com]
> > > On Wed, Oct 30, 2013 at 09:18:53PM +0000, Gupta, Pekon wrote:
> > > >
> > > > I'm not sure, of course, but I don't see why not. It's more likely to
> > > > break for x16 than it is for x8.
> > > >
> > > Another question here is ..
> > > The above patch assumes that user has configured GPMC bus-width
> > > correctly, so if user is already providing GPMC bus-width information
> > > via DT, then do we really need to detect NAND device bus-width again
> > > using NAND_BUSWIDTH_AUTO ?
> > >
> > 
> > Hm.. I think you're forgetting the original motivation for this patch,
> > which was initially explained by you :-) The problem is ONFI doesn't work
> > in 16-bit mode.
> > 
> > Let me clarify. Since GPMC and NAND widths *must* match (otherwise, it
> > wouldn't make much sense, right?) we don't really need to autodetect the
> > NAND width.
> > 
> > However, since ONFI doesn't work in 16-bit mode, we would have to do
> > something like this (untested pseudo code):
> > 
> >   nand_scan_ident(...);
> > 
> >   if (platform_data->devsize == 16)
> >   	nand_chip->options |= NAND_BUSWIDTH_16;
> > 
> > And in some cases we might even get away with such solution. However,
> > we can't guarantee nand_scan_ident() doesn't need to swith to 16-bit mode
> > inside to perform other commands (maybe some ONFI extended parameter
> > page).
> > 
> > Therefore, and given the width can be autodetected in any case (array
> > or ONFI based carry such information) it's much cleaner to simply do:
> > 
> >   nand_chip->options |= NAND_BUSWIDTH_AUTOMAGIC;
> >   nand_scan_ident(...);
> > 
> > See? Much cleaner, no?
> > 
> but still dependent on DT property for GPMC configurations...
> I preferred NAND bus-width detection to be completely independent
> of 'any' DT property.
> 

I think we're still mixing GPMC and NAND, and I don't think it's sane.

> > And remember: the fact that we must know the device width to configure
> > the GPMC correctly (which being a hardware parameter belongs to the DT)
> > is OMAP specific. Other SoCs might not have such memory controller
> > and thus won't need such knowledge before hand, although that sounds
> > unlikely to me.
> > 
> > The outcome of this discussion seems to be that no driver should ever
> > need to specify the 'nand-bus-width' DT property, as Brian
> > previously suggested, right?
> > 
> Right.. And this is where I'm suggesting that in-order to completely
> eliminate the dependency on 'nand-bus-width' DT property, you need
> to also update GPMC driver, so that its registers can be re-configured with
> correct NAND bus-width after nand_scan_ident().
> 


Well, as I said: I don't think there's any technical reason why you
can't just export a GPMC function to re-configure it from the NAND
driver. I just think it's ugly, and not useful.

So, I think you (or me, or anybody else) can push an RFC/PATCH to see
how ugly would that really be. Maybe it's not so bad.

But: on the other hand, I'd really like you to convince me as to
why is it so bad to require the DTB to have the proper GPMC bus width.

Once again:
1. the NAND devices aren't hot-pluggable
2. the "user" (who is actually an engineer, not some regular dummy user)
knows perfectly well the width of the device.

What's the problem with describing the hardware in the DT and saving us
lots of runtime re-configuration trouble?
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com

  reply	other threads:[~2013-11-06 21:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30  9:53 [PATCH 0/1] Fix OMAP2 NAND ONFI device detection Ezequiel Garcia
2013-10-30  9:53 ` Ezequiel Garcia
2013-10-30  9:53 ` [PATCH 1/1] mtd: nand: omap2: Fix device detection path Ezequiel Garcia
2013-10-30  9:53   ` Ezequiel Garcia
2013-10-30 19:14 ` [PATCH 0/1] Fix OMAP2 NAND ONFI device detection Brian Norris
2013-10-30 19:14   ` Brian Norris
2013-10-30 21:18   ` Gupta, Pekon
2013-10-30 21:18     ` Gupta, Pekon
2013-10-30 23:19     ` Ezequiel Garcia
2013-10-30 23:19       ` Ezequiel Garcia
2013-11-06 20:54       ` Gupta, Pekon
2013-11-06 20:54         ` Gupta, Pekon
2013-11-06 21:18         ` Ezequiel Garcia [this message]
2013-11-06 21:18           ` Ezequiel Garcia
2013-11-06 22:00           ` Gupta, Pekon
2013-11-06 22:00             ` Gupta, Pekon
2013-11-06 22:38             ` Ezequiel Garcia
2013-11-06 22:38               ` Ezequiel Garcia
2013-11-30  8:56       ` Brian Norris
2013-11-30  8:56         ` Brian Norris

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=20131106211833.GB12624@localhost \
    --to=ezequiel.garcia@free-electrons.com \
    --cc=balbi@ti.com \
    --cc=computersforpeace@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=marek.belisko@gmail.com \
    --cc=pekon@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.