From: Eric Benard <eric@eukrea.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/3] Fix 2k page size NAND for iMX27
Date: Wed, 15 Jul 2009 17:18:40 +0200 [thread overview]
Message-ID: <1247671121-5160-2-git-send-email-eric@eukrea.com> (raw)
In-Reply-To: <1247671121-5160-1-git-send-email-eric@eukrea.com>
Signed-off-by: Eric Benard <eric@eukrea.com>
---
drivers/nand/nand_imx.c | 20 +++++++++++++++++---
include/asm-arm/arch-imx/imx-nand.h | 3 ++-
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/drivers/nand/nand_imx.c b/drivers/nand/nand_imx.c
index cbff7ce..ecfb649 100644
--- a/drivers/nand/nand_imx.c
+++ b/drivers/nand/nand_imx.c
@@ -874,7 +874,7 @@ static void imx_nand_command(struct mtd_info *mtd, unsigned command,
if (host->pagesize_2k) {
send_addr(host, (page_addr >> 8) & 0xFF);
- if (mtd->size >= 0x40000000) {
+ if (mtd->size >= 0x10000000) {
send_addr(host, (page_addr >> 16) & 0xff);
}
} else {
@@ -961,6 +961,15 @@ static void imx_low_erase(struct mtd_info *mtd)
*
* @return The function always returns 0.
*/
+static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
+
+static struct nand_bbt_descr smallpage_memorybased = {
+ .options = NAND_BBT_SCAN2NDPAGE,
+ .offs = 5,
+ .len = 1,
+ .pattern = scan_ff_pattern
+};
+
static int __init imxnd_probe(struct device_d *dev)
{
struct nand_chip *this;
@@ -969,7 +978,7 @@ static int __init imxnd_probe(struct device_d *dev)
struct imx_nand_host *host;
u16 tmp;
int err = 0;
-#ifdef CONFIG_ARCH_MX27
+#ifdef CONFIG_ARCH_IMX27
PCCR1 |= PCCR1_NFC_BAUDEN;
#endif
/* Allocate memory for MTD device structure and private data */
@@ -1050,7 +1059,12 @@ static int __init imxnd_probe(struct device_d *dev)
this->ecc.layout = &nand_hw_eccoob_16;
}
- host->pagesize_2k = 0;
+ if (pdata->is2k) {
+ host->pagesize_2k = 1;
+ NFMS |= (1 << NFMS_BIT);
+ this->badblock_pattern = &smallpage_memorybased;
+ } else
+ host->pagesize_2k = 0;
/* Scan to find existence of the device */
if (nand_scan(mtd, 1)) {
diff --git a/include/asm-arm/arch-imx/imx-nand.h b/include/asm-arm/arch-imx/imx-nand.h
index 5ebe0be..500bb1a 100644
--- a/include/asm-arm/arch-imx/imx-nand.h
+++ b/include/asm-arm/arch-imx/imx-nand.h
@@ -8,6 +8,7 @@ void imx_nand_load_image(void *dest, int size, int pagesize, int blocksize);
struct imx_nand_platform_data {
int width;
int hw_ecc;
-};
+ int is2k;
+ };
#endif /* __ASM_ARCH_NAND_H */
--
1.6.0.4
next prev parent reply other threads:[~2009-07-15 15:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-15 15:18 [U-Boot] [PATCH v2 1/3] Add Eukrea CPUIMX27 support Eric Benard
2009-07-15 15:18 ` Eric Benard [this message]
2009-07-15 15:18 ` [U-Boot] [PATCH v2 3/3] Add NAND to EUKREA CPUIMX27 defconfig Eric Benard
2009-07-16 19:54 ` [U-Boot] [PATCH v2 2/3] Fix 2k page size NAND for iMX27 Scott Wood
2009-07-17 6:06 ` Eric Bénard
2009-07-31 22:23 ` Scott Wood
2009-08-01 6:28 ` Eric Bénard
2009-08-03 15:38 ` Scott Wood
2009-07-16 7:48 ` [U-Boot] [PATCH v2 1/3] Add Eukrea CPUIMX27 support Sascha Hauer
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=1247671121-5160-2-git-send-email-eric@eukrea.com \
--to=eric@eukrea.com \
--cc=u-boot@lists.denx.de \
/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