Skip to contentSkip to conversation

NAND: Allow drivers to choose ECC block size

PATCH New s-paulraj at ti.com 3 participants 3 messages Nov 6, 2009

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

PATCH 1/1 NAND: Allow drivers to choose ECC block size

From: Sandeep Paulraj <[email protected]>

This patch allows the NAND driver to choose ECC block size in sw ecc case.

---
This applies to u-boot-nand-flash/next

 drivers/mtd/nand/nand_base.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/mtd/nand/nand_base.c +2 -1
index 9263a69..e62060d 100644
@@ -2842,7 +2842,8 @@ int nand_scan_tail(struct mtd_info *mtd)
 		chip->ecc.write_page = nand_write_page_swecc;
 		chip->ecc.read_oob = nand_read_oob_std;
 		chip->ecc.write_oob = nand_write_oob_std;
-		chip->ecc.size = 256;
+		if (!chip->ecc.size)
+			chip->ecc.size = 256;
 		chip->ecc.bytes = 3;
 		break;
 
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 NAND: Allow drivers to choose ECC block size

Quoted 16 lines · s-paulraj at ti.com

From: Sandeep Paulraj <[email protected]>

This patch allows the NAND driver to choose ECC block size in sw ecc case.

---
This applies to u-boot-nand-flash/next

 drivers/mtd/nand/nand_base.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/mtd/nand/nand_base.c +0 -0
index 9263a69..e62060d 100644

drivers/mtd/nand/nand_base.c int nand_scan_tail(struct mtd_info *mtd) · line 2848

Quoted 8 lines
drivers/mtd/nand/nand_base.c +2 -1
@@ -2842,7 +2842,8 @@ int nand_scan_tail(struct mtd_info *mtd)
 		chip->ecc.write_page = nand_write_page_swecc;
 		chip->ecc.read_oob = nand_read_oob_std;
 		chip->ecc.write_oob = nand_write_oob_std;
-		chip->ecc.size = 256;
+		if (!chip->ecc.size)
+			chip->ecc.size = 256;
 		chip->ecc.bytes = 3;
 		break;

For this to work, won't the driver have to also be able to override ecc.calculate, or else nand_calculate_ecc need to be changed to support other ECC block sizes?

-Scott

#2 lore raw

PATCH 1/1 NAND: Allow drivers to choose ECC block size

Quoted 39 lines

-----Original Message-----
From: Scott Wood [mailto:scottwood at freescale.com]
Sent: Friday, November 06, 2009 4:13 PM
To: Paulraj, Sandeep
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH] NAND: Allow drivers to choose ECC block size

Quoted 16 lines · s-paulraj at ti.com

From: Sandeep Paulraj <[email protected]>

This patch allows the NAND driver to choose ECC block size in sw ecc case.

---
This applies to u-boot-nand-flash/next

 drivers/mtd/nand/nand_base.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/mtd/nand/nand_base.c +0 -0
index 9263a69..e62060d 100644

drivers/mtd/nand/nand_base.c int nand_scan_tail(struct mtd_info *mtd) · line 2848

Quoted 8 lines
drivers/mtd/nand/nand_base.c +2 -1
@@ -2842,7 +2842,8 @@ int nand_scan_tail(struct mtd_info *mtd)
 		chip->ecc.write_page = nand_write_page_swecc;
 		chip->ecc.read_oob = nand_read_oob_std;
 		chip->ecc.write_oob = nand_write_oob_std;
-		chip->ecc.size = 256;
+		if (!chip->ecc.size)
+			chip->ecc.size = 256;
 		chip->ecc.bytes = 3;
 		break;

For this to work, won't the driver have to also be able to override ecc.calculate, or else nand_calculate_ecc need to be changed to support other ECC block sizes?

Quoted 1 line

-Scott

I believe so

I think we need this

http://patchwork.ozlabs.org/patch/36357/

Sandeep