Difference between revisions of "CM-T3517: Linux: Kernel"
(→Kernel command line) |
(→Bluetooth) |
||
Line 4: | Line 4: | ||
== Kernel command line == | == Kernel command line == | ||
The Linux kernel for CM-T3517 is shipped with built-in command line parameters: | The Linux kernel for CM-T3517 is shipped with built-in command line parameters: | ||
− | |||
− | |||
− | The default kernel command line defines primary console | + | <pre> |
+ | root=/dev/mmcblk0p2 rootwait console=ttyO2,115200 | ||
+ | </pre> | ||
+ | |||
+ | The default kernel command line defines primary console and root device. | ||
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. | ||
+ | |||
+ | {{Note|Linux kernel command line must have the following parameter appended: {{parameter|nohlt}}. | ||
+ | This prevents the WFI instruction from halting the processor in idle state.}} | ||
== Building kernel for CM-T3517 == | == Building kernel for CM-T3517 == | ||
Line 37: | Line 42: | ||
There are two ways to get Linux kernel sources that can be used as a baseline for CM-T3517 kernel. You can create a copy of linux-omap git tree or download a snapshot and extract it. We assume that you have created {{filename|/home/development/cm-t3517/kernel}} directory for CM-T3517 kernel development. | There are two ways to get Linux kernel sources that can be used as a baseline for CM-T3517 kernel. You can create a copy of linux-omap git tree or download a snapshot and extract it. We assume that you have created {{filename|/home/development/cm-t3517/kernel}} directory for CM-T3517 kernel development. | ||
==== Snapshot download ==== | ==== Snapshot download ==== | ||
− | * Download [http:// | + | * Download [http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.5.7.tar.bz2 v3.5.7] snapshot with your web browser. |
− | * Extract the downloaded archive {{filename|linux- | + | * Extract the downloaded archive {{filename|linux-3.5.7.tar.bz2}} |
<pre> | <pre> | ||
cd /home/development/cm-t3517/kernel | cd /home/development/cm-t3517/kernel | ||
− | tar | + | tar xvf /path/to/downloaded/linux-3.5.7.tar.bz2 |
+ | mv linux-3.5.7 linux-cm-t3517 | ||
</pre> | </pre> | ||
− | : This will create {{filename|/home/development/cm-t3517/kernel/linux- | + | : This will create {{filename|/home/development/cm-t3517/kernel/linux-cm-t3517}} directory containing linux-omap kernel tree. |
+ | |||
* Apply the CM-T3517 patch | * Apply the CM-T3517 patch | ||
<pre> | <pre> | ||
− | cd /home/development/cm-t3517/kernel/linux- | + | cd /home/development/cm-t3517/kernel/linux-cm-t3517 |
− | patch -p1 < /path/to/t3517-linux/kernel/linux- | + | patch -p1 < /path/to/t3517-linux/kernel/linux-3.5.7-cm-t3517-2.patch |
</pre> | </pre> | ||
Line 55: | Line 62: | ||
<pre> | <pre> | ||
cd /home/development/cm-t3517/kernel | cd /home/development/cm-t3517/kernel | ||
− | git clone git://git.kernel.org/pub/scm/linux/kernel/git/ | + | git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-cm-t3517 |
</pre> | </pre> | ||
− | * Create a branch for CM-T3517 development. The CM-T3517 patches are generated vs. commit | + | * Create a branch for CM-T3517 development. The CM-T3517 patches are generated vs. v3.5.7 tag (f2b152564afdf9c9917c17d1c41c1082c82067bd commit) in the linux-stable tree. It is recommended to use exactly the same baseline to avoid merge conflicts. |
<pre> | <pre> | ||
− | git checkout -b cm-t3517-dev | + | git checkout -b cm-t3517-dev f2b152564afdf9c9917c17d1c41c1082c82067bd |
</pre> | </pre> | ||
* Apply the CM-T3517 patch | * Apply the CM-T3517 patch | ||
<pre> | <pre> | ||
− | cd /home/development/cm-t3517/kernel/linux- | + | cd /home/development/cm-t3517/kernel/linux-cm-t3517 |
− | git apply /path/to/ | + | git apply /path/to/cm-t3730-linux/kernel/linux-3.5.7-cm-t3517-2.patch |
</pre> | </pre> | ||
+ | |||
+ | {{Note|Future stable kernel versions of 3.5 can also be used by checking out any later tag of v3.5.y stable kernel tree.}} | ||
=== Building the kernel === | === Building the kernel === | ||
Line 81: | Line 90: | ||
When the CM-T3517 is booted with the kernel image created as described above and with networked root filesystem at {{filename|/home/development/cm-t3517/rootfs/}}, the system will be able to load the kernel modules properly, thus avoiding module version problems. | When the CM-T3517 is booted with the kernel image created as described above and with networked root filesystem at {{filename|/home/development/cm-t3517/rootfs/}}, the system will be able to load the kernel modules properly, thus avoiding module version problems. | ||
− | == Controller–area network (CAN) support == | + | |
+ | == Basic platform support == | ||
+ | The CM-T3517 basic platform support is implemented in the {{filename|arch/arm/mach-omap2/board-cm-t3517.c}} file of Linux kernel source tree. This file includes default setup of multi-functional pins, registration of the devices integrated in the CM-T3517 module and definitions of platform-specific configuration for these devices. | ||
+ | |||
+ | === Controller–area network (CAN) support === | ||
Controller Area Network (CAN) is a slow (up to 1Mbit/s) serial communications protocol used in automotive, marine, industrial and medical applications. The CM-T3517 features a TI High End CAN Controller (HECC), integrated into the Sitara AM3517/05 SoC. The TI HECC implements full CAN protocol version 2.0B. It supports both the base (standard) and the extended frame format as well as a programmable data bit rate with maximum of 1Mbit/s. | Controller Area Network (CAN) is a slow (up to 1Mbit/s) serial communications protocol used in automotive, marine, industrial and medical applications. The CM-T3517 features a TI High End CAN Controller (HECC), integrated into the Sitara AM3517/05 SoC. The TI HECC implements full CAN protocol version 2.0B. It supports both the base (standard) and the extended frame format as well as a programmable data bit rate with maximum of 1Mbit/s. | ||
Line 91: | Line 104: | ||
* CAN bit-timing calculation enabled | * CAN bit-timing calculation enabled | ||
− | === CAN bus subsystem support === | + | ==== CAN bus subsystem support ==== |
In the kernel configuration menu choose "{{parameter|Networking Support}}" submenu and enable "{{parameter|CAN bus subsystem support}}". | In the kernel configuration menu choose "{{parameter|Networking Support}}" submenu and enable "{{parameter|CAN bus subsystem support}}". | ||
You can choose to either build it into the kernel or to compile it as a module. In the last case the module name will be {{filename|can}}. | You can choose to either build it into the kernel or to compile it as a module. In the last case the module name will be {{filename|can}}. | ||
<pre> | <pre> | ||
− | ┌────────────────────────────── Networking support ──────────────────────────────┐ | + | ┌────────────────────────────── Networking support ──────────────────────────────┐ |
− | + | │ ┌────────────────────────────────────────────────────────────────────────────┐ │ | |
− | + | │ │ --- Networking support │ │ | |
− | + | │ │ Networking options ---> │ │ | |
− | + | │ │ [ ] Amateur Radio support ---> │ │ | |
− | │ ┌────────────────────────────────────────────────────────────────────────────┐ │ | + | │ │ <M> CAN bus subsystem support ---> │ │ |
− | │ │ --- Networking support │ │ | + | │ │ < > IrDA (infrared) subsystem support ---> │ │ |
− | │ │ Networking options ---> │ │ | + | │ │ <M> Bluetooth subsystem support ---> │ │ |
− | │ │ [ ] Amateur Radio support ---> │ │ | + | │ │ < > RxRPC session sockets │ │ |
− | │ │ <M> CAN bus subsystem support ---> │ │ | + | │ │ -*- Wireless ---> │ │ |
− | │ │ < > IrDA (infrared) subsystem support ---> │ │ | + | │ │ < > WiMAX Wireless Broadband support ---> │ │ |
− | │ │ <M> Bluetooth subsystem support ---> │ │ | + | │ │ < > RF switch subsystem support ---> │ │ |
− | │ │ < > RxRPC session sockets │ │ | + | │ │ < > Plan 9 Resource Sharing Support (9P2000) (Experimental) ---> │ │ |
− | │ │ -*- Wireless ---> │ │ | + | │ │ │ │ |
− | │ │ < > WiMAX Wireless Broadband support ---> │ │ | + | │ └────────────────────────────────────────────────────────────────────────────┘ │ |
− | │ │ < > RF switch subsystem support ---> │ │ | + | ├────────────────────────────────────────────────────────────────────────────────┤ |
− | │ │ < > Plan 9 Resource Sharing Support (9P2000) (Experimental) ---> │ │ | + | │ <Select> < Exit > < Help > │ |
− | │ │ │ │ | ||
− | │ └────────────────────────────────────────────────────────────────────────────┘ │ | ||
− | ├────────────────────────────────────────────────────────────────────────────────┤ | ||
− | │ <Select> < Exit > < Help > │ | ||
└────────────────────────────────────────────────────────────────────────────────┘ | └────────────────────────────────────────────────────────────────────────────────┘ | ||
</pre> | </pre> | ||
− | === Raw CAN protocol support === | + | ==== Raw CAN protocol support ==== |
In the kernel configuration menu choose {{parameter|Networking Support ---> CAN bus subsystem support}} submenu and enable "{{parameter|Raw CAN Protocol}}". | In the kernel configuration menu choose {{parameter|Networking Support ---> CAN bus subsystem support}} submenu and enable "{{parameter|Raw CAN Protocol}}". | ||
If "{{parameter|CAN bus subsystem support}}" is built into the kernel, you can choose to build Raw CAN protocol into the kernel or as a module. The module name will be {{filename|can-raw}}. For more information, please read [[CM-T3517: Linux: Debian#Loading CAN modules|Loading CAN modules]] chapter. | If "{{parameter|CAN bus subsystem support}}" is built into the kernel, you can choose to build Raw CAN protocol into the kernel or as a module. The module name will be {{filename|can-raw}}. For more information, please read [[CM-T3517: Linux: Debian#Loading CAN modules|Loading CAN modules]] chapter. | ||
<pre> | <pre> | ||
┌────────────────────────── CAN bus subsystem support ───────────────────────────┐ | ┌────────────────────────── CAN bus subsystem support ───────────────────────────┐ | ||
− | |||
− | |||
− | |||
− | |||
│ ┌────────────────────────────────────────────────────────────────────────────┐ │ | │ ┌────────────────────────────────────────────────────────────────────────────┐ │ | ||
│ │ --- CAN bus subsystem support │ │ | │ │ --- CAN bus subsystem support │ │ | ||
Line 140: | Line 145: | ||
</pre> | </pre> | ||
− | === Platform CAN drivers === | + | ==== Platform CAN drivers ==== |
In the kernel configuration menu choose {{parameter|Networking Support ---> CAN bus subsystem support ---> CAN Device Drivers}} submenu and enable: | In the kernel configuration menu choose {{parameter|Networking Support ---> CAN bus subsystem support ---> CAN Device Drivers}} submenu and enable: | ||
* Platform CAN drivers with Netlink support | * Platform CAN drivers with Netlink support | ||
Line 148: | Line 153: | ||
<pre> | <pre> | ||
┌────────────────────────────── CAN Device Drivers ──────────────────────────────┐ | ┌────────────────────────────── CAN Device Drivers ──────────────────────────────┐ | ||
− | |||
− | |||
− | |||
− | |||
│ ┌────────────────────────────────────────────────────────────────────────────┐ │ | │ ┌────────────────────────────────────────────────────────────────────────────┐ │ | ||
│ │ < > Virtual Local CAN Interface (vcan) │ │ | │ │ < > Virtual Local CAN Interface (vcan) │ │ | ||
Line 169: | Line 170: | ||
{{Note|Protocol, platform and device driver modules must be loaded prior to configuring CAN interface.}} | {{Note|Protocol, platform and device driver modules must be loaded prior to configuring CAN interface.}} | ||
+ | |||
+ | === USB On-The-Go (OTG) === | ||
+ | |||
+ | In the kernel configuration menu choose '''Device drivers ---> USB support''' submenu and enable: | ||
+ | * Support for Host-side USB | ||
+ | ** USB runtime power management (autosuspend) and wakeup | ||
+ | *** OTG support | ||
+ | ┌───────────────────────────────── USB support ──────────────────────────────────┐ | ||
+ | │ ┌────────────────────────────────────────────────────────────────────────────┐ │ | ||
+ | │ │ --- USB support │ │ | ||
+ | │ │ <*> Support for Host-side USB │ │ | ||
+ | │ │ [*] USB verbose debug messages │ │ | ||
+ | │ │ [*] USB announce new devices │ │ | ||
+ | │ │ *** Miscellaneous USB options *** │ │ | ||
+ | │ │ [ ] Dynamic USB minor allocation │ │ | ||
+ | │ │ [*] USB runtime power management (autosuspend) and wakeup │ │ | ||
+ | │ │ [*] OTG support │ │ | ||
+ | │ │ [ ] Rely on OTG Targeted Peripherals List │ │ | ||
+ | │ │ [ ] Disable external hubs │ │ | ||
+ | │ │ < > DesignWare USB3 DRD Core Support │ │ | ||
+ | │ │ <*> USB Monitor │ │ | ||
+ | │ │ < > Support WUSB Cable Based Association (CBA) │ │ | ||
+ | │ │ *** USB Host Controller Drivers *** │ │ | ||
+ | │ │ < > Cypress C67x00 HCD support │ │ | ||
+ | │ │ <*> EHCI HCD (USB 2.0) support │ │ | ||
+ | │ │ [*] Root Hub Transaction Translators │ │ | ||
+ | │ │ [*] Improved Transaction Translator scheduling │ │ | ||
+ | │ │ [*] EHCI support for OMAP3 and later chips │ │ | ||
+ | │ └────v(+)────────────────────────────────────────────────────────────────────┘ │ | ||
+ | ├────────────────────────────────────────────────────────────────────────────────┤ | ||
+ | │ <Select> < Exit > < Help > │ | ||
+ | └────────────────────────────────────────────────────────────────────────────────┘ | ||
+ | |||
+ | * Inventra Highspeed Dual Role Controller (TI, ADI, ...) | ||
+ | ** AM35x | ||
+ | ** MUSB DMA mode (Disable DMA (always use PIO)) - will be autoselected | ||
+ | |||
+ | ┌───────────────────────────────── USB support ──────────────────────────────────┐ | ||
+ | │ ┌────^(-)────────────────────────────────────────────────────────────────────┐ │ | ||
+ | │ │ <M> Inventra Highspeed Dual Role Controller (TI, ADI, ...) │ │ | ||
+ | │ │ Platform Glue Layer │ │ | ||
+ | │ │ < > TUSB6010 │ │ | ||
+ | │ │ < > OMAP2430 and onwards │ │ | ||
+ | │ │ <M> AM35x │ │ | ||
+ | │ │ MUSB DMA mode (Disable DMA (always use PIO)) ---> │ │ | ||
+ | │ └────v(+)────────────────────────────────────────────────────────────────────┘ │ | ||
+ | ├────────────────────────────────────────────────────────────────────────────────┤ | ||
+ | │ <Select> < Exit > < Help > │ | ||
+ | └────────────────────────────────────────────────────────────────────────────────┘ | ||
+ | |||
+ | * USB Gadget Support | ||
+ | * NOP USB Transceiver Driver - will be autoselected | ||
+ | |||
+ | ┌───────────────────────────────── USB support ──────────────────────────────────┐ | ||
+ | │ ┌────^(-)────────────────────────────────────────────────────────────────────┐ │ | ||
+ | │ │ <M> USB Gadget Support ---> │ │ | ||
+ | │ │ *** OTG and related infrastructure *** │ │ | ||
+ | │ │ < > GPIO based peripheral-only VBUS sensing 'transceiver' │ │ | ||
+ | │ │ < > Philips ISP1301 with OMAP OTG │ │ | ||
+ | │ │ [ ] Generic ULPI Transceiver Driver │ │ | ||
+ | │ │ <M> TWL4030 USB Transceiver Driver │ │ | ||
+ | │ │ < > TWL6030 USB Transceiver Driver │ │ | ||
+ | │ │ {M} NOP USB Transceiver Driver │ │ | ||
+ | │ └────────────────────────────────────────────────────────────────────────────┘ │ | ||
+ | ├────────────────────────────────────────────────────────────────────────────────┤ | ||
+ | │ <Select> < Exit > < Help > │ | ||
+ | └────────────────────────────────────────────────────────────────────────────────┘ | ||
+ | |||
+ | Enter '''Device drivers ---> USB support ---> USB Gadget Support ''' and at least one gadget driver: | ||
+ | |||
+ | * Gadget Zero (DEVELOPMENT) | ||
+ | * Ethernet Gadget (with CDC Ethernet support) | ||
+ | * Mass Storage Gadget | ||
+ | ** RNDIS support | ||
+ | ** Ethernet Emulation Model (EEM) support | ||
+ | * Serial Gadget (with CDC ACM and CDC OBEX support) | ||
+ | |||
+ | ┌────────────────────────────── USB Gadget Support ──────────────────────────────┐ | ||
+ | │ ┌────────────────────────────────────────────────────────────────────────────┐ │ | ||
+ | │ │ --- USB Gadget Support │ │ | ||
+ | │ │ [*] Debugging messages (DEVELOPMENT) │ │ | ||
+ | │ │ [*] Debugging information files (DEVELOPMENT) │ │ | ||
+ | │ │ [*] Debugging information files in debugfs (DEVELOPMENT) │ │ | ||
+ | │ │ (100) Maximum VBUS Power usage (2-500 mA) │ │ | ||
+ | │ │ (2) Number of storage pipeline buffers │ │ | ||
+ | │ │ USB Peripheral Controller ---> │ │ | ||
+ | │ │ USB Gadget Drivers │ │ | ||
+ | │ │ <M> Gadget Zero (DEVELOPMENT) │ │ | ||
+ | │ │ [ ] HNP Test Device │ │ | ||
+ | │ │ < > Audio Gadget (EXPERIMENTAL) │ │ | ||
+ | │ │ <M> Ethernet Gadget (with CDC Ethernet support) │ │ | ||
+ | │ │ [*] RNDIS support │ │ | ||
+ | │ │ [*] Ethernet Emulation Model (EEM) support │ │ | ||
+ | │ │ < > Network Control Model (NCM) support │ │ | ||
+ | │ │ < > Gadget Filesystem (EXPERIMENTAL) │ │ | ||
+ | │ │ < > Function Filesystem (EXPERIMENTAL) │ │ | ||
+ | │ │ < > File-backed Storage Gadget (DEPRECATED) │ │ | ||
+ | │ │ <M> Mass Storage Gadget │ │ | ||
+ | │ │ <M> Serial Gadget (with CDC ACM and CDC OBEX support) │ │ | ||
+ | │ └────v(+)────────────────────────────────────────────────────────────────────┘ │ | ||
+ | ├────────────────────────────────────────────────────────────────────────────────┤ | ||
+ | │ <Select> < Exit > < Help > │ | ||
+ | └────────────────────────────────────────────────────────────────────────────────┘ | ||
+ | |||
+ | === Bluetooth === | ||
+ | |||
+ | In the kernel configuration menu choose '''Networking Support''' and enable '''Bluetooth subsystem support''' | ||
+ | |||
+ | ┌────────────────────────────── Networking support ──────────────────────────────┐ | ||
+ | │ ┌────────────────────────────────────────────────────────────────────────────┐ │ | ||
+ | │ │ --- Networking support │ │ | ||
+ | │ │ Networking options ---> │ │ | ||
+ | │ │ [ ] Amateur Radio support ---> │ │ | ||
+ | │ │ <M> CAN bus subsystem support ---> │ │ | ||
+ | │ │ < > IrDA (infrared) subsystem support ---> │ │ | ||
+ | │ │ <M> Bluetooth subsystem support ---> │ │ | ||
+ | │ │ < > RxRPC session sockets │ │ | ||
+ | │ └────v(+)────────────────────────────────────────────────────────────────────┘ │ | ||
+ | ├────────────────────────────────────────────────────────────────────────────────┤ | ||
+ | │ <Select> < Exit > < Help > │ | ||
+ | └────────────────────────────────────────────────────────────────────────────────┘ | ||
+ | |||
+ | Enter '''Networking Support ---> Bluetooth subsystem support''' submenu and enable '''RFCOMM protocol support''' (for OBEX FTP support) | ||
+ | |||
+ | ┌───────────────────────── Bluetooth subsystem support ──────────────────────────┐ | ||
+ | │ ┌────────────────────────────────────────────────────────────────────────────┐ │ | ||
+ | │ │ --- Bluetooth subsystem support │ │ | ||
+ | │ │ <M> RFCOMM protocol support │ │ | ||
+ | │ │ [*] RFCOMM TTY support │ │ | ||
+ | │ │ < > BNEP protocol support │ │ | ||
+ | │ │ <M> HIDP protocol support │ │ | ||
+ | │ │ Bluetooth device drivers ---> │ │ | ||
+ | │ │ │ │ | ||
+ | │ └────────────────────────────────────────────────────────────────────────────┘ │ | ||
+ | ├────────────────────────────────────────────────────────────────────────────────┤ | ||
+ | │ <Select> < Exit > < Help > │ | ||
+ | └────────────────────────────────────────────────────────────────────────────────┘ | ||
+ | |||
+ | Enter '''Networking Support ---> Bluetooth subsystem support ---> Bluetooth device drivers''' submenu and enable '''HCI UART driver'''. | ||
+ | |||
+ | Select: | ||
+ | * UART (H4) protocol support | ||
+ | * HCILL protocol support | ||
+ | |||
+ | ┌─────────────────────────── Bluetooth device drivers ───────────────────────────┐ | ||
+ | │ ┌────────────────────────────────────────────────────────────────────────────┐ │ | ||
+ | │ │ < > HCI USB driver │ │ | ||
+ | │ │ < > HCI SDIO driver │ │ | ||
+ | │ │ <M> HCI UART driver │ │ | ||
+ | │ │ [*] UART (H4) protocol support │ │ | ||
+ | │ │ [*] BCSP protocol support │ │ | ||
+ | │ │ [ ] Atheros AR300x serial support │ │ | ||
+ | │ │ [*] HCILL protocol support │ │ | ||
+ | │ └────v(+)────────────────────────────────────────────────────────────────────┘ │ | ||
+ | ├────────────────────────────────────────────────────────────────────────────────┤ | ||
+ | │ <Select> < Exit > < Help > │ | ||
+ | └────────────────────────────────────────────────────────────────────────────────┘ | ||
== See also == | == See also == | ||
Line 176: | Line 334: | ||
* [http://processors.wiki.ti.com/index.php/AM35x_High-End_CAN_Controller_%28HECC%29 AM35x High-End CAN Controller (HECC)] | * [http://processors.wiki.ti.com/index.php/AM35x_High-End_CAN_Controller_%28HECC%29 AM35x High-End CAN Controller (HECC)] | ||
* [http://processors.wiki.ti.com/index.php/Sitara_AM35x_CAN_%28HECC%29_Linux_Driver Sitara AM35x CAN (HECC) Linux Driver] | * [http://processors.wiki.ti.com/index.php/Sitara_AM35x_CAN_%28HECC%29_Linux_Driver Sitara AM35x CAN (HECC) Linux Driver] | ||
+ | * [http://processors.wiki.ti.com/index.php/Usbgeneralpage Linux USB Configuration] | ||
+ | * [http://www.bluez.org/ Official Linux Bluetooth protocol stack] | ||
[[Category:Linux]] | [[Category:Linux]] | ||
[[Category:CM-T3517]] | [[Category:CM-T3517]] |
Revision as of 09:54, 17 October 2012
Contents
Overview
Linux kernel for CM-T3517 modules 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-T3517 modules.
Kernel command line
The Linux kernel for CM-T3517 is shipped with built-in command line parameters:
root=/dev/mmcblk0p2 rootwait console=ttyO2,115200
The default kernel command line defines primary console and root device.
Setting U-Boot bootargs environment variable overrides default kernel command line and can be used to set desired kernel parameters.
Linux kernel command line must have the following parameter appended: nohlt.
This prevents the WFI instruction from halting the processor in idle state. |
Building kernel for CM-T3517
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-T3517 bootloader. You can download prebuilt 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-20xx.xx 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-T3517 kernel. You can create a copy of linux-omap git tree or download a snapshot and extract it. We assume that you have created /home/development/cm-t3517/kernel directory for CM-T3517 kernel development.
Snapshot download
- Download v3.5.7 snapshot with your web browser.
- Extract the downloaded archive linux-3.5.7.tar.bz2
cd /home/development/cm-t3517/kernel tar xvf /path/to/downloaded/linux-3.5.7.tar.bz2 mv linux-3.5.7 linux-cm-t3517
- This will create /home/development/cm-t3517/kernel/linux-cm-t3517 directory containing linux-omap kernel tree.
- Apply the CM-T3517 patch
cd /home/development/cm-t3517/kernel/linux-cm-t3517 patch -p1 < /path/to/t3517-linux/kernel/linux-3.5.7-cm-t3517-2.patch
Git clone
- Install git version control system.
- Create a clone of linux-omap kernel tree
cd /home/development/cm-t3517/kernel git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-cm-t3517
- Create a branch for CM-T3517 development. The CM-T3517 patches are generated vs. v3.5.7 tag (f2b152564afdf9c9917c17d1c41c1082c82067bd commit) in the linux-stable tree. It is recommended to use exactly the same baseline to avoid merge conflicts.
git checkout -b cm-t3517-dev f2b152564afdf9c9917c17d1c41c1082c82067bd
- Apply the CM-T3517 patch
cd /home/development/cm-t3517/kernel/linux-cm-t3517 git apply /path/to/cm-t3730-linux/kernel/linux-3.5.7-cm-t3517-2.patch
Future stable kernel versions of 3.5 can also be used by checking out any later tag of v3.5.y stable kernel tree. |
Building the kernel
export ARCH=arm export CROSS_COMPILE=arm-none-linux-eabi- make cm_t3517_defconfig make menuconfig make && make uImage && \ INSTALL_MOD_PATH=/home/development/cm-t3517/rootfs make modules_install
In the example above, the Linux kernel image (uImage) will be created in /home/development/cm-t3517/kernel/linux-omap-2.6/arch/arm/boot, and the loadable kernel modules will be installed into the /home/development/cm-t3517/rootfs/lib/modules directory.
When the CM-T3517 is booted with the kernel image created as described above and with networked root filesystem at /home/development/cm-t3517/rootfs/, the system will be able to load the kernel modules properly, thus avoiding module version problems.
Basic platform support
The CM-T3517 basic platform support is implemented in the arch/arm/mach-omap2/board-cm-t3517.c file of Linux kernel source tree. This file includes default setup of multi-functional pins, registration of the devices integrated in the CM-T3517 module and definitions of platform-specific configuration for these devices.
Controller–area network (CAN) support
Controller Area Network (CAN) is a slow (up to 1Mbit/s) serial communications protocol used in automotive, marine, industrial and medical applications. The CM-T3517 features a TI High End CAN Controller (HECC), integrated into the Sitara AM3517/05 SoC. The TI HECC implements full CAN protocol version 2.0B. It supports both the base (standard) and the extended frame format as well as a programmable data bit rate with maximum of 1Mbit/s.
To enable CAN functionality of the CM-T3517, the following dependencies must be met:
- CAN bus subsystem support enabled
- Platform CAN drivers with Netlink support enabled
- TI HECC device driver compiled into the kernel or as a module
- Raw CAN protocol support enabled
- CAN bit-timing calculation enabled
CAN bus subsystem support
In the kernel configuration menu choose "Networking Support" submenu and enable "CAN bus subsystem support". You can choose to either build it into the kernel or to compile it as a module. In the last case the module name will be can.
┌────────────────────────────── Networking support ──────────────────────────────┐ │ ┌────────────────────────────────────────────────────────────────────────────┐ │ │ │ --- Networking support │ │ │ │ Networking options ---> │ │ │ │ [ ] Amateur Radio support ---> │ │ │ │ <M> CAN bus subsystem support ---> │ │ │ │ < > IrDA (infrared) subsystem support ---> │ │ │ │ <M> Bluetooth subsystem support ---> │ │ │ │ < > RxRPC session sockets │ │ │ │ -*- Wireless ---> │ │ │ │ < > WiMAX Wireless Broadband support ---> │ │ │ │ < > RF switch subsystem support ---> │ │ │ │ < > Plan 9 Resource Sharing Support (9P2000) (Experimental) ---> │ │ │ │ │ │ │ └────────────────────────────────────────────────────────────────────────────┘ │ ├────────────────────────────────────────────────────────────────────────────────┤ │ <Select> < Exit > < Help > │ └────────────────────────────────────────────────────────────────────────────────┘
Raw CAN protocol support
In the kernel configuration menu choose Networking Support ---> CAN bus subsystem support submenu and enable "Raw CAN Protocol". If "CAN bus subsystem support" is built into the kernel, you can choose to build Raw CAN protocol into the kernel or as a module. The module name will be can-raw. For more information, please read Loading CAN modules chapter.
┌────────────────────────── CAN bus subsystem support ───────────────────────────┐ │ ┌────────────────────────────────────────────────────────────────────────────┐ │ │ │ --- CAN bus subsystem support │ │ │ │ <M> Raw CAN Protocol (raw access with CAN-ID filtering) │ │ │ │ < > Broadcast Manager CAN Protocol (with content filtering) │ │ │ │ CAN Device Drivers ---> │ │ │ │ │ │ │ └────────────────────────────────────────────────────────────────────────────┘ │ ├────────────────────────────────────────────────────────────────────────────────┤ │ <Select> < Exit > < Help > │ └────────────────────────────────────────────────────────────────────────────────┘
Platform CAN drivers
In the kernel configuration menu choose Networking Support ---> CAN bus subsystem support ---> CAN Device Drivers submenu and enable:
- Platform CAN drivers with Netlink support
- CAN bit-timing calculation
- TI High End CAN Controller
If "Platform CAN drivers with Netlink support" or "TI High End CAN Controller" are built as modules, then the module names are can-dev and ti_hecc respectively.
┌────────────────────────────── CAN Device Drivers ──────────────────────────────┐ │ ┌────────────────────────────────────────────────────────────────────────────┐ │ │ │ < > Virtual Local CAN Interface (vcan) │ │ │ │ <M> Platform CAN drivers with Netlink support │ │ │ │ [*] CAN bit-timing calculation │ │ │ │ <M> TI High End CAN Controller │ │ │ │ < > Microchip MCP251x SPI CAN controllers │ │ │ │ < > Philips/NXP SJA1000 devices ---> │ │ │ │ CAN USB interfaces ---> │ │ │ │ [ ] CAN devices debugging messages │ │ │ │ │ │ │ └────────────────────────────────────────────────────────────────────────────┘ │ ├────────────────────────────────────────────────────────────────────────────────┤ │ <Select> < Exit > < Help > │ └────────────────────────────────────────────────────────────────────────────────┘
Protocol, platform and device driver modules must be loaded prior to configuring CAN interface. |
USB On-The-Go (OTG)
In the kernel configuration menu choose Device drivers ---> USB support submenu and enable:
- Support for Host-side USB
- USB runtime power management (autosuspend) and wakeup
- OTG support
- USB runtime power management (autosuspend) and wakeup
┌───────────────────────────────── USB support ──────────────────────────────────┐ │ ┌────────────────────────────────────────────────────────────────────────────┐ │ │ │ --- USB support │ │ │ │ <*> Support for Host-side USB │ │ │ │ [*] USB verbose debug messages │ │ │ │ [*] USB announce new devices │ │ │ │ *** Miscellaneous USB options *** │ │ │ │ [ ] Dynamic USB minor allocation │ │ │ │ [*] USB runtime power management (autosuspend) and wakeup │ │ │ │ [*] OTG support │ │ │ │ [ ] Rely on OTG Targeted Peripherals List │ │ │ │ [ ] Disable external hubs │ │ │ │ < > DesignWare USB3 DRD Core Support │ │ │ │ <*> USB Monitor │ │ │ │ < > Support WUSB Cable Based Association (CBA) │ │ │ │ *** USB Host Controller Drivers *** │ │ │ │ < > Cypress C67x00 HCD support │ │ │ │ <*> EHCI HCD (USB 2.0) support │ │ │ │ [*] Root Hub Transaction Translators │ │ │ │ [*] Improved Transaction Translator scheduling │ │ │ │ [*] EHCI support for OMAP3 and later chips │ │ │ └────v(+)────────────────────────────────────────────────────────────────────┘ │ ├────────────────────────────────────────────────────────────────────────────────┤ │ <Select> < Exit > < Help > │ └────────────────────────────────────────────────────────────────────────────────┘
- Inventra Highspeed Dual Role Controller (TI, ADI, ...)
- AM35x
- MUSB DMA mode (Disable DMA (always use PIO)) - will be autoselected
┌───────────────────────────────── USB support ──────────────────────────────────┐ │ ┌────^(-)────────────────────────────────────────────────────────────────────┐ │ │ │ <M> Inventra Highspeed Dual Role Controller (TI, ADI, ...) │ │ │ │ Platform Glue Layer │ │ │ │ < > TUSB6010 │ │ │ │ < > OMAP2430 and onwards │ │ │ │ <M> AM35x │ │ │ │ MUSB DMA mode (Disable DMA (always use PIO)) ---> │ │ │ └────v(+)────────────────────────────────────────────────────────────────────┘ │ ├────────────────────────────────────────────────────────────────────────────────┤ │ <Select> < Exit > < Help > │ └────────────────────────────────────────────────────────────────────────────────┘
- USB Gadget Support
- NOP USB Transceiver Driver - will be autoselected
┌───────────────────────────────── USB support ──────────────────────────────────┐ │ ┌────^(-)────────────────────────────────────────────────────────────────────┐ │ │ │ <M> USB Gadget Support ---> │ │ │ │ *** OTG and related infrastructure *** │ │ │ │ < > GPIO based peripheral-only VBUS sensing 'transceiver' │ │ │ │ < > Philips ISP1301 with OMAP OTG │ │ │ │ [ ] Generic ULPI Transceiver Driver │ │ │ │ <M> TWL4030 USB Transceiver Driver │ │ │ │ < > TWL6030 USB Transceiver Driver │ │ │ │ {M} NOP USB Transceiver Driver │ │ │ └────────────────────────────────────────────────────────────────────────────┘ │ ├────────────────────────────────────────────────────────────────────────────────┤ │ <Select> < Exit > < Help > │ └────────────────────────────────────────────────────────────────────────────────┘
Enter Device drivers ---> USB support ---> USB Gadget Support and at least one gadget driver:
- Gadget Zero (DEVELOPMENT)
- Ethernet Gadget (with CDC Ethernet support)
- Mass Storage Gadget
- RNDIS support
- Ethernet Emulation Model (EEM) support
- Serial Gadget (with CDC ACM and CDC OBEX support)
┌────────────────────────────── USB Gadget Support ──────────────────────────────┐ │ ┌────────────────────────────────────────────────────────────────────────────┐ │ │ │ --- USB Gadget Support │ │ │ │ [*] Debugging messages (DEVELOPMENT) │ │ │ │ [*] Debugging information files (DEVELOPMENT) │ │ │ │ [*] Debugging information files in debugfs (DEVELOPMENT) │ │ │ │ (100) Maximum VBUS Power usage (2-500 mA) │ │ │ │ (2) Number of storage pipeline buffers │ │ │ │ USB Peripheral Controller ---> │ │ │ │ USB Gadget Drivers │ │ │ │ <M> Gadget Zero (DEVELOPMENT) │ │ │ │ [ ] HNP Test Device │ │ │ │ < > Audio Gadget (EXPERIMENTAL) │ │ │ │ <M> Ethernet Gadget (with CDC Ethernet support) │ │ │ │ [*] RNDIS support │ │ │ │ [*] Ethernet Emulation Model (EEM) support │ │ │ │ < > Network Control Model (NCM) support │ │ │ │ < > Gadget Filesystem (EXPERIMENTAL) │ │ │ │ < > Function Filesystem (EXPERIMENTAL) │ │ │ │ < > File-backed Storage Gadget (DEPRECATED) │ │ │ │ <M> Mass Storage Gadget │ │ │ │ <M> Serial Gadget (with CDC ACM and CDC OBEX support) │ │ │ └────v(+)────────────────────────────────────────────────────────────────────┘ │ ├────────────────────────────────────────────────────────────────────────────────┤ │ <Select> < Exit > < Help > │ └────────────────────────────────────────────────────────────────────────────────┘
Bluetooth
In the kernel configuration menu choose Networking Support and enable Bluetooth subsystem support
┌────────────────────────────── Networking support ──────────────────────────────┐ │ ┌────────────────────────────────────────────────────────────────────────────┐ │ │ │ --- Networking support │ │ │ │ Networking options ---> │ │ │ │ [ ] Amateur Radio support ---> │ │ │ │ <M> CAN bus subsystem support ---> │ │ │ │ < > IrDA (infrared) subsystem support ---> │ │ │ │ <M> Bluetooth subsystem support ---> │ │ │ │ < > RxRPC session sockets │ │ │ └────v(+)────────────────────────────────────────────────────────────────────┘ │ ├────────────────────────────────────────────────────────────────────────────────┤ │ <Select> < Exit > < Help > │ └────────────────────────────────────────────────────────────────────────────────┘
Enter Networking Support ---> Bluetooth subsystem support submenu and enable RFCOMM protocol support (for OBEX FTP support)
┌───────────────────────── Bluetooth subsystem support ──────────────────────────┐ │ ┌────────────────────────────────────────────────────────────────────────────┐ │ │ │ --- Bluetooth subsystem support │ │ │ │ <M> RFCOMM protocol support │ │ │ │ [*] RFCOMM TTY support │ │ │ │ < > BNEP protocol support │ │ │ │ <M> HIDP protocol support │ │ │ │ Bluetooth device drivers ---> │ │ │ │ │ │ │ └────────────────────────────────────────────────────────────────────────────┘ │ ├────────────────────────────────────────────────────────────────────────────────┤ │ <Select> < Exit > < Help > │ └────────────────────────────────────────────────────────────────────────────────┘
Enter Networking Support ---> Bluetooth subsystem support ---> Bluetooth device drivers submenu and enable HCI UART driver.
Select:
- UART (H4) protocol support
- HCILL protocol support
┌─────────────────────────── Bluetooth device drivers ───────────────────────────┐ │ ┌────────────────────────────────────────────────────────────────────────────┐ │ │ │ < > HCI USB driver │ │ │ │ < > HCI SDIO driver │ │ │ │ <M> HCI UART driver │ │ │ │ [*] UART (H4) protocol support │ │ │ │ [*] BCSP protocol support │ │ │ │ [ ] Atheros AR300x serial support │ │ │ │ [*] HCILL protocol support │ │ │ └────v(+)────────────────────────────────────────────────────────────────────┘ │ ├────────────────────────────────────────────────────────────────────────────────┤ │ <Select> < Exit > < Help > │ └────────────────────────────────────────────────────────────────────────────────┘