Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c02a02ee authored by Shaohui Xie's avatar Shaohui Xie Committed by Kumar Gala
Browse files

powerpc/85xx: fix NAND_CMD_READID read bytes number



when nand_get_flash_type() is called, it will read 8 bytes of ID instead of 5,
but the driver only read 5 bytes, so kernel will dump error messages like:

fsl-lbc ffe124000.localbus: read_byte beyond end of buffer
fsl-lbc ffe124000.localbus: read_byte beyond end of buffer
fsl-lbc ffe124000.localbus: read_byte beyond end of buffer

Signed-off-by: default avatarShaohui Xie <Shaohui.Xie@freescale.com>
Acked-by: default avatarScott Wood <scottwood@freescale.com>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent 56299378
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -339,9 +339,9 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command,
		                    (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, NAND_CMD_READID << FCR_CMD0_SHIFT);
		/* 5 bytes for manuf, device and exts */
		/* nand_get_flash_type() reads 8 bytes of entire ID string */
		out_be32(&lbc->fbcr, 5);
		out_be32(&lbc->fbcr, 8);
		elbc_fcm_ctrl->read_bytes = 5;
		elbc_fcm_ctrl->read_bytes = 8;
		elbc_fcm_ctrl->use_mdr = 1;
		elbc_fcm_ctrl->use_mdr = 1;
		elbc_fcm_ctrl->mdr = 0;
		elbc_fcm_ctrl->mdr = 0;