From: Martin Egholm Nielsen <martin@egholm-nielsen.dk>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Re: Reading or writing jffs2 - how?
Date: Thu, 16 Dec 2004 16:17:27 +0100 [thread overview]
Message-ID: <cps8u7$8rh$1@sea.gmane.org> (raw)
In-Reply-To: <87hdmnuvpi.fsf@deepthought.outer.space.org>
Hi Detlev,
>> I have tried to create a jffs2-image of the linux-filesystem I wish
>> to use, and then write it to my flash using "nand write.jffs2
>> 100000 0 $(filesize)". But with no luck... Then I began to
>> investigate the fundamental "ls" and "nand erase" commands, but
>> neither there did I have any success. Below is a trace of what I've
>> tried in order to get something working.
> Are you really sure, your NAND gets accessed correctly both under
> U-Boot and Linux? Can you erase / write / readback some data under
> U-Boot by hand?
I'm sure it works under Linux - there I can both write and read - boot
and use the flash-data again. No problems.
Under u-boot I've just tried the following:
=============== 8< 8< 8< 8< ===============
=> md.b 100000
00100000: 7f a3 eb 78 38 a0 00 00 4b ff fa b1 7c 7f 1b 78
...x8...K...|..x
00100010: 3d 40 c0 18 39 2a 14 60 81 69 00 08 39 6b ff ff
=@..9*.`.i..9k..
00100020: 91 69 00 08 2c 0b 00 00 40 82 00 10 80 0a 14 60
.i..,... at ......`
00100030: 2c 00 00 00 40 82 00 0c 7f e3 fb 78 4b ff fe a0
,... at ......xK...
=> nand write 100000 0 40
NAND write: device 0 offset 0, size 64 ... Warning block writes should
be at lea
st 512 bytes and start on a 512 byte boundry
64 bytes written: OK
=> nand read 200000 0 40
NAND read: device 0 offset 0, size 64 ... Warning block writes should be
at leas
t 512 bytes and start on a 512 byte boundry
64 bytes read: OK
=> md.b 200000
00200000: 7f a3 eb 78 38 a0 00 00 4b ff fa b1 7c 7f 1b 78
...x8...K...|..x
00200010: 3d 40 c0 18 39 2a 14 60 81 69 00 08 39 6b ff ff
=@..9*.`.i..9k..
00200020: 91 69 00 08 2c 0b 00 00 40 82 00 10 80 0a 14 60
.i..,... at ......`
00200030: 2c 00 00 00 40 82 00 0c 7f e3 fb 78 4b ff fe a0
,... at ......xK...
=>
=============== 8< 8< 8< 8< ===============
In short: the giberish-data present at memory 0x100000 is written to
flash, and reread again to memory at 0x200000. The flash does still
contain the data after reboot.
Next, I tried reading the data from my Linux:
# dd if=/dev/mtd0 of=/ftp/dump bs=8 count=8
=== /ftp/dump contains: ===
00000000: 7fa3 eb78 38a0 0000 4bff fab1 7c7f 1b78 ...x8...K...|..x
00000010: 3d40 c018 392a 1460 8169 0008 396b ffff =@..9*.`.i..9k..
00000020: 9169 0008 2c0b 0000 4082 0010 800a 1460 .i..,... at ......`
00000030: 2c00 0000 4082 000c 7fe3 fb78 4bff fea0 ,... at ......xK...
Hence, the same data is available from Linux at the beginning at the device.
That made me wonder... Aaaaand, then I tried mounting the
flash-root-filesystem under Linux after what I thought would have
corrupted it (the above writing of giberish to the system). And the
root-filesystem still worked!
Hence, I tried dumping the entire flash to a file. And I discovered that
the filesystem-data was positioned@the "end" of the flash...
That may be the reason that "ls" in u-boot does not work with the image
in flash - or what?
Best regards,
Martin Egholm
next prev parent reply other threads:[~2004-12-16 15:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-15 12:56 [U-Boot-Users] Reading or writing jffs2 - how? Martin Egholm Nielsen
2004-12-15 20:47 ` Detlev Zundel
2004-12-15 20:56 ` Detlev Zundel
2004-12-16 15:11 ` [U-Boot-Users] " Martin Egholm Nielsen
2004-12-16 15:17 ` Martin Egholm Nielsen [this message]
2004-12-20 14:09 ` Martin Egholm Nielsen
2004-12-20 17:25 ` Detlev Zundel
2004-12-21 9:01 ` Martin Egholm Nielsen
2004-12-21 9:12 ` Wolfgang Denk
2004-12-21 9:30 ` Martin Egholm Nielsen
2004-12-21 12:07 ` Wolfgang Denk
2004-12-21 12:46 ` Martin Egholm Nielsen
2004-12-21 19:19 ` Detlev Zundel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='cps8u7$8rh$1@sea.gmane.org' \
--to=martin@egholm-nielsen.dk \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox