From patchwork Tue Mar 31 12:37:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Grandegger X-Patchwork-Id: 25399 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id CC2FDDF38F for ; Tue, 31 Mar 2009 23:46:15 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by ozlabs.org (Postfix) with ESMTP id A388BDDED5; Tue, 31 Mar 2009 23:40:42 +1100 (EST) Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 0F45D1C1534D; Tue, 31 Mar 2009 14:43:36 +0200 (CEST) X-Auth-Info: +8ysxq9oIz0Nbza2oVP8oOfa21xYIL9M31sKOi6Bswk= Received: from mail.denx.de (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by smtp-auth.mnet-online.de (Postfix) with ESMTP id ACF0E901B5; Tue, 31 Mar 2009 14:40:36 +0200 (CEST) Received: from pollux.denx.de (pollux [192.168.1.1]) by mail.denx.de (Postfix) with ESMTP id 9844F42D7B03; Tue, 31 Mar 2009 14:40:36 +0200 (CEST) Received: by pollux.denx.de (Postfix, from userid 504) id 50FBC10117BBA; Tue, 31 Mar 2009 14:40:36 +0200 (CEST) Message-Id: <20090331124036.204185953@denx.de> User-Agent: quilt/0.47-1 Date: Tue, 31 Mar 2009 14:37:34 +0200 From: Wolfgang Grandegger To: linuxppc-dev@ozlabs.org, Wolfgang Grandegger Subject: [PATCH 7/8] Re: [PATCH 1/2] NAND: Add support for oob size 128 References: <20090331123727.853787299@denx.de> Content-Disposition: inline; filename=nand-oob-size-128.patch Cc: Thomas Gleixner , devicetree-discuss@ozlabs.org, David Woodhouse , Sebastian Siewior X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org * Wolfgang Grandegger | 2009-03-25 11:48:37 [+0100]: >Signed-off-by: Ilya Yanok >Acked-by: Wolfgang Grandegger You seem to forgot a few bits (subpage_sft & max page size). I had this patch in my tree like for ever and forgot post it here. I did however merge the mtd-utils bits allready :) From: Thomas Gleixner Date: Wed, 12 Dec 2007 17:27:03 +0100 Subject: [PATCH 7/8] [PATCH] [MTD] Add support for 4k pages. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Siewior --- drivers/mtd/nand/nand_base.c | 18 ++++++++++++++++++ include/linux/mtd/nand.h | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) Index: linux-2.6/drivers/mtd/nand/nand_base.c =================================================================== --- linux-2.6.orig/drivers/mtd/nand/nand_base.c 2009-03-30 12:47:55.673721571 +0200 +++ linux-2.6/drivers/mtd/nand/nand_base.c 2009-03-30 12:48:07.896719130 +0200 @@ -82,6 +82,20 @@ .length = 38}} }; +static struct nand_ecclayout nand_oob_128 = { + .eccbytes = 48, + .eccpos = { + 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127}, + .oobfree = { + {.offset = 2, + .length = 78}} +}; + static int nand_get_device(struct nand_chip *chip, struct mtd_info *mtd, int new_state); @@ -2555,6 +2569,9 @@ case 64: chip->ecc.layout = &nand_oob_64; break; + case 128: + chip->ecc.layout = &nand_oob_128; + break; default: printk(KERN_WARNING "No oob scheme defined for " "oobsize %d\n", mtd->oobsize); @@ -2676,6 +2693,7 @@ break; case 4: case 8: + case 16: mtd->subpage_sft = 2; break; } Index: linux-2.6/include/linux/mtd/nand.h =================================================================== --- linux-2.6.orig/include/linux/mtd/nand.h 2009-03-30 12:47:55.673721571 +0200 +++ linux-2.6/include/linux/mtd/nand.h 2009-03-30 12:48:07.910718894 +0200 @@ -43,8 +43,8 @@ * is supported now. If you add a chip with bigger oobsize/page * adjust this accordingly. */ -#define NAND_MAX_OOBSIZE 64 -#define NAND_MAX_PAGESIZE 2048 +#define NAND_MAX_OOBSIZE 128 +#define NAND_MAX_PAGESIZE 4096 /* * Constants for hardware specific CLE/ALE/NCE function