Commit f57eb5cc authored by Shengzhou Liu's avatar Shengzhou Liu Committed by David Woodhouse

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: default avatarShengzhou Liu <Shengzhou.Liu@freescale.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent d8251108
...@@ -356,20 +356,22 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command, ...@@ -356,20 +356,22 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command,
fsl_elbc_run_command(mtd); fsl_elbc_run_command(mtd);
return; return;
/* READID must read all 5 possible bytes while CEB is active */
case NAND_CMD_READID: case NAND_CMD_READID:
dev_vdbg(priv->dev, "fsl_elbc_cmdfunc: NAND_CMD_READID.\n"); case NAND_CMD_PARAM:
dev_vdbg(priv->dev, "fsl_elbc_cmdfunc: NAND_CMD %x\n", command);
out_be32(&lbc->fir, (FIR_OP_CM0 << FIR_OP0_SHIFT) | out_be32(&lbc->fir, (FIR_OP_CM0 << FIR_OP0_SHIFT) |
(FIR_OP_UA << FIR_OP1_SHIFT) | (FIR_OP_UA << FIR_OP1_SHIFT) |
(FIR_OP_RBW << FIR_OP2_SHIFT)); (FIR_OP_RBW << FIR_OP2_SHIFT));
out_be32(&lbc->fcr, NAND_CMD_READID << FCR_CMD0_SHIFT); out_be32(&lbc->fcr, command << FCR_CMD0_SHIFT);
/* nand_get_flash_type() reads 8 bytes of entire ID string */ /*
out_be32(&lbc->fbcr, 8); * although currently it's 8 bytes for READID, we always read
elbc_fcm_ctrl->read_bytes = 8; * the maximum 256 bytes(for PARAM)
*/
out_be32(&lbc->fbcr, 256);
elbc_fcm_ctrl->read_bytes = 256;
elbc_fcm_ctrl->use_mdr = 1; elbc_fcm_ctrl->use_mdr = 1;
elbc_fcm_ctrl->mdr = 0; elbc_fcm_ctrl->mdr = column;
set_addr(mtd, 0, 0, 0); set_addr(mtd, 0, 0, 0);
fsl_elbc_run_command(mtd); fsl_elbc_run_command(mtd);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment