Re: [U-Boot] uboot kernel rejects filesystem

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
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.

Hi Detlev,
On Tue, May 12, 2009 at 9:10 PM, Detlev Zundel dzu@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@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@candelatech.com *All bugs added by David S. Miller davem@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@denx.de

Dear Bharat Bhushan,
In message a29be8140905141245r10b62c47u3a27a28b93bdba19@mail.gmail.com you wrote:
u-b>mtdparts device nor0 <m25p80>, # parts =3D 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=3Dm25p80 mtdparts: mtdparts=m25p80:256k(boot),64k(boot_config),64k(board_config),2048k(kernel),4m(filesystem)
If this is what you want, you should let the kenrel know about that...
Log messages from kernel:
...
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
... but your kernel's boot arguments show no trace of any mtdparts= argument.
I am sure I am doing something wrong here.....? It is MIPS Architecture + Linux 2.6.28...
Indeed. You did not read what Detlev explained to you:
So if you have this support in your Linux configuration, you can pass
-------------------------------------------------------------^^^^^^^^^^^^
the whole "mtdpart=.." through the linux commandline. A nasty part here
----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Seems you also didn't read Detlev's PS:
PS: And please stop quoting the full text of the whole e-mail thread as this is considered to be impolite on mailing lists.
:-(
Best regards,
Wolfgang Denk

Hi Bharat,
I have modified in kernel for mtd support. in U_BOOT following is the info:
Apart from the things which Wolfgang pointed out - I do *not* see any MTD related info in your Linux kernel log. Are you sure yoiu have mtd support? For example when I boot a sequoia (440epx amcc) board, I see this:
1fc000000.nor_flash: Found 1 x16 devices at 0x0 in 16-bit bank Amd/Fujitsu Extended Query Table at 0x0040 1fc000000.nor_flash: CFI does not contain boot bank location. Assuming top. number of CFI chips: 1 cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. mtd: no closing ) found in partition name RedBoot partition parsing not available Creating 5 MTD partitions on "1fc000000.nor_flash": 0x000000000000-0x000000180000 : "kernel" 0x000000180000-0x000000380000 : "root" 0x000000380000-0x000003f20000 : "user" 0x000003f60000-0x000003fa0000 : "env" 0x000003fa0000-0x000004000000 : "u-boot"
So recheck your kernel configuration.
Cheers Detlev

Hi Detlev,
I have gone thru the kernel code. I could only figure out that m25p80 is spi driver which is register as spi-driver. Registration is done, which I could see from early printk's. But this module is never probed. Next, kernel iterates through the list of devices and tries to find out mtdpart, which it can not see. Since your mail gave very good pointer where to look for with ref to another nor flash.
Regards, Bharat
Seems I quoted text in previous mail which annoyed you. Sorry for being naive. I hope I will not repeat the same.

Hi Bharat,
I have gone thru the kernel code. I could only figure out that m25p80 is spi driver which is register as spi-driver.
Oh wow, an SPI NOR flash. In my opinion, this is a rare constellation, so you will probably need to debug MTD in Linux.
Registration is done, which I could see from early printk's. But this module is never probed. Next, kernel iterates through the list of devices and tries to find out mtdpart, which it can not see. Since your mail gave very good pointer where to look for with ref to another nor flash.
Ok, so the problem is really that the MTD layer does not know how to talk to your spi flash. I will not be of much help here, I'm afraid, so I'll advise to find a mailing list closer to the problem...
Seems I quoted text in previous mail which annoyed you. Sorry for being naive. I hope I will not repeat the same.
Well if one reads lots and lots of messages, it is basically important that everybody uses an e-mail style allowing efficient processing. There is a good FAQ on this:
http://www.netmeister.org/news/learn2quote.html
Cheers Detlev

Hi Detlev,
Seems there was an issue with my kernel code that you correctly pointed out in previous mail.
Now I could pass bootarg board='myboard'. For myboard, I have done relevent changes in kernel code, so kernel does init for my hardware. Earlier while choosing mips machine, it was choosing generic mips machine which did not mtdpartitions defined. Now with added support of myboard, everything seems to be good.
Thanks for the promptly helps you have given.
Regards, Bharat

Hi Bharat,
Seems there was an issue with my kernel code that you correctly pointed out in previous mail.
Now I could pass bootarg board='myboard'. For myboard, I have done relevent changes in kernel code, so kernel does init for my hardware. Earlier while choosing mips machine, it was choosing generic mips machine which did not mtdpartitions defined. Now with added support of myboard, everything seems to be good.
Excellent - congratulations.
Thanks for the promptly helps you have given.
One problem down, so many to go ;)
Cheers Detlev
participants (3)
-
Bharat Bhushan
-
Detlev Zundel
-
Wolfgang Denk