Patchwork [U-Boot,09/15] kmeter1_nand: allow usage of NAND_ECC_SOFT_BCH

login
register
mail settings
Submitter Holger Brunck
Date Jan. 17, 2013, 12:47 p.m.
Message ID <1358426881-24117-10-git-send-email-holger.brunck@keymile.com>
Download mbox | patch
Permalink /patch/213255/
State Superseded
Delegated to: Kim Phillips
Headers show

Comments

Holger Brunck - Jan. 17, 2013, 12:47 p.m.
If CONFIG_NAND_ECC_BCH is set we use 4-bit error corretion code
instead of the 1-bit error correction code on the NAND device
within this driver.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Scott Wood <scottwood@freescale.com>

---
 drivers/mtd/nand/kmeter1_nand.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Scott Wood - Jan. 17, 2013, 4 p.m.
On 01/17/2013 06:47:55 AM, Holger Brunck wrote:
> If CONFIG_NAND_ECC_BCH is set we use 4-bit error corretion code
> instead of the 1-bit error correction code on the NAND device
> within this driver.
> 
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> cc: Scott Wood <scottwood@freescale.com>
> 
> ---
>  drivers/mtd/nand/kmeter1_nand.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mtd/nand/kmeter1_nand.c  
> b/drivers/mtd/nand/kmeter1_nand.c
> index e8e5b7b..f044597 100644
> --- a/drivers/mtd/nand/kmeter1_nand.c
> +++ b/drivers/mtd/nand/kmeter1_nand.c
> @@ -119,7 +119,11 @@ static int kpn_nand_dev_ready(struct mtd_info  
> *mtd)
> 
>  int board_nand_init(struct nand_chip *nand)
>  {
> +#if defined(CONFIG_NAND_ECC_BCH)
> +	nand->ecc.mode = NAND_ECC_SOFT_BCH;
> +#else
>  	nand->ecc.mode = NAND_ECC_SOFT;
> +#endif
> 
>  	/* Reference hardware control function */
>  	nand->cmd_ctrl  = kpn_nand_hwcontrol;

Acked-by: Scott Wood <scottwood@freescale.com>

-Scott

Patch

diff --git a/drivers/mtd/nand/kmeter1_nand.c b/drivers/mtd/nand/kmeter1_nand.c
index e8e5b7b..f044597 100644
--- a/drivers/mtd/nand/kmeter1_nand.c
+++ b/drivers/mtd/nand/kmeter1_nand.c
@@ -119,7 +119,11 @@  static int kpn_nand_dev_ready(struct mtd_info *mtd)
 
 int board_nand_init(struct nand_chip *nand)
 {
+#if defined(CONFIG_NAND_ECC_BCH)
+	nand->ecc.mode = NAND_ECC_SOFT_BCH;
+#else
 	nand->ecc.mode = NAND_ECC_SOFT;
+#endif
 
 	/* Reference hardware control function */
 	nand->cmd_ctrl  = kpn_nand_hwcontrol;