From patchwork Fri Dec 12 10:10:57 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Singh, Vimal" X-Patchwork-Id: 13697 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C80F9474C2 for ; Fri, 12 Dec 2008 21:13:11 +1100 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1LB4zD-0006XL-PT; Fri, 12 Dec 2008 10:11:07 +0000 Received: from comal.ext.ti.com ([198.47.26.152]) by bombadil.infradead.org with esmtps (Exim 4.68 #1 (Red Hat Linux)) id 1LB4zA-0006OK-I6 for linux-mtd@lists.infradead.org; Fri, 12 Dec 2008 10:11:04 +0000 Received: from dlep36.itg.ti.com ([157.170.170.91]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id mBCAAwSr001435 for ; Fri, 12 Dec 2008 04:11:03 -0600 Received: from webmail.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id mBCAAuOO008589 for ; Fri, 12 Dec 2008 04:10:57 -0600 (CST) Received: from 192.168.10.89 (proxying for 10.24.255.17) (SquirrelMail authenticated user x0094262); by dbdmail.itg.ti.com with HTTP; Fri, 12 Dec 2008 15:40:57 +0530 (IST) Message-ID: <57799.192.168.10.89.1229076657.squirrel@dbdmail.itg.ti.com> Date: Fri, 12 Dec 2008 15:40:57 +0530 (IST) Subject: [PATCH] [MTD] [NAND] nand_base.c: Allowing core driver to choose ECC block size for SW ECC scheme. From: "vimal singh" To: linux-mtd@lists.infradead.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal X-Spam-Score: 0.0 (/) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch allows core driver to choose ECC block size in sw ecc case. Signed-off-by: Vimal Singh --- Current nand driver supports 256 and 512 byte software ecc. This patch provides driver the flexibility to choose ecc size. '256' bytes will be used by default if not provided by core driver. --- a/drivers/mtd/nand/nand_base.c 2008-12-12 14:26:30.050002000 +0530 +++ b/drivers/mtd/nand/nand_base.c 2008-12-12 14:27:05.330000000 +0530 @@ -2622,7 +2622,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;