From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 4/7] mtd: nand: omap: allow to switch to BCH16
Date: Tue, 7 Jun 2016 08:55:42 +0200 [thread overview]
Message-ID: <1465282545-2810-5-git-send-email-hs@denx.de> (raw)
In-Reply-To: <1465282545-2810-1-git-send-email-hs@denx.de>
support in omap_nand_switch_ecc() also an eccstrength
from 16.
Signed-off-by: Heiko Schocher <hs@denx.de>
---
Changes in v2:
- rebase to current mainline commit id:
e4a94ce4ac77396b181663c0493c50bc2d5b9143
arch/arm/cpu/armv7/omap3/board.c | 6 ++++--
drivers/mtd/nand/omap_gpmc.c | 4 ++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 0c44ea5..5f55977 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -280,6 +280,8 @@ static int do_switch_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const arg
omap_nand_switch_ecc(1, 1);
else if (strncmp(argv[2], "bch8", 4) == 0)
omap_nand_switch_ecc(1, 8);
+ else if (strncmp(argv[2], "bch16", 5) == 0)
+ omap_nand_switch_ecc(1, 16);
else
goto usage;
}
@@ -308,8 +310,8 @@ usage:
U_BOOT_CMD(
nandecc, 3, 1, do_switch_ecc,
"switch OMAP3 NAND ECC calculation algorithm",
- "hw [hamming|bch8] - Switch between NAND hardware 1-bit hamming and"
- " 8-bit BCH\n"
+ "hw [hamming|bch8|bch16] - Switch between NAND hardware 1-bit hamming"
+ " and 8-bit/16-bit BCH\n"
" ecc calculation (second parameter may"
" be omitted).\n"
"nandecc sw - Switch to NAND software ecc algorithm."
diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
index 37c4341..67f293d 100644
--- a/drivers/mtd/nand/omap_gpmc.c
+++ b/drivers/mtd/nand/omap_gpmc.c
@@ -917,6 +917,10 @@ int __maybe_unused omap_nand_switch_ecc(uint32_t hardware, uint32_t eccstrength)
err = omap_select_ecc_scheme(nand,
OMAP_ECC_BCH8_CODE_HW,
mtd->writesize, mtd->oobsize);
+ } else if (eccstrength == 16) {
+ err = omap_select_ecc_scheme(nand,
+ OMAP_ECC_BCH16_CODE_HW,
+ mtd->writesize, mtd->oobsize);
} else {
printf("nand: error: unsupported ECC scheme\n");
return -EINVAL;
--
2.5.5
next prev parent reply other threads:[~2016-06-07 6:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-07 6:55 [U-Boot] [PATCH v3 0/7] add support for the etamin draco board variant Heiko Schocher
2016-06-07 6:55 ` [U-Boot] [PATCH v3 1/7] siemens,am33x: add ubi fastmap support Heiko Schocher
2016-06-09 18:03 ` [U-Boot] [U-Boot, v3, 1/7] siemens, am33x: " Tom Rini
2016-06-07 6:55 ` [U-Boot] [PATCH v3 2/7] ubi: add new ubi command "ubi detach" Heiko Schocher
2016-06-09 18:03 ` [U-Boot] [U-Boot,v3,2/7] " Tom Rini
2016-06-07 6:55 ` [U-Boot] [PATCH v3 3/7] nand: add nand mtd concat support Heiko Schocher
2016-06-09 18:03 ` [U-Boot] [U-Boot,v3,3/7] " Tom Rini
2016-06-07 6:55 ` Heiko Schocher [this message]
2016-06-09 18:03 ` [U-Boot] [U-Boot, v3, 4/7] mtd: nand: omap: allow to switch to BCH16 Tom Rini
2016-06-07 6:55 ` [U-Boot] [PATCH v3 5/7] am335x, dxr2: get ECC sType from I2C eeprom Heiko Schocher
2016-06-09 18:03 ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-06-07 6:55 ` [U-Boot] [PATCH v3 6/7] dfu, nand, ubi: fix erasing after write finish Heiko Schocher
2016-06-09 18:04 ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-06-23 15:00 ` [U-Boot] [PATCH v3 " Lukasz Majewski
2016-06-07 6:55 ` [U-Boot] [PATCH v3 7/7] siemens,am33x: add draco etamin board Heiko Schocher
2016-06-09 18:04 ` [U-Boot] [U-Boot,v3,7/7] " Tom Rini
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=1465282545-2810-5-git-send-email-hs@denx.de \
--to=hs@denx.de \
--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