diff options
author | Shengzhou Liu <Shengzhou.Liu@freescale.com> | 2011-12-12 04:40:53 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:18:47 -0500 |
commit | f57eb5cc5394afb2a6f41da7509b794ed9ca5f6d (patch) | |
tree | 280ea115439a795a174cab0885071c4ed33751fb /drivers | |
parent | d8251108e0def5a2f15124a8e6314b14bfa5eb9c (diff) |
mtd: nand: Add ONFI support for FSL NAND controller
- fix NAND_CMD_READID command for ONFI detect.
- add NAND_CMD_PARAM command to read the ONFI parameter page.
Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/nand/fsl_elbc_nand.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index 080e6037cbfb..7195ee6efe12 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c | |||
@@ -356,20 +356,22 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command, | |||
356 | fsl_elbc_run_command(mtd); | 356 | fsl_elbc_run_command(mtd); |
357 | return; | 357 | return; |
358 | 358 | ||
359 | /* READID must read all 5 possible bytes while CEB is active */ | ||
360 | case NAND_CMD_READID: | 359 | case NAND_CMD_READID: |
361 | dev_vdbg(priv->dev, "fsl_elbc_cmdfunc: NAND_CMD_READID.\n"); | 360 | case NAND_CMD_PARAM: |
361 | dev_vdbg(priv->dev, "fsl_elbc_cmdfunc: NAND_CMD %x\n", command); | ||
362 | 362 | ||
363 | out_be32(&lbc->fir, (FIR_OP_CM0 << FIR_OP0_SHIFT) | | 363 | out_be32(&lbc->fir, (FIR_OP_CM0 << FIR_OP0_SHIFT) | |
364 | (FIR_OP_UA << FIR_OP1_SHIFT) | | 364 | (FIR_OP_UA << FIR_OP1_SHIFT) | |
365 | (FIR_OP_RBW << FIR_OP2_SHIFT)); | 365 | (FIR_OP_RBW << FIR_OP2_SHIFT)); |
366 | out_be32(&lbc->fcr, NAND_CMD_READID << FCR_CMD0_SHIFT); | 366 | out_be32(&lbc->fcr, command << FCR_CMD0_SHIFT); |
367 | /* nand_get_flash_type() reads 8 bytes of entire ID string */ | 367 | /* |
368 | out_be32(&lbc->fbcr, 8); | 368 | * although currently it's 8 bytes for READID, we always read |
369 | elbc_fcm_ctrl->read_bytes = 8; | 369 | * the maximum 256 bytes(for PARAM) |
370 | */ | ||
371 | out_be32(&lbc->fbcr, 256); | ||
372 | elbc_fcm_ctrl->read_bytes = 256; | ||
370 | elbc_fcm_ctrl->use_mdr = 1; | 373 | elbc_fcm_ctrl->use_mdr = 1; |
371 | elbc_fcm_ctrl->mdr = 0; | 374 | elbc_fcm_ctrl->mdr = column; |
372 | |||
373 | set_addr(mtd, 0, 0, 0); | 375 | set_addr(mtd, 0, 0, 0); |
374 | fsl_elbc_run_command(mtd); | 376 | fsl_elbc_run_command(mtd); |
375 | return; | 377 | return; |