2009-09-15 16:24:05     problem booting linux kernel on BF561. Cannot mount root fs

Document created by Aaronwu Employee on Aug 19, 2013
Version 1Show Document
  • View in full screen mode

2009-09-15 16:24:05     problem booting linux kernel on BF561. Cannot mount root fs

Mario Valenta (UNITED STATES)

Message: 79947   

 

transferred linux kernel file (ELF) over UART to BF561EZkit using c-kermit.

 

boot board, get to u-boot screen.

 

typed "bootelf" and get this output:

 

U-Boot 2008.10 (ADI-2009R1-rc3) (Jul 16 2009 - 18:03:27)

 

CPU:   ADSP bf561-0.3 (Detected Rev: 0.5) (bypass boot)

Board: ADI BF561 EZ-Kit Lite board

       Support:   blackfin.uclinux.org/

Clock: VCO: 600 MHz, Core: 600 MHz, System: 100 MHz

RAM:   64 MB

Flash:  8 MB

In:    serial

Out:   serial

Err:   serial

Net:   Hit any key to stop autoboot:  0

bfin> print bootargs

bootargs=root=/dev/mtdblock0 rw clkin_hz=30000000 earlyprintk=serial,uart0,57600 console=ttyBF0,57600

bfin> set bootargs 'root=/dev/mtdblock1 rw clkin_hz=30000000 earlyprintk=serial,uart0,57600 console=ttyBF0,57600'<INTERRUPT>

bfin> set bootargs root=/dev/mtdblock1 rw clkin_hz=30000000 earlyprintk=serial,uart0,57600 console=ttyBF0,57600<INTERRUPT>

bfin> set bootargs 'root=/dev/mtdblock2 rw clkin_hz=30000000 earlyprintk=serial,uart0,57600 console=ttyBF0,57600'

bfin> print bootargs

bootargs=root=/dev/mtdblock2 rw clkin_hz=30000000 earlyprintk=serial,uart0,57600 console=ttyBF0,57600

bfin> bootelf

Loading phdr 0 to 0x00001000 (1238484 bytes)

Loading phdr 1 to 0x00130000 (157746 bytes)

Loading phdr 2 to 0x00156832 (7768 bytes)

Loading phdr 3 to 0x0015868a (192 bytes)

Loading phdr 4 to 0x00159000 (0 bytes)

## Starting application at 0x00140000 ...�Linux version 2.6.22.19-ADI-2008R1.5-svn (mario@karma-ii) (gcc version 4.1.2 (ADI svn)) #1 Tue Sep 15 12:08:22 EDT 2009

Hardware Trace Active and Enabled

Warning: limiting memory to 56MB due to hardware anomaly 05000263

Blackfin support (C) 2004-2007 Analog Devices, Inc.

Compiled for ADSP-BF561 Rev 0.3

Warning: Compiled for Rev 3, but running on Rev 5

Blackfin Linux support by   blackfin.uclinux.org/

Processor Speed: 600 MHz core clock and 100 MHz System Clock

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  text      = 0x00001000-0x000ebc90

  rodata    = 0x000ec000-0x0012f5d4

  data      = 0x00130000-0x00140000

    stack   = 0x00130000-0x00132000

  init      = 0x00140000-0x00159000

  bss       = 0x00159000-0x00168590

  available = 0x00168590-0x037ff000

  DMA Zone  = 0x03f00000-0x04000000

NOMPU: setting up cplb tables for global access

Instruction Cache Enabled

Data Cache Enabled (write-through)

Built 1 zonelists.  Total pages: 14224

Kernel command line:

Configuring Blackfin Priority Driven Interrupts

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 available: 55320k/65536k RAM, (100k init code, 939k kernel code, 398k data, 1024k dma, 7756k reserved)

Blackfin Scratchpad data SRAM: 4 KB

Blackfin Data A SRAM: 16 KB (15 KB free)

Blackfin Data B SRAM: 16 KB (16 KB free)

Blackfin Instruction SRAM: 16 KB (8 KB free)

Security Framework v1.0.0 initialized

Mount-cache hash table entries: 512

NET: Registered protocol family 16

Blackfin GPIO Controller

Blackfin DMA Controller

ezkit_init(): registering device resources

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

BF561 Core B driver v0.1 initialized.

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler cfq registered

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

Serial: Blackfin serial driver

bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 35) is a BFIN-UART

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize

smc91x: not found (-19).

bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, regs_base@ffc00500, dma channel@16

TCP cubic registered

NET: Registered protocol family 1

NET: Registered protocol family 17

List of all partitions:

No filesystem could mount root, tried:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

 

 

from some searching thru forums for similar problems, one suggestion was to modify the boot args to have fs mount on a different block.

 

so by default, the 'print bootargs' command returns:

 

bootargs=root=/dev/mtdblock0 rw clkin_hz=30000000 earlyprintk=serial,uart0,57600 console=ttyBF0,57600

 

i tried modifying the root to be /dev/mtdblock1 and also /dev/mtdblock2, both fail to boot with similar kernel panic errors, which is probably becasue the program output doenst mention even creating a partition

 

BTW the flash on the BF561EZKit is a 64mbit flash made by ST micro.

 

Do I have to configure u-boot/uclinux to manually choose partitions (ie boot, kernel, root fs) or are they created automatically?

QuoteReplyEditDelete

 

 

2009-09-15 16:31:19     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mike Frysinger (UNITED STATES)

Message: 79948   

 

like the docs say, do not use Linux ELF's to boot the kernel.  use the uImage.

QuoteReplyEditDelete

 

 

2009-09-15 16:38:45     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mario Valenta (UNITED STATES)

Message: 79949   

 

i did not find this doc you speak of.  closest one i found is this one:

 

  docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:booting_methods

 

 

 

however, it doesn't mention uImage.  is uImage a pre-compiled kernel available for download?  Or is it compiled on my host machine using an option switch to change output to uImage instead of the default ELF file?

QuoteReplyEditDelete

 

 

2009-09-15 16:45:55     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mario Valenta (UNITED STATES)

Message: 79950   

 

I missed where it says you cannot boot from an ELF.

 

doc (link above) says:

 

Here are just some of the applications U-Boot can boot.

 

    Bootable U-Boot Images - can contain any executable code

    ELFs - arbitrary Blackfin Executable and Linking Format files

    LDRs - arbitrary Blackfin Loader files

 

The common types of ELFs that you will see that are known to work:

 

    Linux kernel

    U-Boot stand alone application

    Bare metal application

 

 

 

what i was trying to boot was a linux kernel.  and i see now that uimage == u-boot image.  I missed that the first time reading thru docs

QuoteReplyEditDelete

 

 

2009-09-15 16:52:20     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mike Frysinger (UNITED STATES)

Message: 79951   

 

i didnt say you cant boot an ELF.  i said dont boot a Linux kernel ELF.

QuoteReplyEditDelete

 

 

2009-09-15 17:07:23     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mario Valenta (UNITED STATES)

Message: 79957   

 

my mistake.  What I meant to say was that I did not see anywhere in the docs where it suggests to NOT Linux ELF's to boot the kernel. 

 

This may be common knowledge to most experienced developers here but for guys like me just getting our feet wet with this stuff, this is important things to know and shoudl be added to the docs (if it isn't already)

QuoteReplyEditDelete

 

 

2009-09-15 17:19:54     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mike Frysinger (UNITED STATES)

Message: 79958   

 

all of the examples show booting of uImages.  i dont know why you think you want to boot the kernel ELF.

QuoteReplyEditDelete

 

 

2009-09-15 17:28:19     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mario Valenta (UNITED STATES)

Message: 79959   

 

looks like I'll need a uimage for the linux kernel then... 

 

this doc:

 

  docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:uimage

 

 

 

says:

 

"Normally you do not need to create a boot image yourself as the uClinux-dist and Linux kernel will generate appropriate images for you. But in case you need to, the command to use is called mkimage. You can either find this with the toolchain (just add the corresponding bfin-… prefix), or you can find it in the U-Boot source directory in the tools folder."

 

first off, there is no /images folder in my distro

 

mario@karma-ii:~/blackfin/uClinux-dist-2008R1.5-RC3$ ls

autoconf.h  config.arch    freeswan     openswan       staging     vendors

bfin_patch  config.in      lib          README         testsuites

bin         COPYING        linux-2.6.x  release_notes  tools

config      Documentation  Makefile     SOURCE         user

mario@karma-ii:~/blackfin/uClinux-dist-2008R1.5-RC3$

 

 

 

so i do not have any images already compiled.   great, no biggie.. docs say I can use mkimage..

 

now, i do not have mkimage on my system, or bfin-... mkimage either.  I also do not apper to have a u-boot source directory in the tools folder either as the doc suggests.

 

i'm 0-for-3.  I appear to be out of sync with respect to the documentation for some reason.

QuoteReplyEditDelete

 

 

2009-09-15 17:33:44     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mario Valenta (UNITED STATES)

Message: 79960   

 

all of the examples show booting of uImages.  i dont know why you think you want to boot the kernel ELF.

 

---

 

 

 

probably because I'm (admittedly) an inexperienced noob.  I'm trying to learn how to do this and for someone like me new to linux AND embedded development this is a steep learning curve. 

 

when I sawthis:

 

The common types of ELFs that you will see that are known to work:

 

    Linux kernel

 

i interpreted that as, "ok i just recompiled my kernel, it generated an ELF file called 'linux'.  I should be able to boot this now".

 

I'm trying to learn as I go and I appreciate your patience with my questions, even if they seem ridiculous to you.

QuoteReplyEditDelete

 

 

2009-09-15 22:05:13     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mike Frysinger (UNITED STATES)

Message: 79963   

 

there isnt going to be an images folder if you havent actually compiled the code

 

like the docs say, and like you quoted, there is no need for you to create your own uImage from a kernel ELF.  use the one already generated for you.

QuoteReplyEditDelete

 

 

2009-09-15 22:06:12     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mike Frysinger (UNITED STATES)

Message: 79964   

 

ive updated that line to tell people to not use the ELF.  while it may work (if you know what you're doing), most people should just use the uImage.

QuoteReplyEditDelete

 

 

2009-09-16 09:28:37     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mario Valenta (UNITED STATES)

Message: 80018   

 

the only files in my /uClinux-dist-2008R1.5-RC3/linux-2.6.x/ directory that seem to be suitable are:

 

vmlinux ('file vmlinux' reports: vmlinux: ELF 32-bit LSB executable, Analog Devices Blackfin, version 1 (SYSV), statically linked, not stripped)   so this is an ELF file

 

and

 

linux ('file linux' reports: linux: ELF 32-bit LSB executable, Analog Devices Blackfin, version 1 (SYSV), statically linked, not stripped).  so this is also an ELF file.

 

as mentioned I do not have an images folder, even when i compiled the kernel manually (only the two abovementioned files were created)

 

So the two files generated for me I can't use because they are ELFs.  Do I have to download the precompiled images separately?  Or did I compile the kernel incorrectly?

QuoteReplyEditDelete

 

 

2009-09-16 11:32:00     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mike Frysinger (UNITED STATES)

Message: 80021   

 

if you're compiling the kernel manually, then you should read the `make help` like every other kernel arch.  which means you can find the bootable images in arch/$arch/boot/ like every other kernel arch.  which means you should be using arch/blackfin/boot/vmImage.

QuoteReplyEditDelete

 

 

2009-09-16 13:24:04     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mario Valenta (UNITED STATES)

Message: 80025   

 

that path worked - I have the image file now and will try to load the compressed .gz version later.

 

Note that I could not find this precious information in the uClinux-dist-2008R1.5-RC3/linux-2.6.x/README or in the uClinux-dist-2008R1.5-RC3/linux-2.6.x/Documentation directory.  I was looking for some 'make' or similar help/doc file, to no avail.  so, to save myself future embarrassment, where would this 'make help'  info be found for kernels (in general)?

QuoteReplyEditDelete

 

 

2009-09-16 13:38:14     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mike Frysinger (UNITED STATES)

Message: 80026   

 

the vmImage is gzipped compressed already

 

did you run `make help` ?

QuoteReplyEditDelete

 

 

2009-09-16 13:46:58     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mario Valenta (UNITED STATES)

Message: 80028   

 

yep, tried that.

 

mario@karma-ii:~$ make help

 

make: *** No rule to make target `help'.  Stop.

 

 

 

also tried this

 

mario@karma-ii:~$ 'make help'

bash: make help: command not found

mario@karma-ii:~$

QuoteReplyEditDelete

 

 

2009-09-16 14:12:25     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mike Frysinger (UNITED STATES)

Message: 80029   

 

presumably you're in your home dir and not the kernel tree.  `make` cant guess at where you should be.

QuoteReplyEditDelete

 

 

2009-09-17 10:34:26     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mario Valenta (UNITED STATES)

Message: 80083   

 

ok 'make help' works from within blackfin/uClinux-dist-2008R1.5-RC3/linux-2.6.x/ directory.   I had tried it in blackfin/uClinux-dist-2008R1.5-RC3 with no success.

 

thanks for clearing that up.

QuoteReplyEditDelete

 

 

2009-09-17 11:00:06     Re: problem booting linux kernel on BF561. Cannot mount root fs

Mario Valenta (UNITED STATES)

Message: 80084   

 

I am able to boot linux on my 561EZkit board now using the "uImage_BF561-EZKIT" file downloaded from the file area. 

Attachments

    Outcomes