diff options
author | Karl Beldan <karl.beldan@gmail.com> | 2008-09-15 16:08:03 +0200 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2008-10-29 10:42:17 -0500 |
commit | 33efde5ecac91ab118ff00b95a181fd6d75f8645 (patch) | |
tree | 20833698e05baa1df329358a0df5bfa828dbfd1d /drivers/mtd | |
parent | c45912d8abc52de796b9059a58faf7c4166eab58 (diff) | |
download | u-boot-imx-33efde5ecac91ab118ff00b95a181fd6d75f8645.zip u-boot-imx-33efde5ecac91ab118ff00b95a181fd6d75f8645.tar.gz u-boot-imx-33efde5ecac91ab118ff00b95a181fd6d75f8645.tar.bz2 |
NAND: Reset chip on power-up
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 <karl.beldan@gmail.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 4069ab1..ba05b76 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -2450,6 +2450,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); @@ -2620,6 +2626,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 */ |