aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Waterman2011-04-06 16:01:52 -0400
committerScott Wood2011-04-15 15:53:11 -0500
commit65a9db7be0868be91ba81b9b5bf821de82e6d9b0 (patch)
tree72b55838665f15e88417bd482503ed60b94fb651
parent62974546888c1f9abfdb4ba9f66465a5d102d4d3 (diff)
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: Alex Waterman <awaterman@dawning.com>
-rw-r--r--nand_spl/nand_boot.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/nand_spl/nand_boot.c b/nand_spl/nand_boot.c
index 76b8566fb2a..4a968784e75 100644
--- a/nand_spl/nand_boot.c
+++ b/nand_spl/nand_boot.c
@@ -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 */