public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* UBI and OneNand
@ 2006-11-04  8:22 John
  2006-11-06  9:46 ` Frank Haverkamp
  0 siblings, 1 reply; 17+ messages in thread
From: John @ 2006-11-04  8:22 UTC (permalink / raw)
  To: linux-mtd

Hi,

I have a board with a MIPS core and a OneNAND flash.  I plan to split
the OneNAND into a small partition for the boot loader, and a big
partition for the rest. The big partition will be split using UBI into:
  a partition for the Kernel
  a partition for a readonly root file system (squashfs?)
  a read/write JFFS2 partition for persistant data
  a partition for the root file system for use when the box boots next
time
  etc....
The concepts of UBI seem just right.

I have made the kernel from ubi-2.6.git run on my board. Now I would be
grateful for answers to some questions to help me get UBI going.

  1. Should I expect UBI to run on OneNAND without change, or should I
     expect to have to write or adapt some code?

  2. Which git provides the best mtd-utils? Should I get mtd-tools and
     ubi-tools from different gits?

  3. My attempt to build the ubi tools from the git
     users/haver/mtd-utils.git failed.  The tools use the argp
     functions to parse command line args, but my root file system
     based on uclibc doesn't support argp. I propose to collect argp
     sources following instructions in
     http://savannah.gnu.org/cvs/?group=gnulib and try again. Any
     better suggestions?

  4. The UBI faq
     http://www.linux-mtd.infradead.org/faq/ubi.html#L_run_ubi says
     that when UBI is compiled into the Kernel, you should call
     ubi_attach_mtd_dev() to launch the UBI code.  But
     ubi_attach_mtd_dev() is now declared static, so I guess the
     advice is out of date.  How should UBI be started when compiled
     into the kernel?

  5. What is the way to get jffs2 running on an UBI partition?  Should
     I still be aiming to use gluebi to provide an MTD partition on
     top of a UBI partition (whatever that means)? Cook book
     instructions would be very helpful.

Thanks to all for MTD,

John Smith

^ permalink raw reply	[flat|nested] 17+ messages in thread
* UBI and OneNAND
@ 2006-11-07  2:35 박경민
  2006-11-07  8:50 ` Frank Haverkamp
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: 박경민 @ 2006-11-07  2:35 UTC (permalink / raw)
  To: linux-mtd

Hi,

Sorry for changing subject. My mail program has some problem.

> > I think the following commands just worked:
> > 
> >   mkdir /mnt/nvm
> >   flash_eraseall /dev/mtd6
> >   mount -t jffs2 /dev/mtdblock6 /mnt/nvm 
> > 
> > 
> > I wonder whether this is the first attempt to run a kernel using
> > jffs2 and ubi and mtd and onenand and mips? First or not, it seems to work. 

> Yes, it is.  For both onenand and MIPS.  That is good news.  Thanks for
> testing!

Umm. I think 'John' just mounts jffs2 without UBI.

I also tried but I can't mount jffs2

It is my sequence.

# mkdir -p /mnt
# insmod ubi.ko mtd=3

UBI: attached mtd3 to ubi0
UBI: MTD device name:            "rootfs"
UBI: MTD device size:            16 MB
UBI: physical eraseblock size:   131072 bytes (128 KB)
UBI: logical eraseblock size:    126976 bytes
UBI: number of good PEBs:        127
UBI: number of bad PEBs:         1
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: max. allowed volumes:       124
UBI: wear-levelling threshold:   4096
UBI: number of internal volumes: 2
UBI: number of user volumes:     0
UBI: available PEBs:             122
UBI: total number of reserved PEBs: 5
UBI: number of PEBs reserved for bad PEB handling: 1

# mount -t jffs2 /dev/mtdblock3 /mnt

/ # mount -t jffs2 /dev/mtdblock3 /tmp
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x4255 id
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0x0001 id
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000003c: 0xcedc id
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000800: 0x4255 id
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000804: 0x0101 id
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000808: 0xff7f id
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000083c: 0x25b8 id
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000010a8: 0x16f1 id
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00001154: 0x16f1 id
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00001200: 0x16f1 id
...
Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
empty_blocks 0, bad_blocks 1, c->nr_blocks 128
mount: Mounting /dev/mtdblock3 on /tmp failed: Input/output error

Is it right?

Of course. JFFS2 mount without UBI working well.

Thank you,
Kyungmin Park

^ permalink raw reply	[flat|nested] 17+ messages in thread
* UBI and OneNAND
@ 2006-11-07 12:52 Kyungmin Park
  2006-11-08 16:09 ` Artem Bityutskiy
  0 siblings, 1 reply; 17+ messages in thread
From: Kyungmin Park @ 2006-11-07 12:52 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: John Smith, linux-mtd@lists.infradead.org

Hi,

> > ##
> > ## Look at existing devices
> > ##
> > / # ls -l /dev/mtdblock?
> > brw-r-----    1 0        0         31,   0 Jan  1 00:00 /dev/mtdblock0
> > brw-r-----    1 0        0         31,   1 Jan  1 00:00 /dev/mtdblock1
> > brw-r-----    1 0        0         31,   2 Jan  1 00:00 /dev/mtdblock2
> > brw-r-----    1 0        0         31,   3 Jan  1 00:00 /dev/mtdblock3
> Yo do not need mtdblock devices to mount JFFS2 at all. JFFS2 anyway
> works with MTD devices directly and this is just an old way to mount
> JFFS2. /dev/mtdX are character devices and you cannot feed the mount
> utility by character devices, so this is why fake block devices were
> used. Nowadays there is device-less mount support and you may use:

> mount mtd7 /mnt/nvm

Yes, I can mount ubi with avobe method. 

I can't mount with name but It's possible with new mtdblock node

mtd = 3 -> mtd > 7
# mount -t jffs2 /dev/mtdblock7 /mnt

I will send more detailed description tomorrow.

Thank you,
Kyungmin Park

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2006-11-08 16:09 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-04  8:22 UBI and OneNand John
2006-11-06  9:46 ` Frank Haverkamp
2006-11-06 13:18   ` Artem Bityutskiy
2006-11-06 20:16   ` John Smith
2006-11-06 20:54     ` Josh Boyer
  -- strict thread matches above, loose matches on Subject: below --
2006-11-07  2:35 UBI and OneNAND 박경민
2006-11-07  8:50 ` Frank Haverkamp
2006-11-07 10:20   ` John Smith
2006-11-07 11:39     ` Artem Bityutskiy
2006-11-07 11:47       ` Josh Boyer
2006-11-07 14:10         ` Artem Bityutskiy
2006-11-07 14:24           ` Josh Boyer
2006-11-07 14:39             ` Artem Bityutskiy
2006-11-07  9:16 ` Artem Bityutskiy
2006-11-08 16:03 ` Artem Bityutskiy
2006-11-07 12:52 Kyungmin Park
2006-11-08 16:09 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox