[U-Boot] [RFC/PATCH] jffs2/mtdparts: Fix problem with usage from JFFS2 and MTDPARTS together

Stefan Roese sr at denx.de
Wed May 20 11:54:40 CEST 2009


Hi Wolfgang,

On Sunday 17 May 2009 19:25:07 Wolfgang Denk wrote:
> on NOR fals systems with just a single bank of memory it seems to
> work:

<snip>

> => ls
>  -rwxr-xr-x    14296 Tue Apr 01 22:51:21 2008 false
>  -rwxr-xr-x    83624 Tue Apr 01 22:52:22 2008 fgrep
>  -rwx------   294912 Sun May 17 15:32:14 2009 gawk
>  -rwxr-xr-x     5672 Fri Nov 21 12:32:02 2008 dmesg
>  -rwxr-xr-x    10272 Tue Apr 01 22:57:28 2008 dnsdomainname
>  -rwxr-xr-x     3596 Tue Apr 01 23:20:22 2008 doexec
>  -rwxr-xr-x    10272 Tue Apr 01 22:57:28 2008 domainname
>  -rwxr-xr-x    56972 Wed Apr 02 00:27:30 2008 dumpkeys
> ...

OK.

> So we have:
>
> - problems on NAND flash
> - problems on systems with more than one bank NOR
> - other storage media not tested yet

I just tested on an PPC4xx platform (405EX Kilauea) and enabled JFFS2 and 
MTDPARTS support there. After fixing some problems with the NAND ECC byte 
ordering (see patches already posted) I was able to mount JFFS2 filesystems on 
NOR and NAND:

=> mtdparts                      

device nor0 <nor>, # parts = 5
 #: name                size            offset          mask_flags
 0: kernel              0x00200000      0x00000000      0         
 1: root                0x00200000      0x00200000      0         
 2: user                0x03b60000      0x00400000      0         
 3: env                 0x00040000      0x03f60000      0         
 4: u-boot              0x00060000      0x03fa0000      0         

device nand0 <nand>, # parts = 3
 #: name                size            offset          mask_flags
 0: part1               0x01000000      0x00000000      0         
 1: part2               0x01000000      0x01000000      0         
 2: part3               0x02000000      0x02000000      0         

active partition: nand0,1 - (part2) 0x01000000 @ 0x01000000

defaults:
mtdids  : nor0=nor
mtdparts: mtdparts=nor:2m(kernel),2m(root),60800k(user),256k(env),-(u-boot)
=> chpart nor0,1                                                           
partition changed to nor0,1                                                
=> ls                                                                      
rescan: First time in use                                                  
Scanning JFFS2 FS: . done.                                                 
 -rwxr-xr-x    14296 Wed Feb 20 17:47:23 2008 false                        
 -rwxr-xr-x    83624 Wed Feb 20 17:55:07 2008 fgrep                        
 -rwx------   225280 Thu Jan 01 00:02:33 1970 gawk                         
 -rwxr-xr-x    15392 Wed Feb 20 17:47:23 2008 env                          
 -rwxr-xr-x   673648 Wed Feb 20 18:37:41 2008 ex                           

<snip>

=> chpart nand0,1                                                          
partition changed to nand0,1                                               
=> ls                                                                      
rescan: First time in use                                                  
Scanning JFFS2 FS: . done.                                                 
 -rwxr-xr-x       62 Wed Feb 20 18:43:55 2008 zcat                         
 -rw-r--r--        6 Thu Jan 01 00:01:22 1970 test.txt                     
 -rwxr-xr-x    10148 Wed Feb 20 18:04:36 2008 ypdomainname                 
 -rwxr-xr-x   673648 Wed Feb 20 18:37:41 2008 view                         
 -rwxr-xr-x   673648 Wed Feb 20 18:37:41 2008 vi                           
 -rwxr-xr-x    32796 Wed Feb 20 18:44:14 2008 usleep                       
 -rwxr-xr-x    16884 Wed Feb 20 17:47:23 2008 uname
...


Seems that I only had problems generating and/or flashing the JFFS2 images. I 
now mounted the mtd partitions in Linux and generated the JFFS2 fs via "mount" 
and copied the files to it. This worked in both cases, NOR and NAND. So it 
seems that the common JFFS2/MTDPARTS framework is working correctly.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================


More information about the U-Boot mailing list