I'm struggling to debug an issue where the kernel is unable to
find a JFFS2 partition held in NOR flash (on CS0)
Under U-Boot, I can get a directory listing of the partition:-
U-Boot# chpart nor0,4
partition changed to nor0,4
U-Boot# ls
Scanning JFFS2 FS: ....... done.
drwxrwxr-x 0 Wed Jun 19 16:27:26 2013 bin
drwxr-xr-x 0 Tue Apr 30 08:21:26 2013 dev
drwxr-xr-x 0 Tue Apr 23 14:19:13 2013 etc
drwxrwxr-x 0 Tue Apr 30 08:21:26 2013 home
drwxrwxr-x 0 Wed Jun 19 16:27:26 2013 lib
lrwxrwxrwx 11 Wed May 01 07:53:12 2013 linuxrc -> bin/busybox
drwxrwxr-x 0 Mon Jan 28 14:54:31 2013 media
drwxrwxr-x 0 Mon Jan 28 14:54:31 2013 mnt
drwxrwxr-x 0 Mon Apr 29 13:20:55 2013 nano
drwxrwxr-x 0 Mon Jan 28 14:54:31 2013 opt
drwxrwxr-x 0 Mon Jan 28 14:54:31 2013 proc
drwxrwxr-x 0 Mon Jan 28 14:54:31 2013 root
lrwxrwxrwx 3 Mon Jan 28 14:54:31 2013 run -> tmp
drwxr-xr-x 0 Wed Jun 19 16:27:26 2013 sbin
drwxrwxr-x 0 Mon Jan 28 14:54:31 2013 sys
drwxrwxrwt 0 Tue Apr 30 08:21:13 2013 tmp
drwxrwxr-x 0 Tue Apr 30 14:52:55 2013 usr
drwxrwxr-x 0 Tue Apr 30 08:19:05 2013 var
And here is the partition table (according to U-Boot):-
U-Boot# mtdparts
device nor0 <nor>, # parts = 6
#: name size offset mask_flags
0: u-boot 0x000c0000 0x00000000 0
1: u-boot-env1 0x00020000 0x000c0000 0
2: u-boot-env2 0x00020000 0x000e0000 0
3: kernel 0x00400000 0x00100000 0
4: rootfs 0x03b00000 0x00500000 0
5: data 0x04000000 0x04000000 0
active partition: nor0,4 - (rootfs) 0x03b00000 @ 0x00500000
defaults:
mtdids : nor0=nor
mtdparts: mtdparts=nor:768k(u-boot),128k(u-boot-env1),128k(u-boot-env2),4m(kernel),59m(rootfs),64m(data)
Now, when I boot the kernel, it can see all the partitions:-
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 3.10.0-rc4-00172-gf31c62e-dirty (mpfj@mpfj-nanobone) (gcc version 4.8.1 (Buildroot 2013.08-git-00253-g21736a6-dirty) ) #236 Thu Jun 20 10:08:37 BST 2013
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine: Generic AM33XX (Flattened Device Tree), model: Newflow AM335x NanoBone
...
[ 0.000000] Kernel command line: earlyprintk debug console=ttyO0,115200n8 noinitrd ip=off mem=256M rootwait=1 rootfstype=jffs2 root=/dev/mtdblock4 ignore_loglevel
...
[ 1.055035] spansion,s29gl010p11t: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x002276 Chip ID 0x00023c
[ 1.066567] Amd/Fujitsu Extended Query Table at 0x0040
[ 1.071998] Amd/Fujitsu Extended Query version 1.3.
[ 1.077374] number of CFI chips: 1
[ 1.081178] 6 ofpart partitions found on MTD device spansion,s29gl010p11t
[ 1.088371] Creating 6 MTD partitions on "spansion,s29gl010p11t":
[ 1.094805] 0x000000000000-0x0000000c0000 : "boot"
[ 1.103834] 0x0000000c0000-0x0000000e0000 : "env1"
[ 1.111011] 0x0000000e0000-0x000000100000 : "env2"
[ 1.118004] 0x000000100000-0x000000500000 : "kernel"
[ 1.125067] 0x000000500000-0x000004000000 : "rootfs"
[ 1.132201] 0x000004000000-0x000008000000 : "data"
I've also added some debug to make sure offset 0x00500000 points to
a valid JFFS2 image (magic marker = 0x1985):-
[ 1.401600] phys = 08500000, virt = d08f4000, data = 1985
But, although I specify "root=/dev/mtdblock4", I get the error:-
[ 1.419912] List of all partitions:
[ 1.423644] No filesystem could mount root, tried: jffs2
[ 1.429522] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Can anyone shed some light on what might be wrong ?
Is there anything extra to try ?
I've attached my config.
Cheers
Mark J.
On 20/06/13 10:31, Mark Jackson wrote:
> I'm struggling to debug an issue where the kernel is unable to
> find a JFFS2 partition held in NOR flash (on CS0)
Fixed ... I finally worked out I needed to add:-
CONFIG_MTD_BLOCK
CONFIG_MTD_BLOCK2MTD
Sorry for the noise.
Mark J.