Numonyx chip support
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 Numonyx chip support
Hi all,
I am a newb in working with open projects, so please take it easy if I'll do something wrong.
Below (and in the attachment) is "git format-patch" output. It introduces support for Numonyx memories, that have oobsize=64 and pagesize=4096, that are used e.g. in OMAP3, igep0020b machine.
Solution is very straightforward, though you'll probably reject my patch, as diff contains full path to files that i altered (not relative to mtd-utils). I hope however, that you can tell me how to generate patches for sepcific packages correctly, so it won't contain whole path (e.g. a/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c)
That is how I've done it:
- "git pull" //to update oe dev branch
- bitbake mtd-utils //to get *.c files refreshed
- git checkout -b mtd_utils //to create my new development branch
- git add build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c //to add files I am going to alter
- git commit //to create a starting point for my development
- :::editing=>compiling=>testing:::
- git commit //to check in changes I've made
- git format-patch HEAD^ //to create patch from changes I've made
What am I doing wrong? Sources of packages like mitd-utils are not added to .git repository in OE tree, and when I add it manually to it (as above), and then create patch, whole path relative to OR root is generated, which makes my patch useles to other builds than the one I did (IGEPv2).
I really'd like to contribute, but I can't find any how-to realted to *.c sources editing (*.bb editing is straightforward, as these files are already in oe git tree).
//==================================================
--- .../mtd-utils-1.3.1-r0/git/nanddump.c | 1 + .../mtd-utils-1.3.1-r0/git/nandwrite.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c b/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c index 6926c66..dfc15de 100644
---a/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c
+++b/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c @@ -210,6 +210,7 @@ int main(int argc, char * const argv[])
/* Make sure device page sizes are valid */
if (!(meminfo.oobsize == 128 && meminfo.writesize == 4096) &&
+ !(meminfo.oobsize == 64 && meminfo.writesize == 4096) &&
!(meminfo.oobsize == 64 && meminfo.writesize == 2048) &&
!(meminfo.oobsize == 32 && meminfo.writesize == 1024) &&
!(meminfo.oobsize == 16 && meminfo.writesize == 512) &&diff --git a/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nandwrite.c b/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nandwrite.c index b77edd6..bd45879 100644
---a/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nandwrite.c
+++b/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nandwrite.c @@ -294,6 +294,7 @@ int main(int argc, char * const argv[])
if (!(meminfo.oobsize == 16 && meminfo.writesize == 512) &&
!(meminfo.oobsize == 8 && meminfo.writesize == 256) &&
!(meminfo.oobsize == 64 && meminfo.writesize == 2048) &&
+ !(meminfo.oobsize == 64 && meminfo.writesize == 4096) &&
!(meminfo.oobsize == 128 && meminfo.writesize == 4096)) {
fprintf(stderr, "Unknown flash (not normal NAND)\n");
close(fd);Signature · 1 line
1.6.3.3
From fdfe1dd8a1632b5594cb78d9d35ef7180e8f2d11 Mon Sep 17 00:00:00 2001
From: Michal Stawinski 'nazgee <[email protected]>
Date: Thu, 25 Feb 2010 03:50:09 +0100
Subject: [PATCH] Add oobsize 64 and writesize 4096 as normal nand (e.g. IGEPv2 uses it)
--- .../mtd-utils-1.3.1-r0/git/nanddump.c | 1 + .../mtd-utils-1.3.1-r0/git/nandwrite.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c +1 -0
@@ -210,6 +210,7 @@ int main(int argc, char * const argv[])/* Make sure device page sizes are valid */ if (!(meminfo.oobsize == 128 && meminfo.writesize == 4096) && + !(meminfo.oobsize == 64 && meminfo.writesize == 4096) && !(meminfo.oobsize == 64 && meminfo.writesize == 2048) && !(meminfo.oobsize == 32 && meminfo.writesize == 1024) && !(meminfo.oobsize == 16 && meminfo.writesize == 512) &&
build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nandwrite.c +1 -0
@@ -294,6 +294,7 @@ int main(int argc, char * const argv[])if (!(meminfo.oobsize ==16 && meminfo.writesize ==512 ) && !(meminfo.oobsize ==8 && meminfo.writesize ==256 ) && !(meminfo.oobsize ==64 && meminfo.writesize ==2048 ) && + !(meminfo.oobsize ==64 && meminfo.writesize ==4096 ) && !(meminfo.oobsize ==128 && meminfo.writesize ==4096 )) {fprintf (stderr,"Unknown flash (not normal NAND)\n" );close (fd);
Signature · 1 line
1.6.3.3
Can anyone help me on this, please?
I am really into doing some more work, though I need your help to do this. I've tried some googling and messing around with bb files, but I am more of a C coder, and scripting/tools are not really my thing. Any help would be apprecieated.
Maybe it is wrong mailing-list- should I be writing somewhere else?
TIA, Michal Stawinski
2010/2/25 Michał Stawinski <[email protected]>
Quoted 76 lines
Hi all,
I am a newb in working with open projects, so please take it easy if I'll do something wrong.Below (and in the attachment) is "git format-patch" output. It introduces support for Numonyx memories, that have oobsize=64 and pagesize=4096, that are used e.g. in OMAP3, igep0020b machine.
Solution is very straightforward, though you'll probably reject my patch, as diff contains full path to files that i altered (not relative to mtd-utils). I hope however, that you can tell me how to generate patches for sepcific packages correctly, so it won't contain whole path (e.g.
a/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c)That is how I've done it:
- "git pull" //to update oe dev branch
- bitbake mtd-utils //to get *.c files refreshed
- git checkout -bmtd_utils//to create my new development branch
- git addbuild/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c//to add files I am going to alter
- git commit //to create a starting point for my development
- :::editing=>compiling=>testing:::
- git commit //to check in changes I've made
- git format-patch HEAD^ //to create patch from changes I've madeWhat am I doing wrong? Sources of packages like mitd-utils are not added to .git repository in OE tree, and when I add it manually to it (as above), and then create patch, whole path relative to OR root is generated, which makes my patch useles to other builds than the one I did (IGEPv2).
I really'd like to contribute, but I can't find any how-to realted to *.c sources editing (*.bb editing is straightforward, as these files are already in oe git tree).
//==================================================
--- .../mtd-utils-1.3.1-r0/git/nanddump.c | 1 + .../mtd-utils-1.3.1-r0/git/nandwrite.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)diff --git
a/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.cb/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.cindex 6926c66..dfc15de 100644
---a/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c
+++b/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c(quoted diff) +1
-0@@ -210,6 +210,7 @@ int main(int argc, char * const argv[]) /* Make sure device page sizes are valid */ if (!(meminfo.oobsize == 128 && meminfo.writesize == 4096) && + !(meminfo.oobsize == 64 && meminfo.writesize == 4096) && !(meminfo.oobsize == 64 && meminfo.writesize == 2048) && !(meminfo.oobsize == 32 && meminfo.writesize == 1024) && !(meminfo.oobsize == 16 && meminfo.writesize == 512) &&diff --git
a/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nandwrite.cb/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nandwrite.cindex b77edd6..bd45879 100644
---a/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nandwrite.c
+++b/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nandwrite.c(quoted diff) +1
-1@@ -294,6 +294,7 @@ int main(int argc, char * const argv[]) if (!(meminfo.oobsize == 16 && meminfo.writesize == 512) && !(meminfo.oobsize == 8 && meminfo.writesize == 256) && !(meminfo.oobsize == 64 && meminfo.writesize == 2048) && + !(meminfo.oobsize == 64 && meminfo.writesize == 4096) && !(meminfo.oobsize == 128 && meminfo.writesize == 4096)) { fprintf(stderr, "Unknown flash (not normal NAND)\n"); close(fd); --1.6.3.3
Dear Michal,
please do not top post.
Am Mittwoch, den 10.03.2010, 09:10 +0100 schrieb Michal Stawinski:
Quoted 5 lines
2010/2/25 Michał Stawinski <[email protected]>
Quoted 2 lines
I am a newb in working with open projects, so please take it easy if I'll do something wrong.
Can anyone help me on this, please?
Welcome! And sorry that nobody responded earlier to you. Next time this happens I suggest, you join the IRC channel and contact the developers directly.
Quoted 21 lines
Quoted 21 lines
Below (and in the attachment) is "git format-patch" output. It introduces support for Numonyx memories, that have oobsize=64 and pagesize=4096, that are used e.g. in OMAP3, igep0020b machine.
Solution is very straightforward, though you'll probably reject my patch, as diff contains full path to files that i altered (not relative to mtd-utils). I hope however, that you can tell me how to generate patches for sepcific packages correctly, so it won't contain whole path (e.g.
a/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c)That is how I've done it:
- "git pull" //to update oe dev branch
- bitbake mtd-utils //to get *.c files refreshed
- git checkout -bmtd_utils//to create my new development branch
- git addbuild/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c//to add files I am going to alter
- git commit //to create a starting point for my development
- :::editing=>compiling=>testing:::
- git commit //to check in changes I've made
- git format-patch HEAD^ //to create patch from changes I've made
Quoted 2 lines
Quoted 2 lines
What am I doing wrong? Sources of packages like mitd-utils are not added to .git repository in OE tree,
That is correct. OE does not distribute the sources but just the magic (recipes) on how to get the sources and install them correctly. Therefore you should not have your build directory in the OE tree.
Quoted 7 lines
Quoted 7 lines
and when I add it manually to it (as above), and
then create patch, whole path relative to OR root is generated, which makes my patch useles to other builds than the one I did (IGEPv2).I really'd like to contribute, but I can't find any how-to realted to *.c sources editing (*.bb editing is straightforward, as these files are already in oe git tree).
As you figured out, you have to patch the source. BitBake provides a way to apply patches to the source. Unfortunately [2] is down right now, but I try to give different references.
First you find a lot of information in the OE user manual [3]. The source files for the manual are also in the Git repository [4].
$ ls recipes/mtd/mtd-utils/
add-exclusion-to-mkfs-jffs2-git-2.patch lzo_1x-git.patch
add-exclusion-to-mkfs-jffs2-git.patch lzo_1x.patch
fix-ignoreerrors-git.patch
$ $ more recipes/mtd/mtd-utils_1.3.1.bb
require mtd-utils.inc DEPENDS += "e2fsprogs-libs"
PARALLEL_MAKE = ""
ARM_INSTRUCTION_SET = "arm"
# This is the default package, thus we lock to a specific git version so
# upstream changes will not break builds.
TAG = "v${PV}"
SRC_URI = "git://git.infradead.org/mtd-utils.git;protocol=git;tag=${TAG} \
file://add-exclusion-to-mkfs-jffs2-git-2.patch;patch=1 \
file://fix-ignoreerrors-git.patch;patch=1 \
file://lzo_1x-git.patch;patch=1"
[…]So in SRC_URI you see the file://… lines. That is how patches get applied in OE.
So I suggest
1. you to create the patch for mtd-utils in its source directory (get the source, for example [5] in a seperate directory outside the OE tree, adapt it and create a patch).
2. Copy the patch to recipes/mtd/mtd-utils/.
3. Add a file line to SRC_URI.
4. If this works, add the patch to the OE Git tree (git add …) and proceed as you did before.
[…]
Quoted 1 line
Maybe it is wrong mailing-list- should I be writing somewhere else?
It would be really nice to get your patch included upstream, so that patches are not needed in the future [6]. So please also send it to upstream MTD [1][7].
Thanks,
Paul
[1] http://www.linux-mtd.infradead.org/
[2] http://www.openembedded.org
[3] http://docs.openembedded.org/usermanual/html/recipes_syntax.html
[4] docs/usermanual/chapters/recipes.xml
[5] git clone git://git.infradead.org/mtd-utils.git
[6] http://wiki.openembedded.net/index.php/Push_patches_upstream
[7] http://www.linux-mtd.infradead.org/mail.html
2010/3/10 Paul Menzel <[email protected]>
Quoted 3 lines
Dear Michal,
please do not top post.
It will never happen again
Quoted 4 lines
[...]
So I suggest
1. you to create the patch for mtd-utils in its source directory (get
Quoted 7 lines
the source, for example [5] in a seperate directory outside the OE tree, adapt it and create a patch).
2. Copy the patch torecipes/mtd/mtd-utils/.
3. Add a file line toSRC_URI.
4. If this works, add the patch to the OE Git tree (git add …) and proceed as you did before.
[…]
Thank you for your comprehensive explanation. I thinked Ive grasped it all.
BR, Michal