CM-A510: Linux: Kernel

From Compulab Mediawiki
Jump to: navigation, search


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:


  • Enable USB0 host functionality (default):


Admolition note.png Current kernel release does not support dual head output. Ensure that only one interface (VGA or DVI) is active.

Building kernel for CM-A510


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
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-
cd /home/development/cm-a510/kernel
tar xjvf /path/to/downloaded/linux-
This will create /home/development/cm-a510/kernel/linux- directory containing linux- kernel tree.
  • Apply the CM-A510 patch
cd /home/development/cm-a510/kernel/linux-
patch -p1 < /path/to/cm-a510-linux/kernel/linux-

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:// linux-
  • 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-
git apply /path/to/cma510-linux/kernel/linux-

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-, 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.

Building WiFi driver

Building Wireless SiP module WM-N-BM-01 driver, based on Broadcom 4319 chipset.

  • Extract archive from the CM-A510 Linux package utilities directory
cd /home/development/cm-a510/
unzip /path/to/cm-a510-linux/utilities/
cd broadcom-wlan/bcm4329/src/dhd/linux
  • Compile and install the driver
export ARCH=arm
export CROSS_COMPILE=/path/to/cross-compiler/arm-none-linux-gnueabi-
export LINUXDIR=/home/development/cm-a510/kernel
export LINUX_BUILD_DIR=/home/development/cm-a510/kernel
export INSTALL_MOD_PATH=/home/development/cm-a510/rootfs/lib/modules/

make clean
make dhd-cdc-sdmmc-gpl-debug
cp ./dhd-cdc-sdmmc-gpl-debug- $INSTALL_MOD_PATH

See also