summaryrefslogtreecommitdiff
path: root/common/cmd_nand.c
diff options
context:
space:
mode:
authorLei Wen <leiwen@marvell.com>2011-01-06 11:11:58 +0800
committerScott Wood <scottwood@freescale.com>2011-01-12 17:13:10 -0600
commit47fc18f1e72ef1fc68a179c2b674a4c58646afc9 (patch)
treec93268a1dc06ec5034716ec2b5992faa1bbdd378 /common/cmd_nand.c
parent7fab9dfffab3a662f6ef1967dcb90618fd28df3c (diff)
downloadu-boot-imx-47fc18f1e72ef1fc68a179c2b674a4c58646afc9.zip
u-boot-imx-47fc18f1e72ef1fc68a179c2b674a4c58646afc9.tar.gz
u-boot-imx-47fc18f1e72ef1fc68a179c2b674a4c58646afc9.tar.bz2
NAND: add the ability to directly write yaffs image
This patch add addition suffix to nand write to give the uboot the power to directly burn the yaffs image to nand. Signed-off-by: Lei Wen <leiwen@marvell.com>
Diffstat (limited to 'common/cmd_nand.c')
-rw-r--r--common/cmd_nand.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 6783645..7bd37de 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -574,7 +574,15 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
(u_char *)addr);
else
ret = nand_write_skip_bad(nand, off, &rwsize,
- (u_char *)addr);
+ (u_char *)addr, 0);
+#ifdef CONFIG_CMD_NAND_YAFFS
+ } else if (!strcmp(s, ".yaffs")) {
+ if (read) {
+ printf("Unknown nand command suffix '%s'.\n", s);
+ return 1;
+ }
+ ret = nand_write_skip_bad(nand, off, &rwsize, (u_char *)addr, 1);
+#endif
} else if (!strcmp(s, ".oob")) {
/* out-of-band data */
mtd_oob_ops_t ops = {
@@ -680,6 +688,11 @@ U_BOOT_CMD(
"nand write - addr off|partition size\n"
" read/write 'size' bytes starting at offset 'off'\n"
" to/from memory address 'addr', skipping bad blocks.\n"
+#ifdef CONFIG_CMD_NAND_YAFFS
+ "nand write.yaffs - addr off|partition size\n"
+ " write 'size' bytes starting at offset 'off' with yaffs format\n"
+ " from memory address 'addr', skipping bad blocks.\n"
+#endif
"nand erase[.spread] [clean] [off [size]] - erase 'size' bytes "
"from offset 'off'\n"
" With '.spread', erase enough for given file size, otherwise,\n"