Hi Andrew,
Which ever method (ramdisk vs NOR JFFS2) you want to use depends
on your needs. A ramdisk filesystem is obviously faster than NOR JFFS2
since it resides in RAM; if you need your embedded system to run
very efficiently, it's better to use the ramdisk method. The con of
a ramdisk system is, of course, everything is volatile and you
lose everything in the ramdisk once you power it off; also it's harder
to update software on a ramdisk system since you have re-create the
ramdisk with the updated software and re-image the whole ramdisk.gz
into flash. The NOR JFFS2 method is just the opposite; it's slower than
a ramdisk (on the order of 3???) but it's a non-volatile system so changes
to the filesystem are saved after power off; hence it's easier to
update software on a NOR JFFS2; also it leaves you more RAM to work
with.
I guess a better method would be a hybrid where both the ramdisk and
NOR JFFS2 are used. Just have both a ramdisk MTD partition and
a NOR JFFS2 partition in flash; the system would boot up loading
the ramdisk image from flash to RAM, run from it, and is able
to save data on the mounted NOR JFFS2 partition. What do you think?
Hey, I may have to give this a try =)
Regards,
Andy
----- Original Message ----
From: Andrew Armstrong <[EMAIL PROTECTED]>
To: Andy Ngo <[EMAIL PROTECTED]>
Sent: Wednesday, April 11, 2007 12:18:14 AM
Subject: Re: NOR flash file system on Davinci
Hi Andy,
Glad to hear you are solving some of these difficult issues! I have a
question for you, I feel you are probably the most experienced to answer
it!
I am currently working on a project where we are using NOR, we intend to
use a 32mb variant (apparently you can wire up some extra address lines
somewhere - still to be looked it!)
Basically as per usual we intend our kernel and OS image to reside in
NOR to be copied into DDR as is normally the case. The problem is I
cannot decide whether to use the route described as in SPRAAH2 or set
the whole thing up as a JFFS2 as you have.
The latter may offer some flexibility, but in terms of setting up both
routes are tedious. Do you have an opinion?
Regards,
Andrew
On Wed, 2007-04-11 at 00:55 -0700, Andy Ngo wrote:
> Note also that the default NOR flash memory controller setting in the
> current
> DVEVM configuration (u-boot) is NOT optimal (everything is set at max
> timeout, wait states, etc). Hence the performance on the JFFS2
> filesystem is
> not efficient and is relatively slow. I changed the value to
> asynchronous
> configuration register (NOR flash is attached to CS2) as follows:
>
> ACFG2 = 0
> | ( 0 << 31 ) // selectStrobe = 0;
> | ( 0 << 30 ) // extWait = 0;
> | ( 0 << 26 ) // writeSetup = 0; // 0 ns
> | ( 3 << 20 ) // writeStrobe = 3; // 35 ns
> | ( 0 << 17 ) // writeHold = 0; // 0 ns
> | ( 3 << 13 ) // readSetup = 3; // 30 ns
> | ( 10<< 7 ) // readStrobe = 10; // 120 ns
> | ( 0 << 4 ) // readHold = 0; // 0 ns
> | ( 3 << 2 ) // turnAround = 3; // ?? ns ( MAX
> TIMEOUT )
> | ( 1 << 0 ) // asyncSize = 1; // 16-bit bus
> ;
>
> and it gives me a lot better performance. You can add code to set the
> CS2 ACR
> register in board/davinci/platform.S (in the same area where CS3, CS4,
> and CS5
> are initialized).
>
> Regards,
> Andy
>
> ----- Original Message ----
> From: Andy Ngo <[EMAIL PROTECTED]>
> To: Yogesh Kumar M <[EMAIL PROTECTED]>;
> [email protected]
> Sent: Tuesday, April 10, 2007 11:25:52 PM
> Subject: Re: NOR flash file system on Davinci
>
> Yogesh,
>
> I have done so. Took me a while to figure it out but I eventually did
> it.
> Here is a summary of the steps for those who want to try:
>
> 1) Download the GIT kernel (linux-davinci-2.6); the Montavista version
> doesn't
> seem to support it
> 2) Create a default config for the DVEVM
> make ARCH=arm CROSS_COMPILE=arm_v5t_le-
> davinci_evm_dm644x_defconfig
> 3) Configure the kernel to disable IDE (MTD NOR flash can only be used
> when IDE support
> is disabled)
>
> make ARCH=arm CROSS_COMPILE=arm_v5t_le- menuconfig
> => Device Drivers => ATA/ATAPI/MFM/RLL support => unselect
> ATA/ATAPI/MFM/RLL support
>
> * NOTE: no need to enable MTD NOR JFFS2 support since it's already
> enabled in
> the default DVEVM configuration from step 2
>
> The flash layout is already defined in
> arch/arm/mach-davinci/board-evm.c:
>
> static struct mtd_partition davinci_evm_partitions[] = {
> /* bootloader (U-Boot, etc) in first 4 sectors */
> {
> .name = "bootloader",
> .offset = 0,
> .size = 4 * SZ_64K,
> .mask_flags = MTD_WRITEABLE, /* force read-only */
> },
> /* bootloader params in the next 1 sectors */
> {
> .name = "params",
> .offset = MTDPART_OFS_APPEND,
> .size = SZ_64K,
> .mask_flags = 0,
> },
> /* kernel */
> {
> .name = "kernel",
> .offset = MTDPART_OFS_APPEND,
> .size = SZ_2M,
> .mask_flags = 0
> },
> /* file system */
> {
> .name = "filesystem",
> .offset = MTDPART_OFS_APPEND,
> .size = MTDPART_SIZ_FULL,
> .mask_flags = 0
> }
> };
>
> so the 4 MTD partitions should look like this:
>
> 0x00000000-0x00040000 : "bootloader"
> 0x00040000-0x00050000 : "params"
> 0x00050000-0x00250000 : "kernel"
> 0x00250000-0x01000000 : "filesystem"
>
> Your JFFS2 filesystem will reside in the 4th MTD partition.
>
> 4) Build the kernel
> 5) Prepare your JFFS2 filesystem
> a) Download the mtd utilities from
> http://www.linux-mtd.infradead.org/
> and build it to generate the mkfs.jffs2 utility
> b) Gather the rootfs with which you want to generate the
> filesystem;
> I used the sample ramdisk.gz mentioned from spraah2.pdf:
> gunzip ramdisk.gz
> mkdir myrootfs
> mount -o loop ramdisk myrootfs
> c) Create the JFFS2 filesystem
> mkfs.jffs2 -d myrootfs -o rootfs.jffs2 -e 0x10000
> 6) Use u-boot to flash the uImage (from 4) and rootfs.jffs2 (from 5c)
> a) Flash uImage at 0x02050000
> b) Flash rootfs.jffs2 at 0x02250000
> 7) Adjust your boot environment variables to boot to the new NOR JFFS2
> filesystem
> a) setenv bootargs mem=120M console=ttyS0,115200n8
> root=/dev/mtdblock3 rw noinitrd noatime rootfstype=jffs2 ip=off
> b) saveenv
> 8) You are done! Reboot your board and you will boot to your new JFFS2
> filesystem
> on the NOR flash. NOTE: the first time you boot, the JFFS2
> processing will
> prepare (format) the filesystem for use so you will hang at the
> kernel message
> "Freeing init memory: 80K" for a few minutes so be patient. The
> next time you
> boot you won't get this "hung delay" as your JFFS2 filesystem is
> already formatted.
>
> I spent over a week figuring this out (wasting most of my time on the
> Montavista
> kernel until I switched over to the GIT kernel) I hope this helps
> anyone who wants
> to create a small footprint system, which doesn't have the luxury of a
> hard drive
> as the DVEVM board does.
>
> Regards,
> Andy
>
>
>
>
> ----- Original Message ----
> From: Yogesh Kumar M <[EMAIL PROTECTED]>
> To: [email protected]
> Sent: Monday, April 9, 2007 1:34:54 AM
> Subject: NOR flash file system on Davinci
>
> Hi,
>
> Has anybody successfully ported NOR flash based file system on
> DAVINCI and
> successful in booting linux with flash file system?
> please let me know what changes to be made to the kernel for detecting
> the
> flash and where should I specify the memory map .
>
> thanks
> yogesh
>
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> [email protected]
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
>
>
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> [email protected]
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
>
>
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> [email protected]
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source