summaryrefslogtreecommitdiff
path: root/meta/recipes-devtools/mtd
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2015-04-24 00:54:09 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-24 11:14:29 +0100
commit4b57b7d59ddea33ee7696880ea1652e56f46d843 (patch)
treee8362bcd6fd71751fea33f42b57905a4c181aac5 /meta/recipes-devtools/mtd
parent4c0ae7cce06de15f6881654ecec7f8bb743ff389 (diff)
downloadopenembedded-core-4b57b7d59ddea33ee7696880ea1652e56f46d843.tar.gz
openembedded-core-4b57b7d59ddea33ee7696880ea1652e56f46d843.tar.bz2
openembedded-core-4b57b7d59ddea33ee7696880ea1652e56f46d843.zip
mtd-utils: enable mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
We still need it, so update and enable it. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/mtd')
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch22
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils_git.bb1
2 files changed, 14 insertions, 9 deletions
diff --git a/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch b/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
index a66087e301..7207cfcb3a 100644
--- a/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
+++ b/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
@@ -36,6 +36,10 @@ JFFS2: Erase block at 0x00028000 is not formatted. It will be erased
Signed-off-by: Liu Shuo <b35362@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
+Updated for the new version
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
---
v2 : get length of availble freeoob bytes from oobinfo information,
not use the ioctl ECCGETLAYOUT which is being deprecated.
@@ -44,18 +48,18 @@ v2 : get length of availble freeoob bytes from oobinfo information,
1 files changed, 39 insertions(+), 7 deletions(-)
diff --git a/flash_erase.c b/flash_erase.c
-index fe2eaca..3e94495 100644
+index 933373a..4b9d84b 100644
--- a/flash_erase.c
+++ b/flash_erase.c
-@@ -98,6 +98,7 @@ int main(int argc, char *argv[])
- int isNAND;
+@@ -99,6 +99,7 @@ int main(int argc, char *argv[])
+ bool isNAND;
int error = 0;
- uint64_t offset = 0;
+ off_t offset = 0;
+ void *oob_data = NULL;
/*
* Process user arguments
-@@ -197,15 +198,43 @@ int main(int argc, char *argv[])
+@@ -201,15 +202,43 @@ int main(int argc, char *argv[])
if (ioctl(fd, MEMGETOOBSEL, &oobinfo) != 0)
return sys_errmsg("%s: unable to get NAND oobinfo", mtd_device);
@@ -104,7 +108,7 @@ index fe2eaca..3e94495 100644
} else {
/* Legacy mode */
switch (mtd.oob_size) {
-@@ -223,7 +252,6 @@ int main(int argc, char *argv[])
+@@ -227,7 +256,6 @@ int main(int argc, char *argv[])
break;
}
}
@@ -112,13 +116,13 @@ index fe2eaca..3e94495 100644
}
cleanmarker.hdr_crc = cpu_to_je32(mtd_crc32(0, &cleanmarker, sizeof(cleanmarker) - 4));
}
-@@ -272,7 +300,8 @@ int main(int argc, char *argv[])
+@@ -276,7 +304,8 @@ int main(int argc, char *argv[])
/* write cleanmarker */
if (isNAND) {
-- if (mtd_write_oob(mtd_desc, &mtd, fd, offset + clmpos, clmlen, &cleanmarker) != 0) {
+- if (mtd_write_oob(mtd_desc, &mtd, fd, (uint64_t)offset + clmpos, clmlen, &cleanmarker) != 0) {
+ void *data = oob_data ? oob_data + clmpos : &cleanmarker;
-+ if (mtd_write_oob(mtd_desc, &mtd, fd, offset + clmpos, clmlen, data) != 0) {
++ if (mtd_write_oob(mtd_desc, &mtd, fd, (uint64_t)offset + clmpos, clmlen, data) != 0) {
sys_errmsg("%s: MTD writeoob failure", mtd_device);
continue;
}
diff --git a/meta/recipes-devtools/mtd/mtd-utils_git.bb b/meta/recipes-devtools/mtd/mtd-utils_git.bb
index f991ea17c3..7010cac145 100644
--- a/meta/recipes-devtools/mtd/mtd-utils_git.bb
+++ b/meta/recipes-devtools/mtd/mtd-utils_git.bb
@@ -14,6 +14,7 @@ SRC_URI = "git://git.infradead.org/mtd-utils.git \
file://add-exclusion-to-mkfs-jffs2-git-2.patch \
file://fix-armv7-neon-alignment.patch \
file://0001-hashtable-Remove-duplicate-hashtable_iterator_value-.patch \
+ file://mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch \
"
S = "${WORKDIR}/git/"