Skip to content
Snippets Groups Projects
Commit 65a9db7b authored by Alex Waterman's avatar Alex Waterman Committed by Scott Wood
Browse files

nand_spl: Fix large page nand_command()


This patch changes the large page nand_command() routine to use a word
offset instead of a byte offset. The 'offs' argument gets divided by 2
so that the offset passed to nand_command() is still by byte offset.
Originally, the offset was not shifted and when too high an offset was
requested the nand chip would attempt to read non-existent data.

Signed-off-by: default avatarAlex Waterman <awaterman@dawning.com>
parent 62974546
No related branches found
No related tags found
No related merge requests found
......@@ -90,6 +90,10 @@ static int nand_command(struct mtd_info *mtd, int block, int page, int offs, u8
cmd = NAND_CMD_READ0;
}
/* Shift the offset from byte addressing to word addressing. */
if (this->options & NAND_BUSWIDTH_16)
offs >>= 1;
/* Begin command latch cycle */
this->cmd_ctrl(mtd, cmd, NAND_CTRL_CLE | NAND_CTRL_CHANGE);
/* Set ALE and clear CLE to start address cycle */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment