mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
To: barebox@lists.infradead.org
Cc: Grigory Milev <g.milev@sam-solutions.com>,
	Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Subject: [PATCH 4/5] nand: mxs: Check for up to 4 NAND chips
Date: Mon, 10 Mar 2014 14:39:52 +0300	[thread overview]
Message-ID: <1394451593-3090-4-git-send-email-d.lavnikevich@sam-solutions.com> (raw)
In-Reply-To: <1394451593-3090-1-git-send-email-d.lavnikevich@sam-solutions.com>

Since i.MX6 has only one R/B actual pin, if there are several R/B
signals (from different NAND chips) they must be connected to this
pin.

Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Signed-off-by: Grigory Milev <g.milev@sam-solutions.com>
---
 drivers/mtd/nand/nand_mxs.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nand_mxs.c b/drivers/mtd/nand/nand_mxs.c
index d1e4b57..237a423 100644
--- a/drivers/mtd/nand/nand_mxs.c
+++ b/drivers/mtd/nand/nand_mxs.c
@@ -33,6 +33,7 @@
 #include <dma/apbh-dma.h>
 #include <stmp-device.h>
 #include <asm/mmu.h>
+#include <mach/generic.h>
 
 #define	MX28_BLOCK_SFTRST				(1 << 31)
 #define	MX28_BLOCK_CLKGATE				(1 << 30)
@@ -427,7 +428,13 @@ static int mxs_nand_device_ready(struct mtd_info *mtd)
 
 	if (nand_info->version > GPMI_VERSION_TYPE_MX23) {
 		tmp = readl(gpmi_regs + GPMI_STAT);
-		tmp >>= (GPMI_STAT_READY_BUSY_OFFSET + nand_info->cur_chip);
+		/* i.MX6 has only one R/B actual pin, so if there are several
+		   R/B signals they must be all connected to this pin */
+		if (cpu_is_mx6())
+			tmp >>= GPMI_STAT_READY_BUSY_OFFSET;
+		else
+			tmp >>= (GPMI_STAT_READY_BUSY_OFFSET +
+					 nand_info->cur_chip);
 	} else {
 		tmp = readl(gpmi_regs + GPMI_DEBUG);
 		tmp >>= (GPMI_DEBUG_READY0_OFFSET + nand_info->cur_chip);
@@ -1304,7 +1311,7 @@ static int mxs_nand_probe(struct device_d *dev)
 	nand->ecc.strength	= 8;
 
 	/* first scan to find the device and get the page size */
-	err = nand_scan_ident(mtd, 1, NULL);
+	err = nand_scan_ident(mtd, 4, NULL);
 	if (err)
 		goto err2;
 
-- 
1.9.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2014-03-10 11:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-10 11:39 [PATCH 1/5] mtd: Update internal API to support 64-bit device size Dmitry Lavnikevich
2014-03-10 11:39 ` [PATCH 2/5] mtd: Support for 4GB partitions Dmitry Lavnikevich
2014-03-10 11:39 ` [PATCH 3/5] ubi: Fix for creating ubi volumes with 64bit size Dmitry Lavnikevich
2014-03-10 11:39 ` Dmitry Lavnikevich [this message]
2014-03-10 11:39 ` [PATCH 5/5] nand: mxs: Fix for calculating ecc strength on some types of NAND flash Dmitry Lavnikevich
2014-03-12 20:28 ` [PATCH 1/5] mtd: Update internal API to support 64-bit device size Sascha Hauer
2014-03-12 20:51   ` Alexander Aring
2014-03-12 20:53     ` Sascha Hauer
     [not found] <1394190783-12978-1-git-send-email-d.lavnikevich@sam-solutions.com>
2014-03-07 11:15 ` [PATCH 4/5] nand: mxs: Check for up to 4 NAND chips Dmitry Lavnikevich

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=1394451593-3090-4-git-send-email-d.lavnikevich@sam-solutions.com \
    --to=d.lavnikevich@sam-solutions.com \
    --cc=barebox@lists.infradead.org \
    --cc=g.milev@sam-solutions.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