"Starting kernel ..." Lock Up

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"Starting kernel ..." Lock Up

13,985 Views
PaulDeMetrotion
Senior Contributor I

Am in development of a custom i.MX6 single-board computer and have built a u-boot image and a Linux kernel. Everything works fine until the Linux attempts to boot using a micro-SD card. This is when I get the 'Starting kernel ...' message and then nothing. Using an emulator I have determined that I am stuck in a loop, but don't know why I got there.

Environment variables:

bootdelay=3
baudrate=115200
ipaddr=192.168.1.103
serverip=192.168.1.101
netmask=255.255.255.0
rd_loadaddr=(0x1300000)
netdev=eth0
ethprime=FEC0
uboot=u-boot.bin
kernel=uImage
nfsroot=/opt/eldk/arm
bootargs_base=setenv bootargs console=ttymxc0,115200
bootargs_nfs=setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp nfsroot=${serveri
p}:${nfsroot},v3,tcp
bootcmd_net=run bootargs_base bootargs_nfs; tftpboot ${loadaddr} ${kernel}; boot
m
ethact=FEC0
bootcmd=run bootcmd_mmc
bootargs_mmc=setenv bootargs ${bootargs} root=/dev/mmcblk0p1 rootwait rw
bootargs=console=ttymxc0,115200 root=/dev/mmcblk0p1 rootwait rw
bootcmd_mmc=run bootargs_base bootargs_mmc; mmc dev 0; mmc read ${loadaddr} 0x80
0 0x2000; bootm
loadaddr=0x10800000
stdin=serial
stdout=serial
stderr=serial

Environment size: 763/8188 bytes

Any debug suggestions would be appreciated.

Labels (2)
0 Kudos
15 Replies

1,822 Views
PaulDeMetrotion
Senior Contributor I

I was able to get past the "turn off boot console ttymxc0" message by adding the parameter keep_bootcon to the boot arguments. I now lock up at the printk message "Waiting for root device /dev/mmcblk0p1 ...". I am going to open a new thread to discuss this.

Concerning the memory settings I added the following code in the ltib/rpm/BUILD/u-boot-2009.08/board/freescale/mx6q_sbc35_c398/ flash_header.S file:

# 512 MB

#MXC_DCD_ITEM(58, MMDC_P0_BASE_ADDR + 0x040, 0x00000017)

#MXC_DCD_ITEM(59, MMDC_P0_BASE_ADDR + 0x000, 0x821A0000)

# 2 GB

MXC_DCD_ITEM(58, MMDC_P0_BASE_ADDR + 0x040, 0x00000047)

MXC_DCD_ITEM(59, MMDC_P0_BASE_ADDR + 0x000, 0x841A0000)

1,822 Views
wallyyeh
Contributor V

Oh my god..., Saved by this post twice!!

my boss told me to test i.mx6Q + 2G RAM 2 years ago... and today he just want me do it again.

really appreciated!

0 Kudos

1,822 Views
markusstelzhamm
Contributor I

Hi!

It seems that I'm facing the same problem as Paul. I've got the MX6Q-SABRELITE board.

I'm trying to boot my own kernel (with IPIPE patch and Xenomai, but I tried a "clean" one as well).

It's working well when I use kernel 3.0.35 but when I want to use kernel version 3.5.7 the system locks up after

"Starting kernel ..."

I have already enabled "early printk" but nothing changes.

Would be great if someone had an idea how to go on here.

greetz

Markus

0 Kudos

1,822 Views
PaulDeMetrotion
Senior Contributor I

I actually have this booting much further after resolving a few issues:

1. I had the wrong memory configuration for our 2GB DRAM configuration. I did not have access to any memory from 80000000-90000000h. After fixing this I booted a little further and stopped at the "Uncompressing linux... done, booting the kernel" message.

2. Within the kernel configuration menus generated by ltib, I navigated through System Type -> Freescale MXC Implementations and found that my kernel was being built for the Armadillo platform. I added my specific platform to the menu files so that it could be selected under the MXC Implementations menu.

3. I then created custom board files required in the rpm/BUILD/linux-3.0.35/arch/arm/mach-mx6 directory. These are extremely stripped down with very basic functionality. I then built the new uImage.

My linux now boots quite far and stops at a "turn off boot console ttymxc0" message. The kernel may be booting further but the console is being disabled and none of my video options are working yet.

So now my question is why is the console being disabled?

Hope this helps.

0 Kudos

1,822 Views
markusstelzhamm
Contributor I

As I'm quite new to this stuff...

Could you maybe describe more detailed where you changed those memory settings?

Do you think it will effect my system as I only have 1GB RAM?

thanks in advance

0 Kudos

1,822 Views
lily_zhang
NXP Employee
NXP Employee

Which uart is used for your console? Ensure "console" boot option setting is right.

0 Kudos

1,822 Views
PaulDeMetrotion
Senior Contributor I

I can provide a little more info. The boot fails on the last function call of start_kernel which is rest_init(). It appears that this is the kerenl's first attempt to switch to a new thread. The sequence of function calls is here:
start_kernel -> rest_init -> schedule -> __schedule -> context_switch -> switch_to ->

__switch_to -> ret_from_fork -> ret_slow_syscall -> restore_user_regs -> DataAbort vector

0 Kudos

1,822 Views
PaulDeMetrotion
Senior Contributor I

You asked for it and you go it!

U-Boot 2009.08 (Jan 15 2013 - 12:37:56)

CPU: Freescale i.MX6 family TO1.2 at 792 MHz
Temperature:   41 C, calibration data 0x5884c87d
mx6q pll1: 792MHz
mx6q pll2: 528MHz
mx6q pll3: 480MHz
mx6q pll8: 50MHz
ipg clock     : 66000000Hz
ipg per clock : 66000000Hz
uart clock    : 80000000Hz
cspi clock    : 60000000Hz
ahb clock     : 132000000Hz
axi clock   : 264000000Hz
emi_slow clock: 29333333Hz
ddr clock     : 528000000Hz
usdhc1 clock  : 198000000Hz
usdhc2 clock  : 198000000Hz
usdhc3 clock  : 198000000Hz
usdhc4 clock  : 198000000Hz
nfc clock     : 24000000Hz
Board: i.MX6Q-SBC-C398: unknown-board Board: 0x63012 [POR]
Boot Device: SD
I2C:   ready
DRAM:   2 GB
MMC:   FSL_USDHC: 0,FSL_USDHC: 1
In:    serial
Out:   serial
Err:   serial
Net:   got MAC address from IIM: 00:01:45:01:12:64
FEC0 [PRIME]
Hit any key to stop autoboot:  0
mmc0 is current device

MMC read: dev # 0, block # 2048, count 10240 ... 10240 blocks read: OK
## Booting kernel from Legacy Image at 10800000 ...
   Image Name:   Linux-3.0.35-1968-gd3f7f36
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3722840 Bytes =  3.6 MB
   Load Address: 10008000
   Entry Point:  10008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

0 Kudos

1,822 Views
fabio_estevam
NXP Employee
NXP Employee

It is hard to tell without knowing your board code in Linux and your hardware. Some suggestions:

- Make sure that U-boot passes the correct machine id for the kernel

- Try enabling low level debugging in the menuconfig to get more information of what is going on.

0 Kudos

1,822 Views
PaulDeMetrotion
Senior Contributor I

Where can I enable the low level debug?

0 Kudos

1,822 Views
jimmychan
NXP TechSupport
NXP TechSupport

The u-boot is board specific. Have you modify the u-boot base on your board accordingly? and the micro-sd on your board is dev0?

0 Kudos

1,822 Views
PaulDeMetrotion
Senior Contributor I

Yes, u-boot works fine on our device and the micro-SD is dev0. I have been digging deeper and found that the kernel is calling the panic function with a message of "Kernel panic - not syncing: Attempted to kill init!".

The cause of the kernel panic occurs when the function kernel_thread_helper is called from the function ret_slow_syscall. The assembly code is here:

8003CFA0 f10c0080   CPSID     i

8003CFA4 e5991000   LDR       R1,[R9]

8003CFA8 e31100ff   TST       R1,#000000ff

8003CFAC 1afffff0   BNE       8003cf74

8003CFB0 e59d1040   LDR       R1,[SP,#040]

8003CFB4 e5bde03c   LDR       LR,[SP,#03c]!

8003CFB8 e16ff001   MSR       SPSR_cxsf,R1

8003CFBC f57ff01f   CLREX    

8003CFC0 e95d7fff   LDMEA     SP,{R0-R12,SP,LR}^

8003CFC4 e1a00000   NOP      

8003CFC8 e28dd00c   ADD       SP,SP,#0000000c

8003CFCC e1b0f00e   MOVS      PC,LR                         --> This instruction causes panic

Have no idea why this is happening? I have been digging through the Kernel Configuration menus but haven't seen anything suspicious yet.

0 Kudos

1,822 Views
fabio_estevam
NXP Employee
NXP Employee

It would be helpful if you post the entire log (from U-boot to kernel)  so that we can better understand what is going on.

Regards,

Fabio Estevam

0 Kudos

1,822 Views
hemalgandhi
Contributor III

Hello,

Environment variables are not set correctly for SD as boot media.

Please set environment variable as shown below.( It is assumed that development board is I.MX6Dual/Quad)

1. Replace built u-boot-mx6q-sabresd.bin(rename u-boot.bin to built u-boot-mx6q-sabresd.bin)  , uImage and rootfs.tar.bz2 in

Mfgtools-Rel-L3.0.35_1.0.1_MX6Q_UPDATER\Profiles\MX6Q Linux Update\OS Firmware\files

2. Update the SD card as mentioned in the user guide chapter 6 using MFG tool. (i.MX_6Dual6Quad_SABRE-SD_Linux_User_Guide.pdf)

3. Boot the board  and press any key to enter it in to u-boot command prompt.

4. To use HDMI display, set the following environment variable on U-boot command.

  • setenv loadaddr 0x10800000
  • setenv bootargs_base 'setenv bootargs console=ttymxc0,115200'
  • setenv bootargs_mmc 'setenv bootargs ${bootargs} root=/dev/mmcblk1p1 rootwait rw video=mxcfb1:dev=ldb,LDB-XGA,if=RGB666 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24'
  • setenv bootcmd_mmc 'run bootargs_base bootargs_mmc;mmc dev 2;mmc read ${loadaddr} 0x800 0x2000;bootm'
  • saveenv
  • run bootcmd

5. Board will boot and ask for login. Enter root

6. It  prompts root@freescale ~$

Following link may help you.

https://community.freescale.com/message/310442#310442

Thanks,

Hemal

PicusTech Software.

0 Kudos

1,822 Views
PaulDeMetrotion
Senior Contributor I

Thanks for the reply Hemal. I am not using the Sabre SD board. We have developed our own custom iMX6Q board.

I would like to know how to set up our video which is HDMI and LVDS. What are the mxcfb0 and mxcfb1 entires? Where can I get info on how to set up the different environment variables for our specific device?

0 Kudos