From: Ben Dooks <ben-linux@fluff.org>
To: linux-mtd@lists.infradead.org
Cc: Michel Pollet <buserror@gmail.com>, Ben Dooks <ben-linux@fluff.org>
Subject: [MTD] [NAND] S3C2410: Allow the machine code to get the BBT table from NAND
Date: Sat, 30 May 2009 18:41:36 +0100 [thread overview]
Message-ID: <1243705298-21814-10-git-send-email-ben-linux@fluff.org> (raw)
In-Reply-To: <1243705298-21814-9-git-send-email-ben-linux@fluff.org>
From: Michel Pollet <buserror@gmail.com>
Added a flag to allow the machine code to tell the NAND
subsystem that it should try to pickup a BBT from the flash,
and also skip the NAND full scan at startup.
Signed-off-by: Michel Pollet <buserror@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
arch/arm/plat-s3c/include/plat/nand.h | 5 +++++
drivers/mtd/nand/s3c2410.c | 6 ++++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-s3c/include/plat/nand.h b/arch/arm/plat-s3c/include/plat/nand.h
index 350ec95..bed4a51 100644
--- a/arch/arm/plat-s3c/include/plat/nand.h
+++ b/arch/arm/plat-s3c/include/plat/nand.h
@@ -13,6 +13,10 @@
/**
* struct s3c2410_nand_set - define a set of one or more nand chips
* @disable_ecc: Entirely disable ECC - Dangerous
+ * @flash_bbt: Openmoko u-boot can create a Bad Block Table
+ * Setting this flag will allow the kernel to
+ * look for it at boot time and also skip the NAND
+ * scan.
* @nr_chips: Number of chips in this set
* @nr_partitions: Number of partitions pointed to be partitoons (or zero)
* @name: Name of set (optional)
@@ -25,6 +29,7 @@
*/
struct s3c2410_nand_set {
unsigned int disable_ecc:1;
+ unsigned int flash_bbt:1;
int nr_chips;
int nr_partitions;
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index ef56652..d315b51 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -845,6 +845,12 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,
dev_info(info->device, "NAND ECC UNKNOWN\n");
break;
}
+
+ /* If you use u-boot BBT creation code, specifying this flag will
+ * let the kernel fish out the BBT from the NAND, and also skip the
+ * full NAND scan that can take 1/2s or so. Little things... */
+ if (set->flash_bbt)
+ chip->options |= NAND_USE_FLASH_BBT | NAND_SKIP_BBTSCAN;
}
/**
--
1.5.6.5
next prev parent reply other threads:[~2009-05-30 18:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-30 17:41 S3C2410 NAND controller updates Ben Dooks
2009-05-30 17:41 ` [MTD] [NAND] S3C2410: Move to using platform device table Ben Dooks
2009-05-30 17:41 ` [MTD] [NAND] S3C2410: Basic kerneldoc comment updates Ben Dooks
2009-05-30 17:41 ` [MTD] [NAND] S3C2410: NAND ECC by chip rather than global Ben Dooks
2009-05-30 17:41 ` [MTD] [NAND] S3C2410: Small colon cleanup Ben Dooks
2009-05-30 17:41 ` [MTD] [NAND] S3C2410: Uninitialised variable cleanup Ben Dooks
2009-05-30 17:41 ` [MTD] [NAND] S3C2410: Fix CFG debug order Ben Dooks
2009-05-30 17:41 ` [MTD] [NAND] S3C2410: Allow commandline partition processing Ben Dooks
2009-05-30 17:41 ` [MTD] [NAND] S3C2410: Added a kerneldoc for s3c2410_nand_set Ben Dooks
2009-05-30 17:41 ` Ben Dooks [this message]
2009-05-30 17:41 ` [MTD] [NAND] S3C2410: Deal with unaligned lengths in S3C2440 buffer read/write Ben Dooks
2009-05-30 17:41 ` [MTD] [NAND] S3C2410: Use DIV_ROUND_UP Ben Dooks
2009-06-02 19:36 ` [MTD] [NAND] S3C2410: Added a kerneldoc for s3c2410_nand_set Peter Korsgaard
2009-06-02 22:55 ` Ben Dooks
2009-06-01 5:47 ` [MTD] [NAND] S3C2410: Move to using platform device table Eric Miao
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=1243705298-21814-10-git-send-email-ben-linux@fluff.org \
--to=ben-linux@fluff.org \
--cc=buserror@gmail.com \
--cc=linux-mtd@lists.infradead.org \
/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