From patchwork Mon Sep 15 12:37:29 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karl Beldan X-Patchwork-Id: 278 Return-Path: X-Original-To: patchwork@ozlabs.org Delivered-To: patchwork@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 DF2E6DE66D for ; Mon, 15 Sep 2008 22:37:57 +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 1KfDKh-0003wc-Ug; Mon, 15 Sep 2008 12:37:35 +0000 Received: from mail-gx0-f12.google.com ([209.85.217.12]) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1KfDKc-0003vD-EV for linux-mtd@lists.infradead.org; Mon, 15 Sep 2008 12:37:30 +0000 Received: by gxk5 with SMTP id 5so23457891gxk.18 for ; Mon, 15 Sep 2008 05:37:29 -0700 (PDT) Received: by 10.100.120.15 with SMTP id s15mr8260536anc.128.1221482249120; Mon, 15 Sep 2008 05:37:29 -0700 (PDT) Received: by 10.100.142.14 with HTTP; Mon, 15 Sep 2008 05:37:29 -0700 (PDT) Message-ID: Date: Mon, 15 Sep 2008 14:37:29 +0200 From: "Karl Beldan" To: linux-mtd@lists.infradead.org Subject: [PATCH] [MTD] [NAND] nand_base.c: reset chip first MIME-Version: 1.0 Content-Disposition: inline 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+patchwork=ozlabs.org@lists.infradead.org Some chips require a RESET after power-up (e.g. Micron MT29FxGxxxxx). The first command sent is NAND_CMD_READID. Issue a NAND_CMD_RESET in nand_scan_ident before reading the device id. Tested with an MT29F4G08AAC. Signed-off-by: Karl Beldan diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index d1129ba..2cfac9b 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -2318,6 +2318,12 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, /* Select the device */ chip->select_chip(mtd, 0); + /* + * Reset the chip, required by some chips (e.g. Micron MT29FxGxxxxx) + * after power-up + */ + chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); + /* Send the command for reading device ID */ chip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1);