All of lore.kernel.org
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Reading or writing jffs2 - how?
Date: Wed, 15 Dec 2004 21:47:38 +0100	[thread overview]
Message-ID: <87r7lruw45.fsf@deepthought.outer.space.org> (raw)
In-Reply-To: <cppc9u$op8$1@sea.gmane.org> (Martin Egholm Nielsen's message of "Wed, 15 Dec 2004 13:56:29 +0100")

Hi Martin,

> 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.
>
> In section 2, I'd expect the nand to be mountable from Linux - but's
> it's not.
> In section 3, I'd expect the filesystem to be ls'ed correct from
> u-boot - but it's not...
>
> Can someone tell me if there is something I've misunderstood?
>
> ********************************
> ********** 1 U-Boot ************
> ********************************
> U-Boot 1.1.2 (Nov 27 2004 - 11:50:10)
> CPU:   IBM PowerPC 405EP Rev. B at 333.333 MHz (PLB=111, OPB=55, EBC=37 MHz)
>
> ==== 8< 8< 8< ====
>
> NAND:Probing at 0xff400000
>    64 MB
>
> ==== 8< 8< 8< ====
>
> => nand erase clean
>
> NAND erase: device 0 offset 0, size 67108864 ... OK
>
> => ls
> Scanning JFFS2 FS:  done.
> =>
>
> *******************************
> ********** 2 Linux ************
> *******************************

Which Linux kernel with which mtd code version?

> # cat /proc/mtd
>
> dev:    size   erasesize  name
> mtd0: 04000000 00004000 "Trampoline Nand Flash (128 MB)"
>
> # mount -t jffs2 /dev/mtdblock0 mnt/nand0
>
> jffs2: Erase block size too small (16KiB). Using virtual blocks size
> (32KiB) instead
> Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
> empty_blocks 1325, bad_blocks 4, c->nr_blocks 2048
> mount: Mounting /dev/mtdblock0 on /mnt/nand0 failed: Invalid argument
>
> # eraseall /dev/mtd0

Use -j (--jffs2) in the future.

> Erasingnand_erase: attempt to erase a bad block at p 16 Kibyte @
> 400age 0x00000020
> 0 --  0 % complenand_erase: attempt to erase te.
> eraseall: /a bad block at page 0x00000040
> dev/mtd0: MTD Ernand_erase: attempt to erasase failure: Inpe a bad
> block at page 0x00000060
> nand_erase: attempt to erase a bad blo
> Erasing 16 Kibck at page 0x00000080
> yte @ 8000 --  0nand_erase: attempt to er % complete.
> erase a bad block at page 0x000000a0
> aseall: /dev/mtd0: MTD Erase fainalure: Input/outpnd_erase: attempt to
> erase a b
> ad block at page 0x000000c0
> ut error
> Erasinand_erng 16 Kibyte @ case: attempt to erase a bad block at page
> 0x000000e0
> 000 --  0 % complete.
> eraseall: /dev/mtd0: MTD Erase failure: Input/output error
> Erasing 16 Kibyte @ 10000 --  0 % complete.
> eraseall: /dev/mtd0: MTD Erase failure: Input/output error
> Erasing 16 Kibyte @ 14000 --  0 % complete.
> eraseall: /dev/mtd0: MTD Erase failure: Input/output error
> Erasing 16 Kibyte @ 18000 --  0 % complete.
> eraseall: /dev/mtd0: MTD Erase failure: Input/output error
> Erasing 16 Kibyte @ 1c000 --  0 % complete.
> eraseall: /dev/mtd0: MTD Erase failure: Input/output error
> Erased 65536 Kibyte @ 0 -- 100% complete.

Might be caused be eraseall without -j ignoring bad blocks but I'm not
sure.

> # mount -t jffs2 /dev/mtdblock0 /mnt/nand0/
>
> jffs2: Erase block size too small (16KiB). Using virtual blocks size
> (32KiB) instead
>
> # touch /mnt/nand0/testfile
> # mkdir /mnt/nand0/testdir
> # umount /mnt/nand0
>
> jffs2: No clean, dirty _or_ erasable blocks to GC from! Where are they all?
> jffs2: Couldn't find erase block to garbage collect!

Thats just a warning and can be ignored - iirc it means the unmount
triggered a garbage collection which found nothing to collect.

> # mount -t jffs2 /dev/mtdblock0 /mnt/nand0/
>
> jffs2: Erase block size too small (16KiB). Using virtual blocks size
> (32KiB) instead
>
> # ls -l /mnt/nand0/
> drwxr-xr-x    2 0        0               0 Feb  8 05:59 testdir
> -rw-r--r--    1 0        0               0 Feb  8 05:59 testfile
>
> ********************************
> ********** 3 U-Boot ************
> ********************************
>
> => ls
> Scanning JFFS2 FS:  done.
> =>

This should definitely work (it worked for me on 8xx and 4xx in the
past).

Check the mtd code in your Linux version - many improvements related
to NAND went in there not long ago.

Cheers
  Detlev

-- 
In God we trust.  All others we monitor
                       -- NSA motto

  reply	other threads:[~2004-12-15 20:47 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 [this message]
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
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=87r7lruw45.fsf@deepthought.outer.space.org \
    --to=dzu@denx.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.