Linux won't boot on i.mx53 board

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

Linux won't boot on i.mx53 board

3,959 Views
ebike
Contributor I

Hi There,

I am having trouble getting the linux kernel to boot a custom board based on the ARD board.

I am not sure what text is outputted by the bootloader and what by the kernel starting up ..

Here is the output from the serial console:

Thanks,

Bernie

Mem Start= 1879048192 Mem Size= 268435456

## Booting kernel from Legacy Image at 70200000 ...

   Image Name:   linux-2.6

   Image Type:   ARM Linux Kernel Image (uncompressed)

   Data Size:    3430768 Bytes =  3.3 MB

   Load Address: 70200000

   Entry Point:  70200000

   Verifying Checksum ... OK

   XIP Kernel Image ... OK

OK

*** Just entered do_bootm_linux func ...

## Transferring control to Linux (at address 70200000) ...

*** Setup_start

*** hdr.tag: 54410001

*** hdr.size: 00000005

*** Setup_revison_tags

*** hdr.tag: 54410007

*** hdr.size: 00000003

*** revision: 00053121

*** Setup_memory_tags

*** 0 hdr.tag: 54410002

*** 0 hdr.size: 00000004

*** 0 u.mem.start: 70000000

*** 0 u.mem.size: 10000000

*** Setup_commandline_tags

*** hdr.tag: 54410009

*** hdr.size: 0000000b

*** cmdline: 70000138

Starting kernel ...

Ready to jump to OS ...

machid 00000bc2

boot_param 70000100

Labels (1)
0 Kudos
Reply
19 Replies

2,509 Views
ebike
Contributor I

Removing Watchdog config did not help ..

I wish there was some guide for configuring Linux for new hardware .. :smileysad:

0 Kudos
Reply

2,509 Views
lily_zhang
NXP Employee
NXP Employee

You can download "i.MX53 System Development User’s Guide" from Freescale i.MX web site. This document is targeted to software and hardware engineers who desire to port the i.MX53 board support package (BSP) to customer-specific products.

Regarding your dedicate question, i suggest that you check arch/arm/mach-mx5/board-mx53_ard.c and modify it for your hardware.

0 Kudos
Reply

2,509 Views
ebike
Contributor I

Thanks Xiaoli,

I put print statements in thge MX53_ard.c init function and found that when it was setting up IO Pin PADS that was when it was resetting .. disabled that code for now and my boot up progresses to the point below where it has just setup the USB ports .. then stops.

" "

[    2.601414] Creating 5 MTD partitions on "NAND 1GiB 3,3V 8-bit":

[    2.607466] 0x000000000000-0x000001000000 : "bootloader"

[    2.614455] 0x000001000000-0x000001500000 : "nand.kernel"

[    2.621218] 0x000001500000-0x000011500000 : "nand.rootfs"

[    2.628064] 0x000011500000-0x000021500000 : "nand.userfs1"

[    2.634818] 0x000021500000-0x000080000000 : "nand.userfs2"

[    2.642600] i.MX GPMI NFC

[    2.645740] FEC Ethernet Driver

[    2.649110] smsc911x: Driver version 2008-10-21.

[    2.653942] usbcore: registered new interface driver cdc_ether

[    2.659899] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

[    2.776351] fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller

[    2.782998] fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1

[    2.816280] fsl-ehci fsl-ehci.0: irq 18, io base 0x53f80000

[    2.836263] fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00

[    2.842779] hub 1-0:1.0: USB hub found

[    2.846603] hub 1-0:1.0: 1 port detected

[    2.956280] fsl-ehci fsl-ehci.1: Freescale On-Chip EHCI Host Controller

[    2.962938] fsl-ehci fsl-ehci.1: new USB bus registered, assigned bus number 2

[    2.996272] fsl-ehci fsl-ehci.1: irq 14, io base 0x53f80200

[    3.016258] fsl-ehci fsl-ehci.1: USB 2.0 started, EHCI 1.00

[    3.022677] hub 2-0:1.0: USB hub found

[    3.026494] hub 2-0:1.0: 1 port detected

Does anyone know how to debug further? I don't know what order the drivers come up in to see what is next that it is getting stuck on ..

0 Kudos
Reply

2,509 Views
lily_zhang
NXP Employee
NXP Employee

You can consider to check mx53_ard_board_init in mx53_ard.c. If you are not sure whether the devices are configured well, you can comment these device registers firstly. For example, remove “imx53_add_” functions.

The driver sequences into this function will decide the driver come-up sequences.

Best Regards

Lily Zhang

Freescale MPU Support

0 Kudos
Reply

2,509 Views
ebike
Contributor I

Hi Lily,

I only have a mx53_ard_io_init() function, not the ...board_init() one in that file.

I do have a mxc_board_init(), is this function what you mean? It has a lot of mxc_register_device() style initializations ..

Cheers,

Bernie

0 Kudos
Reply

2,509 Views
lily_zhang
NXP Employee
NXP Employee

We may see different version software. Yes. Please look into mxc_board_init file.

Best Regards

Lily Zhang

Freescale MPU Support

0 Kudos
Reply

2,509 Views
ebike
Contributor I

I had a look in that function and even put print() debug statements in that file ... I see the print() statements print out along time  before the sequence leading upto the USB init stuff ... i.e the debug print comes out around the 0.6sec mark of the init sequence, the USB init around 3sec.

So it looks like registering the drivers happens well before the drivers come up ... is that correct?

Cheers,

B.

0 Kudos
Reply

2,509 Views
lily_zhang
NXP Employee
NXP Employee

You can consider to remove USB register code firstly.

0 Kudos
Reply

2,509 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello,Bernie,

    Please check MACHINE ID in u-boot and linux if they are the same one.

in u-boot : u-boot/linux/include/asm/mach-type.h

#define MACH_TYPE_MX53_ARD             3010

in linux :

linux/arch/arm/tools/mach-types

mx53_ard  MACH_MX53_ARD  MX53_ARD  3010

When you compile linux kernel, maybe ID in kernel is different from that one in u-boot.

So please check it !

Regards,

Weidong

0 Kudos
Reply

2,509 Views
ebike
Contributor I

Hi Weidong,

Yes, I suspected the same, uboot is setup for the ARD board, but I do not know how to set the kernel

to the ARD board .... I have MACH_MX53_ARD set in the .config file (as well as many other MX53 boards) .

I now have further printing from the kernel:

Ready to jump to OS ...

machid 00000bc2

boot_param 70000100

Error: unrecognized/unsupported machine ID (r1 = 0x00000bc2).

Available machine support:

ID (hex)        NAME

ffffffff        Freescale i.MX53 (Device Tree Support)

ffffffff        ARM-Versatile Express

000008e0        ARM-Versatile Express

Please check your kernel config and/or bootloader.

I don't know where it is getting the ARM-Versatile-Express machine ID from?

Thanks,

Bernie

0 Kudos
Reply

2,509 Views
ebike
Contributor I

Actually I found I was compiling with a stale .config ... it's all good now .. except now I get a different issue, I get partway into the boot and the box resets ... see below for printout ..

Ready to jump to OS ...

machid 00000bc2

boot_param 70000100Uncompressing Linux... done, booting the kernel.

[    0.000000] Initializing cgroup subsys cpuset

[    0.000000] Initializing cgroup subsys cpu

[    0.000000] Linux version 2.6.35.3-imx3.6 (bmentink@bodhi-box) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #1 PREEMPT Fri Mar 8 07:51:30 NZDT 2013

[    0.000000] CPU: ARMv7 Processor [412fc085] revision 5 (ARMv7), cr=10c53c7f

[    0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache

[    0.000000] Machine: Freescale MX53 ARD Board

[    0.000000] Memory policy: ECC disabled, Data cache writeback

[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 56896

[    0.000000] Kernel command line: noinitrd console=ttymxc0,115200

[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)

[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)

[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)

[    0.000000] allocated 1146880 bytes of page_cgroup

[    0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups

[    0.000000] Memory: 224MB = 224MB total

[    0.000000] Memory: 215264k/215264k available, 14112k reserved, 0K highmem

[    0.000000] Virtual kernel memory layout:

[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)

[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)

[    0.000000]     DMA     : 0xf8e00000 - 0xffe00000   ( 112 MB)

[    0.000000]     vmalloc : 0x8e800000 - 0xf4000000   (1624 MB)

[    0.000000]     lowmem  : 0x80000000 - 0x8e000000   ( 224 MB)

[    0.000000]     pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)

[    0.000000]     modules : 0x7f000000 - 0x7fe00000   (  14 MB)

[    0.000000]       .init : 0x80008000 - 0x8003e000   ( 216 kB)

[    0.000000]       .text : 0x8003e000 - 0x809b7000   (9700 kB)

[    0.000000]       .data : 0x809e6000 - 0x80a4c140   ( 409 kB)

[    0.000000] SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

[    0.000000] Hierarchical RCU implementation.

[    0.000000] Verbose stalled-CPUs detection is disabled.

[    0.000000] NR_IRQS:368

[    0.000000] MXC GPIO hardware

[    0.000000] MXC IRQ initialized

[    0.000000] MXC_Early serial console at MMIO 0x53fbc000 (options '115200')

[    0.000000] bootconsole [ttymxc0] enabled

[    0.000000] Console: colour dummy device 80x30

[    0.348011] Calibrating delay loop... 799.53 BogoMIPS (lpj=3997696)

[    0.576254] pid_max: default: 32768 minimum: 301

[    0.580931] Security Framework initialized

[    0.585065] Smack:  Initializing.

[    0.588415] Mount-cache hash table entries: 512

[    0.593320] Initializing cgroup subsys cpuacct

[    0.597811] Initializing cgroup subsys memory

[    0.602201] Initializing cgroup subsys devices

[    0.606659] Initializing cgroup subsys freezer

[    0.611170] CPU: Testing write buffer coherency: ok

[    0.616741] devtmpfs: initialized

[    0.624808] regulator: core version 0.5

[    0.628826] NET: Registered protocol family 16

[    0.633404] i.MX IRAM pool: 128 KB@0x8e840000

[    0.637847] IRAM READY

[    0.640642] CPU is i.MX53 Revision 2.1

[    0.644430] MX53 ARD board

Is there some setup regarding the ARD board that my custom board does not like perhaps? The ram layout is the same though ..

0 Kudos
Reply

2,509 Views
fabio_estevam
NXP Employee
NXP Employee

Which bootloader are you using?

Does it tell you the cause of resets? Is it a watchdog reset?

0 Kudos
Reply

2,509 Views
ebike
Contributor I

Hi Fabio,

No idea what is causing the reset ... I will have a look in the kernel configs and turn off any watchdog code, just in case ..

I am using uboot ...

Cheers,

B

0 Kudos
Reply

2,509 Views
fabio_estevam
NXP Employee
NXP Employee

Which U-boot version? Can you share the full log (since U-boot starts, until the reboot)?

0 Kudos
Reply

2,509 Views
ebike
Contributor I

Hi Fabio,

Full printout is below however, the 1st part of the serial port text is garbled, so can only give a partial printout, i.e from NAND setup ..

NAND:  Manufacturer      : Samsung (0xec)

Device Code       : 0xd3

Cell Technology   : SLC

Chip Size         : 1 GiB

Pages per Block   : 64

Page Geometry     : 2048+64

ECC Strength      : 4 bits

ECC Size          : 512 B

Data Setup Time   : 25 ns

Data Hold Time    : 15 ns

Address Setup Time: 35 ns

GPMI Sample Delay : 6 ns

tREA              : Unknown

tRLOH             : Unknown

tRHOH             : Unknown

Description       : K9K8G08UXM, K9NBG08U5A, K9WAG08U1A

Bad block table found at page 1048512, version 0x01

Bad block table found at page 1048448, version 0x01

nand_read_bbt: Bad block at 0x00003d280000

nand_read_bbt: Bad block at 0x000053ca0000

nand_read_bbt: Bad block at 0x00006ea40000

nand_read_bbt: Bad block at 0x000074a60000

2048 MiB

MMC:   FSL_ESDHC: 0,FSL_ESDHC: 1

In:    serial

Out:   serial

Err:   serial

Net:   MAC address not programmed, using default value: 7c:6f:06:01:60:91

FEC0 [PRIME]

Hit any key to stop autoboot:  3     0

Uboot.Nand.mx53_Mamaku > run linux

Configures yaffs mount boot_disk: dev 0 start block 64, end block 575 using inband tags

Mounting yaffs2 mount point boot_disk

Copy /boot_disk/uImage to 0x70008000... [DONE]

Mem Start= 1879048192 Mem Size= 268435456

## Booting kernel from Legacy Image at 70008000 ...

   Image Name:   IMX53-ARD

   Image Type:   ARM Linux Kernel Image (uncompressed)

   Data Size:    3822520 Bytes =  3.6 MB

   Load Address: 70200000

   Entry Point:  70200000

   Verifying Checksum ... OK

   Loading Kernel Image ... OK

OK

*** Just entered do_bootm_linux func ...

## Transferring control to Linux (at address 70200000) ...

*** Setup_start

*** hdr.tag: 54410001

*** hdr.size: 00000005

*** Setup_revison_tags

*** hdr.tag: 54410007

*** hdr.size: 00000003

*** revision: 00053121

*** Setup_memory_tags

*** 0 hdr.tag: 54410002

*** 0 hdr.size: 00000004

*** 0 u.mem.start: 70000000

*** 0 u.mem.size: 10000000

*** Setup_commandline_tags

*** hdr.tag: 54410009

*** hdr.size: 0000000b

*** cmdline: 70000138

Starting kernel ...

Ready to jump to OS ...

machid 00000bc2

boot_param 70000100Uncompressing Linux... done, booting the kernel.

[    0.000000] Initializing cgroup subsys cpuset

[    0.000000] Initializing cgroup subsys cpu

[    0.000000] Linux version 2.6.35.3-imx3.7 (bmentink@bodhi-box) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #1 PREEMPT Fri Mar 8 12:43:01 NZDT 2013

[    0.000000] CPU: ARMv7 Processor [412fc085] revision 5 (ARMv7), cr=10c53c7f

[    0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache

[    0.000000] Machine: Freescale MX53 ARD Board

[    0.000000] Memory policy: ECC disabled, Data cache writeback

[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 56896

[    0.000000] Kernel command line: noinitrd console=ttymxc0,115200

[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)

[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)

[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)

[    0.000000] allocated 1146880 bytes of page_cgroup

[    0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups

[    0.000000] Memory: 224MB = 224MB total

[    0.000000] Memory: 215264k/215264k available, 14112k reserved, 0K highmem

[    0.000000] Virtual kernel memory layout:

[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)

[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)

[    0.000000]     DMA     : 0xf8e00000 - 0xffe00000   ( 112 MB)

[    0.000000]     vmalloc : 0x8e800000 - 0xf4000000   (1624 MB)

[    0.000000]     lowmem  : 0x80000000 - 0x8e000000   ( 224 MB)

[    0.000000]     pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)

[    0.000000]     modules : 0x7f000000 - 0x7fe00000   (  14 MB)

[    0.000000]       .init : 0x80008000 - 0x8003e000   ( 216 kB)

[    0.000000]       .text : 0x8003e000 - 0x809b8000   (9704 kB)

[    0.000000]       .data : 0x809e6000 - 0x80a4c140   ( 409 kB)

[    0.000000] SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

[    0.000000] Hierarchical RCU implementation.

[    0.000000] Verbose stalled-CPUs detection is disabled.

[    0.000000] NR_IRQS:368

[    0.000000] MXC GPIO hardware

[    0.000000] MXC IRQ initialized

[    0.000000] MXC_Early serial console at MMIO 0x53fbc000 (options '115200')

[    0.000000] bootconsole [ttymxc0] enabled

[    0.000000] Console: colour dummy device 80x30

[    0.254652] Calibrating delay loop... 799.53 BogoMIPS (lpj=3997696)

[    0.482880] pid_max: default: 32768 minimum: 301

[    0.487557] Security Framework initialized

[    0.491691] Smack:  Initializing.

[    0.495041] Mount-cache hash table entries: 512

[    0.499951] Initializing cgroup subsys cpuacct

[    0.504439] Initializing cgroup subsys memory

[    0.508828] Initializing cgroup subsys devices

[    0.513286] Initializing cgroup subsys freezer

[    0.517795] CPU: Testing write buffer coherency: ok

[    0.523372] devtmpfs: initialized

[    0.531330] regulator: core version 0.5

[    0.535352] NET: Registered protocol family 16

[    0.539927] i.MX IRAM pool: 128 KB@0x8e840000

[    0.544367] IRAM READY

[    0.547537] CPU is i.MX53 Revision 2.1

[    0.551330] MX53 ARD board

0 Kudos
Reply

2,509 Views
fabio_estevam
NXP Employee
NXP Employee

If the serial console is messed up in U-boot, then it is a good idea to fix this first.

Repeating my question: which U-boot version are you using?

Same for the kernel: your log shows "Linux version 2.6.35.3-imx3.7", which is not very clear where are you taking the kernel from.

My suggestions: if you want to use code from FSL BSP, then use the lastest 11.09.01 code for the kernel and U-boot from git.freescale.com. The messed UART log you mentioned usually happens when U-boot and kernel come from different releases.

If you want to use a newer kernel, say 3.8, then use U-boot 2013.01 as it supports booting a device tree kernel.

0 Kudos
Reply

2,509 Views
ebike
Contributor I

Hi,

Thanks, the uBoot version is: U-Boot 2009.08 (Oct 29 2012 - 08:42:21).

I don't think the garbage serial is anything todo with what it is booting, as it occurs when uboot 1st starts up.

Your point about needing the latest uboot for device-tree booting is very helpful. I do not know anything about device-tree kernel, does this mean you no longer have to provide a machine ID to match with uboot? Would be very helpful if you could describe what device-tree kernel does :smileyhappy: thanks..

Cheers,

Bernie

0 Kudos
Reply

2,509 Views
fabio_estevam
NXP Employee
NXP Employee

U-boot 2009.08 may come from different BSP releases. if you want to use the U-boot from Freescale, then please use the latest one from:

http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/log/?h=imx_v2009.08

And the latest 2.6.35 kernel for mx53 is located at:

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/log/?h=imx_2.6.35_maintain

If you mix versions, it is likely that you will see messed up console like you described.

0 Kudos
Reply

2,509 Views
ebike
Contributor I

Currently the uboot we are using boots WinCE and has lot's of customizations including YAFFS support, I am reluctant at the moment to update uboot as that is a lot of work.

I have tried the latest kernel from the link you posted, but am having trouble compiling .. it fails even after a fresh 'git clone'.

However I have had more sucess using the same version of kernel,  but following the instructions on this page:

i.MX53 Quick Start - Linux on ARM - eewiki

This is the kernel that gets to the point above and reset's. (followed instructions above to build Freescale 2.6.35 bsp.)

I have tried removing config options for hardware that is not on our board, but I usually get build failures when I do that .. there seems to be dependency issues ... is there some step I am missing between "make menuconfig" and building the kernel?

0 Kudos
Reply