Skip to contentSkip to conversation

Trying to load old kernel with new u-boot

U-Boot DaveKucharczyk 2 participants 5 messages Sep 15, 2015 – Sep 17, 2015

lore
Share & tools
lore
#0 lore raw

One of our mx51 based boards doesn't seem to like 2.6.35 kernel with 2014.07 u-boot.
We've ported our boards for the new kernel and new u-boot, but we need the old kernel to also work with new u-boot.

So here's what happens...

U-Boot 2014.07-svn83200 (Sep 15 2015 - 15:57:02)

CPU:   Freescale i.MX51 rev3.0 at 800 MHz
I2C:   ready
DRAM:  512 MiB
Last reset reason:POR, (1)
Boot Device: MMC
MMC:   FSL_SDHC: 0
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0

MMC read: dev # 0, block # 2048, count 6144 ... 6144 blocks read: OK ## Booting kernel from Legacy Image at 92000000 ...

   Image Name:   Linux-2.6.35.3-1129-g691c08a+
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2873388 Bytes = 2.7 MiB

Load Address: 90008000
Entry Point: 90008000
Verifying Checksum ... OK
Loading Kernel Image ... OK

Starting kernel ...

???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? console [ttymxc1] enabled, bootconsole disabled
blah blah
boot continues as normal...

Looks like new u-boot passes something wrong to the kernel or doesn't pass something we need.

Seems like the first half of the kernel output timing is wrong. I tried different bauds to no avail.

On a working board we see early on...

entering mx51_clocks_init
turning off all clocks
external_low_reference = 00008000 external_high_reference = 01588800
ckih2_reference = 01770000
oscillator_reference = 016e3600
entering clk_tree_init
clk_tree_init for mx51
returned from clk_tree_init
setting uart_main_clk to pll3_sw_clk
MXC_CCM_CSCDR1 is 00c30458
MXC_Early serial console at MMIO 0x73fc0000 (options '115200') bootconsole [ttymxc1] enabled

And then later...
console [ttymxc1] enabled, bootconsole disabled

Looks like the early console is not working. I'll have to debug this tomorrow, but if anyone has suggestions that would be great.

--
View this message in context: http://u-boot.10912.n7.nabble.com/Trying-to-load-old-kernel-with-new-u-boot-tp228429.html
Sent from the U-Boot mailing list archive at Nabble.com.

#1 lore raw

When I set putty to 38400 I get the first half of the kernel console output fine and the second half is garbage.

So that tells me early kernel is outputting at 38400. Even though we don't set it to that. When I print gd->baudrate in board_late_init() I get 115200.

So what does 2014.07 u-boot do differently than 2009.08 that causes the early kernel console to get messed up?

That's my trail at the moment.

--
View this message in context: http://u-boot.10912.n7.nabble.com/Trying-to-load-old-kernel-with-new-u-boot-tp228429p228444.html
Sent from the U-Boot mailing list archive at Nabble.com.

#2 lore raw
Quoted 8 lines · DaveKucharczyk

When I set putty to 38400 I get the first half of the kernel console output fine and the second half is garbage.

So that tells me early kernel is outputting at 38400. Even though we don't set it to that. When I print gd->baudrate in board_late_init() I get 115200.

So what does 2014.07 u-boot do differently than 2009.08 that causes the early kernel console to get messed up?

If I recall correctly they have different parents or the uart clock.

#3 lore raw
Quoted 5 lines · Fabio Estevam
Quoted 3 lines · DaveKucharczyk

When I set putty to 38400 I get the first half of the kernel console output fine and the second half is garbage.

Quoted 7 lines
Quoted 5 lines

So that tells me early kernel is outputting at 38400. Even though we don't set it to that. When I print gd->baudrate in board_late_init() I get 115200.

So what does 2014.07 u-boot do differently than 2009.08 that causes the early kernel console to get messed up?

If I recall correctly they have different parents or the uart clock.

I meant "different parents for the uart clock"

#4 lore raw

Fabio Estevam-2 wrote

Quoted 1 line

I meant "different parents for the uart clock"

Fabio, that would make sense why it doesn't work when setting 2014 u-boot CSCDR1 to the value in 2009 u-boot. I can check all the combinations of clock division I want and it's never going to work since the parent is different.

The patch for u-boot 2009.08 states...
------------------
Subject: [PATCH] ENGR00133727: uart outputs messy code when kernel starts on mx51

uart outputs messy code when kernel starts on mx51. Change uart clock to use pll2 as source clock.
------------------

Looks like we never implemented that patch in our 2009 u-boot. Looks like that patch made it to 2014 u-boot.

So I tried setting the uart clock parent to default in u-boot 2014 in arch/arm/cpu/armv7/mx5/lowlevel_init.S, but still the same thing happens.

Any suggestions?

Basically I want kernel 2.6.35 to boot cleanly on the console using u-boot 2014 on an mx51 board.

--
View this message in context: http://u-boot.10912.n7.nabble.com/Trying-to-load-old-kernel-with-new-u-boot-tp228429p228518.html
Sent from the U-Boot mailing list archive at Nabble.com.