From: Lars-Peter Clausen <lars@metafoo.de>
To: Artem Bityutskiy <dedekind1@gmail.com>
Cc: Ben Dooks <ben-linux@fluff.org>,
Kukjin Kim <kgene.kim@samsung.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
Holger Freyther <zecke@openmoko.org>,
Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 1/2] MTD: s3c2410_nand: Add option to disable hw ECC at runtime
Date: Tue, 12 Apr 2011 21:47:51 +0200 [thread overview]
Message-ID: <1302637672-25339-1-git-send-email-lars@metafoo.de> (raw)
From: Holger Freyther <zecke@openmoko.org>
This patch adds a flag to the s3c2410_nand platform data, which configures
whether hardware ECC is used.
Currently it is only possible to decide whether hw ECC should be used or not at
compile time through a config option. But if you want to build a kernel which
runs on multiple devices you might have a configuration where some devices
require hw ECC and some devices which want software ECC.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/plat-samsung/include/plat/nand.h | 1 +
drivers/mtd/nand/s3c2410.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/arm/plat-samsung/include/plat/nand.h b/arch/arm/plat-samsung/include/plat/nand.h
index b64115f..cbdc8f0 100644
--- a/arch/arm/plat-samsung/include/plat/nand.h
+++ b/arch/arm/plat-samsung/include/plat/nand.h
@@ -49,6 +49,7 @@ struct s3c2410_platform_nand {
int twrph1; /* time for release CLE/ALE from nWE/nOE inactive */
unsigned int ignore_unset_ecc:1;
+ unsigned int software_ecc:1; /* force software ecc at runtime */
int nr_sets;
struct s3c2410_nand_set *sets;
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index cea775a..4666b5e 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -842,7 +842,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,
nmtd->mtd.owner = THIS_MODULE;
nmtd->set = set;
- if (hardware_ecc) {
+ if (!(info->platform && info->platform->software_ecc) && hardware_ecc) {
chip->ecc.calculate = s3c2410_nand_calculate_ecc;
chip->ecc.correct = s3c2410_nand_correct_data;
chip->ecc.mode = NAND_ECC_HW;
--
1.7.2.5
next reply other threads:[~2011-04-12 19:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 19:47 Lars-Peter Clausen [this message]
2011-04-12 19:47 ` [PATCH 2/2] ARM: s3c2440: GTA02: Disable hardware ECC by default Lars-Peter Clausen
2011-04-14 12:08 ` [PATCH 1/2] MTD: s3c2410_nand: Add option to disable hw ECC at runtime Artem Bityutskiy
2011-04-14 14:48 ` Lars-Peter Clausen
2011-04-15 14:01 ` Artem Bityutskiy
2011-04-28 13:51 ` Russell King - ARM Linux
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=1302637672-25339-1-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=ben-linux@fluff.org \
--cc=dedekind1@gmail.com \
--cc=kgene.kim@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=zecke@openmoko.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;
as well as URLs for NNTP newsgroup(s).