From: Scott Wood Date: Fri, 6 Nov 2009 15:12:56 -0600 Subject: [U-Boot] [PATCH] NAND: Allow drivers to choose ECC block size In-Reply-To: <1257522816-31911-1-git-send-email-s-paulraj@ti.com> References: <1257522816-31911-1-git-send-email-s-paulraj@ti.com> Message-ID: <20091106211256.GB31725@loki.buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, Nov 06, 2009 at 10:53:36AM -0500, s-paulraj at ti.com wrote: > From: Sandeep Paulraj > > This patch allows the NAND driver to choose ECC block size in > sw ecc case. > > Signed-off-by: Sandeep Paulraj > --- > This applies to u-boot-nand-flash/next > drivers/mtd/nand/nand_base.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c > index 9263a69..e62060d 100644 > --- a/drivers/mtd/nand/nand_base.c > +++ b/drivers/mtd/nand/nand_base.c > @@ -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