Skip to contentSkip to conversation

the procedure setting up jffs2

DISCUSSION Jack Lu 5 participants 6 messages Sep 12, 2002 – Sep 13, 2002 Memory technology devices (MTD)

lore
Share & tools
lore

Jack Lu

author
#0 lore raw

Hi

I am using RPX850 Lite with 16MB flash(4 chips of Am29Lv320MB) with buswidth 32 and interleave 4.
I have complied the MTD and JFFS2 module into the kernel.
When I start up the Linux, Linux found the 16MB flash, the whole flash corresponds to /dev/mtd0.

1. where can I get the mkfs.jffs2 excutable for MPC850?

2. the bottom 256KB is the boot loader code of the 16MB flash. the rest si for storing data
if I do
#cat jffs2.image > /dev/mtd0
will the bootloader be erased?

I appreciate your help.
Thanks.

#1 lore raw
Quoted 7 lines · Jack Lu

I am using RPX850 Lite with 16MB flash(4 chips of Am29Lv320MB) with buswidth 32 and interleave 4.
I have complied the MTD and JFFS2 module into the kernel.
When I start up the Linux, Linux found the 16MB flash, the whole flash corresponds to /dev/mtd0.

1. where can I get the mkfs.jffs2 excutable for MPC850?

Hmm... There are quite a few places that provide pre-packaged PPC tools, Denx (denx.de) is one of those. If you have the cross-compiling tools already, then building it on your own should be fairly easy also.

Quoted 5 lines

2. the bottom 256KB is the boot loader code of the 16MB flash. the rest si for storing data
if I do
#cat jffs2.image > /dev/mtd0
will the bootloader be erased?

The chip you mention is bottom-boot, so the above will very likely wipe-out the bootloader. You probably want to partition your MTD device by modifying the mapping driver and then write the JFFS2 image to another partition then /dev/mtd0. Check drivers/mtd/tqm8xxl.c for an example.

Karim

===================================================
Karim Yaghmour
[email protected]
Embedded and Real-Time Linux Expert
===================================================

#2 lore raw

Hi Karim,

Quoted 5 lines · in message <[email protected]> you wrote:

The chip you mention is bottom-boot, so the above will very likely wipe-out the bootloader. You probably want to partition your MTD device by modifying the mapping driver and then write the JFFS2 image to another partition then /dev/mtd0. Check drivers/mtd/tqm8xxl.c for an example.

We (more or less) consider this method of static partitioning
obsolete. We use (and recommend to our customers) a dynamic
partitioning, where "partition table" information is passed to the Linux kernel by PPCBoot using the kernel command line.

For example, passing the kernel a boot argument of

	mtdparts=0:256k(PPCboot)ro,768k(Kernel),-(Rest);1:-(myJFFS2)

results in this partitioning:

	...
	TQM flash bank 0: Using command line partition definition
	Creating 3 MTD partitions on "TQM8xxL Bank 0":
	0x00000000-0x00040000 : "PPCboot"
	0x00040000-0x00100000 : "Kernel"
	0x00100000-0x00400000 : "Rest"
	TQM flash bank 1: Using command line partition definition
	Creating 1 MTD partitions on "TQM8xxL Bank 1":
	0x00000000-0x00400000 : "myJFFS2"
	...

See the config option "CONFIG_MTD_CMDLINE_PARTS" in our kernel sources.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: [email protected]
The price one pays for pursuing any profession,  or  calling,  is  an
intimate knowledge of its ugly side.                  - James Baldwin
#3 lore raw
Quoted 9 lines · Wolfgang Denk
Quoted 5 lines · in message <[email protected]> you wrote:

The chip you mention is bottom-boot, so the above will very likely wipe-out the bootloader. You probably want to partition your MTD device by modifying the mapping driver and then write the JFFS2 image to another partition then /dev/mtd0. Check drivers/mtd/tqm8xxl.c for an example.

We (more or less) consider this method of static partitioning obsolete.

So do I. Unfortunately, drivers/mtd/cmdline.c is only available in the MTD CVS for the time being (and Denx's kernel sources ;). Neither 2.5.34 nor 2.4.19 include this code. Instead, they currently include drivers/mtd/bootldr.c which is only for ARM. Do you have any idea when cmdline.c will be part of the mainline kernel?

Karim

===================================================
Karim Yaghmour
[email protected]
Embedded and Real-Time Linux Expert
===================================================

#4 lore raw
Quoted 2 lines · Karim Yaghmour

So do I. Unfortunately, drivers/mtd/cmdline.c is only available in the MTD CVS for the time being (and Denx's kernel sources ;). Neither 2.5.34 nor

For the records, I'd like to add that obviously (since we developed it), the cmdline partitioning is also a standard feature of our Elinos distribution.

Regarding the main-line kernel: don't forget that updating kernel.org's MTD is one thing -- having more mapping drivers actually _use_ cmdline.c is another. This is the job of the corresponding maintainers.

Regards,
Marius

-----------------------------------------------------------------------------

Marius Groeger           SYSGO Real-Time Solutions GmbH     [email protected]
Software Engineering     Embedded and Real-Time Software    www.sysgo.de
Voice: +49-6136-9948-0   Am Pfaffenstein 14                 www.osek.de
FAX:   +49-6136-9948-10  55270 Klein-Winternheim, Germany   www.elinos.com
#5 lore raw
Quoted 4 lines · [email protected] said:

Regarding the main-line kernel: don't forget that updating
kernel.org's MTD is one thing -- having more mapping drivers actually _use_ cmdline.c is another. This is the job of the corresponding maintainers.

I need to push the current stuff to Linus fairly soon, after which we can go through Jörn's new partition stuff and argue about the details for a while before merging it :)

--
dwmw2