Porting a kernel

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

Porting a kernel

2,221 Views
wayne_ng
Contributor I

Hi all,

 

I'm looking for some guidance on how to tackle a kernel boot problem. I have been using a i.MX53 Emtrion SOM, this module comes with its own BSP with a 2.6.35.3 kernel, there are some outdated drivers and features missing in the BSP, however they are contained in the 2.6.38 kernel hosted in Freescales git repo here http://opensource.freescale.com/git?p=imx/linux-2.6-imx.git;a=summary. There I am attempting a port.

I have been hacking the 2.6.38 kernel with information from the Emtrion BSP kernel in the hope that I could get the board to boot to some degree. I have managed to build the 2.3.38 kernel but when the board boots it gets stuck at the "booting kernel" message.

 

Calculated data checksum = 0x221d9f41 (OK)

linux will be booted now

## Booting kernel from Legacy Image at 70800000 ...   
Image Name:   Linux-2.6.38-ga269596-dirty   
Created:      2011-11-23   9:29:59 UTC   
Image Type:   ARM Linux Kernel Image (uncompressed)   
Data Size:    2140812 Bytes = 2 MiB   
Load Address: 70008000   
Entry Point:  70008000   
Verifying Checksum ... OK   
Loading Kernel Image ... OK
Starting kernel ...

Uncompressing Linux... done, booting the kernel.

 

I have put some printks in my board init function but it would appear the the boot process isn't even getting as far as the board init, could anyone offer up some suggestions on where I should be looking to try and fix this?

 

Thanks very much

 

W.

0 Kudos
15 Replies

1,774 Views
dhlii
Contributor I

I have succeeded in booting the i.mx53 QSB with just about every linux kernel I have tried.

Though newer kernels - 3.1, 3.2 often do not have drivers for all hardware.

My normal process - used for many boards, is to find a working config file for that board or something similar, from an older or newer linux, or even a similar board. Copy that to the root of the linux kernel source as .config and make the kernel with the correct arguments and settings for your cross compiler, ....

If the .config does not quite match the version of linux you are building, the build process will ask questions regarding things it can not figure out. Look at those carefully and answer them correctly.

Failing immediately after the uncompressing kernel message suggests either u-boot or relocation issues.

Is the kernel/uimage being built with the correct zreladdr-y ? Does that match the one used by mkimage, and the u-boot load address for the kernel ?

My make line is

Makefile ARCH=arm   CROSS_COMPILE=arm-linux- zreladdr-y=0x70008000 uImage

Alternately early printk's may not be enabled in your .config.

Regardless, the absence of messages after the decompressing kernel message suguests a gross misconfiguration rather than an incorrect driver.

0 Kudos

1,779 Views
daiane_angolini
NXP Employee
NXP Employee

ok.

Please, share your results when you finish ;)

0 Kudos

1,779 Views
DonaldR_PooleJr
Contributor I

I will try the linaro u-boot with the linaro-3.1 kernel when I get another SD card.  I think I will use the Freescale 2.6.35.3 kernel and corresponding u-boot since I almost have it working now.  Thanks for your assistance!

Daiane Angolini said:

if you´re using imx53QSB you don´t need to care about machine ID. (only in case you have a custom kernel and a custom u-boot).

 

I believe imx5_defconfig should work.

 

Take the u-boot from linaro (that one inside freescale directory, likely kernel you have taken)

0 Kudos

1,779 Views
daiane_angolini
NXP Employee
NXP Employee

if you´re using imx53QSB you don´t need to care about machine ID. (only in case you have a custom kernel and a custom u-boot).

 

I believe imx5_defconfig should work.

 

Take the u-boot from linaro (that one inside freescale directory, likely kernel you have taken)

0 Kudos

1,779 Views
DonaldR_PooleJr
Contributor I

I'm using u-boot 2011.06 actually.  I looked in the arch/arm/configs directory of my kernel source, and I didn't see a mx53_loco, but I did see a imx5_defconfig.  So, I guess that one is the next best thing?  I actually have the i.MX53QSB, but I'm not sure which machine id i'm using.  How do I check it to make sure u-boot and the kernel match?

Daiane Angolini said:

Have you upgraded u-boot either?

 

Actually I cannot remember how I configured my kernel. But I can remember I have make menuconfig and then chose mx53_loco manually

 

Are you using a different machine id for your custom board? It can cause some misunderstood as well

0 Kudos

1,779 Views
daiane_angolini
NXP Employee
NXP Employee

Have you upgraded u-boot either?

 

Actually I cannot remember how I configured my kernel. But I can remember I have make menuconfig and then chose mx53_loco manually

 

Are you using a different machine id for your custom board? It can cause some misunderstood as well

0 Kudos

1,779 Views
DonaldR_PooleJr
Contributor I

Daiane, did you grab the linaro 3.1 kernel from this repo Linaro-3.1? I went there and grabbed the snapshot of the lt-3.1 head, but I'm still getting the Uncompressing Linux... done, booting the kernel hang up.

 

These are the bootargs I'm passing to the kernel

  • console=ttymxc0,115200 root=/dev/mmcblk0p1 rw rootfstype=ext3 rootwait video=mxcdi0fb:RGB24,1024x768M@60

 

And I compiled the kernel with the lt-mx5_defconfig file.

 

Do my bootargs look right and am I using the correct file?


Daiane Angolini said:

As I know kernel from linaro is 3.1 already, and I was able to boot my imx53QSB using it.

 

At least, you can try to use it as a sample code to work with

0 Kudos

1,779 Views
daiane_angolini
NXP Employee
NXP Employee

I didn't tested it. So I don't know.

 

Take a look here to know what is supported

http://git.linaro.org/gitweb?p=bsp/freescale/linux-linaro.git;a=blob;f=arch/arm/mach-mx5/board-mx53_...

0 Kudos

1,779 Views
wayne_ng
Contributor I

Daiane can I ask if you ran into any trouble getting peripherals to work i.e i2c and spi?

0 Kudos

1,779 Views
DonaldR_PooleJr
Contributor I

I will give the linaro 2.6.38 & 3.1 kernels a shot then and see how that works out.  But, like Wayne, I passed the same bootargs that were passed in to my 2.6.35 kernel that was working as well.  I was also using the imx5_defconfig for my QSB, which I believe to be the right configuration file for the imx53QSB.

Daiane Angolini said:

Have you guys tried the kernel source code from Linaro?

 

For "Uncompressing Linux... done, booting the kernel." stuck problem:

 

1- does your kernel command line have the console config?

2- did you configured kernel properly choosing the right board?

 

0 Kudos

1,779 Views
daiane_angolini
NXP Employee
NXP Employee

As I know kernel from linaro is 3.1 already, and I was able to boot my imx53QSB using it.

 

At least, you can try to use it as a sample code to work with

0 Kudos

1,779 Views
wayne_ng
Contributor I

No I haven't tried linaro I take it it may be worth a shot?

 

1- bootargs are passed from uboot which work fine for the 2.6.35 kernel so I just assumed they are ok for 2.6.38

2- my board config is based on the mx53 evk I have just replicated the board config from the 2.6.35 source tree that I have working.

0 Kudos

1,779 Views
daiane_angolini
NXP Employee
NXP Employee

Have you guys tried the kernel source code from Linaro?

 

For "Uncompressing Linux... done, booting the kernel." stuck problem:

 

1- does your kernel command line have the console config?

2- did you configured kernel properly choosing the right board?

0 Kudos

1,779 Views
wayne_ng
Contributor I

Hi Donald,

 

Not getting much further, spoke to some people on the arm-linux mailing list and it turns out that 2.6.38 has not been tested on imx5. In also tried enabling earlyprintk but this had no affect on the console output, it was highlighted in the mailing list that there may be a timing difference between uboot and the kernel. Support was limited due to the FSL kernel not being mainlined. 

 

I am thinking about shelving this endeavour and try and solve my core problem within the 2.6.35 kernel.

 

I Sorry I couldn't be any help, though keep us update on any progress

 

Wayne

0 Kudos

1,779 Views
DonaldR_PooleJr
Contributor I

Wayne,

Have you made much progress on getting your kernel to boot? I'm trying to use the 2.6.38 kernel from the freescale site as well and running into the same problem. Although, I'm using the i.MX53 Quick Start Board, I think your problem is very similar to mine.

0 Kudos