[U-Boot] Searching for JFFS2 understanding.

I have a project with the Freescape MPC8323ERDB board and am having a little trouble booting the jffs2 image and I suspect it is either a u-boot environment string, a u-boot CONFIG* setting or a Linux CONFIG* setting.
At this point, I can build a rootfs.jffs2, include uImage into the rootfs.jffs2 and from the u-boot prompt do things like this and even boot from the uImage in the JFFS2 flash.
=> *fsload 0x00800000 /uImage* //the uImage in the jffs2 rootfs. => *bootm 0x00800000 - 0xfe080000*
So, I think my confusion is in making the jump between u-boot's perception of partitions in NOR flash and the kernels perception of partitions in NOR flash.
I have *CONFIG_CMD_JFFS2* defined, but not *CONFIG_CMD_MTDPARTS* as they seem to be mutually exclusive.
I have tried a bootargs of:
*root=/dev/mtdblock1 rw rootfstype=jffs2 mtdparts=nor0:3072k(u-boot),-(jffs2) console=ttyS0,115200*
thinking this would define sufficiently mtdparts for the Linux kernel to boot. Maybe there is a C source file in the linux kernel that needs the mtd partitioning information hard-code? I vaguely remember something like this a while back.
At this point, I am hoping for a few ideas that will allow me to complete my understanding of the boot process with JFFS2 so I can then get to the next problem of understanding the boot process with UBI.
The end of the kernel boot shows this: *MTDSB: dev_name "/dev/root" MTDSB: lookup_bdev() returned 0 List of all partitions: No filesystem could mount root, tried: jffs2*
An "ls" in u-boot with DEBUG_JFFS2 defined gives me this: *=> ls ---mtdparts_init--- dev id: type = 1, num = 0, size = 0x01000000, mtd_id = single part part : name = static, size = 0x01000000, offset = 0x00000000 --- jffs2_part_info: partition number 0 for device nor0 (single part) Scanning JFFS2 FS: ...... done. drwxrwxr-x 0 Sat Apr 02 22:04:07 2011 bin drwxr-xr-x 0 Sat Apr 02 19:03:52 2011 dev drwxr-xr-x 0 Sat Apr 02 22:04:07 2011 etc ... -rw-r--r-- 2003122 Sat Apr 02 22:03:34 2011 uImage drwxrwxr-x 0 Tue Nov 30 15:52:43 2010 usr drwxrwxr-x 0 Tue Nov 30 15:52:43 2010 var => *

Dear Charles Krinke,
In message AANLkTi=pfBvvVko1iRnuxdyyU0xWdK6pGretf90+jO5F@mail.gmail.com you wrote:
I have *CONFIG_CMD_JFFS2* defined, but not *CONFIG_CMD_MTDPARTS* as they seem to be mutually exclusive.
They are not. There are 64 boards in mainline which define both.
thinking this would define sufficiently mtdparts for the Linux kernel to boot. Maybe there is a C source file in the linux kernel that needs the mtd partitioning information hard-code? I vaguely remember something like this a while back.
No. You just select CONFIG_MTD_CMDLINE_PARTS=y in the Linux kernel configuration.
List of all partitions: No filesystem could mount root, tried: jffs2*
Seems your kernel does not recognize any MTD partitions at all.
Do you pass any mtdparts= boot argument to the kernel at all? What exactly are your bootargs?
Did you enable MTD support and CMDLINE_PARTS in the kernel config?
Best regards,
Wolfgang Denk

I believe the command line to the kernel is indeed not quite complete, but here it is at this point:
*bootargs root=mtd:nor0 rw rootfstype=jffs2 mtdparts=nor0:3072k(u-boot),-(jffs2) console=ttyS0,115200*
With this command line, the kernel printk's just before it panics are: *MTDSB: dev_name "mtd:nor0" MTDSB: mtd:%s, name "nor0" MTD: MTD device with name "nor0" not found. MTDSB: lookup_bdev() returned -2 VFS: Cannot open root device "mtd:nor0" or unknown-block(0,0) * I can see by looking in the mtdsuper.c file in the kernel that it is now looking for mtd:something and that the previous /dev/mtdblockX is deprecated.
I believe I am close but dont quite have the new syntax for passing this command line for jffs2.
On Sun, Apr 3, 2011 at 1:20 AM, Wolfgang Denk wd@denx.de wrote:
Dear Charles Krinke,
In message AANLkTi=pfBvvVko1iRnuxdyyU0xWdK6pGretf90+jO5F@mail.gmail.com you wrote:
I have *CONFIG_CMD_JFFS2* defined, but not *CONFIG_CMD_MTDPARTS* as they seem to be mutually exclusive.
They are not. There are 64 boards in mainline which define both.
thinking this would define sufficiently mtdparts for the Linux kernel to boot. Maybe there is a C source file in the linux kernel that needs the
mtd
partitioning information hard-code? I vaguely remember something like
this a
while back.
No. You just select CONFIG_MTD_CMDLINE_PARTS=y in the Linux kernel configuration.
List of all partitions: No filesystem could mount root, tried: jffs2*
Seems your kernel does not recognize any MTD partitions at all.
Do you pass any mtdparts= boot argument to the kernel at all? What exactly are your bootargs?
Did you enable MTD support and CMDLINE_PARTS in the kernel config?
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Die Freiheit des Menschen liegt nicht darin, dass er tun kann, was er will, sondern darin, dass er nicht tun muss, was er nicht will. -- Jean-Jacques Rousseau

A litrtle bit more info. I turned on the debug statements in u-boot and when I do an ls of the jffs2 file system, I see this:
*=> ls
---mtdparts_init--- dev id: type = 1, num = 0, size = 0x01000000, mtd_id = single part part : name = static, size = 0x01000000, offset = 0x00000000
--- jffs2_part_info: partition number 0 for device nor0 (single part) Scanning JFFS2 FS: ...... done. drwxrwxr-x 0 Sun Apr 03 17:39:05 2011 bin drwxr-xr-x 0 Sat Apr 02 19:03:52 2011 dev drwxr-xr-x 0 Sun Apr 03 17:39:05 2011 etc drwxrwxr-x 0 Sat Apr 02 19:03:52 2011 home lrwxrwxrwx 9 Sun Apr 03 17:39:05 2011 init -> sbin/init ... drwxrwxrwt 0 Sat Apr 02 19:03:39 2011 tmp -rw-r--r-- 1892470 Sun Apr 03 17:37:56 2011 uImage drwxrwxr-x 0 Tue Nov 30 15:52:43 2010 usr drwxrwxr-x 0 Tue Nov 30 15:52:43 2010 var * On Sun, Apr 3, 2011 at 11:36 AM, Charles Krinke charles.krinke@gmail.comwrote:
I believe the command line to the kernel is indeed not quite complete, but here it is at this point:
*bootargs root=mtd:nor0 rw rootfstype=jffs2 mtdparts=nor0:3072k(u-boot),-(jffs2) console=ttyS0,115200*
With this command line, the kernel printk's just before it panics are: *MTDSB: dev_name "mtd:nor0" MTDSB: mtd:%s, name "nor0" MTD: MTD device with name "nor0" not found. MTDSB: lookup_bdev() returned -2 VFS: Cannot open root device "mtd:nor0" or unknown-block(0,0)
I can see by looking in the mtdsuper.c file in the kernel that it is now looking for mtd:something and that the previous /dev/mtdblockX is deprecated.
I believe I am close but dont quite have the new syntax for passing this command line for jffs2.
On Sun, Apr 3, 2011 at 1:20 AM, Wolfgang Denk wd@denx.de wrote:
Dear Charles Krinke,
In message AANLkTi=pfBvvVko1iRnuxdyyU0xWdK6pGretf90+jO5F@mail.gmail.com you wrote:
I have *CONFIG_CMD_JFFS2* defined, but not *CONFIG_CMD_MTDPARTS* as they seem to be mutually exclusive.
They are not. There are 64 boards in mainline which define both.
thinking this would define sufficiently mtdparts for the Linux kernel to boot. Maybe there is a C source file in the linux kernel that needs the
mtd
partitioning information hard-code? I vaguely remember something like
this a
while back.
No. You just select CONFIG_MTD_CMDLINE_PARTS=y in the Linux kernel configuration.
List of all partitions: No filesystem could mount root, tried: jffs2*
Seems your kernel does not recognize any MTD partitions at all.
Do you pass any mtdparts= boot argument to the kernel at all? What exactly are your bootargs?
Did you enable MTD support and CMDLINE_PARTS in the kernel config?
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Die Freiheit des Menschen liegt nicht darin, dass er tun kann, was er will, sondern darin, dass er nicht tun muss, was er nicht will. -- Jean-Jacques Rousseau
-- Charles Krinke
participants (2)
-
Charles Krinke
-
Wolfgang Denk