mtd: IFC NAND: Add support of ONFI NAND flash
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Mon May 14 15:59:02 EDT 2012
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=4b0f1923114b3dee963ec6f8f7375a2b479a6e13
Commit: 4b0f1923114b3dee963ec6f8f7375a2b479a6e13
Parent: 9e5324b68c437804c7d3a3eb7c36001737b075e7
Author: Prabhakar Kushwaha <prabhakar at freescale.com>
AuthorDate: Mon Apr 9 10:55:22 2012 +0530
Committer: David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sun May 13 22:40:56 2012 -0500
mtd: IFC NAND: Add support of ONFI NAND flash
- Fix NAND_CMD_READID command for ONFI detect.
- Add NAND_CMD_PARAM command to read the ONFI parameter page.
Signed-off-by: Prabhakar Kushwaha <prabhakar at freescale.com>
Acked-by: Scott Wood <scottwood at freescale.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at linux.intel.com>
(cherry picked from commit bfdcd41efc153b7ef40f8cd0be5ab6c82ce48c40)
---
drivers/mtd/nand/fsl_ifc_nand.c | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index c30ac7b..5387cec 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -375,21 +375,31 @@ static void fsl_ifc_cmdfunc(struct mtd_info *mtd, unsigned int command,
return;
- /* READID must read all 8 possible bytes */
case NAND_CMD_READID:
+ case NAND_CMD_PARAM: {
+ int timing = IFC_FIR_OP_RB;
+ if (command == NAND_CMD_PARAM)
+ timing = IFC_FIR_OP_RBCD;
+
out_be32(&ifc->ifc_nand.nand_fir0,
(IFC_FIR_OP_CMD0 << IFC_NAND_FIR0_OP0_SHIFT) |
(IFC_FIR_OP_UA << IFC_NAND_FIR0_OP1_SHIFT) |
- (IFC_FIR_OP_RB << IFC_NAND_FIR0_OP2_SHIFT));
+ (timing << IFC_NAND_FIR0_OP2_SHIFT));
out_be32(&ifc->ifc_nand.nand_fcr0,
- NAND_CMD_READID << IFC_NAND_FCR0_CMD0_SHIFT);
- /* 8 bytes for manuf, device and exts */
- out_be32(&ifc->ifc_nand.nand_fbcr, 8);
- ifc_nand_ctrl->read_bytes = 8;
+ command << IFC_NAND_FCR0_CMD0_SHIFT);
+ out_be32(&ifc->ifc_nand.row3, column);
+
+ /*
+ * although currently it's 8 bytes for READID, we always read
+ * the maximum 256 bytes(for PARAM)
+ */
+ out_be32(&ifc->ifc_nand.nand_fbcr, 256);
+ ifc_nand_ctrl->read_bytes = 256;
set_addr(mtd, 0, 0, 0);
fsl_ifc_run_command(mtd);
return;
+ }
/* ERASE1 stores the block and page address */
case NAND_CMD_ERASE1:
More information about the linux-mtd-cvs
mailing list