Utilite Linux Kernel

From Utilite Wiki

Jump to: navigation, search

Contents

Overview

The Linux kernel for Utilite provides support for on-board peripherals and abstracts the functionality provided by the hardware.

Kernel boot process

Default boot process

The Utilite U-Boot scans the various boot devices and loads the kernel from the first valid boot device. The boot device is valid when:

  • physically present
  • boot partition formatted with vfat
  • has uImage-cm-fx6 or boot.scr in the root of the boot partition

Default boot device layout

The Utilite default boot device layout:

  • /boot/uImage-cm-fx6 - Utilite Linux kernel
  • /boot/boot.scr - Optional U-Boot boot script that selects correct kernel boot parameters and loads the kernel
  • / - Root file system formatted with ext2/ext3/ext4

Boot device scan order

The U-Boot boot script will attempt to boot from the various boot devices according to the following order:

  1. Micro-SD card
  2. Internal SATA storage (if available)

Kernel command line

Admolition note.png The Linux kernel build-in and/or U-Boot default Linux command line might not be the most recent ones. Please use the command line provided below.
  • A micro-SD Linux boot command line:
console=ttymxc3,115200 root=/dev/mmcblk0p2 rw rootwait elevator=noop consoleblank=0
  • The internal SATA storage Linux boot command line:
console=ttymxc3,115200 root=/dev/sda2 rw rootwait consoleblank=0

Setting U-Boot bootargs environment variable overrides default kernel command line and can be used to set the desired kernel parameters.

Building kernel for Utilite

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.

Getting kernel sources

Linux git tree can be cloned or downloaded as a tarball from [https://gitorious.org/utilite]. The instructions below assume that the /home/development/Utilite/kernel directory has been created for Utilite kernel development.

Git clone

  • Install git version control system.
  • Create a clone of the Utilite Linux kernel tree
cd /home/development/Utilite/kernel
git clone git@gitorious.org:utilite/utilite.git

Building the kernel

export ARCH=arm
export CROSS_COMPILE=arm-none-linux-eabi-
make utilite_defconfig
make menuconfig
make && make uImage && \
     INSTALL_MOD_PATH=/home/development/Utilite/rootfs make modules_install

In the example above, the Linux kernel image (uImage) will be created in /home/development/Utilite/kernel/arch/arm/boot, and the loadable kernel modules will be installed into the /home/development/Utilite/rootfs/lib/modules directory.

When the Utilite is booted with the kernel image created as described above and with networked root filesystem at /home/development/Utilite/rootfs/, the system will be able to load the kernel modules properly, thus avoiding module version problems.

uImage and modules locations

  • In the example above, the Linux kernel image (uImage) will be created in /home/development/Utilite/kernel/arch/arm/boot
# ls -al /home/development/Utilite/kernel/arch/arm/boot/uImage
  • The loadable kernel modules will be installed into the /home/development/Utilite/rootfs/lib/modules directory.
# ls -al /home/development/Utilite/rootfs/lib/modules

Kernel Version

  • In the example above, the Linux kernel release version number will be saved in /home/development/Utilite/kernel/include/config/kernel.release
# cat /home/development/Utilite/kernel/include/config/kernel.release

Prepare kernel and modules tarball

  • In the example below, the Linux kernel and modules are packed into the tar archive for deploying onto the Utilite.
# mkdir -p /home/development/Utilite/rootfs/boot
# cp -v /home/development/Utilite/kernel/arch/arm/boot/uImage /home/development/Utilite/rootfs/boot/uImage-cm-fx6
# tar -C /home/development/Utilite/rootfs -czvf /home/development/Utilite/linux-image-utilite.tar.gz .

Deploying the Utilite kernel and modules

Boot up the Utilite computer. Copy the previousely created linux-image-utilite.tar.gz to /root directory of the Utilite.

Mount boot partition

  • Use the below command to mount the boot partition for installing the Utilite Linux kernel binary:
# boot_partition=`cat /proc/cmdline | awk '{ for (i=1;i<=NF;i++) { if($i~/root=/) { print substr($i,6,length($i)-6)"1" } } }'`
# mount $boot_partition /boot

Back up old kernel

  • It is essential to backup the old (known to work) kernel binary.
# mv /boot/uImage-cm-fx6 /boot/uImage-cm-fx6-`uname -r`

Installing kernel and modules

Assuming that the linux-image-utilite.tar.gz tarball has been copied to the Utilite /root directory.

  • Extract and install the Linux kernel binary:
# tar -C / -xvf /root/linux-image-utilite.tar.gz

Basic platform support

The Utilite basic platform support is implemented in the arch/arm/mach-mx6/board-cm-fx6.c file of Linux kernel source tree. This file includes default setup of multi-functional pins, registration of the devices integrated in the Utilite module and definitions of platform-specific configuration for these devices.

DVI and HDMI support

Utilite can be used with two display interfaces: HDMI and DVI. Utilite makes use of the HDMI port as the default video output interface.

Image Processing Unit (IPU)

To enable the IPU in the kernel configuration menu enter Device Drivers ---> MXC support drivers submenu and enable:

  • Image Processing Unit Driver
┌──────────────────────────────── Graphics support ──────────────────────────────┐
│ ┌────^(-)────────────────────────────────────────────────────────────────────┐ │
│ │    [*] Image Processing Unit Driver                                        │ │
│ │        MXC SSI support  --->                                               │ │
│ │        MXC Digital Audio Multiplexer support  --->                         │ │
│ │        MXC PMIC support  --->                                              │ │
│ └────v(+)────────────────────────────────────────────────────────────────────┘ │
├────────────────────────────────────────────────────────────────────────────────┤
│                         <Select>    < Exit >    < Help >                       │
└────────────────────────────────────────────────────────────────────────────────┘
DVI

In the default configuration the second frame buffer is routed to the DVI interface. Therefore, no special kernel arguments are required to use the DVI on the second frame buffer. Here is an example of the default video parameter for DVI on the second framebuffer setup:

video=mxcfb1:dev=dvi,1920x1080M-32@50,if=RGB32

For routing the first frame buffer to the DVI interface, the following kernel parameter must be appended to the kernel command line:

video=mxcfb0:dev=dvi,1920x1080M-32@50,if=RGB32

HDMI

To enable the HDMI interface in the kernel configuration menu enter Device Drivers ---> Graphics support submenu and enable:

  • MXC HDMI driver support
┌──────────────────────────────── Graphics support ──────────────────────────────┐
│ ┌────^(-)────────────────────────────────────────────────────────────────────┐ │
│ │    < >   E-Ink Panel Framebuffer                                           │ │
│ │    < >   SIPIX Panel Framebuffer                                           │ │
│ │    < > Support MXC ELCDIF framebuffer                                      │ │
│ │    <*> MXC HDMI driver support                                             │ │
│ │        Console display driver support  --->                                │ │
│ │    [*] Bootup logo  --->                                                   │ │
│ └────────────────────────────────────────────────────────────────────────────┘ │
├────────────────────────────────────────────────────────────────────────────────┤
│                         <Select>    < Exit >    < Help >                       │
└────────────────────────────────────────────────────────────────────────────────┘

In the default configuration the first frame buffer is routed to the HDMI interface. Therefore, no special kernel arguments are required to use the HDMI on the first frame buffer. Here is an example of the default video parameter for HDMI on the first framebuffer setup:

video=mxcfb0:dev=hdmi,1920x1080M-32@50,if=RGB32

For routing the second frame buffer to the HDMI interface, the following kernel parameter must be appended to the kernel command line:

video=mxcfb1:dev=hdmi,1920x1080M-32@50,if=RGB32

Analog Audio Support

To enable the analog audio support, in the kernel configuration menu enter Device Drivers ---> Sound card support ---> Advanced Linux Sound Architecture ---> ALSA for SoC audio support ---> SoC Audio for Freescale i.MX CPUs submenu and enable:

  • SoC Audio support for Utilite boards
┌────────────────── SoC Audio for Freescale i.MX CPUs ───────────────────────────┐
│ ┌────────────────────────────────────────────────────────────────────────────┐ │
│ │   --- SoC Audio for Freescale i.MX CPUs                                    │ │
│ │   < >   SoC Audio support for IMX boards with WM8958                       │ │
│ │   < >   SoC Audio support for IMX boards with WM8962                       │ │
│ │   <*>   SoC Audio support for Utilite boards                               │ │
│ │   < >   SoC Audio support for IMX SI4763                                   │ │
│ │   <*>   SoC Audio support for IMX - S/PDIF                                 │ │
│ │   <*>   SoC Audio support for IMX - HDMI                                   │ │
│ └────────────────────────────────────────────────────────────────────────────┘ │
├────────────────────────────────────────────────────────────────────────────────┤
│                         <Select>    < Exit >    < Help >                       │
└────────────────────────────────────────────────────────────────────────────────┘

WiFi and Bluetooth

Utilite has WiFi and Bluetooth support based on Marvell 88W8787.

WiFi

To enable WiFi support, in the kernel configuration menu choose Device Drivers ---> Network device support ---> Wireless LAN submenue and enable:

  • Marvell WiFi-Ex Driver
  • Marvell WiFi-Ex Driver for SD8787
┌──────────────────────────────── Wireless LAN ──────────────────────────────────┐
│ ┌────────────────────────────────────────────────────────────────────────────┐ │
│ │   < >   ZyDAS ZD1211/ZD1211B USB-wireless support                          │ │
│ │   <M>   Marvell WiFi-Ex Driver                                             │ │
│ │   <M>     Marvell WiFi-Ex Driver for SD8787                                │ │
│ └────────────────────────────────────────────────────────────────────────────┘ │
├────────────────────────────────────────────────────────────────────────────────┤
│                         <Select>    < Exit >    < Help >                       │
└────────────────────────────────────────────────────────────────────────────────┘

Bluetooth

To enable the Bluetooth support, in the kernel configuration menu enter Networking support ---> Bluetooth subsystem support ---> Bluetooth device drivers submenu and enable:

  • Marvell Bluetooth driver support
  • Marvell BT-over-SDIO driver
┌─────────────────────── Bluetooth device drivers ───────────────────────────────┐
│ ┌────────────────────────────────────────────────────────────────────────────┐ │
│ │   < >   HCI VHCI (Virtual HCI device) driver                               │ │
│ │   <M>   Marvell Bluetooth driver support                                   │ │
│ │   <M>     Marvell BT-over-SDIO driver                                      │ │
│ │   < >   Atheros firmware download driver                                   │ │
│ └────────────────────────────────────────────────────────────────────────────┘ │
├────────────────────────────────────────────────────────────────────────────────┤
│                         <Select>    < Exit >    < Help >                       │
└────────────────────────────────────────────────────────────────────────────────┘

USB On-The-Go (OTG)

To enable the OTG support, in the kernel configuration menu enter System Type ---> Freescale MXC Implementations submenu and enable:

  • FSL USB OTG support
┌────────────────────────────────────────────────────────────────────────────────┐
│ ┌────────────────────────────────────────────────────────────────────────────┐ │
│ │   [*] Support CompuLab Utilite module                                      │ │
│ │              *** MX6 Options: ***                                          │ │
│ │   [*] PCI Express support                                                  │ │
│ │   <*>   USB Host 1 support                                                 │ │
│ │   <*>   FSL USB OTG support                                                │ │
│ │   [ ] Internal LDO in MX6Q/DL bypass                                       │ │
│ │   [ ] MX6 clk setting for smooth UI transtion from bootloader to kernel    │ │
│ └────────────────────────────────────────────────────────────────────────────┘ │
├────────────────────────────────────────────────────────────────────────────────┤
│                         <Select>    < Exit >    < Help >                       │
└────────────────────────────────────────────────────────────────────────────────┘

In the kernel configuration menu enter Device Drivers ---> USB support submenu and enable:

  • Support for Host-side USB
  • EHCI HCD (USB 2.0) support
    • Support for Freescale controller
  • USB OTG pin detect support
┌───────────────────────────── USB support ──────────────────────────────────────┐
│ ┌────────────────────────────────────────────────────────────────────────────┐ │
│ │   --- USB support                                                          │ │  
│ │   <*>   Support for Host-side USB                                          │ │  
│ │   [ ]     USB verbose debug messages                                       │ │  
│ │   [ ]     USB announce new devices                                         │ │  
│ │           *** Miscellaneous USB options ***                                │ │  
│ │   [ ]     USB device filesystem (DEPRECATED)                               │ │  
│ │   [ ]     USB device class-devices (DEPRECATED)                            │ │  
│ │   [ ]     Dynamic USB minor allocation                                     │ │  
│ │   [*]     USB runtime power management (autosuspend) and wakeup            │ │  
│ │   -*-       OTG support                                                    │ │  
│ │   .......................................................................  │ │
│ │   <*>   EHCI HCD (USB 2.0) support                                         │ │  
│ │   [*]     Support for Freescale controller                                 │ │  
│ │   .......................................................................  │ │
│ │   <*>     USB Gadget Support  --->                                         │ │
│ │        *** OTG and related infrastructure ***                              │ │
│ │   .......................................................................  │ │
│ │   <*>   USB OTG pin detect support                                         │ │
│ └────────────────────────────────────────────────────────────────────────────┘ │
├────────────────────────────────────────────────────────────────────────────────┤
│                         <Select>    < Exit >    < Help >                       │
└────────────────────────────────────────────────────────────────────────────────┘
Personal tools