summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch
diff options
context:
space:
mode:
authorSaul Wold <sgw@linux.intel.com>2011-05-04 16:39:44 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-05 12:26:44 +0100
commita00b11ba879df1e667baacbcb4cab3276828c40b (patch)
treecc4520ade371bb102ad68129261a1839f0c57653 /meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch
parent37481801b1528bb69a9de9437fb771a62a4bd0bc (diff)
downloadpoky-a00b11ba879df1e667baacbcb4cab3276828c40b.tar.gz
yaffs2: Update patch and checksums
(From OE-Core rev: c7cc702faadd2eada16bd8b7bcae1f28295bee94) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch')
-rw-r--r--meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch116
1 files changed, 60 insertions, 56 deletions
diff --git a/meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch b/meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch
index 521f1ba9a0..e55d58bbd3 100644
--- a/meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch
+++ b/meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch
@@ -18,10 +18,11 @@
18 * And BTW, what was one supposed to do with that file that this horror 18 * And BTW, what was one supposed to do with that file that this horror
19 * occasionally managed to generate? 19 * occasionally managed to generate?
20 */ 20 */
21diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c 21Index: yaffs2/utils/mkyaffs2image.c
22--- yaffs2.orig/utils/mkyaffs2image.c 2005-12-12 16:34:58.000000000 -0800 22===================================================================
23+++ yaffs2/utils/mkyaffs2image.c 2006-02-10 16:56:13.000000000 -0800 23--- yaffs2.orig/utils/mkyaffs2image.c 2010-01-11 13:43:18.000000000 -0800
24@@ -31,10 +47,10 @@ 24+++ yaffs2/utils/mkyaffs2image.c 2011-05-04 14:50:42.045984700 -0700
25@@ -29,10 +29,10 @@
25 #include <dirent.h> 26 #include <dirent.h>
26 #include <string.h> 27 #include <string.h>
27 #include <unistd.h> 28 #include <unistd.h>
@@ -33,53 +34,55 @@ diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
33 #include "yaffs_packedtags2.h" 34 #include "yaffs_packedtags2.h"
34 35
35 unsigned yaffs_traceMask=0; 36 unsigned yaffs_traceMask=0;
36@@ -43,9 +59,45 @@ 37@@ -41,9 +41,47 @@
37 38
38 #define chunkSize 2048 39 #define chunkSize 2048
39 #define spareSize 64 40 #define spareSize 64
40+#define PT2_BYTES 25 41+#define PT2_BYTES 25
42+
41 43
42 const char * mkyaffsimage_c_version = "$Id: mkyaffs2image.c,v 1.4 2007-02-14 01:09:06 wookey Exp $"; 44 const char * mkyaffsimage_c_version = "$Id: mkyaffs2image.c,v 1.5 2010-01-11 21:43:18 charles Exp $";
43 45
44+static int layout_no; 46+static int layout_no;
45+ 47+
46+static struct nand_oobinfo oob_layout[] = { 48+static struct nand_oobinfo oob_layout[] = {
47+ /* KSI: 49+ /* KSI:
48+ * Dummy "raw" layout - no ECC, all the bytes are free. Does NOT 50+ * Dummy "raw" layout - no ECC, all the bytes are free. Does NOT
49+ * really work, only used for compatibility with CVS YAFFS2 that 51+ * really work, only used for compatibility with CVS YAFFS2 that
50+ * never ever worked with any stock MTD. 52+ * never ever worked with any stock MTD.
51+ */ 53+ */
52+ { 54+ {
53+ .useecc = MTD_NANDECC_AUTOPLACE, 55+ .useecc = MTD_NANDECC_AUTOPLACE,
54+ .eccbytes = 0, 56+ .eccbytes = 0,
55+ .eccpos = {}, 57+ .eccpos = {},
56+ .oobfree = { {0, 64} } 58+ .oobfree = { {0, 64} }
57+ }, 59+ },
58+ /* KSI: 60+ /* KSI:
59+ * Regular MTD AUTOPLACED ECC for large page NAND devices, the 61+ * Regular MTD AUTOPLACED ECC for large page NAND devices, the
60+ * only one existing in stock MTD so far. It corresponds to layout# 1 62+ * only one existing in stock MTD so far. It corresponds to layout# 1
61+ * in command line arguments. Any other layouts could be added to 63+ * in command line arguments. Any other layouts could be added to
62+ * the list when they made their way in kernel's MTD. The structure 64+ * the list when they made their way in kernel's MTD. The structure
63+ * is simply copied from kernel's drivers/mtd/nand/nand_base.c as-is. 65+ * is simply copied from kernel's drivers/mtd/nand/nand_base.c as-is.
64+ */ 66+ */
65+ { 67+ {
66+ .useecc = MTD_NANDECC_AUTOPLACE, 68+ .useecc = MTD_NANDECC_AUTOPLACE,
67+ .eccbytes = 24, 69+ .eccbytes = 24,
68+ .eccpos = { 70+ .eccpos = {
69+ 40, 41, 42, 43, 44, 45, 46, 47, 71+ 40, 41, 42, 43, 44, 45, 46, 47,
70+ 48, 49, 50, 51, 52, 53, 54, 55, 72+ 48, 49, 50, 51, 52, 53, 54, 55,
71+ 56, 57, 58, 59, 60, 61, 62, 63}, 73+ 56, 57, 58, 59, 60, 61, 62, 63},
72+ .oobfree = { {2, 38} } 74+ .oobfree = { {2, 38} }
73+ }, 75+ },
74+ /* End-of-list marker */ 76+ /* End-of-list marker */
75+ { 77+ {
76+ .useecc = -1, 78+ .useecc = -1,
77+ } 79+ }
78+}; 80+};
81+
79 82
80 typedef struct 83 typedef struct
81 { 84 {
82@@ -59,7 +111,7 @@ 85@@ -57,7 +95,7 @@
83 static int n_obj = 0; 86 static int n_obj = 0;
84 static int obj_id = YAFFS_NOBJECT_BUCKETS + 1; 87 static int obj_id = YAFFS_NOBJECT_BUCKETS + 1;
85 88
@@ -88,7 +91,7 @@ diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
88 91
89 static int outFile; 92 static int outFile;
90 93
91@@ -123,6 +175,11 @@ 94@@ -121,6 +159,11 @@
92 return -1; 95 return -1;
93 } 96 }
94 97
@@ -100,7 +103,7 @@ diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
100 /* This little function converts a little endian tag to a big endian tag. 103 /* This little function converts a little endian tag to a big endian tag.
101 * NOTE: The tag is not usable after this other than calculating the CRC 104 * NOTE: The tag is not usable after this other than calculating the CRC
102 * with. 105 * with.
103@@ -155,11 +212,56 @@ 106@@ -153,11 +196,56 @@
104 tags->asBytes[7] = temp.asBytes[7]; 107 tags->asBytes[7] = temp.asBytes[7];
105 #endif 108 #endif
106 } 109 }
@@ -157,7 +160,7 @@ diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
157 160
158 error = write(outFile,data,chunkSize); 161 error = write(outFile,data,chunkSize);
159 if(error < 0) return error; 162 if(error < 0) return error;
160@@ -177,18 +279,27 @@ 163@@ -175,18 +263,28 @@
161 // added NCB **CHECK** 164 // added NCB **CHECK**
162 t.chunkUsed = 1; 165 t.chunkUsed = 1;
163 166
@@ -171,25 +174,26 @@ diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
171 174
172 nPages++; 175 nPages++;
173 176
174 yaffs_PackTags2(&pt,&t); 177 yaffs_PackTags2(&pt,&t,1);
175- 178-
176-// return write(outFile,&pt,sizeof(yaffs_PackedTags2)); 179-// return write(outFile,&pt,sizeof(yaffs_PackedTags2));
177- return write(outFile,&pt,spareSize); 180- return write(outFile,&pt,spareSize);
178- 181-
179+ 182+
180+ memset(spare_buf, 0xff, sizeof(spare_buf)); 183+ memset(spare_buf, 0xff, sizeof(spare_buf));
181+ 184+
182+ if (layout_no == 0) { 185+ if (layout_no == 0) {
183+ memcpy(spare_buf, &pt, sizeof(yaffs_PackedTags2)); 186+ memcpy(spare_buf, &pt, sizeof(yaffs_PackedTags2));
184+ } else { 187+ } else {
185+ nandmtd2_pt2buf(spare_buf, &pt); 188+ nandmtd2_pt2buf(spare_buf, &pt);
186+ } 189+ }
187+ 190+
188+ return write(outFile,spare_buf,spareSize); 191+ return write(outFile,spare_buf,spareSize);
192+
189 } 193 }
190 194
191 #define SWAP32(x) ((((x) & 0x000000FF) << 24) | \ 195 #define SWAP32(x) ((((x) & 0x000000FF) << 24) | \
192@@ -199,6 +310,8 @@ 196@@ -197,6 +295,8 @@
193 #define SWAP16(x) ((((x) & 0x00FF) << 8) | \ 197 #define SWAP16(x) ((((x) & 0x00FF) << 8) | \
194 (((x) & 0xFF00) >> 8)) 198 (((x) & 0xFF00) >> 8))
195 199
@@ -198,7 +202,7 @@ diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
198 // This one is easier, since the types are more standard. No funky shifts here. 202 // This one is easier, since the types are more standard. No funky shifts here.
199 static void object_header_little_to_big_endian(yaffs_ObjectHeader* oh) 203 static void object_header_little_to_big_endian(yaffs_ObjectHeader* oh)
200 { 204 {
201@@ -256,6 +369,7 @@ 205@@ -254,6 +354,7 @@
202 oh->roomToGrow[11] = SWAP32(oh->roomToGrow[11]); 206 oh->roomToGrow[11] = SWAP32(oh->roomToGrow[11]);
203 #endif 207 #endif
204 } 208 }
@@ -206,7 +210,7 @@ diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
206 210
207 static int write_object_header(int objId, yaffs_ObjectType t, struct stat *s, int parent, const char *name, int equivalentObj, const char * alias) 211 static int write_object_header(int objId, yaffs_ObjectType t, struct stat *s, int parent, const char *name, int equivalentObj, const char * alias)
208 { 212 {
209@@ -300,10 +414,13 @@ 213@@ -298,10 +399,13 @@
210 strncpy(oh->alias,alias,YAFFS_MAX_ALIAS_LENGTH); 214 strncpy(oh->alias,alias,YAFFS_MAX_ALIAS_LENGTH);
211 } 215 }
212 216
@@ -220,7 +224,7 @@ diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
220 224
221 return write_chunk(bytes,objId,0,0xffff); 225 return write_chunk(bytes,objId,0,0xffff);
222 226
223@@ -319,7 +436,7 @@ 227@@ -317,7 +421,7 @@
224 nDirectories++; 228 nDirectories++;
225 229
226 dir = opendir(path); 230 dir = opendir(path);
@@ -229,7 +233,7 @@ diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
229 if(dir) 233 if(dir)
230 { 234 {
231 while((entry = readdir(dir)) != NULL) 235 while((entry = readdir(dir)) != NULL)
232@@ -403,12 +520,12 @@ 236@@ -401,12 +505,12 @@
233 error = nBytes; 237 error = nBytes;
234 238
235 printf("%d data chunks written\n",chunk); 239 printf("%d data chunks written\n",chunk);
@@ -243,7 +247,7 @@ diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
243 247
244 } 248 }
245 249
246@@ -448,58 +565,82 @@ 250@@ -446,58 +550,82 @@
247 } 251 }
248 } 252 }
249 } 253 }