From patchwork Mon Jan 6 15:34:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodolfo Giometti X-Patchwork-Id: 3439151 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 004E99F1C4 for ; Mon, 6 Jan 2014 15:35:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B259D2016A for ; Mon, 6 Jan 2014 15:35:27 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 012FA20161 for ; Mon, 6 Jan 2014 15:35:26 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W0CD1-0001EI-Mh; Mon, 06 Jan 2014 15:35:19 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W0CCz-0005JT-64; Mon, 06 Jan 2014 15:35:17 +0000 Received: from ip-196-116.sn1.eutelia.it ([62.94.196.116] helo=goldrake.enneenne.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W0CCw-0005IW-Ds for linux-arm-kernel@lists.infradead.org; Mon, 06 Jan 2014 15:35:15 +0000 Received: from cvsweb.enneenne.com ([192.168.32.10] helo=enneenne.com) by goldrake.enneenne.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1W0CCO-0000Ko-7O; Mon, 06 Jan 2014 16:34:49 +0100 Date: Mon, 6 Jan 2014 16:34:38 +0100 From: Rodolfo Giometti To: Ezequiel Garcia Message-ID: <20140106153438.GX10251@enneenne.com> References: <20140102124407.GF10251@enneenne.com> <20140102144236.270c4a6a@skate> <20140103112926.GP10251@enneenne.com> <20140103145336.GA9618@localhost> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140103145336.GA9618@localhost> Organization: GNU/Linux Device Drivers, Embedded Systems and Courses X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 192.168.32.10 X-SA-Exim-Mail-From: giometti@enneenne.com X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Subject: Re: NAND support for Armada 370 X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000) X-SA-Exim-Scanned: Yes (on goldrake.enneenne.com) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140106_103514_732437_3D121FC3 X-CRM114-Status: GOOD ( 14.67 ) X-Spam-Score: -1.9 (-) Cc: Thomas Petazzoni , Gregory =?iso-8859-15?Q?Cl=E9ment?= , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Jan 03, 2014 at 11:53:37AM -0300, Ezequiel Garcia wrote: > > Can you modify the above message so the ECC step size is also printed? > I'll help you prepare a suitable fix to support your NAND. After some attemps I found this configuration... however I'd like to have your opinion about it since I'm not so sure that I correctly understood what each parameter means. :-) Thanks in advance, Rodolfo From 8fc320506e1573dbff4844f4d98e20ff91c43ffd Mon Sep 17 00:00:00 2001 From: Rodolfo Giometti Date: Mon, 6 Jan 2014 16:18:49 +0100 Subject: [PATCH] mtd pxa3xx_nand.c: add support for 2048 bytes page size layout Signed-off-by: Rodolfo Giometti --- drivers/mtd/nand/pxa3xx_nand.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 31aae53..2a7a0b2 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -286,6 +286,16 @@ static struct nand_bbt_descr bbt_mirror_descr = { .pattern = bbt_mirror_pattern }; +static struct nand_ecclayout ecc_layout_2KB_bch4bit = { + .eccbytes = 32, + .eccpos = { + 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63}, + .oobfree = { {2, 30} } +}; + static struct nand_ecclayout ecc_layout_4KB_bch4bit = { .eccbytes = 64, .eccpos = { @@ -1360,6 +1370,17 @@ static int pxa_ecc_init(struct pxa3xx_nand_info *info, * Required ECC: 4-bit correction per 512 bytes * Select: 16-bit correction per 2048 bytes */ + } else if (strength == 4 && ecc_stepsize == 512 && page_size == 2048) { + info->ecc_bch = 1; + info->chunk_size = 2048; + info->spare_size = 32; + info->ecc_size = 32; + ecc->mode = NAND_ECC_HW; + ecc->size = info->chunk_size; + ecc->layout = &ecc_layout_2KB_bch4bit; + ecc->strength = 16; + return 1; + } else if (strength == 4 && ecc_stepsize == 512 && page_size == 4096) { info->ecc_bch = 1; info->chunk_size = 2048; -- 1.8.1.2