can we use XIP(Execute in place) method to execute 3.8.13-bone-xx kernel from NAND flash of BBB?

Hello,
I am using Beaglebone black board with ubuntu-12.04.3LTS(3.8.13) kernel. I want to optimize boot-up time. I measured boot-time using the debug port uart-ttyO0. During boot-up I observed that about 1.5 sec is wasted for uncompressing the kernel. So I am thinking to use Execute In Place method to load kernel. With XIP we can run kernel out of flash instead of bringing into RAM. But I am newbie so I dont know how to do this. If anybody had done this before , please help me to do this. First thing I want to know, whether it is possible or not??
Please help me to speed up booting time. All suggestions welcome. Thanking you…

Regards,
Kishor

Hi,

Using XIP requires easily addressable memory like NOR flash memory. XIP is not compatible with paged memory types like NAND/eMMC.

Even if you had NOR memory there you might hit performance issues later on the system as usually NOR interface is slower than DDR SDRAM interface.

With that being said you might want to have another look at page:
http://www.elinux.org/Boot_Time

In addition to that being written on that page you might want to verify that boot loader configures CPU/DDR/eMMC to optimal speeds as those all affect generic kernel loading speed. Then you probably want to take everything unnecessary out of the kernel eg. modify the kernel (might not be an option for you if you want to stick with Ubuntu kernel).

Thanks,
Vesa Jääskeläinen

Hello Vesa,

Thank you for quick reply and helpful information provided by you.
After reading your post I can’t go for XIP. But, can I use uncompressed kernel image to save that time of uncompress?
If yes, what should be my approach?? How can I get uncompressed kernel image and how to link it with u-boot bootloader to boot succesfully??
Thanking you.

Regards,
Kishor Dhanawade

"zImage" is just a container file for the current compressed kernel
image, it can also hold an uncompressed image.

However your are forgetting one little detail. It's not just the
"uncompression" time, you also have the image "load" time..

There is a good blog post here:
http://free-electrons.com/blog/arm-xz-kernel-decompression-benchmarks/

Currently we are using: CONFIG_KERNEL_XZ
https://github.com/RobertCNelson/linux-dev/blob/am33x-v3.8/patches/defconfig#L39

you might see a small reduction from: CONFIG_KERNEL_LZO

Post 3.11, take a look at lz4
http://events.linuxfoundation.org/sites/events/files/lcjpcojp13_klee.pdf

Regards,