Difference between revisions of "CM-A510: Linux: Kernel"
m (1 revision(s)) |
|||
Line 6: | Line 6: | ||
ubi.mtd=1,2048 root=ubi0_0 rootfstype=ubifs useNandHal=4bitecc pm_disable console=ttyS0,115200 | ubi.mtd=1,2048 root=ubi0_0 rootfstype=ubifs useNandHal=4bitecc pm_disable console=ttyS0,115200 | ||
− | The default kernel command line defines primary console, default display settings, root device and root filesystem type. | + | The default kernel command line defines primary console, default DVI display settings, root device and root filesystem type. |
Setting U-Boot {{parameter|bootargs}} environment variable overrides default kernel command line and can be used to set desired kernel parameters. | Setting U-Boot {{parameter|bootargs}} environment variable overrides default kernel command line and can be used to set desired kernel parameters. | ||
+ | |||
+ | === Custom kernel command line options === | ||
+ | |||
+ | The default command line can be extended with the parameters below to enable additional CM-A510 kernel functionality: | ||
+ | |||
+ | * Enable VGA output: | ||
+ | {{cmd|1=video=dovefb:lcd1:1024x768-16@60-edid clcd.lcd1_enable=1 clcd.lcd0_enable=0}} | ||
+ | * Enable DVI output (default): | ||
+ | {{cmd|1=video=dovefb:lcd0:1024x768-16@60-edid clcd.lcd0_enable=1 clcd.lcd1_enable=0}} | ||
+ | * Enable USB0 device functionality: | ||
+ | {{cmd|1=usb0Mode=device}} | ||
+ | * Enable USB0 host functionality (default): | ||
+ | {{cmd|1=usb0Mode=host}} | ||
+ | |||
+ | {{Note| Current kernel release does not support dual head output. Ensure that only one interface (VGA or DVI) is active.}} | ||
== Building kernel for CM-A510 == | == Building kernel for CM-A510 == | ||
Line 40: | Line 55: | ||
<pre> | <pre> | ||
cd /home/development/cm-a510/kernel | cd /home/development/cm-a510/kernel | ||
− | tar | + | tar xjvf /path/to/downloaded/linux-2.6.32.9.tar.bz2 |
</pre> | </pre> | ||
: This will create {{filename|/home/development/cm-a510/kernel/linux-2.6.32.9}} directory containing linux-2.6.32.9 kernel tree. | : This will create {{filename|/home/development/cm-a510/kernel/linux-2.6.32.9}} directory containing linux-2.6.32.9 kernel tree. | ||
Line 69: | Line 84: | ||
<pre> | <pre> | ||
export ARCH=arm | export ARCH=arm | ||
− | export CROSS_COMPILE=arm-none-linux- | + | export CROSS_COMPILE=/path/to/cross-compiler/arm-none-linux-gnueabi- |
make cm_a510_defconfig | make cm_a510_defconfig | ||
− | make | + | make uImage && make modules && \ |
− | |||
INSTALL_MOD_PATH=/home/development/cm-a510/rootfs make modules_install | INSTALL_MOD_PATH=/home/development/cm-a510/rootfs make modules_install | ||
</pre> | </pre> |
Revision as of 15:53, 25 January 2011
Contents
Overview
The CM-A510 Linux kernel provides support for on-board peripherals and abstracts the functionality provided by the hardware. Current support coverage is specified at O/S support coverage map page. CompuLab provides ready-to-run binary kernel images, and source code of the modifications and additions made to the Linux kernel to work properly with CM-A510 modules.
Kernel command line
The CM-A510 Linux kernel is shipped with built-in command line parameters:
ubi.mtd=1,2048 root=ubi0_0 rootfstype=ubifs useNandHal=4bitecc pm_disable console=ttyS0,115200
The default kernel command line defines primary console, default DVI display settings, root device and root filesystem type.
Setting U-Boot bootargs environment variable overrides default kernel command line and can be used to set desired kernel parameters.
Custom kernel command line options
The default command line can be extended with the parameters below to enable additional CM-A510 kernel functionality:
- Enable VGA output:
video=dovefb:lcd1:1024x768-16@60-edid clcd.lcd1_enable=1 clcd.lcd0_enable=0
- Enable DVI output (default):
video=dovefb:lcd0:1024x768-16@60-edid clcd.lcd0_enable=1 clcd.lcd1_enable=0
- Enable USB0 device functionality:
usb0Mode=device
- Enable USB0 host functionality (default):
usb0Mode=host
Current kernel release does not support dual head output. Ensure that only one interface (VGA or DVI) is active. |
Building kernel for CM-A510
Cross-Compiler
There are several options for cross-compilation toolchain setup. You can either compile your cross-compiler or use an already built cross-compiler. The cross-compiler should support the ARM embedded-application binary interface ("EABI")
- Pre-built toolchain:
- Tools for creating cross-compilers:
- Crosstool-ng: Builds a cross-compiler from source. Non-distribution specific.
- Crossdev: Gentoo's cross-compiler builder. Needs Gentoo.
U-Boot mkimage tool
U-Boot mkimage utility is required in order to create kernel images that can be loaded by the CM-A510 boot-loader. You can download pre-built mkimage binary or build it yourself:
mkdir ~/tmp cd tmp wget ftp://ftp.denx.de/pub/u-boot/u-boot-latest.tar.bz2 tar -xjvf u-boot-latest.tar.bz2 cd u-boot-2009.08 touch include/config.{h,mk} make tools sudo install tools/mkimage /usr/local/bin
Getting kernel sources
There are two ways to get Linux kernel sources that can be used as a baseline for CM-A510 kernel. You can create a copy of linux-2.6.32.y git tree or download a snapshot and extract it. We assume that you have created /home/development/cm-a510/kernel directory for CM-A510 kernel development.
Snapshot download
- Download linux-v2.6.32.9 snapshot with your web browser.
- Extract the downloaded archive linux-2.6.32.9.tar.bz2
cd /home/development/cm-a510/kernel tar xjvf /path/to/downloaded/linux-2.6.32.9.tar.bz2
- This will create /home/development/cm-a510/kernel/linux-2.6.32.9 directory containing linux-2.6.32.9 kernel tree.
- Apply the CM-A510 patch
cd /home/development/cm-a510/kernel/linux-2.6.32.9 patch -p1 < /path/to/cm-a510-linux/kernel/linux-2.6.32.9-cm-a510.patch
Git clone
- Install git version control system.
- Create a clone of linux-2.6.32.y kernel tree
cd /home/development/cm-a510/kernel git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.32.y.git linux-2.6.32.9
- Create a branch for CM-A510 development. The CM-A510 patches are generated vs. tag v2.6.32.9 in the linux-2.6.32.y tree. It is recommended to use exactly the same baseline to avoid merge conflicts.
git checkout -b cm-a510-dev v2.6.32.9
- Apply the CM-A510 patch
cd /home/development/cm_a510/kernel/linux-2.6.32.9 git apply /path/to/cma510-linux/kernel/linux-2.6.32.9-cm-a510.patch
Building the kernel
export ARCH=arm export CROSS_COMPILE=/path/to/cross-compiler/arm-none-linux-gnueabi- make cm_a510_defconfig make uImage && make modules && \ INSTALL_MOD_PATH=/home/development/cm-a510/rootfs make modules_install
In the example above, the Linux kernel image (uImage) will be created in /home/development/cm-a510/kernel/linux-2.6.32.9/arch/arm/boot, and the loadable kernel modules will be installed into the /home/development/cm-a510/rootfs/lib/modules directory.
Now, if you boot CM-A510 with newly created kernel image and with networked root filesysem at /home/development/cm-a510/rootfs/ the system will be able to properly load kernel modules and you avoid modules versioning problems.