All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: linux-omap@vger.kernel.org, linux-mtd@lists.infradead.org
Cc: Felipe Balbi <balbi@ti.com>, Pekon Gupta <pekon@ti.com>,
	Brian Norris <computersforpeace@gmail.com>,
	marek.belisko@gmail.com,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Subject: [PATCH 1/1] mtd: nand: omap2: Fix device detection path
Date: Wed, 30 Oct 2013 06:53:08 -0300	[thread overview]
Message-ID: <1383126788-27426-2-git-send-email-ezequiel.garcia@free-electrons.com> (raw)
In-Reply-To: <1383126788-27426-1-git-send-email-ezequiel.garcia@free-electrons.com>

Because the device bus can be 8-bit or 16-bit width, yet ONFI detection
cannot work in 16-bit mode, we need to set the NAND_BUSWIDTH_AUTO option
which allows proper initialization configuration.

Once the bus width is detected, nand_scan_ident() updates the nand_chip struct
'option' field to use the appropriate read/write functions and configure
the ECC engine.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
 drivers/mtd/nand/omap2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index ec40b8d..c71206b 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1662,7 +1662,7 @@ static int omap_nand_probe(struct platform_device *pdev)
 	mtd->owner		= THIS_MODULE;
 	nand_chip		= &info->nand;
 	nand_chip->ecc.priv	= NULL;
-	nand_chip->options	|= NAND_SKIP_BBTSCAN;
+	nand_chip->options	|= NAND_SKIP_BBTSCAN | NAND_BUSWIDTH_AUTO;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (res == NULL) {
@@ -1708,7 +1708,6 @@ static int omap_nand_probe(struct platform_device *pdev)
 	}
 
 	/* scan NAND device connected to chip controller */
-	nand_chip->options |= pdata->devsize & NAND_BUSWIDTH_16;
 	if (nand_scan_ident(mtd, 1, NULL)) {
 		pr_err("nand device scan failed, may be bus-width mismatch\n");
 		err = -ENXIO;
-- 
1.8.1.5


WARNING: multiple messages have this Message-ID (diff)
From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: <linux-omap@vger.kernel.org>, <linux-mtd@lists.infradead.org>
Cc: marek.belisko@gmail.com,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
	Brian Norris <computersforpeace@gmail.com>,
	Pekon Gupta <pekon@ti.com>, Felipe Balbi <balbi@ti.com>
Subject: [PATCH 1/1] mtd: nand: omap2: Fix device detection path
Date: Wed, 30 Oct 2013 06:53:08 -0300	[thread overview]
Message-ID: <1383126788-27426-2-git-send-email-ezequiel.garcia@free-electrons.com> (raw)
In-Reply-To: <1383126788-27426-1-git-send-email-ezequiel.garcia@free-electrons.com>

Because the device bus can be 8-bit or 16-bit width, yet ONFI detection
cannot work in 16-bit mode, we need to set the NAND_BUSWIDTH_AUTO option
which allows proper initialization configuration.

Once the bus width is detected, nand_scan_ident() updates the nand_chip struct
'option' field to use the appropriate read/write functions and configure
the ECC engine.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
 drivers/mtd/nand/omap2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index ec40b8d..c71206b 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1662,7 +1662,7 @@ static int omap_nand_probe(struct platform_device *pdev)
 	mtd->owner		= THIS_MODULE;
 	nand_chip		= &info->nand;
 	nand_chip->ecc.priv	= NULL;
-	nand_chip->options	|= NAND_SKIP_BBTSCAN;
+	nand_chip->options	|= NAND_SKIP_BBTSCAN | NAND_BUSWIDTH_AUTO;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (res == NULL) {
@@ -1708,7 +1708,6 @@ static int omap_nand_probe(struct platform_device *pdev)
 	}
 
 	/* scan NAND device connected to chip controller */
-	nand_chip->options |= pdata->devsize & NAND_BUSWIDTH_16;
 	if (nand_scan_ident(mtd, 1, NULL)) {
 		pr_err("nand device scan failed, may be bus-width mismatch\n");
 		err = -ENXIO;
-- 
1.8.1.5

  reply	other threads:[~2013-10-30  9:53 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 ` Ezequiel Garcia [this message]
2013-10-30  9:53   ` [PATCH 1/1] mtd: nand: omap2: Fix device detection path 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
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=1383126788-27426-2-git-send-email-ezequiel.garcia@free-electrons.com \
    --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.