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