Skip to contentSkip to conversation

mtd: atmel_nand: add support for 8k page nand

PATCH Applied Raphael Poggi 2 participants 5 messages Jul 17, 2014 – Jul 18, 2014

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

v2 cover mtd: atmel_nand: add support for 8k page nand

This patch series add support for 8k page NAND. This is done by increasing chip_delay (20us to 40us) and enable PMECC for 8k nand. A patch also fix bit error correction when using 1024 sector size with pmecc.

Raphaël Poggi (3):
[PATCH 1/3] mtd: atmel_nand: increase chip_delay [PATCH 2/3] mtd: atmel_nand: fix bit error correction [PATCH 3/3] mtd: atmel_nand: enable PMECC for 8k page nand

 drivers/mtd/nand/atmel_nand.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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

#1 lore raw

PATCH v2 1/3 mtd: atmel_nand: increase chip_delay

Some nand like Micron MT29F32G08ABAAAWP need more than 20us.

---
 drivers/mtd/nand/atmel_nand.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/atmel_nand.c +1 -1
index 3161e89..a02f38f 100644
@@ -1162,7 +1162,7 @@ static int __init atmel_nand_probe(struct device_d *dev)
 		nand_chip->ecc.mode = NAND_ECC_HW;
 	}
 
-	nand_chip->chip_delay = 20;		/* 20us command delay time */
+	nand_chip->chip_delay = 40;		/* 40us command delay time */
 
 	if (IS_ENABLED(CONFIG_NAND_ECC_BCH) &&
 			pdata->ecc_mode == NAND_ECC_SOFT_BCH) {
Signature · 7 lines
1.7.9.5


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

PATCH v2 2/3 mtd: atmel_nand: fix bit error correction

In reply to Raphael Poggi

When pmecc uses a 1024 sector size to correct bit error, the gf dimension must be 14.

So this commit chooses the right degree for different sector size (512 or 1024).

---
 drivers/mtd/nand/atmel_nand.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/nand/atmel_nand.c +2 -1
index a02f38f..1ce7d4d 100644
@@ -796,7 +796,8 @@ static int __init atmel_pmecc_nand_init_params(struct device_d *dev,
 	switch (mtd->writesize) {
 	case 2048:
 	case 4096:
-		host->pmecc_degree = PMECC_GF_DIMENSION_13;
+		host->pmecc_degree = (sector_size == 512) ?
+					PMECC_GF_DIMENSION_13 : PMECC_GF_DIMENSION_14;
 		host->pmecc_cw_len = (1 << host->pmecc_degree) - 1;
 		host->pmecc_sector_number = mtd->writesize / sector_size;
 		host->pmecc_bytes_per_sector = pmecc_get_ecc_bytes(
Signature · 7 lines
1.7.9.5


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

PATCH v2 3/3 mtd: atmel_nand: enable PMECC for 8k page nand

In reply to Raphael Poggi

Enable the PMECC to support 8k page.

---
 drivers/mtd/nand/atmel_nand.c |    1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/atmel_nand.c +1 -0
index 1ce7d4d..337e225 100644
@@ -796,6 +796,7 @@ static int __init atmel_pmecc_nand_init_params(struct device_d *dev,
 	switch (mtd->writesize) {
 	case 2048:
 	case 4096:
+	case 8192:
 		host->pmecc_degree = (sector_size == 512) ?
 					PMECC_GF_DIMENSION_13 : PMECC_GF_DIMENSION_14;
 		host->pmecc_cw_len = (1 << host->pmecc_degree) - 1;
Signature · 7 lines
1.7.9.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#4 lore raw
In reply to Raphael Poggi
Quoted 8 lines · Raphael Poggi

This patch series add support for 8k page NAND. This is done by increasing chip_delay (20us to 40us) and enable PMECC for 8k nand. A patch also fix bit error correction when using 1024 sector size with pmecc.

Raphaël Poggi (3):
[PATCH 1/3] mtd: atmel_nand: increase chip_delay [PATCH 2/3] mtd: atmel_nand: fix bit error correction [PATCH 3/3] mtd: atmel_nand: enable PMECC for 8k page nand

Applied, thanks

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