Skip to contentSkip to conversation

mtd: atmel_nand: add support for 8k page nand

PATCH Superseded Raphael Poggi 3 participants 6 messages Jul 17, 2014

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/2 mtd: atmel_nand: increase chip_delay

In reply to Raphael Poggi

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
#3 lore raw

PATCH 2/2 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 |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/nand/atmel_nand.c +3 -1
index fa596ed..36a60d1 100644
@@ -796,7 +796,9 @@ 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;
+	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;
 		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
#0 lore raw

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.

Raphaël Poggi (2):
[PATCH 1/2] mtd: atmel_nand: increase chip_delay [PATCH 2/2] 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

Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] mtd: atmel_nand: increase chip_delay

In reply to Raphael Poggi

Hi Raphael,

Quoted 3 lines · Raphael Poggi

Some nand like Micron MT29F32G08ABAAAWP need more than 20us.

Quoted 10 lines
---
  drivers/mtd/nand/atmel_nand.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/atmel_nand.c +0 -0
index 3161e89..a02f38f 100644

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

Quoted 8 lines
drivers/mtd/nand/atmel_nand.c +1 -1
@@ -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) {

Best Regards,
Bo Shen

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

Acked-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] mtd: atmel_nand: enable PMECC for 8k page nand

In reply to Raphael Poggi

Hi Raphael,

Quoted 3 lines · Raphael Poggi

Enable the PMECC to support 8k page.

Quoted 9 lines
---
  drivers/mtd/nand/atmel_nand.c |    4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/nand/atmel_nand.c +0 -0
index fa596ed..36a60d1 100644

drivers/mtd/nand/atmel_nand.c static int __init atmel_pmecc_nand_init_params(struct device_d *dev, · line 801

Quoted 7 lines
drivers/mtd/nand/atmel_nand.c +3 -1
@@ -796,7 +796,9 @@ 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;
+	case 8192:
+		host->pmecc_degree = (sector_size == 512) ?
+					PMECC_GF_DIMENSION_13 : PMECC_GF_DIMENSION_14;

Actually, this is a fix + 8K page support.
If some commit message or split into two patches will be better.

drivers/mtd/nand/atmel_nand.c static int __init atmel_pmecc_nand_init_params(struct device_d *dev, · line 804

Quoted 4 lines
drivers/mtd/nand/atmel_nand.c +0 -0
  		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(

Best Regards,
Bo Shen

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

#5 lore raw

Re: [PATCH 2/2] mtd: atmel_nand: enable PMECC for 8k page nand

Thanks for your Acked.

Yes you're right, so I split this into 2 commits and send a v2.

Best regards,
Raphaël Poggi

2014-07-17 12:05 GMT+02:00 Bo Shen <[email protected]>:

Quoted 42 lines

Hi Raphael,

Quoted 4 lines · Raphael Poggi

Enable the PMECC to support 8k page.

Quoted 9 lines
---
  drivers/mtd/nand/atmel_nand.c |    4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/nand/atmel_nand.c +0 -0
index fa596ed..36a60d1 100644

drivers/mtd/nand/atmel_nand.c static int __init atmel_pmecc_nand_init_params(struct · line 803

Quoted 9 lines
drivers/mtd/nand/atmel_nand.c +3 -1
@@ -796,7 +796,9 @@ 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;
+       case 8192:
+               host->pmecc_degree = (sector_size == 512) ?
+                                       PMECC_GF_DIMENSION_13 :
 PMECC_GF_DIMENSION_14;

Actually, this is a fix + 8K page support.
If some commit message or split into two patches will be better.

Quoted 4 lines
drivers/mtd/nand/atmel_nand.c +0 -0
                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(
Quoted 7 lines

Best Regards,
Bo Shen

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

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