[U-Boot] uboot kernel rejects filesystem

Bharat Bhushan bharat.76 at gmail.com
Thu May 14 21:45:55 CEST 2009


Hi Detlev,

On Tue, May 12, 2009 at 9:10 PM, Detlev Zundel <dzu at denx.de> wrote:

> Hi Bharat,
>
> [re-adding the mailing list as others may also profit from the
> discussion]
>
> > Thank you for the prompt reply.
> >
> > Unfortunately in linux tree, my board specific MTD partition info is not
> > preset.
> >
> > Is there any quick way round.
>
> Yep - thinking some more, I see two possible (quick) solutions.
>
> > M/M Layout:
> > 0xBF000000 : U-BOOT
> > 0xBF040000 : u_boot_config_area
> > 0xBF060000: vm_linux_image (with u-boot header : created by mkimage and
> LZMA)
> > 0xBF260000: root_fs area... Here I have flashed squashfs (without u-boot
> hdr)
> > Should I?
> > 0xBFFC0000: root_fs_data .. JFFS RW filesystem
>
> Just as a sidenote - are you able to use the JFFS (really JFFS, not
> JFFS2?) image?  If so, then you _do_ have an MTD partition in Linux
> which you only need to tweak.
>
> > I do following on u-boot prompt
> >
> > board>bootm 0xBF060000 0xBF260000
>
> This command only makes sense, if the image at 0xbf260000 is wrapped
> with mkimage.  This is exactly the first solution that you can try,
> i.e. use mkimage with -T ramdisk to wrap your image and use the it with
> the two argument bootm version like you tried.  Maybe you will need to
> specify "rootfstype=squashfs" on the command line also, you will have to
> check this.
>
> Having said this, if you are on an ARM platform, the above will very
> likely not work, so you will have to turn to the other solution I have
> in mind:
>
> > NO SUCCESS
> > again I try:
> > with modification to
> > include/configs/my_board.h file as
> >
> > #define MTDIDS_DEFAULT "nor0=app"
> > #define MTDPARTS_DEFAULT \
> >     "mtdparts=app:64k(u-boot),64k(boot_config),64k(board_config),2048k
> > (kernel),13696(rootfs),256kb(roots_data)"
> > #define CONFIG_BOOTARGS "root=/dev/mtdblock4 rootfstype=squashfs console=
> > ttyS1,115200"
> >
> > board>bootm 0xbf060000
>
I have modified in kernel for mtd support. in U_BOOT following is the info:

u-b>flinfo
Bank # 1: 256x64K=16MB, Spansion SL25FL128P (0x012018)
u-b>mtdparts
device nor0 <m25p80>, # parts = 5
 #: name                        size            offset          mask_flags
 0: boot                0x00040000      0x00000000      0
 1: boot_config         0x00010000      0x00040000      0
 2: board_config        0x00010000      0x00050000      0
 3: kernel              0x00200000      0x00060000      0
 4: filesystem          0x00400000      0x00260000      0

active partition: nor0,0 - (boot) 0x00040000 @ 0x00000000

defaults:
mtdids  : nor0=m25p80
mtdparts:
mtdparts=m25p80:256k(boot),64k(boot_config),64k(board_config),2048k(kernel),4m(filesystem)

u-b>bootm 0xbf06000
Log messages from kernel:


## Booting kernel from Legacy Image at bf060000 ...
   Image Name:   MIPS OpenWrt Linux-2.6.28.9
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    767717 Bytes = 749.7 kB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum ... OK
## No init Ramdisk
   ramdisk start = 0x00000000, ramdisk end = 0x00000000
   Uncompressing Kernel Image ... OK
linux_argv[0]:<NULL>
linux_env a3f9c3c0
theKernel 80060000

Starting kernel ...

Linux version 2.6.28.9 (bharat at debian) (gcc version 4.1.2) #5 Thu May 14
22:15:40 IST 2009
console [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7161 rev 2 (id:0xaa), CPU:680.000 MHz, AHB:170.000 MHz,
DDR:340.000 MHz
Determined physical RAM map:
 memory: 04000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00004000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00004000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: root=/dev/mtdpart4 rootfstype=squashfs,yaffs,jffs2
noinitrd console=ttyS0,115200 init=/etc/preinit
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00001c10
Readback ErrCtl register=00001c10
PID hash table entries: 256 (order: 8, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 62120k/65536k available (1820k kernel code, 3340k reserved, 330k
data, 132k init, 0k highmem)
SLUB: Genslabs=6, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
Mount-cache hash table entries: 512
net_namespace: 480 bytes
NET: Registered protocol family 16
MIPS: machine is Generic AR71xx board
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 3.0 (2006/03/15) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
yaffs May 13 2009 12:26:38 Installing.
msgmni has been set to 121
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console handover: boot [early0] -> real [ttyS0]
Atheros AR71xx SPI Controller driver version 0.2.2
Atheros AR71xx hardware watchdog driver version 0.1.0
TCP vegas registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb at candelatech.com>
*All bugs added by David S. Miller <davem at redhat.com>
VFS: Cannot open root device "mtdpart4" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available
partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(0,0)
*


I am sure I am doing something wrong here.....? It is MIPS Architecture +
Linux 2.6.28...





>
>
> The "mtdparts" variable in U-Boot has no automagic connection to the
> Linux kernel.  It was designed however with connecting in Linux by using
> the following Linux config:
>
> drivers/mtd/Kconfig:106
>  "Device Drivers"
> config MTD_CMDLINE_PARTS
>        bool "Command line partition table parsing"
>        depends on MTD_PARTITIONS = "y" && MTD = "y"
>        ---help---
>          Allow generic configuration of the MTD partition tables via the
> kernel
>          command line. Multiple flash resources are supported for hardware
> where
>          different kinds of flash memory are available.
>
> So if you have this support in your Linux configuration, you can pass
> the whole "mtdpart=.." through the linux commandline.  A nasty part here
> is the beginning (you chose "app") of the configuration - as you will
> need to find what your kernel thinks the name of the flash chip is.
>
> > I think in second case it does make sense to pass mtdblock4 since my
> kernel
> > (;;) does not recognize it.
> >
> > Is there any work around like adding mtd table in linux kernel from uboot
> via
> > bootargs.
>
> Yes, like I stated above.
>
> Please try either method - if you are trying via MTD, be sure to include
> the contents of /proc/mtd and the relevant section of the Linux bootlog
> where the MTD layer registers in your next mail.
>
> Thanks
>  Detlev
>
> PS: And please stop quoting the full text of the whole e-mail thread as
>    this is considered to be impolite on mailing lists.
>
> --
> Each language has its purpose, however humble. Each language expresses
> the Yin and Yang of software. Each language has its place within the Tao.
>
> But do not program in COBOL if you can avoid it.
>                           -- The Tao of Programming
> --
> 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
>



-- 
Bharat


More information about the U-Boot mailing list