NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
Booting XIP Kernel on OMAP-L138
Important Note:
The software discussed on this site is available for download, but is no longer being actively developed. This wiki is in maintenance mode and the software is supported on OMAPL1x Processor E2E forum
Introduction[edit]
This document talks about enabling XIP support in Linux kernel and then booting the same from NOR flash on DA850/OMAP-L138 EVM. This has been tested with latest PSP release 03.22.00.02 which can be downloaded from TI's Technology and Software Publicly Available (TSPA) download site.
Prerequisites[edit]
Patch at https://patchwork.kernel.org/patch/1268451 is required for the kernel to build when XIP support is enabled.
Patch at http://svn.openezx.org/branches/kernel-2.6.23.x-patches/binutils-buildid-arm.patch is required to reduce the xipImage size. Without this patch when XIP support was included in the kernel, kernel image size was 17MB. With this patch, it came down to 5MB.
Enabling XIP support in Linux[edit]
Device Drivers ---> <*> Memory Technology Device (MTD) support ---> Boot options ---> [*] Kernel Execute-In-Place from ROM (0x60100040) XIP Kernel Physical Location (0xc0000000) Physical address of main memory
NOTE
DA850/OMAP-L138 EVM has 8MB NOR Flash. XIP Kernel Physical Location should be 64 bytes (Hex 0x40) more than the actual location where XIP image will be flashed. U-Boot header will be inserted in this 64 byte space. Since kernel image will be flashed at 0x60100000, 0x60100040 was chosen as the physical location.
Compiling[edit]
After editing Linux configuration as mentioned above, compile the XIP image using the below command:
host$ make xipImage ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-
The compiled xipImage will be present in the arch/arm/boot directory under the kernel tree. This image will be without the u-boot header which should be added using the mkimage command. The procedure to do this consists of concating the image with a binary file of 64 bytes containing ones (tempfile). We then use mkimage to overwrite the added ones with the correct header. This step is done so that we do not overwrite the actual image.
To add the ones and produce a xipImage named xip.img:
host$ cat tempfile xipImage > xip.img
Now we have a XIP image with the added ones in the beginning of the file. To overwrite the ones with the actual header:
host$ mkimage -x -A arm -O linux -T kernel -C none -a 0x60100000 -e 0x60100040 -n "XIP Image" -d xip.img xipuImage
Once XIP kernel image is ready, if you are using tftp boot, use the following commands to copy the xipuImage to a place where U-Boot can use TFTP to download it to the EVM. These commands assume you are using the default TFTP root area, which is /tftpboot. If you use another TFTP root location, please change /tftpboot to your own TFTP root location:
host$ cp xipuImage /tftpboot
Booting[edit]
Flash the u-boot to NOR flash and boot the board. From the u-boot prompt, un-protect the write protected flash sectors.
U-Boot> protect off all
Erase the area of flash where you want to flash the xipuImage.
U-Boot> erase 0x60100000 +600000
Download the xipuImage onto EVM.
U-Boot> tftp c0700000 xipuImage
Flash the image onto NOR flash.
U-Boot> cp.b 0xc0700000 0x60100000 0x600000
Once the flashing is complete, boot the XIP image.
U-Boot> bootm 0x60100000 ## Booting kernel from Legacy Image at 60100000 ... Image Name: XIP Image Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 5238624 Bytes = 5 MiB Load Address: 60100000 Entry Point: 60100040 Verifying Checksum ... OK XIP Kernel Image ... OK OK Starting kernel ... Booting Linux on physical CPU 0 .... .... ....
NOTE
Though booting the kernel in XIP mode should reduce boot time, it is observed that by following the above method, booting is taking more time. After printing "Starting kernel..." the system took around 35 seconds to start booting. Even when ramdisk was used it took close to 30 minutes to get to Linux login prompt.