From patchwork Fri Sep 19 12:41:28 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AYYANARPONNUSAMY GANGHEYAMOORTHY X-Patchwork-Id: 622 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 9D1D7DE037 for ; Sat, 20 Sep 2008 00:06:47 +1000 (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 1KggbD-0005v3-VJ; Fri, 19 Sep 2008 14:04:44 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1KgfIf-0008AC-Qo for linux-mtd@lists.infradead.org; Fri, 19 Sep 2008 12:41:33 +0000 Received: from ep_ms13_bk (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0K7G00LAT0L57I@mailout1.samsung.com> for linux-mtd@lists.infradead.org; Fri, 19 Sep 2008 21:41:29 +0900 (KST) Received: from ep_spt04 (ms13.samsung.com [203.254.225.109]) by ms13.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0K7G00LJT0L4MY@ms13.samsung.com> for linux-mtd@lists.infradead.org; Fri, 19 Sep 2008 21:41:29 +0900 (KST) Content-return: prohibited Date: Fri, 19 Sep 2008 12:41:28 +0000 (GMT) From: AYYANARPONNUSAMY GANGHEYAMOORTHY Subject: [PATCH] [MTD-UTILS] Add support for 4KB page flash devices To: linux-mtd@lists.infradead.org Message-id: <33142758.53091221828088797.JavaMail.weblogic@epml16> MIME-version: 1.0 MIME-version: 1.0 X-Priority: 3 Msgkey: 20080919124020363@moorthy.apg X-MTR: 20080919124020363@moorthy.apg X-EPLocale: en_US.windows-1252 X-EPWebmail-Msg-Type: personal X-EPWebmail-Reply-Demand: 0 X-EPApproval-Locale: X-EPHeader: ML X-EPTrCode: X-EPTrName: X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 MIME_BASE64_BLANKS RAW: Extra blank lines in base64 encoding 2.8 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding -4.0 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [203.254.224.24 listed in list.dnswl.org] Cc: David.Woodhouse@intel.com X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: moorthy.apg@samsung.com 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 We can now use these utilities on 4KB devices. Signed-off-by: Rohit Hagargundgi --- a/flash_otp_write.c 2008-06-27 21:51:28.000000000 +0530 +++ b/flash_otp_write.c 2008-07-01 16:04:12.000000000 +0530 @@ -18,7 +18,7 @@ int main(int argc,char *argv[]) int fd, val, ret, size, wrote, len; mtd_info_t mtdInfo; off_t offset; - char *p, buf[2048]; + char *p, buf[4096]; if (argc != 4 || strcmp(argv[1], "-u")) { fprintf(stderr, "Usage: %s -u \n", argv[0]); --- a/include/mtd/mtd-abi.h 2008-06-27 21:51:28.000000000 +0530 +++ b/include/mtd/mtd-abi.h 2008-06-30 18:51:39.000000000 +0530 @@ -104,7 +104,7 @@ struct nand_oobinfo { uint32_t useecc; uint32_t eccbytes; uint32_t oobfree[8][2]; - uint32_t eccpos[32]; + uint32_t eccpos[128]; }; struct nand_oobfree { @@ -119,7 +119,7 @@ struct nand_oobfree { */ struct nand_ecclayout { uint32_t eccbytes; - uint32_t eccpos[64]; + uint32_t eccpos[128]; uint32_t oobavail; struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES]; }; --- a/flashcp.c 2008-06-27 21:51:28.000000000 +0530 +++ b/flashcp.c 2008-07-02 14:49:21.000000000 +0530 @@ -61,7 +62,7 @@ typedef int bool; #define PERCENTAGE(x,total) (((x) * 100) / (total)) /* size of read/write buffer */ -#define BUFSIZE (10 * 1024) +#define BUFSIZE (10 * 4096) /* cmd-line flags */ #define FLAG_NONE 0x00