ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ltib] JFFS2 Implementation using Ltib


From: aaron
Subject: Re: [Ltib] JFFS2 Implementation using Ltib
Date: Tue, 7 Apr 2009 09:42:00 -0500 (CDT)
User-agent: SquirrelMail/1.4.16

Not exactly sure about 2.4.22, but I'll tell you what I did for 2.6.13.4
if it helps.  Judging by what you described, you want to have a ext2 ram
disk as your root file system, and then use another partition of your
flash for a jffs2 file system.  In my setup I just have jffs2 as my root
file system, but you can do it your way as well.

You need to enable support in your kernel for your flash chip.

In my menuconfig, that's device drivers -> mtd -> RAM/ROM/Flash chip
drivers -> Support for AMD/Fujitsu flash chips.  I also have Detect flash
chips by Common Flash Interface (CFI) probe checked.

Then you'll probably have to enable support to map the memory of your
flash chip to physical memory.

device drivers -> mtd -> Mapping drivers for chip access -> CFI Flash
device in physical memory map.  In my system, my flash is physically
mapped to 0xfc000000, which is the value I have in Physical start address
of flash mapping, and is 64 MB in size, so I put 0x4000000 in Physical
length of flash mapping, and 2 for Bank width in octets.  If you have the
correct setup for this stuff, then you should see appropriate messages in
your kernel printout when you boot.

My kernel says:

physmap flash device: 4000000 at fc000000
phys_mapped_flash: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
phys_mapped_flash: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.

Note the name of my device, phys_mapped_flash.

Also in menuconfig, if you want to do command line partitioning (from
U-Boot to the kernel) you'll need device drivers -> mtd -> MTD
partitioning support (and) -> Command line partition table parsing.  I
also have Direct char device access to MTD devices and Caching block
device access to MTD devices checked.  This enables me to create
partitions on the phys_mapped_flash device, and mount them as jffs2 file
systems.  You'll need support for jffs2 file systems compiled into your
kernel as well.  As far as I know, you don't need to do anything in U-Boot
for what you want to do other than pass the appropriate command line
arguments to the kernel.  In my case, I set the bootargs variable as such:

setenv bootargs root=/dev/mtdblock1
mtdparts=phys_mapped_flash:2m(hrcw/kernel)ro,address@hidden(rootfs),address@hidden(uboot)ro
rootfstype=jffs2 rw

I worked with another kernel earlier, 2.6.12, where the bootargs were set to:

setenv bootargs root=/dev/mtdblock1 ro mtdparts=phys:2M(ROM)ro,-(root)
rootfstype=jffs2

It depends what your kernel is naming your flash mapped to physical
memory, either phys_mapped_flash, or phys in these cases.  You partition
your flash any way you want with the appropriate start locations and
sizes.  Refer to drivers/mtd/cmdlinepart.c for more details.

If successful, you'll see kernel printouts on boot similar to these that I
get:

4 cmdlinepart partitions found on MTD device phys_mapped_flash
Creating 4 MTD partitions on "phys_mapped_flash":
0x00000000-0x00200000 : "hrcw/kernel"
0x00200000-0x00800000 : "rootfs"
0x00800000-0x03f00000 : "spare"
0x03f00000-0x04000000 : "uboot"

You'll have to translate this into 2.4 kernel options.  Afterwards, you'll
be able to mount your flash with something like:

mount -t jffs2 -o rw /dev/mtdblock4 /mnt/flash

If it's the first time you've mounted this partition, it could take a
while, as it seems like the kernel has to format and initialize the jffs2
file system, like doing a mkfs.jffs2 /dev/mtdblock4.

> Dear All,
>    I am working on EP885 Development board with ltib deployed on Open Suse
> 10.2
> and also on Red Hat 7.3.The iso image for board BSP was provided by
> Freescale
> in the CD by the name ep88x_ltib.iso.It works fine.But currently I am
> stucj
> up with the implementaion of Jffs2 on the Board.I will be grateful to you
> if
> any help is provided in this respect.
> My Board Specifications are:
>      CPU:    MPC885
>      Flash:    32MB
>      SDRAM:    64MB     AM29LV640B
>      U-Boot :    1.1.3
>      Kernel:    Linux-2.4.22
>
> Now I want to partition the flash as follows
>
> ______________________ 0xFC000000-0xFC03FFFF
> |                                     |
> |  Bootloader (256K)         |
> |_____________________|0xFC040000-0xFC07FFFF
> |Bootloader Env Variab     |
> |   (256K)                        |
> |_____________________|0xFC100000-0xFC19FFFF
> |                                     |
> |Kernel Image                  |
> |_____________________|0xFD000000-0xFDF7FFFF
> |                                     |
> |rootfs.ext2.gz.uboot        |->(Ram disk Image)
> |_____________________|0xFDF80000-0xFDFFFFFF
> |                                     |
> |  Jffs2 File System          |->>This is required for
> |                                     | configuration related para-
> |_____________________| meters  which should
>                                        be R/W e.g: /etc
>
> I searched a lot but didn't get something relevant to this kind of
> deployment
> Can anyone clear me some doubts as follows:
> 1>Is Mtd partition necessary to be implemented in U-boot?
> 2>How The implimentation will be done?
> 3>If I need to add something, then where it is to be done?
> 4> Is there any documentation for similar kind of scenario?
>
> Hoping to hear from you soon.
> Thanking you in anticipation.
>
> BR,
> Sagar Kadam,
> Cygnusmicro Systems,
> Hyderabad-51
>
>
>
>
>
> --
> BR,
> Sagar Kadam
>
>
>
> Happiness keeps you Sweet,
> Trials keep you Strong,
> Sorrows keep you Human,
> Failures keep you humble,
> Success keeps You Glowing,
> but Only God keeps You Going
> _______________________________________________
> LTIB home page: http://bitshrine.org
>
> Ltib mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/ltib
>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]