2008-07-11 22:26:18     hanging while booting the kernel on custom board

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

2008-07-11 22:26:18     hanging while booting the kernel on custom board

Bo Zhuang (CANADA)

Message: 58707   

 

Hi guys,

 

I have downloaded the kernel uImage file (uImage.initramfs) and run using bootm on our custom board.

 

I got:

 

bfin> bootm

## Booting image at 01000000 ...

Image Name: Linux-2.6.22.19-ADI-2008R1-svn

Created: 2005-04-12 19:53:31 UTC

Image Type: Blackfin Linux Kernel Image (gzip compressed)

Data Size: 4642440 Bytes = 4.4 MB

Load Address: 00001000

Entry Point: 001d0000

Verifying Checksum ... OK

Uncompressing Kernel Image ... OK

Starting Kernel at = 001d000

 

and hangs.

 

Any insight on this?

 

Thanks.

QuoteReplyEditDelete

 

 

2008-07-12 01:14:29     Re: hanging while booting the kernel on custom board

Robin Getz (UNITED STATES)

Message: 58709   

 

Bo:

 

Have a peek at:

 

https://docs.blackfin.uclinux.org/doku.php?id=post_mortem

 

-Robin

QuoteReplyEditDelete

 

 

2008-07-12 07:24:31     Re: hanging while booting the kernel on custom board

Jian Ju (HONG KONG)

Message: 58722   

 

Hi Bo,

 

Have you change the board parittion in corresponding kernel file (stamp.c)? Your kernel starting addr seems different from the stamp board. Also it's a good idea to use tftp to test your kernel image first.

 

Good luck,

 

JJ

TranslateQuoteReplyEditDelete

 

 

2008-07-15 04:14:09     Re: hanging while booting the kernel on custom board

Mike Frysinger (UNITED STATES)

Message: 58814   

 

the start address looks correct to me ... its exact value may shift depending on what kernel options you've enabled in the kernel, so comparing it exactly to another board will largely be meaningless.

QuoteReplyEditDelete

 

 

2008-07-15 15:09:30     Re: hanging while booting the kernel on custom board

Bo Zhuang (CANADA)

Message: 58866   

 

Thanks Robin, I've been able to check the log file. I found my problem is due to the wrong setting of the UART. I'm using the UART3, while the kernel sets to UART1.

 

However, when I tried to change it in the menuconfig -> Device drivers -> Character drivers -> Serial drivers -> Enable UART3, the defconfig still says: "#CONFIG_SERIAL_BFIN_UART1=y" and "#CONFIG_SERIAL_BFIN_UART3 is not set". Any other step is needed to change to UART3? Can I use UART3 to talk to the host if our board is designed for that?

 

Thanks.

 

Bo

QuoteReplyEditDelete

 

 

2008-07-15 16:30:18     Re: hanging while booting the kernel on custom board

Robin Getz (UNITED STATES)

Message: 58869   

 

Bo:

 

Which defconfig are you looking at? the only that matters is the ./linux-2.6.x/.config file.

 

-Robin

QuoteReplyEditDelete

 

 

2008-07-15 20:48:56     Re: hanging while booting the kernel on custom board

Mike Frysinger (UNITED STATES)

Message: 58880   

 

the defconfig does not matter ... it is simply that: a default config

 

look at linux-2.6.x/.config to see what settings are being used

QuoteReplyEditDelete

 

 

2008-07-15 20:49:56     Re: hanging while booting the kernel on custom board

Bo Zhuang (CANADA)

Message: 58882   

 

Hi Robin,

 

I have made sure that the UART is configured to 3. While the kernel still says:" unable to open an initial console". Just to make sure, can we boot the kernel on blackfin using UART3?

 

Thanks,

 

Bo

QuoteReplyEditDelete

 

 

2008-07-15 22:17:23     Re: hanging while booting the kernel on custom board

Sonic Zhang (CHINA)

Message: 58888   

 

Did you set "console=/dev/ttyBF3" on the boot command line?

QuoteReplyEditDelete

 

 

2008-07-15 22:22:58     Re: hanging while booting the kernel on custom board

Mike Frysinger (UNITED STATES)

Message: 58889   

 

post the full kernel output

QuoteReplyEditDelete

 

 

2008-07-15 22:47:55     Re: hanging while booting the kernel on custom board

Bo Zhuang (CANADA)

Message: 58891   

 

Here is the full kernel output with ttyBF0. If I use the ttyBF3, it hangs in the "Starting Kernel at = 13a000".

 

## Booting image at 01000000 ...

   Image Name:   Linux-2.6.22.19-ADI-2008R1-svn

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    4116071 Bytes =  3.9 MB

   Load Address: 00001000

   Entry Point:  0013a000

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

Starting Kernel at = 13a000

Linux version 2.6.22.19-ADI-2008R1-svn (bozhuang@bozhuang-desktop) (gcc version 4.1.2 (ADI svn)) #157 Tue Jul 15 19:01:06 PDT 2008

Hardware Trace Active and Enabled

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

Compiled for ADSP-BF548 Rev 0.0

Warning: Compiled for Rev 0, but running on Rev 1

Blackfin Linux support by http://blackfin.uclinux.org/

Processor Speed: 400 MHz core clock and 133 MHz System Clock

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  text      = 0x00001000-0x000dcd20

  rodata    = 0x000dd000-0x001299fc

  data      = 0x0012a000-0x0013a000

    stack   = 0x0012a000-0x0012c000

  init      = 0x0013a000-0x00781000

  bss       = 0x00781000-0x0078ede4

  available = 0x0078ede4-0x03dff000

  DMA Zone  = 0x03e00000-0x04000000

Instruction Cache Enabled

Data Cache Enabled (write-through)

Built 1 zonelists.  Total pages: 15748

Kernel command line: console=ttyBF0,115200

Configuring Blackfin Priority Driven Interrupts

PID hash table entries: 256 (order: 8, 1024 bytes)

bfin-rtc: invalid date; resetting

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory available: 55168k/65536k RAM, (6428k init code, 879k kernel code, 428k data, 2048k dma, 584k reserved)

Blackfin Scratchpad data SRAM: 4 KB

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

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

Blackfin Instruction SRAM: 48 KB (42 KB free)

Security Framework v1.0.0 initialized

Mount-cache hash table entries: 512

Blackfin GPIO Controller

Blackfin DMA Controller

ezkit_init(): registering device resources

SCSI subsystem initialized

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler cfq registered

bfin-otp: initialized

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

Serial: Blackfin serial driver

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

register bfin atapi driver

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

i2c /dev entries driver

rtc-bfin rtc-bfin: setting the system clock to 2057-08-11 05:18:01 (2764732681)

Freeing unused kernel memory: 6428k freed

Warning: unable to open an initial console.

 

 

(hang here)

 

Thanks.

 

Bo

QuoteReplyEditDelete

 

 

2008-07-15 23:07:04     Re: hanging while booting the kernel on custom board

Bo Zhuang (CANADA)

Message: 58892   

 

Hi Sonic,

 

ttyBF3 is not in my device.txt. Should I add it? Or should I link the ttyBF3 to ttyS0 with: ln -s ttyBF0 /dev/ttyS0 to make it work?

 

Thanks,

 

Bo

QuoteReplyEditDelete

 

 

2008-07-15 23:19:15     Re: hanging while booting the kernel on custom board

Mike Frysinger (UNITED STATES)

Message: 58893   

 

linking random files to incorrect devices doesnt solve things.  ttyS0 is not for any Blackfin UART.

 

from the linux perspective, the # in ttyBF# represents the UARTs that are enabled, not the UARTs that exist.  in other words, if you only enabled UART3, then ttyBF0 represents UART3.  if you enabled UART0 and UART3, then ttyBF0 represents UART0 and ttyBF1 represents UART3.

QuoteReplyEditDelete

 

 

2008-07-16 02:42:11     Re: hanging while booting the kernel on custom board

Bo Zhuang (CANADA)

Message: 58900   

 

Hi Mike,

 

I only enabled UART3, thus ttyBF0 should be the one. Any reason why it still doesn't work?

 

Thanks,

 

Bo

QuoteReplyEditDelete

 

 

2008-07-16 07:22:35     Re: hanging while booting the kernel on custom board

Mike Frysinger (UNITED STATES)

Message: 58942   

 

the console warning shows up when the /dev/console file is unable to be opened.  verify it exits in your root filesystem image.

QuoteReplyEditDelete

 

 

2008-07-16 12:55:51     Re: hanging while booting the kernel on custom board

Bo Zhuang (CANADA)

Message: 58966   

 

Hi Mike,

 

It exists. I found "nod /dev/console 600 0 0 c 5 1" in the rootfs.initramfs.contents file.

 

I think if it works, there should be a line like: "bfin-uart.3: ttyBF0 at MMIO 0xffc03100 (irq = xx) is a BFIN-UART" followed the "Serial: Blackfin serial driver" line showing during booting. But that line is not here now. Any reason?

 

btw: in the board file (the section shown below), shoud I select .id = 3 when using UART3?

 

static struct platform_device bfin_uart_device = {

    .name = "bfin-uart",

    .id = 1,

    .num_resources = ARRAY_SIZE(bfin_uart_resources),

    .resource = bfin_uart_resources,

};

 

Thanks,

 

Bo

 

QuoteReplyEditDelete

 

 

2008-07-16 16:32:25     Re: hanging while booting the kernel on custom board

Bo Zhuang (CANADA)

Message: 58971   

 

Hi Mike,

 

As you suggested, I enable both the UART1 and UART3 and then use ttyBF1 in the config file. In this case, it seems the UART3 works as shown in the following boot message:

 

SCSI subsystem initialized

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler cfq registered

bfin-otp: initialized

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

Serial: Blackfin serial driver

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

bfin-uart.1: ttyBF1 at MMIO 0xffc03100 (irq = 42) is a BFIN-UART

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

register bfin atapi driver

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

i2c /dev entries driver

rtc-bfin rtc-bfin: setting the system clock to 2057-08-11 05:18:01 (2764732681)

Freeing unused kernel memory: 6436k freed

 

However, it gets super slow after Freeing unused kernel memory (looks like hanging). For example, it took 5 hours to only show one fifth of the linux booting logo. It will take forever for the root:> to pop up. Is that related to UART3? The same code boots normally in EZKIT (with ttyBF0 (UART1)).

 

Thanks,

 

Bo

QuoteReplyEditDelete

 

 

2008-07-16 22:06:13     Re: hanging while booting the kernel on custom board

Mike Frysinger (UNITED STATES)

Message: 58983   

 

what kernel version are you using ?  there was a bug in the core kernel code that has since been fixed in svn

QuoteReplyEditDelete

 

 

2008-07-16 22:27:24     Re: hanging while booting the kernel on custom board

Bo Zhuang (CANADA)

Message: 58984   

 

Hi Mike,

 

I've been using Linux-2.6.22.19-ADI-2008R1-svn. Are there any important changes during the past two months in this branch?

 

Thanks,

 

Bo

 

 

QuoteReplyEditDelete

 

 

2008-07-17 02:46:22     Re: hanging while booting the kernel on custom board

Mike Frysinger (UNITED STATES)

Message: 58987   

 

are you actually using svn or are you using the 2008R1 release ?  if you're using svn, make sure you're using the latest svn version.

QuoteReplyEditDelete

 

 

2008-07-17 16:52:02     Re: hanging while booting the kernel on custom board

Bo Zhuang (CANADA)

Message: 59029   

 

Hi Mike,

 

I've tested the latest svn in "sources.blackfin.uclinux.org/uclinux-dist/branches/2008R1" and it still gets almost a hang after the console has been openned (after freeing unused kernel memory and before the linux logo). Does this mean UART3 can't be used to boot the kernel or there is something wrong in the board design?

 

Thanks,

 

Bo

QuoteReplyEditDelete

 

 

2008-07-18 03:57:22     Re: hanging while booting the kernel on custom board

Mike Frysinger (UNITED STATES)

Message: 59058   

 

please update your svn checkout to the latest ... i found one bug which occurs when using just UART3, but it should be OK now

QuoteReplyEditDelete

 

 

2008-07-18 18:47:15     Re: hanging while booting the kernel on custom board

Bo Zhuang (CANADA)

Message: 59098   

 

Hi Mike,

 

I've updated to the latest svn version (sources.blackfin.uclinux/org/uClinux-dist/branches/2008R1/) and it seems still not working. When I only enable UART3 (with ttyBF0), the booting message says cannot open the console. If I enable both UART1 and UART3 (with ttyBF1) or enable all UARTS (0,1,2,3 with ttyBF3), it doesn't have the error message but just hang after freeing unused kernel memory. We are kind of stuck in here. Please help us on this issue coz it's really critical for the success of the project.

 

Thanks,

 

Bo

QuoteReplyEditDelete

 

 

2008-07-20 22:16:06     Re: hanging while booting the kernel on custom board

Mike Frysinger (UNITED STATES)

Message: 59151   

 

make sure you're using the latest.  then make sure you're running the UART in DMA mode and not PIO (see the kernel config options).

 

if things are still not working (when only UART3 is enabled), then post the full kernel boot output.

QuoteReplyEditDelete

 

 

2008-07-21 14:47:58     Re: hanging while booting the kernel on custom board

Bo Zhuang (CANADA)

Message: 59157   

 

Hi Mike,

 

Woops. The kernel boots up fine in our board!!! Here is the only working configuration for my case: I have to (1) download today's svn, (2) enable both UART0 and UART3 (while selecting ttyBF1), and (3) use DMA UART mode to make it work. Only selecting UART3 and ttyBF0 don't work for my board. Anyway, thanks for the help! 

One issue left is that after booting, It says: init: /sbin/syslogd respawning too fast. Although it doesn't influence the kernel booting, may be there is a way to solve it?

 

Thanks a lot!

 

Bo

QuoteReplyEditDelete

 

 

2008-07-21 23:01:50     Re: hanging while booting the kernel on custom board

Mike Frysinger (UNITED STATES)

Message: 59169   

 

this is covered in the faq:

http://docs.blackfin.uclinux.org/doku.php?id=faq

QuoteReplyEditDelete

 

 

2008-08-07 12:57:23     Re: hanging while booting the kernel on custom board

Isaac Leung (CANADA)

Message: 60109   

 

I'm working with Bo on the same custom board.

 

We are finding that with that particular version of code that was download from SVN, we have no problem booting with the console on UART3 (it would be ttyBF1 since we need UART0 enabled as well, even though we don't use it).

 

However, with some later version of code from SVN (which contains a lot of nice fixes and other goodies that would be handy) we seem to be running into the same problem as before when Bo was using some older codebase. The last version I tried was the latest available as of Aug.6, 2008 (should be Revision 5113). Even though we are setting up the kernel config same as before, it is hanging on boot. The boot output on to the console is same as a kernel built using the previous revision (which does boot) and gets to just before the text Tux logo, but never (I'm not that patient, I only waited 15 minutes at max) gets to the command prompt.

 

Has there been any code which regressed due to some other bug that might be causing this issue?

 

 

 

 

 

Thanks,

 

Isaac

QuoteReplyEditDelete

 

 

2008-08-08 11:05:07     Re: hanging while booting the kernel on custom board

Mike Frysinger (UNITED STATES)

Message: 60178   

 

you're using the 2008R1 svn branch right ?  run `make bugreport` and post the tarball as an attachment so we can check out the configs and try to reproduce on our bf548-ezkits ...

Attachments

    Outcomes