{"id":279,"url":"http://patchwork.ozlabs.org/api/1.0/patches/279/?format=json","project":{"id":3,"url":"http://patchwork.ozlabs.org/api/1.0/projects/3/?format=json","name":"Linux MTD development","link_name":"linux-mtd","list_id":"linux-mtd.lists.infradead.org","list_email":"linux-mtd@lists.infradead.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<48CE6C43.8050500@gmail.com>","date":"2008-09-15T14:08:03","name":"[PATCH] [MTD] [NAND] nand_base.c: reset chip first","commit_ref":"ef89a8801321e0d0665c327c9d77d602ef764c87","pull_url":null,"state":"accepted","archived":false,"hash":"284c1480d2ae96d7d8ad688070a89e6c4dd67c83","submitter":{"id":144,"url":"http://patchwork.ozlabs.org/api/1.0/people/144/?format=json","name":"Karl Beldan","email":"karl.beldan@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-mtd/patch/48CE6C43.8050500@gmail.com/mbox/","series":[],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/279/checks/","tags":{},"headers":{"Return-Path":"<linux-mtd-bounces+patchwork=ozlabs.org@lists.infradead.org>","X-Original-To":"patchwork@ozlabs.org","Delivered-To":"patchwork@ozlabs.org","Received":["from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\tby ozlabs.org (Postfix) with ESMTPS id 35952DE356\n\tfor <patchwork@ozlabs.org>; Tue, 16 Sep 2008 00:08:33 +1000 (EST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux))\n\tid 1KfEkR-0002mi-2m; Mon, 15 Sep 2008 14:08:15 +0000","from rn-out-0910.google.com ([64.233.170.190])\n\tby bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux))\n\tid 1KfEkO-0002ee-Tk\n\tfor linux-mtd@lists.infradead.org; Mon, 15 Sep 2008 14:08:13 +0000","by rn-out-0910.google.com with SMTP id m7so1453040rnd.3\n\tfor <linux-mtd@lists.infradead.org>;\n\tMon, 15 Sep 2008 07:08:12 -0700 (PDT)","by 10.86.68.1 with SMTP id q1mr6022966fga.2.1221487691676;\n\tMon, 15 Sep 2008 07:08:11 -0700 (PDT)","from ?192.168.2.205? ( [82.225.11.200])\n\tby mx.google.com with ESMTPS id 3sm15019978fge.3.2008.09.15.07.08.03\n\t(version=TLSv1/SSLv3 cipher=RC4-MD5);\n\tMon, 15 Sep 2008 07:08:04 -0700 (PDT)"],"Message-ID":"<48CE6C43.8050500@gmail.com>","Date":"Mon, 15 Sep 2008 16:08:03 +0200","From":"Karl Beldan <karl.beldan@gmail.com>","User-Agent":"Thunderbird 2.0.0.9 (X11/20071031)","MIME-Version":"1.0","To":"linux-mtd@lists.infradead.org","Subject":"Re: [PATCH] [MTD] [NAND] nand_base.c: reset chip first","References":"<ea2442770809150537p538f5298s9b5b003a1825b09f@mail.gmail.com>","In-Reply-To":"<ea2442770809150537p538f5298s9b5b003a1825b09f@mail.gmail.com>","X-Spam-Score":"0.0 (/)","Cc":"David.Woodhouse@intel.com","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.9","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"linux-mtd-bounces@lists.infradead.org","Errors-To":"linux-mtd-bounces+patchwork=ozlabs.org@lists.infradead.org"},"content":"Some chips require a RESET after power-up (e.g. Micron MT29FxGxxxxx).\nThe first command sent is NAND_CMD_READID.\nIssue a NAND_CMD_RESET in nand_scan_ident before reading the device id.\nTested with an MT29F4G08AAC.\n\nSigned-off-by: Karl Beldan <karl.beldan@gmail.com>","diff":"diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c\nindex d1129ba..2cfac9b 100644\n--- a/drivers/mtd/nand/nand_base.c\n+++ b/drivers/mtd/nand/nand_base.c\n@@ -2318,6 +2318,12 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,\n \t/* Select the device */\n \tchip->select_chip(mtd, 0);\n \n+\t/*\n+\t * Reset the chip, required by some chips (e.g. Micron MT29FxGxxxxx)\n+\t * after power-up\n+\t */\n+\tchip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);\n+\n \t/* Send the command for reading device ID */\n \tchip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1);\n \n@@ -2488,6 +2494,8 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips)\n \t/* Check for a chip array */\n \tfor (i = 1; i < maxchips; i++) {\n \t\tchip->select_chip(mtd, i);\n+\t\t/* See comment in nand_get_flash_type for reset */\n+\t\tchip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);\n \t\t/* Send the command for reading device ID */\n \t\tchip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1);\n \t\t/* Read manufacturer and device IDs */\n","prefixes":["MTD","NAND"]}