uboot-nand_write_yaffs.patch

来自「Uboot常用的移植patches, 方便定制移植到s3c2440」· PATCH 代码 · 共 36 行

PATCH
36
字号
Index: u-boot/common/cmd_nand.c===================================================================--- u-boot.orig/common/cmd_nand.c+++ u-boot/common/cmd_nand.c@@ -378,6 +378,21 @@ 				opts.quiet      = quiet; 				ret = nand_write_opts(nand, &opts); 			}+		} else if (!read && s != NULL &&+			   (!strcmp(s, ".yaffs") || !strcmp(s, ".yaffs1"))) {+			nand_write_options_t opts;+			memset(&opts, 0, sizeof(opts));+			opts.buffer 	= (u_char*) addr;+			opts.length	= size;+			opts.offset	= off;+			opts.pad	= 0;+			opts.blockalign = 1;+			opts.quiet	= quiet;+			opts.writeoob	= 1;+			opts.autoplace	= 1;+			if (s[6] == '1')+				opts.forceyaffs = 1;+			ret = nand_write_opts(nand, &opts); 		} else if (s != NULL && !strcmp(s, ".oob")) { 			/* read out-of-band data */ 			if (read)@@ -524,6 +539,8 @@ 	"nand read[.jffs2]     - addr off|partition size\n" 	"nand write[.jffs2]    - addr off|partiton size - read/write `size' bytes starting\n" 	"    at offset `off' to/from memory address `addr'\n"+	"nand write[.yaffs[1]]    - addr off|partiton size - read/write `size' byte yaffs image\n"+	"    starting at offset `off' to/from memory address `addr' (.yaffs1 for 512+16 NAND)\n" 	"nand erase [clean] [off size] - erase `size' bytes from\n" 	"    offset `off' (entire device if not specified)\n" 	"nand bad - show bad blocks\n"

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?