[U-Boot] [U-Boot-Users] Boot from Jffs2 filesystem problem

Detlev Zundel dzu at denx.de
Thu Sep 4 13:51:21 CEST 2008


Hi Pedro,

the SourceForge mailing list is deprecated, please use the one at
lists.denx.de.

[This time, the new address is correct]

> The u-boot version I'm using is 1.3.1 (self compiled) and Linux Kernel 2.6.23.1.
>
> It is possible to boot it with a stored kernel uImage and the oftree in the flash using a nfs filesystem, 
> but I can't not boot it using the jffs2 image.
> I've read a lot of documentation from denx.de and this is my configuration at the moment:
>
> mtdparts=mtdparts=TQM5200-0:512k(uboot),256k(environment),3328k(kernel),20m(jffs2),256k(oftree)
> bootargs_mtd=setenv bootargs ${bootargs} ${mtdparts}
> bootargs_flash=setenv bootargs ${bootargs} root=/dev/mtdblock4 rw rootfstype=jffs2 
> (even tried with root=/dev/mtdblock3, I'm not sure if 0 counts or not)
> bootargs_base=setenv bootargs console=ttyPSC0,115200
> bootcmd_flash=run bootargs_base bootargs_flash bootargs_mtd;bootm fC0C0000 – fD800000
>
> I've defined the partitions myself and double checked the numbers, first myself, then using the mtdparts command. 
> The kernel image, oftree, and jffs2 filesystem are stored in the flash. 
> The problem comes at booting. Even when "root=/dev/mtdblock4 rw rootfstype=jffs2" is passed to the kernel, 
> it always tries to boot from a Ramdisk image.  This is the output when I run bootcmd_flash command:
>
> => run bootcmd_flash
> ## Booting image at fc0c0000 ...
>    Image Name:   Linux-2.6.23.1-rt5-pcm030-1trunk
>    Created:      2008-09-02  11:48:23 UTC
>    Image Type:   PowerPC Linux Kernel Image (gzip compressed)
>    Data Size:    1534856 Bytes =  1.5 MB
>    Load Address: 00000000
>    Entry Point:  00000000
>    Verifying Checksum ... OK
>    Uncompressing Kernel Image ... OK
> ## Loading RAMDisk Image at 00000000 ...
> Bad Magic Number
>
> It seems to me that U-boot is trying to boot from RAMDisk instead of booting the kernel, but I'm not sure.

Yes, indeed.  It looks like the "bootm fc0c0000 - fd800000" is not
evaluated properly.  In v1.3.1 code the code lines were
(common/cmd_bootm.c:622)

#if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
        /* Look for a '-' which indicates to ignore the ramdisk argument
        */
        if (argc >= 3 && strcmp(argv[2], "-") ==  0) {
                        debug ("Skipping initrd\n");
                        len = data = 0;
                }
        else
#endif

So The upstream v1.3.1 config for TQM5200 also has CONFIG_OF_LIBFDT
defined:

$ git-show v1.3.1:include/configs/TQM5200.h | grep CONFIG_OF_LIBFDT
#define CONFIG_OF_LIBFDT         1

So if you did not change that, my last explanation is that you have
hidden escape characters in the definition of bootcmd_flash.  Check with
'md' on the environment sectors to find out.

Cheers
  Detlev

-- 
Shin: a device for finding furniture in the dark.
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de


More information about the U-Boot mailing list