Skip to contentSkip to conversation

mtd: atmel_nand: add SOFT_BCH support

PATCH In review Raphael Poggi 3 participants 3 messages Jul 15, 2014 – Jul 17, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: atmel_nand: add SOFT_BCH support

To use soft ecc with nand with 8k page, we need the BCH support. This commit adds the possibilty for atmel_nand to enable SOFT_BCH.

---
 drivers/mtd/nand/atmel_nand.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/mtd/nand/atmel_nand.c +5 -0
index e9b2af7..d542a83 100644
@@ -1164,6 +1164,11 @@ static int __init atmel_nand_probe(struct device_d *dev)
 		nand_chip->ecc.mode = NAND_ECC_HW;
 	}
 
+	if (IS_ENABLED(CONFIG_NAND_ECC_BCH) &&
+		pdata->ecc_mode == NAND_ECC_SOFT_BCH) {
+		nand_chip->ecc.mode = NAND_ECC_SOFT_BCH;
+	}
+
 	nand_chip->chip_delay = 40;		/* 40us command delay time */
 
 	if (host->board->bus_width_16) {	/* 16-bit bus width */
Signature · 7 lines
1.7.9.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw
Quoted 13 lines · Raphael Poggi

To use soft ecc with nand with 8k page, we need the BCH support. This commit adds the possibilty for atmel_nand to enable SOFT_BCH.

---
 drivers/mtd/nand/atmel_nand.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/mtd/nand/atmel_nand.c +0 -0
index e9b2af7..d542a83 100644

drivers/mtd/nand/atmel_nand.c static int __init atmel_nand_probe(struct device_d *dev) · line 1172

Quoted 9 lines
drivers/mtd/nand/atmel_nand.c +5 -0
@@ -1164,6 +1164,11 @@ static int __init atmel_nand_probe(struct device_d *dev)
 		nand_chip->ecc.mode = NAND_ECC_HW;
 	}
 
+	if (IS_ENABLED(CONFIG_NAND_ECC_BCH) &&
+		pdata->ecc_mode == NAND_ECC_SOFT_BCH) {
+		nand_chip->ecc.mode = NAND_ECC_SOFT_BCH;
+	}
+
 	nand_chip->chip_delay = 40;		/* 40us command delay time */

The mainline code has 20us here. Do you need that change?

Anyway, applied this patch.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

Hi,

Thanks for applied, yes I changed the 20us to 40us for handle 8k page NAND. I will send patchs about that.

2014-07-17 7:30 GMT+02:00 Sascha Hauer <[email protected]>:

Quoted 37 lines · Raphael Poggi
Quoted 13 lines

To use soft ecc with nand with 8k page, we need the BCH support. This commit adds the possibilty for atmel_nand to enable SOFT_BCH.

---
 drivers/mtd/nand/atmel_nand.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/mtd/nand/atmel_nand.c +0 -0
index e9b2af7..d542a83 100644

drivers/mtd/nand/atmel_nand.c static int __init atmel_nand_probe(struct device_d *dev) · line 1172

Quoted 9 lines
drivers/mtd/nand/atmel_nand.c +5 -0
@@ -1164,6 +1164,11 @@ static int __init atmel_nand_probe(struct device_d *dev)
              nand_chip->ecc.mode = NAND_ECC_HW;
      }
 
+     if (IS_ENABLED(CONFIG_NAND_ECC_BCH) &&
+             pdata->ecc_mode == NAND_ECC_SOFT_BCH) {
+             nand_chip->ecc.mode = NAND_ECC_SOFT_BCH;
+     }
+
      nand_chip->chip_delay = 40;             /* 40us command delay time */

The mainline code has 20us here. Do you need that change?

Anyway, applied this patch.

Sascha

--

Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
Quoted 4 lines

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox