summaryrefslogtreecommitdiffstats
path: root/recipes-devtools
diff options
context:
space:
mode:
authorMatthew McClintock <msm@freescale.com>2012-05-15 13:30:25 -0500
committerMatthew McClintock <msm@freescale.com>2012-05-15 13:30:25 -0500
commita6ed3f465ce660302b9621fdd09b1f7f3073232f (patch)
tree80eab9249f1bfad8498e62a8906238cd8b1ecb0b /recipes-devtools
parenta88d77e2ae8a4ec05d6757eddee80537933b86a5 (diff)
downloadmeta-fsl-ppc-a6ed3f465ce660302b9621fdd09b1f7f3073232f.tar.gz
mtd-utils: remove extra patches
Signed-off-by: Matthew McClintock <msm@freescale.com>
Diffstat (limited to 'recipes-devtools')
-rw-r--r--recipes-devtools/mtd/mtd-utils-1.4.6/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch132
-rw-r--r--recipes-devtools/mtd/mtd-utils_1.4.6.bbappend3
2 files changed, 0 insertions, 135 deletions
diff --git a/recipes-devtools/mtd/mtd-utils-1.4.6/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch b/recipes-devtools/mtd/mtd-utils-1.4.6/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
deleted file mode 100644
index 2823c65..0000000
--- a/recipes-devtools/mtd/mtd-utils-1.4.6/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
+++ /dev/null
@@ -1,132 +0,0 @@
1From patchwork Mon Aug 8 08:16:43 2011
2Content-Type: text/plain; charset="utf-8"
3MIME-Version: 1.0
4Content-Transfer-Encoding: 7bit
5Subject: mtd-utils: fix corrupt cleanmarker with flash_erase -j command
6Date: Sun, 07 Aug 2011 22:16:43 -0000
7From: b35362@freescale.com
8X-Patchwork-Id: 108873
9Message-Id: <1312791403-13473-1-git-send-email-b35362@freescale.com>
10To: <dwmw2@infradead.org>
11Cc: Liu Shuo <b35362@freescale.com>, Artem.Bityutskiy@nokia.com,
12 Li Yang <leoli@freescale.com>, linux-mtd@lists.infradead.org
13
14From: Liu Shuo <b35362@freescale.com>
15
16Flash_erase -j should fill discrete freeoob areas with required bytes
17of JFFS2 cleanmarker in jffs2_check_nand_cleanmarker(). Not just fill
18the first freeoob area.
19
20The below is the result without this workaround:
21
22JFFS2: Erase block at 0x00000000 is not formatted. It will be erased
23JFFS2: Erase block at 0x00004000 is not formatted. It will be erased
24JFFS2: Erase block at 0x00008000 is not formatted. It will be erased
25JFFS2: Erase block at 0x0000c000 is not formatted. It will be erased
26JFFS2: Erase block at 0x00010000 is not formatted. It will be erased
27JFFS2: Erase block at 0x00014000 is not formatted. It will be erased
28JFFS2: Erase block at 0x00018000 is not formatted. It will be erased
29JFFS2: Erase block at 0x0001c000 is not formatted. It will be erased
30JFFS2: Erase block at 0x00020000 is not formatted. It will be erased
31JFFS2: Erase block at 0x00024000 is not formatted. It will be erased
32JFFS2: Erase block at 0x00028000 is not formatted. It will be erased
33...
34
35Signed-off-by: Liu Shuo <b35362@freescale.com>
36Signed-off-by: Li Yang <leoli@freescale.com>
37
38---
39v2 : get length of availble freeoob bytes from oobinfo information,
40 not use the ioctl ECCGETLAYOUT which is being deprecated.
41
42 flash_erase.c | 46 +++++++++++++++++++++++++++++++++++++++-------
43 1 files changed, 39 insertions(+), 7 deletions(-)
44
45diff --git a/flash_erase.c b/flash_erase.c
46index fe2eaca..3e94495 100644
47--- a/flash_erase.c
48+++ b/flash_erase.c
49@@ -98,6 +98,7 @@ int main(int argc, char *argv[])
50 int isNAND;
51 int error = 0;
52 uint64_t offset = 0;
53+ void *oob_data = NULL;
54
55 /*
56 * Process user arguments
57@@ -197,15 +198,43 @@ int main(int argc, char *argv[])
58 if (ioctl(fd, MEMGETOOBSEL, &oobinfo) != 0)
59 return sys_errmsg("%s: unable to get NAND oobinfo", mtd_device);
60
61+ cleanmarker.totlen = cpu_to_je32(8);
62 /* Check for autoplacement */
63 if (oobinfo.useecc == MTD_NANDECC_AUTOPLACE) {
64- /* Get the position of the free bytes */
65- if (!oobinfo.oobfree[0][1])
66+ struct nand_ecclayout_user ecclayout;
67+ int i, oobavail;
68+
69+ for (i = 0, oobavail = 0; oobinfo.oobfree[i][1]; i++)
70+ oobavail += oobinfo.oobfree[i][1];
71+
72+ if (!oobavail)
73 return errmsg(" Eeep. Autoplacement selected and no empty space in oob");
74+
75+ /* Get the position of the free bytes */
76 clmpos = oobinfo.oobfree[0][0];
77- clmlen = oobinfo.oobfree[0][1];
78- if (clmlen > 8)
79- clmlen = 8;
80+ clmlen = MIN(oobavail, 8);
81+
82+ if (oobinfo.oobfree[0][1] < 8 && oobavail >= 8) {
83+ int left, n, last = 0;
84+ void *cm;
85+
86+ oob_data = malloc(mtd.oob_size);
87+ if (!oob_data)
88+ return -ENOMEM;
89+
90+ memset(oob_data, 0xff, mtd.oob_size);
91+ cm = &cleanmarker;
92+ for (i = 0, left = clmlen; left ; i++) {
93+ n = MIN(left, oobinfo.oobfree[i][1]);
94+ memcpy(oob_data + oobinfo.oobfree[i][0],
95+ cm, n);
96+ left -= n;
97+ cm += n;
98+ last = oobinfo.oobfree[i][0] + n;
99+ }
100+
101+ clmlen = last - clmpos;
102+ }
103 } else {
104 /* Legacy mode */
105 switch (mtd.oob_size) {
106@@ -223,7 +252,6 @@ int main(int argc, char *argv[])
107 break;
108 }
109 }
110- cleanmarker.totlen = cpu_to_je32(8);
111 }
112 cleanmarker.hdr_crc = cpu_to_je32(mtd_crc32(0, &cleanmarker, sizeof(cleanmarker) - 4));
113 }
114@@ -272,7 +300,8 @@ int main(int argc, char *argv[])
115
116 /* write cleanmarker */
117 if (isNAND) {
118- if (mtd_write_oob(mtd_desc, &mtd, fd, offset + clmpos, clmlen, &cleanmarker) != 0) {
119+ void *data = oob_data ? oob_data + clmpos : &cleanmarker;
120+ if (mtd_write_oob(mtd_desc, &mtd, fd, offset + clmpos, clmlen, data) != 0) {
121 sys_errmsg("%s: MTD writeoob failure", mtd_device);
122 continue;
123 }
124@@ -291,5 +320,8 @@ int main(int argc, char *argv[])
125 show_progress(&mtd, offset, eb, eb_start, eb_cnt);
126 bareverbose(!quiet, "\n");
127
128+ if (oob_data)
129+ free(oob_data);
130+
131 return 0;
132 }
diff --git a/recipes-devtools/mtd/mtd-utils_1.4.6.bbappend b/recipes-devtools/mtd/mtd-utils_1.4.6.bbappend
deleted file mode 100644
index 2d96368..0000000
--- a/recipes-devtools/mtd/mtd-utils_1.4.6.bbappend
+++ /dev/null
@@ -1,3 +0,0 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/mtd-utils-1.4.6:"
2
3SRC_URI += "file://mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch"