From: Ben Dooks <ben-linux@fluff.org>
To: Karl Beldan <karl.beldan@gmail.com>
Cc: linux-mtd@lists.infradead.org, David.Woodhouse@intel.com
Subject: Re: [PATCH] [MTD] [NAND] nand_base.c: reset chip first
Date: Tue, 16 Sep 2008 11:10:48 +0100 [thread overview]
Message-ID: <20080916101048.GA4322@fluff.org.uk> (raw)
In-Reply-To: <ea2442770809150537p538f5298s9b5b003a1825b09f@mail.gmail.com>
On Mon, Sep 15, 2008 at 02:37:29PM +0200, Karl Beldan wrote:
> 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.
This seems sensible to me, we don't really know what state the NAND
chip is in.
Does there need to be a delay after sending the reset command before
attempting to read the chip's identity?
> Signed-off-by: Karl Beldan <karl.beldan@gmail.com>
> ---
> Prior to resetting, the chip gives a correct first ID byte though.
>
>
> 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);
>
> @@ -2488,6 +2494,8 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips)
> /* Check for a chip array */
> for (i = 1; i < maxchips; i++) {
> chip->select_chip(mtd, i);
> + /* See comment in nand_get_flash_type for reset */
> + chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);
> /* Send the command for reading device ID */
> chip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1);
> /* Read manufacturer and device IDs */
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
next prev parent reply other threads:[~2008-09-16 10:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-15 12:37 [PATCH] [MTD] [NAND] nand_base.c: reset chip first Karl Beldan
2008-09-15 14:08 ` Karl Beldan
2008-09-16 10:10 ` Ben Dooks [this message]
2008-09-16 11:55 ` Karl Beldan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080916101048.GA4322@fluff.org.uk \
--to=ben-linux@fluff.org \
--cc=David.Woodhouse@intel.com \
--cc=karl.beldan@gmail.com \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.