VAR-SOM-AM35 Linux Building Linux Images
From Variscite Wiki
VAR-SOM-MX25 - Building Linux Images
Variscite supports its VAR-SOM-MX25 with Linux Kernel 2.6.31 and example Freescale file-systems. The Linux kernel provides support for all on-board peripherals. Your Linux Folder on your CD contains:
- ready-to-run pre-built binaries of : Kernel, U-boot, Xloader
- Source code
- U-boot script for Downloading, Flashing and setting the proper environment parameters.
1 Building Linux images for VAR-SOM-MX25
This section describes how to rebuild the different software images.
Ensure that the toolchain installation has been completed (see section “Installing the Toolchain”).
Some of the makefiles build development host utilities in the process of building the target content. For these steps to complete correctly, the Linux host must be capable of compiling host programs.
Install the following libraries:
# sudo apt-get install build-essential libncurses5-dev mtd-tools
1.1 Installing the Toolchain
This guide assumes the use of the LITE version of the CodeSourcery toolchain. This version is an unrestricted command line toolchain available free of charge.
The toolchain on the CD included in the VAR-DVK-MX25 package.
The installation file resides at Software/host/ folder.
To install the toolchain, follow the sequence below:
# sudo mkdir –p /opt/toolchain # sudo cp imx.toolchain.tar.bz2 /opt/toolchain # cd /opt/toolchain # sudo tar xvf imx.toolchain.tar.bz2 # sudo rm imx.toolchain.tar.bz2
Add the /opt/toolchain/arm-none-linuux-gnueabi.4.1.2/bin folder to your path. This is typically done by adding an additional line to your shell resource file (~/.bashrc). For the path given above, add the following line to your .bashrc file:
# export PATH=/opt/toolchain/arm-none-linuux-gnueabi.4.1.2/bin:$PATH
This adds the toolchain tools to your path and allows you to execute the tools using
arm-nonelinux-gnueabi-gcc (or other tools in the tool chain) from any directory.
1.2 Building kernel for VAR-SOM-MX25
Note: building the kernel requires using mkimage, a host side utility built by the u-boot makefile. You will need to build U-boot and place mkimage in your Path. If you are using a bash shell, add the following in the .bashrc file in your user account.
export PATH=<path to U-boot>/tools:$PATH
After making the modifications to the .bashrc file, make sure you perform the following step for the change to take effect in the current session.
# source ~/.bashrc
Untar the Linux kernel source archive from Software\src folder
tar xfv linux-2.6.31.tar.bz2
To build the kernel, follow the following commands:
# cd linux-2.6.31 # make distclean # make var_som_mx25_defconfig
If you need to make changes to the default configuration, you can run:
# make menuconfig
Note: Variscite supports 2 types of LCD displays on VAR-DVK-MX25. The LCD panel should be setup before Kernel build at the menuconfig stage.
Once ready to build the kernel, run:
# make uImage
The resulting kernel image uImage will be placed under arch/arm/boot and is ready to be loaded to target.
1.3 Building the U-boot for VAR-SOM-MX25
Untar the U-Boot source archive from \Software\src\ folder:
tar xfv u-boot-2009.08.tar.bz2
Go to the u-boot folder:
# cd u-boot-2009.08
Configure u-boot. The following actions may be done only once
# make distclean # make mx25_3stack_config
To build the U-Boot, follow the following commands:
Resulting U-Boot image named u-boot.bin will be in the current directory.
2 Linux File Systems
Preprogrammed Linux file system JFFS2 image is supplied by Freescale and burnt on module without any modification.