From patchwork Fri Oct 4 08:17:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Kushwaha X-Patchwork-Id: 280488 X-Patchwork-Delegate: scottwood@freescale.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 49B9F2C010A for ; Fri, 4 Oct 2013 18:19:34 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 97B654A05E; Fri, 4 Oct 2013 10:19:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NDrwmQllNg44; Fri, 4 Oct 2013 10:19:30 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2E0A94A063; Fri, 4 Oct 2013 10:19:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 72EBB4A063 for ; Fri, 4 Oct 2013 10:19:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lHg8HYcnVzp0 for ; Fri, 4 Oct 2013 10:19:17 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from db9outboundpool.messaging.microsoft.com (mail-db9lp0250.outbound.messaging.microsoft.com [213.199.154.250]) by theia.denx.de (Postfix) with ESMTPS id 323ED4A05E for ; Fri, 4 Oct 2013 10:19:11 +0200 (CEST) Received: from mail218-db9-R.bigfish.com (10.174.16.235) by DB9EHSOBE028.bigfish.com (10.174.14.91) with Microsoft SMTP Server id 14.1.225.22; Fri, 4 Oct 2013 08:19:10 +0000 Received: from mail218-db9 (localhost [127.0.0.1]) by mail218-db9-R.bigfish.com (Postfix) with ESMTP id 82D0C20144; Fri, 4 Oct 2013 08:19:10 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h208ch1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzz1de098h1de097h8275bhz2dh2a8h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh1fb3h1d0ch1d2eh1d3fh1dc1h1dfeh1dffh1e23h1fe8h1ff5h1155h) Received: from mail218-db9 (localhost.localdomain [127.0.0.1]) by mail218-db9 (MessageSwitch) id 1380874694667362_14001; Fri, 4 Oct 2013 08:18:14 +0000 (UTC) Received: from DB9EHSMHS001.bigfish.com (unknown [10.174.16.252]) by mail218-db9.bigfish.com (Postfix) with ESMTP id 9F8FD2A0140; Fri, 4 Oct 2013 08:18:14 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB9EHSMHS001.bigfish.com (10.174.14.11) with Microsoft SMTP Server (TLS) id 14.16.227.3; Fri, 4 Oct 2013 08:18:14 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-004.039d.mgd.msft.net (10.84.1.14) with Microsoft SMTP Server (TLS) id 14.3.158.2; Fri, 4 Oct 2013 08:18:12 +0000 Received: from b32579-VirtualBox.ap.freescale.net (B32579-02-010232132087.ap.freescale.net [10.232.132.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id r948I3II029208; Fri, 4 Oct 2013 01:18:10 -0700 From: Prabhakar Kushwaha To: Date: Fri, 4 Oct 2013 13:47:58 +0530 Message-ID: <1380874678-8439-1-git-send-email-prabhakar@freescale.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Cc: scottwood@freescale.com Subject: [U-Boot] [PATCH 1/3][v5] mtd: move & update nand_ecclayout structure X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de nand_ecclayout is present in mtd.h at Linux. Move this structure to mtd.h to comply with Linux. Also, increase the ecc placement locations to 640 to suport device having writesize/oobsize of 8KB/640B. This means that the maximum oobsize has gone up to 640 bytes and consequently the maximum ecc placement locations have also gone up to 640. Signed-off-by: Prabhakar Kushwaha CC: Vipin Kumar --- Changes for v2: Incorporated Scott's comments - move nand_ecclayout to mtd.h - updated OOBFREE, ECCPOS max entries Changes for v3: Sending as it is Changes for v4: Sending as it is Changes for v5: Sending as it is include/linux/mtd/mtd.h | 14 ++++++++++++++ include/mtd/mtd-abi.h | 12 ------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 6f44abd..3a18f8f 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -96,6 +96,20 @@ struct mtd_oob_ops { uint8_t *oobbuf; }; +#define MTD_MAX_OOBFREE_ENTRIES 32 +#define MTD_MAX_ECCPOS_ENTRIES 640 + +/* + * ECC layout control structure. Exported to userspace for + * diagnosis and to allow creation of raw images + */ +struct nand_ecclayout { + uint32_t eccbytes; + uint32_t eccpos[MTD_MAX_ECCPOS_ENTRIES]; + uint32_t oobavail; + struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES]; +}; + struct mtd_info { u_char type; u_int32_t flags; diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h index d51c1ab..ac3c298 100644 --- a/include/mtd/mtd-abi.h +++ b/include/mtd/mtd-abi.h @@ -155,18 +155,6 @@ struct nand_oobfree { uint32_t length; }; -#define MTD_MAX_OOBFREE_ENTRIES 8 -/* - * ECC layout control structure. Exported to userspace for - * diagnosis and to allow creation of raw images - */ -struct nand_ecclayout { - uint32_t eccbytes; - uint32_t eccpos[128]; - uint32_t oobavail; - struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES]; -}; - /** * struct mtd_ecc_stats - error correction stats *