Difference between revisions of "CM-T335: Linux: Kernel"

From Compulab Mediawiki
Jump to: navigation, search
(Overview)
(Display support)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
 
Linux kernel for the CompuLab CM-T335 System-on-Module / Computer-on-Module provides support for on-board peripherals and abstracts the functionality provided by the hardware.
 
Linux kernel for the CompuLab CM-T335 System-on-Module / Computer-on-Module provides support for on-board peripherals and abstracts the functionality provided by the hardware.
Current support coverage is specified at [http://compulab.co.il/products/availability-of-os-and-drivers-for-cm-t335-and-sbc-t335/ 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-T335 modules.
 
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-T335 modules.
  
== Kernel command line ==
+
== Building kernel for CM-T335 ==
The Linux kernel for CM-T335 is shipped with built-in command line parameters:
 
  
<pre>
+
=== Getting kernel sources ===
console=ttyO0,115200n8 root=ubi0:rootfs rw rootfstype=ubifs ubi.mtd=rootfs
+
There are various ways to get Linux kernel sources that can be used as a baseline for CM-T335 kernel.
</pre>
+
For instance, a copy of linux-stable git tree can be created or a Linux kernel sources snapshot can be downloaded.
 
 
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.
 
 
 
=== Select video output ===
 
 
 
Default CM-T335 video output device is DVI. Other video output devices can be used as well.
 
* LCD video output can be enabled by adding the following boot options to the kernel command line parameters:
 
<pre>
 
cm_t335_disp=lcd
 
</pre>
 
* LVDS video output can be enabled by adding the following boot options to the kernel command line parameters:
 
<pre>
 
cm_t335_disp=lvds
 
</pre>
 
 
 
== Building kernel for CM-T335 ==
 
=== 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 ("[http://en.wikipedia.org/wiki/Application_binary_interface#EABI EABI]")
 
* Pre-built toolchain (recommended):
 
** [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/ Sourcery CodeBench Lite]
 
* Tools for creating cross-compilers:
 
** [http://crosstool-ng.org/ Crosstool-ng]: Builds a cross-compiler from source. Non-distribution specific.
 
** [http://www.gentoo.org/proj/en/base/embedded/handbook/index.xml?part=1&chap=4 Crossdev]: Gentoo's cross-compiler builder. Needs Gentoo.
 
  
=== U-Boot mkimage tool ===
+
Assuming that the {{filename|/home/development/cm-t335/kernel}} directory structure has been created for CM-T335 kernel development.
U-Boot {{cmd|mkimage}} utility is required in order to create kernel images that can be loaded by the CM-T335 bootloader.
 
You can download prebuilt [[media:mkimage.tar.gz|{{cmd|mkimage}} binary]] or build it yourself:
 
<pre>
 
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
 
</pre>
 
  
=== Getting kernel sources ===
 
There are two ways to get Linux kernel sources that can be used as a baseline for CM-T335 kernel. You can create a copy of Linux Integration/Staging git tree for AM33x SoC maintained by [http://arago-project.org/wiki/index.php/Main_Page Arago Project] or download a snapshot and extract it. We assume that you have created {{filename|/home/development/cm-t335/kernel}} directory for CM-T335 kernel development.
 
 
==== Snapshot download ====
 
==== Snapshot download ====
* Download [http://arago-project.org/git/projects/?p=linux-am33x.git;a=snapshot;h=b81bf04091986fa3893f31955564594567be3b61;sf=tgz v3.2-staging] snapshot with your web browser.
+
* Download [https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.tar.gz v4.4] snapshot with a web browser.
* Extract the downloaded archive {{filename|linux-am33x-refs_heads_v3.2-staging.tar.gz}}
+
* Extract the downloaded archive {{filename|linux-4.4.tar.gz}}
 
<pre>
 
<pre>
 
cd /home/development/cm-t335/kernel
 
cd /home/development/cm-t335/kernel
tar xvf /path/to/downloaded/linux-am33x-refs_heads_v3.2-staging.tar.gz
+
tar xvf /path/to/downloaded/linux-4.4.tar.gz
mv linux-am33x linux-cm-t335
+
mv linux-4.4 linux-cm-t335
 
</pre>
 
</pre>
 
: This will create {{filename|/home/development/cm-t335/kernel/linux-cm-t335}} directory containing linux kernel tree.
 
: This will create {{filename|/home/development/cm-t335/kernel/linux-cm-t335}} directory containing linux kernel tree.
* Apply the CM-T335 patch
+
* Apply the cm-t335 patch
 
<pre>
 
<pre>
 
cd /home/development/cm-t335/kernel/linux-cm-t335
 
cd /home/development/cm-t335/kernel/linux-cm-t335
patch -p1 < /path/to/cm-t335-linux/kernel/linux-3.2.0-cm-t335-4.patch
+
patch -p1 < /path/to/cm-t335-linux/kernel/linux-4.4.0-cm-t335-5.1.patch
 
</pre>
 
</pre>
  
Line 72: Line 31:
 
<pre>
 
<pre>
 
cd /home/development/cm-t335/kernel
 
cd /home/development/cm-t335/kernel
git clone git://arago-project.org/git/projects/linux-am33x.git linux-cm-t335
+
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux-cm-t335
 
</pre>
 
</pre>
* Create a branch for CM-T335 development. The CM-T335 patches are generated vs. b81bf04091986fa3893f31955564594567be3b61 commit in the Linux tree. It is recommended to use exactly the same baseline to avoid merge conflicts.
+
* Create a branch for CM-T335 development. The CM-T335 patches are generated vs. v4.4 tag (b5be40b90dbaa6bd337f3b77de361bfc0723468b commit) in the Linux tree. It is recommended to use exactly the same baseline to avoid merge conflicts.
 
<pre>
 
<pre>
git checkout -b cm-t335-dev b81bf04091986fa3893f31955564594567be3b61
+
cd /home/development/cm-t335/kernel/linux-cm-t335
 +
git checkout -b cm-t335-dev v4.4
 
</pre>
 
</pre>
 
* Apply the CM-T335 patch
 
* Apply the CM-T335 patch
 
<pre>
 
<pre>
cd /home/development/cm-t335/kernel/linux-cm-t335
+
git am /path/to/cm-t335-linux/kernel/patches/*.patch
git apply /path/to/cm-t335-linux/kernel/linux-3.2.0-cm-t335-4.patch
 
 
</pre>
 
</pre>
 +
 +
{{Note|Future stable kernel versions of 4.4 can also be used by adding the Linux kernel stable repository as a remote and checking out any later tag of the v4.4.y stable kernel branch.}}
  
 
=== Building the kernel ===
 
=== Building the kernel ===
 +
* Run the following commands:
 
<pre>
 
<pre>
 
export ARCH=arm
 
export ARCH=arm
 
export CROSS_COMPILE=arm-none-linux-eabi-
 
export CROSS_COMPILE=arm-none-linux-eabi-
make cm_t335_defconfig
+
make cm_t335_defconfig && make menuconfig
make menuconfig
+
make && INSTALL_MOD_PATH=/home/development/cm-t335/rootfs make modules_install
make && make uImage && \
 
    INSTALL_MOD_PATH=/home/development/cm-t335/rootfs make modules_install
 
 
</pre>
 
</pre>
  
In the example above, the Linux kernel image ({{filename|uImage}}) will be created in {{filename|/home/development/cm-t335/kernel/linux-cm-t335/arch/arm/boot}}, and the loadable kernel modules will be installed into the {{filename|/home/development/cm-t335/rootfs/lib/modules}} directory.
+
In the example above:
  
When the CM-T335 is booted with the kernel image created as described above and with networked root filesystem at {{filename|/home/development/cm-t335/rootfs/}}, the system will be able to load the kernel modules properly, thus avoiding module version problems.
+
* The Linux kernel image {{filename|zImage}} will be created in {{filename|/home/development/cm-t335/kernel/linux-cm-t335/arch/arm/boot}}
 +
* The Device Tree binary {{filename|am335x-sbc-t335.dtb}} will be created in {{filename|/home/development/cm-t335/kernel/linux-cm-t335/arch/arm/boot/dts}}
 +
* The Device Tree binary {{filename|am335x-cm-t335.dtb}} will be created in {{filename|/home/development/cm-t335/kernel/linux-cm-t335/arch/arm/boot/dts}}
 +
* The loadable kernel modules will be installed into the {{filename|/home/development/cm-t335/rootfs/lib/modules}} directory.
 +
 
 +
When the CM-T335 is booted with the kernel image and Device Tree binary created as described above and with networked root filesystem at {{filename|/home/development/cm-t335/rootfs/}}, the system will be able to load the kernel modules properly, thus avoiding module version problems.
  
 
== Basic platform support ==
 
== Basic platform support ==
 +
The CM-T335 basic platform support is implemented in device tree files located in {{filename|arch/arm/boot/dts/}} folder of Linux kernel source tree.
  
=== Analog Audio Support ===
+
=== Device Tree ===
In the kernel configuration menu choose '''Device Drivers ---> Sound card support ---> Advanced Linux Sound Architecture ---> ALSA for SoC audio support''' submenu and enable:
+
Device Tree (DT), is a data structure and language for describing hardware. More specifically, it is a description of hardware that is readable by an operating system so that the operating system doesn't need to hard code details of the machine.
* SoC Audio for the AM33XX chip
+
 
* SoC Audio support for Compulab CM-T335
+
A device tree file, named *.dts, is a text file that describes the hardware platform. It is compiled into a device tree blob, *.dtb, which is loaded into memory before the Linux kernel is started. The Linux kernel then uses that device tree blob to initialize itself at runtime.
 +
 
 +
==== CM-T335 device tree organization ====
 +
The SBC-T335 product is built from 3 major components:
 
<pre>
 
<pre>
  ┌──────────────── ALSA for SoC audio support ─────────────────┐
+
┌───────────────────────────────┐
  Arrow keys navigate the menu.  <Enter> selects submenus   
+
SB-T335 baseboard           
  --->.  Highlighted letters are hotkeys.  Pressing <Y>     
+
                 
  includes, <N> excludes, <M> modularizes features.  Press   │
+
│  ┌─────────────────────┐ 
  │  <Esc><Esc> to exit, <?> for Help, </> for Search.  Legend:
+
│  │ CM-T335 SoM         
   │ ┌─────────────────────────────────────────────────────────┐ │
+
  │         │ │
  │ │    --- ALSA for SoC audio support                      │ │
+
│  │ ┌─────────────┐   │ │
   │ │   [ ]  Support LZO compression for register caches    │ │
+
│  │ │TI AM335x SoC│   │ │
   │ │    <*>   SoC Audio for the AM33XX chip                  │ │
+
│  │ └─────────────┘   │ │
  │   < >   SoC Audio support for AM335X EVM             
+
│  └─────────────────────┘
   │ │    <*>  SoC Audio support for Compulab CM-T335        │ │
+
└───────────────────────────────┘
  │    < >   SoC Audio for the Texas Instruments OMAP chips
 
  │ │    < >   Build all ASoC CODEC drivers                  │ │
 
  │ └─────────────────────────────────────────────────────────┘
 
  ├─────────────────────────────────────────────────────────────┤
 
   │              <Select>    < Exit >    < Help >             
 
  └─────────────────────────────────────────────────────────────┘
 
 
</pre>
 
</pre>
 +
SBC-T335 Device tree hierarchy reflects the hardware hierarchy:
 +
<pre>
 +
  am33xx.dtsi
 +
 +
 +
am335x-cm-t335.dts
 +
      ∧
 +
    │
 +
am335x-sbc-t335.dts
 +
</pre>
 +
   
 +
* {{filename | am33xx.dtsi}} is the SoC vendor device tree describing the AM33x SoC group.
 +
* {{filename | am335x-cm-t335.dts}} is the SoM vendor device tree describing the CM-T335 SoM.
 +
* {{filename | am335x-sbc-t335.dts}} describes the SB-T335 baseboard. The SB-T335 board is simulating the customer board. The file should be updated according to the customer main board.
  
=== Controller–area network (CAN) support ===
+
For more details visit official [http://devicetree.org/Device_Tree_Usage Device Tree WiKi] pages and make an overview of a [http://events.linuxfoundation.org/sites/events/files/slides/petazzoni-device-tree-dummies.pdf  Device Tree tutorial]
<dl>
+
 
The CM-T335 features a TI DCAN Controller Area Network (DCAN), integrated into the Sitara AM335X SoC.
+
=== Kernel configuration ===
The TI DCAN module supports bitrates up to 1 Mbit/s and is compliant to the CAN 2.0B protocol specification.
+
 
</dl>
+
==== MMC/SDIO support ====
In the kernel configuration menu choose '''Networking support''' submenu and enable:
+
In the kernel configuration menu choose '''Device Drivers ---> MMC/SD/SDIO card support''' submenu and enable:
* CAN bus subsystem support
+
* TI OMAP High Speed Multimedia Card Interface support
 
<pre>
 
<pre>
   ┌───────────────────── CAN bus subsystem support ─────────────────────┐
+
   ┌─────────────────────────────── MMC/SD/SDIO card support ──────────────────┐
   │  Arrow keys navigate the menu<Enter> selects submenus --->.     
+
   │ ┌───────────────────────────────────────────────────────────────────────┐ │   
   │ Highlighted letters are hotkeys. Pressing <Y> includes, <N>     
+
  │ │      ...                                                             │ │  
  │  excludes, <M> modularizes features.  Press <Esc><Esc> to exit, <?> │
+
  │ │      --- MMC/SD/SDIO card support                                    │
   │ for Help, </> for Search.  Legend: [*] built-in  [ ] excluded      │
+
   │ │      ...                                                             │ │   
   │ ┌─────────────────────────────────────────────────────────────────┐
+
   │ │      < >  Secure Digital Host Controller Interface support          │ │
   │ │   [ ]   Amateur Radio support --->                            │ │   
+
   │ │       <M>   TI OMAP Multimedia Card Interface support                 │ │   
   │ │   <*CAN bus subsystem support --->                        │ │   
+
   │ │       <MTI OMAP High Speed Multimedia Card Interface support     │ │   
   │ │   < >  IrDA (infrared) subsystem support --->                │ │   
+
   │ │       < >  Synopsys DesignWare Memory Card Interface                │ │  
   │ └─────────────────────────────────────────────────────────────────┘
+
  │ │      ...                                                            │ │   
   ├─────────────────────────────────────────────────────────────────────┤
+
   │ └───────────────────────────────────────────────────────────────────────┘
   │                 <Select>    < Exit >    < Help >                  
+
   ├───────────────────────────────────────────────────────────────────────────┤ 
   └─────────────────────────────────────────────────────────────────────┘
+
   │         <Select>    < Exit >    < Help >   < Save >    < Load >         
 +
   └───────────────────────────────────────────────────────────────────────────┘
 
</pre>
 
</pre>
In the kernel configuration menu choose '''Networking support ---> CAN bus subsystem support''' submenu and enable CAN protocol support:
+
 
* Raw CAN Protocol
+
==== NAND support ====
* Broadcast Manager CAN Protocol
+
In the kernel configuration menu choose '''Device Drivers ---> Memory Technology Device (MTD) support ---> NAND Device Support''' submenu and enable:
You can choose to either build it into the kernel or to compile it as a module named ''can-raw'' and ''can-bcm'' respectively.
+
* NAND Flash device on OMAP2, OMAP3 and OMAP4
 +
* Support hardware based BCH error correction
 +
* Support software BCH ECC
 
<pre>
 
<pre>
   ┌───────────────────── CAN bus subsystem support ─────────────────────┐
+
   ┌─────────────────────────── NAND Device Support ───────────────────────────┐
   │  Arrow keys navigate the menu.  <Enter> selects submenus --->.     
+
   │ ┌───────────────────────────────────────────────────────────────────────┐ │   
  │  Highlighted letters are hotkeys.  Pressing <Y> includes, <N>      │
+
  │ │    --- NAND Device Support                                            │ │   
   │ excludes, <M> modularizes features.  Press <Esc><Esc> to exit, <?> │
+
   │ │   [*]  Support software BCH ECC                                    │ │
  for Help, </> for Search.  Legend: [*] built-in  [ ] excluded      │
+
   │ │    < >  Support Denali NAND controller as a DT device                │ │
   │ ┌─────────────────────────────────────────────────────────────────┐
+
   │ │    < >  GPIO assisted NAND Flash driver                              │ │
   │ │    --- CAN bus subsystem support                                │ │
+
   │ │    <*>  NAND Flash device on OMAP2, OMAP3 and OMAP4                  │ │
   │ │    <*Raw CAN Protocol (raw access with CAN-ID filtering)    │ │
+
   │ │    [*]    Support hardware based BCH error correction                │ │
   │ │    <*>  Broadcast Manager CAN Protocol (with content filtering)│ │
+
   │ │   ...                                                                │ │
   │ │    < >  CAN Gateway/Router (with netlink configuration)        │ │
+
   │ └───────────────────────────────────────────────────────────────────────┘
   │ │         CAN Device Drivers  --->                              │ │
+
   ├───────────────────────────────────────────────────────────────────────────┤ 
   │ └─────────────────────────────────────────────────────────────────┘
+
   │         <Select>    < Exit >    < Help >   < Save >    < Load >         
   ├─────────────────────────────────────────────────────────────────────┤
+
   └───────────────────────────────────────────────────────────────────────────┘ 
   │                 <Select>    < Exit >    < Help >                  
 
   └─────────────────────────────────────────────────────────────────────┘
 
 
</pre>
 
</pre>
Next, in the kernel configuration menu choose '''Networking support ---> CAN bus subsystem support ---> CAN Device Drivers''' submenu and enable following options:
+
 
* Platform CAN drivers with Netlink support (built into the kernel or as a module named ''can-dev'')
+
==== SPI support ====
* CAN bit-timing calculation
+
In the kernel configuration menu choose '''Device Drivers ---> SPI support''' submenu and enable:
* Bosch D_CAN devices (built into the kernel or as a module named ''d_can'')
+
* McSPI driver for OMAP
 
<pre>
 
<pre>
   ┌──────────────────────── CAN Device Drivers ─────────────────────────┐
+
   ┌─────────────────────────────── SPI support ───────────────────────────────┐
   │ Arrow keys navigate the menu.  <Enter> selects submenus --->.      │
+
   │ ┌───────────────────────────────────────────────────────────────────────┐ │   
  │  Highlighted letters are hotkeys.  Pressing <Y> includes, <N>      │
+
   │ │   --- SPI support                                                    │ │
   │ excludes, <M> modularizes features.  Press <Esc><Esc> to exit, <?> │
+
   │ │    ...                                                                │ │
  for Help, </> for Search.  Legend: [*] built-in  [ ] excluded     
+
   │ │    <*>  McSPI driver for OMAP                                        │ │
  │ ┌─────────────────────────────────────────────────────────────────┐
+
   │ │    ...                                                                │ │
   │ │    < > Virtual Local CAN Interface (vcan)                      │ │
+
   │ └───────────────────────────────────────────────────────────────────────┘
  │ │    < > Serial / USB serial CAN Adaptors (slcan)                │ │
+
   ├───────────────────────────────────────────────────────────────────────────┤  
   │ │    <*> Platform CAN drivers with Netlink support                │ │
+
   │         <Select>    < Exit >   < Help >    < Save >    < Load >        
   │ │   [*]  CAN bit-timing calculation                            │ │
+
   └───────────────────────────────────────────────────────────────────────────┘ 
   │ │    < >  TI High End CAN Controller                            │ │
 
   │ │   < >  Microchip MCP251x SPI CAN controllers                  │ │
 
   │ │    < > Philips/NXP SJA1000 devices --->                        │ │
 
   │ │    < > Bosch C_CAN devices  --->                                │ │
 
  │ │   <*> Bosch D_CAN devices  --->                                │ │
 
  │ │        CAN USB interfaces  --->                                │ │
 
  │ └────v(+)─────────────────────────────────────────────────────────┘ │
 
  ├─────────────────────────────────────────────────────────────────────┤
 
  │                  <Select>    < Exit >    < Help >                  
 
   └─────────────────────────────────────────────────────────────────────┘
 
 
</pre>
 
</pre>
Finally, in the kernel configuration menu choose '''Networking support ---> CAN bus subsystem support ---> CAN Device Drivers ---> Bosch D_CAN devices''' submenu and enable:
+
 
* Generic Platform Bus based D_CAN driver (built into the kernel or as a module named ''d_can_platform'').
+
==== UART support ====
 +
In the kernel configuration menu choose '''Device Drivers ---> Character devices ---> Serial drivers''' submenu and enable:
 +
* OMAP serial port support
 +
* Console on OMAP serial port
 
<pre>
 
<pre>
   ┌──────────────────────── Bosch D_CAN devices ────────────────────────┐
+
   ┌───────────────────────────── Serial drivers ──────────────────────────────┐
   │  Arrow keys navigate the menu.  <Enter> selects submenus --->.      │
+
   │ ┌───────────────────────────────────────────────────────────────────────┐ │   
   │ Highlighted letters are hotkeys.  Pressing <Y> includes, <N>      
+
   │ │    <*> OMAP serial port support                                      │ │   
  │  excludes, <M> modularizes features.  Press <Esc><Esc> to exit, <?> │
+
   │ │    [*]  Console on OMAP serial port                                  │ │
   │ for Help, </> for Search.  Legend: [*] built-in  [ ] excluded      │
+
   │ └───────────────────────────────────────────────────────────────────────┘
   │ ┌─────────────────────────────────────────────────────────────────┐ │
+
   ├───────────────────────────────────────────────────────────────────────────┤
  │ │    --- Bosch D_CAN devices                                      │ │
+
   │         <Select>    < Exit >    < Help >   < Save >    < Load >         
  │ │    <M>  Generic Platform Bus based D_CAN driver                │ │
+
   └───────────────────────────────────────────────────────────────────────────┘
   │ └─────────────────────────────────────────────────────────────────┘
 
   ├─────────────────────────────────────────────────────────────────────┤
 
   │                 <Select>    < Exit >    < Help >                  
 
   └─────────────────────────────────────────────────────────────────────┘
 
 
</pre>
 
</pre>
  
=== Touchscreen Support ===
+
==== Ethernet support ====
In the kernel configuration menu choose '''Device Drivers ---> Input device support''' submenu and enable:
+
In the kernel configuration menu choose '''Device Drivers ---> Network device support ---> Ethernet driver support''' submenu and enable:
* Touchscreens
+
* Texas Instruments (TI) devices
 +
* TI DaVinci MDIO Support
 +
* TI DaVinci CPDMA Support
 +
* TI CPSW ALE Support
 
<pre>
 
<pre>
   ┌─────────────────────── Input device support ────────────────────────┐
+
   ┌──────────────────────── Ethernet driver support ──────────────────────────┐
   │ Arrow keys navigate the menu. <Enter> selects submenus --->.    
+
   │ ┌───────────────────────────────────────────────────────────────────────┐ │
   │ Highlighted letters are hotkeys.  Pressing <Y> includes, <N>     
+
  │ │    ...                                                               │
   │ excludes, <M> modularizes features.  Press <Esc><Esc> to exit, <?> │
+
   │ │    [*]  Texas Instruments (TI) devices                              │
   │ for Help, </> for Search.  Legend: [*] built-in  [ ] excluded     
+
   │ │    <*>     TI DaVinci EMAC Support                                    │
   │ ┌────^(-)─────────────────────────────────────────────────────────┐
+
   │ │    -*-     TI DaVinci MDIO Support                                    │
   │ │    [ ]  Joysticks/Gamepads  --->                              │ │
+
   │ │    -*-     TI DaVinci CPDMA Support                                  │
   │ │    [ ]  Tablets  --->                                          │ │
+
   │ │    -*-     TI CPSW Switch Phy sel Support                            │ │
   │ │    [*]  Touchscreens  --->                                    │ │
+
   │ │    -*-     TI CPSW ALE Support                                        │ │
   │ │    [*]   Miscellaneous devices  --->                            │ │
+
   │ │    <*>     TI CPSW Switch Support                                     │ │
   │ │       Hardware I/O ports  --->                                │ │
+
   │ │    [*]       TI Common Platform Time Sync (CPTS) Support              │ │
   │ └─────────────────────────────────────────────────────────────────┘
+
   │ │   ...                                                                │ │
   ├─────────────────────────────────────────────────────────────────────┤
+
   │ └───────────────────────────────────────────────────────────────────────┘
   │                 <Select>    < Exit >    < Help >                  
+
   ├───────────────────────────────────────────────────────────────────────────┤
   └─────────────────────────────────────────────────────────────────────┘
+
   │         <Select>    < Exit >    < Help >   < Save >    < Load >         
 +
   └───────────────────────────────────────────────────────────────────────────┘
 
</pre>
 
</pre>
Next, in the kernel configuration menu choose '''Device Drivers ---> Input device support ---> Touchscreens''' submenu and enable:
+
 
* TI Touchscreen Interface
+
In the kernel configuration menu choose '''Device Drivers ---> Network device support ---> PHY Device support and infrastructure''' submenu and enable:
 +
* Drivers for Atheros AT803X PHYs
 
<pre>
 
<pre>
   ┌───────────────────────────── Touchscreens ──────────────────────────┐
+
   ┌────────────────── PHY Device support and infrastructure ──────────────────┐
   │ Arrow keys navigate the menu.  <Enter> selects submenus --->.      │   
+
   │ ┌───────────────────────────────────────────────────────────────────────┐ │   
   │ Highlighted letters are hotkeys.  Pressing <Y> includes, <N>     
+
   │ │   --- PHY Device support and infrastructure                         │ │   
  │  excludes, <M> modularizes features.  Press <Esc><Esc> to exit, <?> │ 
+
   │ │         *** MII PHY device drivers ***                              │ │   
  │  for Help, </> for Search.  Legend: [*] built-in  [ ] excluded      │ 
+
   │ │    < >  Drivers for the Aquantia PHYs                                │ │   
  │ ┌────^(-)─────────────────────────────────────────────────────────┐ │ 
+
   │ │    <*Drivers for Atheros AT803X PHYs                              │ │   
  │ │    < >  Touchright serial touchscreen                         │ │   
+
   │ │    ...                                                                │ │
   │ │   < >  Touchwin serial touchscreen                            │ │   
+
   │ └───────────────────────────────────────────────────────────────────────┘ │   
   │ │    <*TI Touchscreen Interface                              │ │   
+
   ├───────────────────────────────────────────────────────────────────────────┤
   │ │    < >  USB Touchscreen Driver                                │ │   
+
   │         <Select>    < Exit >    < Help >   < Save >    < Load >         
   │ │    < >  Sahara TouchIT-213 touchscreen                        │ │
+
   └───────────────────────────────────────────────────────────────────────────┘
   │ └────v(+)─────────────────────────────────────────────────────────┘ │   
 
   ├─────────────────────────────────────────────────────────────────────┤ 
 
   │                   <Select>    < Exit >    < Help >                
 
   └─────────────────────────────────────────────────────────────────────┘ 
 
 
</pre>
 
</pre>
Finally, in the kernel configuration menu choose '''Device Drivers ---> Multifunction device drivers''' submenu and enable
+
 
* TI ADC / Touch Screen chip support
+
==== Display support ====
 +
CM-T335 has a single parallel RGB display interface which drives multiple display connectors, including: a parallel RGB LCD + touchscreen connector, a DVI connector, and an LVDS connector.
 +
Since all 3 connectors are driven by the same interface, they should not be used simultaneously.
 +
 
 +
In the kernel configuration menu choose '''Device Drivers ---> Graphics support ---> Frame buffer Devices ---> OMAP2+ Display Subsystem support''' submenu and enable:
 +
* DPI support
 +
* OMAP2+ frame buffer support
 
<pre>
 
<pre>
   ┌─────────────────── Multifunction device drivers ────────────────────┐
+
   ┌──────────────────── OMAP2+ Display Subsystem support ─────────────────────┐
   │  Arrow keys navigate the menu.  <Enter> selects submenus --->.     
+
   │ ┌───────────────────────────────────────────────────────────────────────┐ │   
  │  Highlighted letters are hotkeys.  Pressing <Y> includes, <N>      │
+
  │ │    --- OMAP2+ Display Subsystem support                              │ │   
   │ excludes, <M> modularizes features. Press <Esc><Esc> to exit, <?>
+
   │ │    ...                                                               │
   │ for Help, </> for Search.  Legend: [*] built-in  [ ] excluded      │
+
   │ │    [*]  DPI support                                                  │ │
   │ ┌─────────────────────────────────────────────────────────────────┐
+
   │ │    ...                                                                │ │
   │ │    < > TPS6507x Power Management / Touch Screen chips          │ │
+
   │ │    <M>   OMAP2+ frame buffer support --->                            │ │
   │ │    <*> TI ADC / Touch Screen chip support                       │ │
+
   │ │         OMAP Display Device Drivers (new device model)  --->         │ │
   │ │   < > TPS65217 Power Management / White LED chips              │ │
+
   │ └───────────────────────────────────────────────────────────────────────┘
   │ │   [ ] TPS6586x Power Management chips                          │ │
+
   ├───────────────────────────────────────────────────────────────────────────┤
   │ └────v(+)─────────────────────────────────────────────────────────┘ │
+
   │         <Select>    < Exit >    < Help >   < Save >    < Load >         
  ├─────────────────────────────────────────────────────────────────────┤
+
   └───────────────────────────────────────────────────────────────────────────┘
   │                 <Select>    < Exit >    < Help >                  
 
   └─────────────────────────────────────────────────────────────────────┘
 
 
</pre>
 
</pre>
  
=== WLAN and Bluetooth ===
+
==== Wifi support ====
<dl>
+
The WiFi chip is connected to the SoC via SPI interface, so make sure you have SPI support turned on. Also, make sure wireless support is turned on under '''Network support'''.
CM-T335 has WLAN and Bluetooth support based on TI WL1271.
+
 
</dl>
+
In the kernel configuration menu choose '''Device Drivers ---> Network device support ---> Wireless LAN ---> TI Wireless LAN support''' submenu and enable:
==== WLAN ====
+
* TI wl12xx support
In the kernel configuration menu choose '''Networking support ---> Wireless''' submenu and enable following options:
+
* TI wlcore support
* cfg80211
+
* TI wlcore SPI support
* Common routines for IEEE802.11 drivers
 
* mac80211
 
 
<pre>
 
<pre>
   ┌────────────────────────── Wireless ───────────────────────────┐
+
   ┌───────────────────────── TI Wireless LAN support ─────────────────────────┐
   │  Arrow keys navigate the menu.  <Enter> selects submenus      │
+
   │ ┌───────────────────────────────────────────────────────────────────────┐ │   
   │ --->.  Highlighted letters are hotkeys.  Pressing <Y>       
+
   │ │    --- TI Wireless LAN support                                        │ │   
  │  includes, <N> excludes, <M> modularizes features.  Press    │
+
   │ │    < >   TI wl1251 driver support ----                              │ │
   │ <Esc><Esc> to exit, <?> for Help, </> for Search. Legend:  │
+
   │ │    <M>  TI wl12xx support                                            │ │
  │ ┌───────────────────────────────────────────────────────────┐ │
+
   │ │    < >   TI wl18xx support                                            │ │
  │ │    --- Wireless                                          │ │
+
   │ │    -M-   TI wlcore support                                            │ │
   │ │    <M>  cfg80211 - wireless configuration API            │ │
+
   │ │    <M>     TI wlcore SPI support                                      │ │
   │ │    [ ]    nl80211 testmode command                      │ │
+
   │ │    < >     TI wlcore SDIO support                                    │ │
   │ │   [ ]    enable developer warnings                      │ │
+
   │ └───────────────────────────────────────────────────────────────────────┘ │   
   │ │    [ ]    cfg80211 regulatory debugging                  │ │
+
   │         <Select>    < Exit >    < Help >   < Save >    < Load >         
   │ │   [*]    enable powersave by default                    │ │
+
   └───────────────────────────────────────────────────────────────────────────┘
  │ │    [ ]    cfg80211 DebugFS entries                      │ │
+
   
  │ │    [*]    cfg80211 wireless extensions compatibility    │ │
 
  │ │    [*]  Wireless extensions sysfs files                  │ │
 
   │ │    <M>   Common routines for IEEE802.11 drivers          │ │
 
  │ │    [ ]  lib80211 debugging messages                      │ │
 
   │ │    <M>   Generic IEEE 802.11 Networking Stack (mac80211)  │ │
 
   │ │         Default rate control algorithm (Minstrel)  ---> │ │
 
   │ └────v(+)───────────────────────────────────────────────────┘ │
 
  ├───────────────────────────────────────────────────────────────┤
 
  │              <Select>    < Exit >    < Help >              
 
   └───────────────────────────────────────────────────────────────┘
 
 
</pre>
 
</pre>
Next, in the kernel configuration menu choose '''Device Drivers ---> Network device support ---> Wireless LAN''' submenu and enable:
+
 
* TI wl12xx driver support
+
==== Bluetooth support ====
 +
The Bluetooth chip is connected to the SoC via UART interface, so make sure you have UART support turned on. Also, make sure bluetooth support is turned on under '''Network support ---> Bluetooth subsystem support'''.
 +
 
 +
In the kernel configuration menu choose '''Networking support ---> Bluetooth subsystem support ---> Bluetooth device drivers''' submenu and enable:
 +
* HCI SDIO driver
 +
* HCI UART driver
 +
* Marvell Bluetooth driver support
 +
* Marvell BT-over-SDIO driver
 
<pre>
 
<pre>
   ┌──────────────────────── Wireless LAN ─────────────────────────┐
+
   ┌──────────────────────── Bluetooth device drivers ─────────────────────────┐
   │  Arrow keys navigate the menu.  <Enter> selects submenus      │
+
   │ ┌───────────────────────────────────────────────────────────────────────┐ │   
   │ --->. Highlighted letters are hotkeys. Pressing <Y>       
+
   │ │    ...                                                               │
   │ includes, <N> excludes, <M> modularizes features. Press    │
+
   │ │    <M> HCI UART driver                                                │ │  
   │ <Esc><Esc> to exit, <?> for Help, </> for Search.  Legend: 
+
   │ │   [*]   UART (H4) protocol support                                  │
   │ ┌────^(-)───────────────────────────────────────────────────┐
+
   │ │    [*]   BCSP protocol support                                        │ │
   │ │    < >   Realtek RTL8192CU/RTL8188CU USB Wireless Network │ │
+
   │ │    [ ]   Atheros AR300x serial support                               │ │
   │ │    < >   TI wl1251 driver support --->                  │ │
+
   │ │    [*]   HCILL protocol support                                       │ │
   │ │    <M>   TI wl12xx driver support --->                  │ │
+
   │ │    ...                                                                │ │
   │ │    < >  ZyDAS ZD1211/ZD1211B USB-wireless support        │ │
+
   │ └───────────────────────────────────────────────────────────────────────┘ │  
   │ └───────────────────────────────────────────────────────────┘
+
   │         <Select>    < Exit >    < Help >   < Save >    < Load >         
  ├───────────────────────────────────────────────────────────────┤
+
   └───────────────────────────────────────────────────────────────────────────┘
   │               <Select>    < Exit >    < Help >              
 
   └───────────────────────────────────────────────────────────────┘
 
 
</pre>
 
</pre>
Finally, in the kernel configuration menu '''Device Drivers ---> Network device support ---> Wireless LAN ---> TI wl12xx driver support''' submenu enable:
+
 
* TI wl12xx support
+
==== Audio support ====
* TI wl12xx SPI support
+
In the kernel configuration menu choose '''Device Drivers ---> Sound card support ---> Advanced Linux Sound Architecture ---> ALSA for SoC audio support''' submenu and enable:
 +
* SoC Audio for Texas Instruments chips using eDMA
 +
* Multichannel Audio Serial Port (McASP) support
 +
* ASoC Simple sound card support
 
<pre>
 
<pre>
   ┌────────────────── TI wl12xx driver support ───────────────────┐
+
   ┌─────────────────────── ALSA for SoC audio support ────────────────────────┐
   │  Arrow keys navigate the menu.  <Enter> selects submenus      │
+
   │ ┌───────────────────────────────────────────────────────────────────────┐ │   
   │ --->. Highlighted letters are hotkeys.  Pressing <Y>      
+
   │ │    --- ALSA for SoC audio support                                    │ │  
   │ includes, <N> excludes, <M> modularizes features. Press    │
+
  │ │    < >   SoC Audio for the Atmel System-on-Chip                      │
   │ <Esc><Esc> to exit, <?> for Help, </> for Search.  Legend:  │
+
   │ │    <M>   SoC Audio for Texas Instruments chips using eDMA            │ │  
   │ ┌───────────────────────────────────────────────────────────┐
+
   │ │    <MMultichannel Audio Serial Port (McASP) support              │ │
   │ │    --- TI wl12xx driver support                          │ │
+
   │ │    ...                                                                │ │
   │ │   <M>   TI wl12xx support                                │ │
+
   │ │         CODEC drivers  --->                                         │ │
   │ │    <M>     TI wl12xx SPI support                         │ │
+
   │ │    <M>   ASoC Simple sound card support                               │ │
   │ │    < >    TI wl12xx SDIO support                        │ │
+
   │ │    ...                                                                │ │
   │ └───────────────────────────────────────────────────────────┘
+
   │ └───────────────────────────────────────────────────────────────────────┘
  ├───────────────────────────────────────────────────────────────┤
+
   │         <Select>    < Exit >    < Help >   < Save >    < Load >         
   │               <Select>    < Exit >    < Help >              
+
   └───────────────────────────────────────────────────────────────────────────┘
   └───────────────────────────────────────────────────────────────┘
 
 
</pre>
 
</pre>
  
==== Bluetooth ====
+
Under the '''CODEC drivers''' submenu of the same section enable:
In the kernel configuration menu choose '''Networking support ---> Bluetooth subsystem support''' submenu and enable following options:
+
* Texas Instruments TLV320AIC23 audio CODEC - I2C
 
<pre>
 
<pre>
   ┌───────────────── Bluetooth subsystem support ─────────────────┐
+
   ┌────────────────────────────── CODEC drivers ──────────────────────────────┐
   │  Arrow keys navigate the menu.  <Enter> selects submenus      │
+
   │ ┌───────────────────────────────────────────────────────────────────────┐ │   
   │ --->. Highlighted letters are hotkeys. Pressing <Y>        │
+
   │ │    ...                                                               │ │
  │  includes, <N> excludes, <M> modularizes features. Press   
+
   │ │    <M> Texas Instruments TLV320AIC23 audio CODEC - I2C                │ │
  │  <Esc><Esc> to exit, <?> for Help, </> for Search.  Legend:  │
+
   │ │    ...                                                                │ │
  │ ┌───────────────────────────────────────────────────────────┐
+
   │ └───────────────────────────────────────────────────────────────────────┘
   │ │    --- Bluetooth subsystem support                        │ │
+
   │         <Select>    < Exit >    < Help >    < Save >    < Load >        
   │ │    [*]  L2CAP protocol support                          │ │
+
   └───────────────────────────────────────────────────────────────────────────┘
   │ │    [*]  SCO links support                                │
 
   │ │    <M>   RFCOMM protocol support                          │ │
 
  │ │    [*]    RFCOMM TTY support                            │ │
 
  │ │   <M>   BNEP protocol support                            │ │
 
  │ │    [*]    Multicast filter support                      │ │
 
  │ │    [*]    Protocol filter support                        │ │
 
  │ │   <M>  HIDP protocol support                            │ │
 
  │ │          Bluetooth device drivers  --->                  │ │
 
  │ └───────────────────────────────────────────────────────────┘ │
 
  ├───────────────────────────────────────────────────────────────┤
 
  │              <Select>    < Exit >    < Help >              
 
   └───────────────────────────────────────────────────────────────┘
 
 
</pre>
 
</pre>
Next, in the kernel configuration menu choose '''Networking support ---> Bluetooth subsystem support ---> Bluetooth device drivers''' submenu and enable following options:
+
 
 +
==== CAN bus support ====
 +
In the kernel configuration menu choose '''Networking support ---> CAN bus subsystem support''' submenu and enable:
 +
* Raw CAN Protocol (raw access with CAN-ID filtering)
 +
* Broadcast Manager CAN Protocol (with content filtering)
 +
 
 +
  ┌──────────────────────── CAN bus subsystem support ────────────────────────┐
 +
  │ ┌───────────────────────────────────────────────────────────────────────┐ │ 
 +
  │ │    --- CAN bus subsystem support                                      │ │ 
 +
  │ │    <M>   Raw CAN Protocol (raw access with CAN-ID filtering)          │ │ 
 +
  │ │    <M>  Broadcast Manager CAN Protocol (with content filtering)      │ │ 
 +
  │ │    < >  CAN Gateway/Router (with netlink configuration)              │ │ 
 +
  │ │          CAN Device Drivers  --->                                    │ │ 
 +
  │ └───────────────────────────────────────────────────────────────────────┘ │
 +
  │        <Select>    < Exit >    < Help >    < Save >    < Load >          │
 +
  └───────────────────────────────────────────────────────────────────────────┘
 +
 
 +
In the kernel configuration menu choose '''Networking support ---> CAN bus subsystem support ---> CAN Device Drivers''' submenu and enable:
 +
* Platform CAN drivers with Netlink support
 +
* Bosch C_CAN/D_CAN devices
 
<pre>
 
<pre>
   ┌────────────────── Bluetooth device drivers ───────────────────┐
+
   ┌─────────────────────────── CAN Device Drivers ────────────────────────────┐
   │ Arrow keys navigate the menu.  <Enter> selects submenus      │
+
   │ ┌───────────────────────────────────────────────────────────────────────┐ │   
  │  --->.  Highlighted letters are hotkeys.  Pressing <Y>        │
+
   │ │   < > Virtual Local CAN Interface (vcan)                            │ │
   │ includes, <N> excludes, <M> modularizes features.  Press   
+
   │ │    < > Serial / USB serial CAN Adaptors (slcan)                      │ │
  │  <Esc><Esc> to exit, <?> for Help, </> for Search.  Legend:  │
+
   │ │    <M> Platform CAN drivers with Netlink support                      │ │
  ┌───────────────────────────────────────────────────────────┐
+
   │ │    [*]  CAN bit-timing calculation                                  │ │
   │ │    < > HCI USB driver                                    │ │
+
   │ │    [ ]  Enable LED triggers for Netlink based drivers                │ │
   │ │    < > HCI SDIO driver                                    │ │
+
   │ │    < >   TI High End CAN Controller                                  │ │
   │ │    <M> HCI UART driver                                    │ │
+
   │ │    < >   Support for Freescale FLEXCAN based chips                   │ │
   │ │    [*UART (H4) protocol support                      │ │
+
   │ │    < >   Aeroflex Gaisler GRCAN and GRHCAN CAN devices                │ │
   │ │    [*]   BCSP protocol support                            │ │
+
   │ │    < >   Renesas R-Car CAN controller                                │ │
   │ │    [ ]   Atheros AR300x serial support                   │ │
+
   │ │    < >   Philips/NXP SJA1000 devices  ----                            │ │
   │ │    [*]   HCILL protocol support                          │ │
+
   │ │    <M>   Bosch C_CAN/D_CAN devices  --->                              │ │
   │ │    < > HCI BCM203x USB driver                            │ │
+
   │ │    ...                                                                │
   │ │    < > HCI BPA10x USB driver                              │ │
+
   │ └───────────────────────────────────────────────────────────────────────┘ │
   │ │    < > HCI BlueFRITZ! USB driver                          │ │
+
   │         <Select>    < Exit >    < Help >   < Save >    < Load >         
   │ └────v(+)───────────────────────────────────────────────────┘
+
   └───────────────────────────────────────────────────────────────────────────┘
   ├───────────────────────────────────────────────────────────────┤
 
   │               <Select>    < Exit >    < Help >              
 
   └───────────────────────────────────────────────────────────────┘
 
 
</pre>
 
</pre>
  
 
== See also ==
 
== See also ==
* [[CM-T335: Linux: Getting started]]
+
* [[CM-T335: Linux: Automatic Linux Installation|Automatic Linux installation on CM-T335]]
* [[CM-T335: Linux: Debian]]
+
* [[CM-T335: Linux: Debian|Debian Linux for CM-T335]]
* [[Linux: Development for ARM modules]]
 
  
 
[[Category:Linux]]
 
[[Category:Linux]]
 
[[Category:CM-T335]]
 
[[Category:CM-T335]]

Latest revision as of 17:14, 15 September 2016

Overview

Linux kernel for the CompuLab CM-T335 System-on-Module / Computer-on-Module provides support for on-board peripherals and abstracts the functionality provided by the hardware. 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-T335 modules.

Building kernel for CM-T335

Getting kernel sources

There are various ways to get Linux kernel sources that can be used as a baseline for CM-T335 kernel. For instance, a copy of linux-stable git tree can be created or a Linux kernel sources snapshot can be downloaded.

Assuming that the /home/development/cm-t335/kernel directory structure has been created for CM-T335 kernel development.

Snapshot download

  • Download v4.4 snapshot with a web browser.
  • Extract the downloaded archive linux-4.4.tar.gz
cd /home/development/cm-t335/kernel
tar xvf /path/to/downloaded/linux-4.4.tar.gz
mv linux-4.4 linux-cm-t335
This will create /home/development/cm-t335/kernel/linux-cm-t335 directory containing linux kernel tree.
  • Apply the cm-t335 patch
cd /home/development/cm-t335/kernel/linux-cm-t335
patch -p1 < /path/to/cm-t335-linux/kernel/linux-4.4.0-cm-t335-5.1.patch

Git clone

  • Install git version control system.
  • Create a clone of linux kernel tree
cd /home/development/cm-t335/kernel
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux-cm-t335
  • Create a branch for CM-T335 development. The CM-T335 patches are generated vs. v4.4 tag (b5be40b90dbaa6bd337f3b77de361bfc0723468b commit) in the Linux tree. It is recommended to use exactly the same baseline to avoid merge conflicts.
cd /home/development/cm-t335/kernel/linux-cm-t335
git checkout -b cm-t335-dev v4.4
  • Apply the CM-T335 patch
git am /path/to/cm-t335-linux/kernel/patches/*.patch


Admolition note.png Future stable kernel versions of 4.4 can also be used by adding the Linux kernel stable repository as a remote and checking out any later tag of the v4.4.y stable kernel branch.

Building the kernel

  • Run the following commands:
export ARCH=arm
export CROSS_COMPILE=arm-none-linux-eabi-
make cm_t335_defconfig && make menuconfig
make && INSTALL_MOD_PATH=/home/development/cm-t335/rootfs make modules_install

In the example above:

  • The Linux kernel image zImage will be created in /home/development/cm-t335/kernel/linux-cm-t335/arch/arm/boot
  • The Device Tree binary am335x-sbc-t335.dtb will be created in /home/development/cm-t335/kernel/linux-cm-t335/arch/arm/boot/dts
  • The Device Tree binary am335x-cm-t335.dtb will be created in /home/development/cm-t335/kernel/linux-cm-t335/arch/arm/boot/dts
  • The loadable kernel modules will be installed into the /home/development/cm-t335/rootfs/lib/modules directory.

When the CM-T335 is booted with the kernel image and Device Tree binary created as described above and with networked root filesystem at /home/development/cm-t335/rootfs/, the system will be able to load the kernel modules properly, thus avoiding module version problems.

Basic platform support

The CM-T335 basic platform support is implemented in device tree files located in arch/arm/boot/dts/ folder of Linux kernel source tree.

Device Tree

Device Tree (DT), is a data structure and language for describing hardware. More specifically, it is a description of hardware that is readable by an operating system so that the operating system doesn't need to hard code details of the machine.

A device tree file, named *.dts, is a text file that describes the hardware platform. It is compiled into a device tree blob, *.dtb, which is loaded into memory before the Linux kernel is started. The Linux kernel then uses that device tree blob to initialize itself at runtime.

CM-T335 device tree organization

The SBC-T335 product is built from 3 major components:

┌───────────────────────────────┐
│ SB-T335 baseboard    	        │
│      	       	       	   	│
│   ┌─────────────────────┐  	│
│   │ CM-T335 SoM      	  │    	│
│   │  	       		  │	│
│   │  	┌─────────────┐	  │	│
│   │ 	│TI AM335x SoC│	  │	│
│   │	└─────────────┘	  │	│
│   └─────────────────────┘	│
└───────────────────────────────┘

SBC-T335 Device tree hierarchy reflects the hardware hierarchy:

	   am33xx.dtsi
		∧
		│
	am335x-cm-t335.dts 
	       	∧		
	     	│		
	am335x-sbc-t335.dts
  • am33xx.dtsi is the SoC vendor device tree describing the AM33x SoC group.
  • am335x-cm-t335.dts is the SoM vendor device tree describing the CM-T335 SoM.
  • am335x-sbc-t335.dts describes the SB-T335 baseboard. The SB-T335 board is simulating the customer board. The file should be updated according to the customer main board.

For more details visit official Device Tree WiKi pages and make an overview of a Device Tree tutorial

Kernel configuration

MMC/SDIO support

In the kernel configuration menu choose Device Drivers ---> MMC/SD/SDIO card support submenu and enable:

  • TI OMAP High Speed Multimedia Card Interface support
  ┌─────────────────────────────── MMC/SD/SDIO card support ──────────────────┐
  │ ┌───────────────────────────────────────────────────────────────────────┐ │  
  │ │       ...                                                             │ │  
  │ │       --- MMC/SD/SDIO card support                                    │ │  
  │ │       ...                                                             │ │  
  │ │       < >   Secure Digital Host Controller Interface support          │ │  
  │ │       <M>   TI OMAP Multimedia Card Interface support                 │ │  
  │ │       <M>   TI OMAP High Speed Multimedia Card Interface support      │ │  
  │ │       < >   Synopsys DesignWare Memory Card Interface                 │ │  
  │ │       ...                                                             │ │  
  │ └───────────────────────────────────────────────────────────────────────┘ │  
  ├───────────────────────────────────────────────────────────────────────────┤  
  │         <Select>    < Exit >    < Help >    < Save >    < Load >          │  
  └───────────────────────────────────────────────────────────────────────────┘ 

NAND support

In the kernel configuration menu choose Device Drivers ---> Memory Technology Device (MTD) support ---> NAND Device Support submenu and enable:

  • NAND Flash device on OMAP2, OMAP3 and OMAP4
  • Support hardware based BCH error correction
  • Support software BCH ECC
  ┌─────────────────────────── NAND Device Support ───────────────────────────┐
  │ ┌───────────────────────────────────────────────────────────────────────┐ │  
  │ │    --- NAND Device Support                                            │ │  
  │ │    [*]   Support software BCH ECC                                     │ │  
  │ │    < >   Support Denali NAND controller as a DT device                │ │  
  │ │    < >   GPIO assisted NAND Flash driver                              │ │  
  │ │    <*>   NAND Flash device on OMAP2, OMAP3 and OMAP4                  │ │  
  │ │    [*]     Support hardware based BCH error correction                │ │  
  │ │    ...                                                                │ │  
  │ └───────────────────────────────────────────────────────────────────────┘ │  
  ├───────────────────────────────────────────────────────────────────────────┤  
  │         <Select>    < Exit >    < Help >    < Save >    < Load >          │  
  └───────────────────────────────────────────────────────────────────────────┘  

SPI support

In the kernel configuration menu choose Device Drivers ---> SPI support submenu and enable:

  • McSPI driver for OMAP
  ┌─────────────────────────────── SPI support ───────────────────────────────┐
  │ ┌───────────────────────────────────────────────────────────────────────┐ │  
  │ │    --- SPI support                                                    │ │  
  │ │    ...                                                                │ │  
  │ │    <*>   McSPI driver for OMAP                                        │ │  
  │ │    ...                                                                │ │  
  │ └───────────────────────────────────────────────────────────────────────┘ │  
  ├───────────────────────────────────────────────────────────────────────────┤  
  │         <Select>    < Exit >    < Help >    < Save >    < Load >          │  
  └───────────────────────────────────────────────────────────────────────────┘  

UART support

In the kernel configuration menu choose Device Drivers ---> Character devices ---> Serial drivers submenu and enable:

  • OMAP serial port support
  • Console on OMAP serial port
  ┌───────────────────────────── Serial drivers ──────────────────────────────┐
  │ ┌───────────────────────────────────────────────────────────────────────┐ │  
  │ │    <*> OMAP serial port support                                       │ │  
  │ │    [*]   Console on OMAP serial port                                  │ │  
  │ └───────────────────────────────────────────────────────────────────────┘ │
  ├───────────────────────────────────────────────────────────────────────────┤
  │         <Select>    < Exit >    < Help >    < Save >    < Load >          │
  └───────────────────────────────────────────────────────────────────────────┘

Ethernet support

In the kernel configuration menu choose Device Drivers ---> Network device support ---> Ethernet driver support submenu and enable:

  • Texas Instruments (TI) devices
  • TI DaVinci MDIO Support
  • TI DaVinci CPDMA Support
  • TI CPSW ALE Support
  ┌──────────────────────── Ethernet driver support ──────────────────────────┐
  │ ┌───────────────────────────────────────────────────────────────────────┐ │
  │ │    ...                                                                │ │
  │ │    [*]   Texas Instruments (TI) devices                               │ │
  │ │    <*>     TI DaVinci EMAC Support                                    │ │
  │ │    -*-     TI DaVinci MDIO Support                                    │ │
  │ │    -*-     TI DaVinci CPDMA Support                                   │ │
  │ │    -*-     TI CPSW Switch Phy sel Support                             │ │
  │ │    -*-     TI CPSW ALE Support                                        │ │
  │ │    <*>     TI CPSW Switch Support                                     │ │
  │ │    [*]       TI Common Platform Time Sync (CPTS) Support              │ │
  │ │    ...                                                                │ │
  │ └───────────────────────────────────────────────────────────────────────┘ │
  ├───────────────────────────────────────────────────────────────────────────┤
  │         <Select>    < Exit >    < Help >    < Save >    < Load >          │
  └───────────────────────────────────────────────────────────────────────────┘

In the kernel configuration menu choose Device Drivers ---> Network device support ---> PHY Device support and infrastructure submenu and enable:

  • Drivers for Atheros AT803X PHYs
  ┌────────────────── PHY Device support and infrastructure ──────────────────┐
  │ ┌───────────────────────────────────────────────────────────────────────┐ │  
  │ │    --- PHY Device support and infrastructure                          │ │  
  │ │          *** MII PHY device drivers ***                               │ │  
  │ │    < >   Drivers for the Aquantia PHYs                                │ │  
  │ │    <*>   Drivers for Atheros AT803X PHYs                              │ │  
  │ │    ...                                                                │ │
  │ └───────────────────────────────────────────────────────────────────────┘ │  
  ├───────────────────────────────────────────────────────────────────────────┤
  │         <Select>    < Exit >    < Help >    < Save >    < Load >          │
  └───────────────────────────────────────────────────────────────────────────┘

Display support

CM-T335 has a single parallel RGB display interface which drives multiple display connectors, including: a parallel RGB LCD + touchscreen connector, a DVI connector, and an LVDS connector. Since all 3 connectors are driven by the same interface, they should not be used simultaneously.

In the kernel configuration menu choose Device Drivers ---> Graphics support ---> Frame buffer Devices ---> OMAP2+ Display Subsystem support submenu and enable:

  • DPI support
  • OMAP2+ frame buffer support
  ┌──────────────────── OMAP2+ Display Subsystem support ─────────────────────┐
  │ ┌───────────────────────────────────────────────────────────────────────┐ │  
  │ │    --- OMAP2+ Display Subsystem support                               │ │  
  │ │    ...                                                                │ │
  │ │    [*]   DPI support                                                  │ │  
  │ │    ...                                                                │ │
  │ │    <M>   OMAP2+ frame buffer support  --->                            │ │  
  │ │          OMAP Display Device Drivers (new device model)  --->         │ │  
  │ └───────────────────────────────────────────────────────────────────────┘ │  
  ├───────────────────────────────────────────────────────────────────────────┤
  │         <Select>    < Exit >    < Help >    < Save >    < Load >          │
  └───────────────────────────────────────────────────────────────────────────┘

Wifi support

The WiFi chip is connected to the SoC via SPI interface, so make sure you have SPI support turned on. Also, make sure wireless support is turned on under Network support.

In the kernel configuration menu choose Device Drivers ---> Network device support ---> Wireless LAN ---> TI Wireless LAN support submenu and enable:

  • TI wl12xx support
  • TI wlcore support
  • TI wlcore SPI support
  ┌───────────────────────── TI Wireless LAN support ─────────────────────────┐
  │ ┌───────────────────────────────────────────────────────────────────────┐ │  
  │ │    --- TI Wireless LAN support                                        │ │  
  │ │    < >   TI wl1251 driver support  ----                               │ │  
  │ │    <M>   TI wl12xx support                                            │ │  
  │ │    < >   TI wl18xx support                                            │ │  
  │ │    -M-   TI wlcore support                                            │ │  
  │ │    <M>     TI wlcore SPI support                                      │ │  
  │ │    < >     TI wlcore SDIO support                                     │ │
  │ └───────────────────────────────────────────────────────────────────────┘ │  
  │         <Select>    < Exit >    < Help >    < Save >    < Load >          │
  └───────────────────────────────────────────────────────────────────────────┘
    

Bluetooth support

The Bluetooth chip is connected to the SoC via UART interface, so make sure you have UART support turned on. Also, make sure bluetooth support is turned on under Network support ---> Bluetooth subsystem support.

In the kernel configuration menu choose Networking support ---> Bluetooth subsystem support ---> Bluetooth device drivers submenu and enable:

  • HCI SDIO driver
  • HCI UART driver
  • Marvell Bluetooth driver support
  • Marvell BT-over-SDIO driver
  ┌──────────────────────── Bluetooth device drivers ─────────────────────────┐
  │ ┌───────────────────────────────────────────────────────────────────────┐ │  
  │ │    ...                                                                │ │
  │ │    <M> HCI UART driver                                                │ │  
  │ │    [*]   UART (H4) protocol support                                   │ │  
  │ │    [*]   BCSP protocol support                                        │ │  
  │ │    [ ]   Atheros AR300x serial support                                │ │  
  │ │    [*]   HCILL protocol support                                       │ │
  │ │    ...                                                                │ │
  │ └───────────────────────────────────────────────────────────────────────┘ │ 
  │         <Select>    < Exit >    < Help >    < Save >    < Load >          │
  └───────────────────────────────────────────────────────────────────────────┘

Audio support

In the kernel configuration menu choose Device Drivers ---> Sound card support ---> Advanced Linux Sound Architecture ---> ALSA for SoC audio support submenu and enable:

  • SoC Audio for Texas Instruments chips using eDMA
  • Multichannel Audio Serial Port (McASP) support
  • ASoC Simple sound card support
  ┌─────────────────────── ALSA for SoC audio support ────────────────────────┐
  │ ┌───────────────────────────────────────────────────────────────────────┐ │  
  │ │    --- ALSA for SoC audio support                                     │ │  
  │ │    < >   SoC Audio for the Atmel System-on-Chip                       │ │  
  │ │    <M>   SoC Audio for Texas Instruments chips using eDMA             │ │  
  │ │    <M>   Multichannel Audio Serial Port (McASP) support               │ │  
  │ │    ...                                                                │ │
  │ │          CODEC drivers  --->                                          │ │
  │ │    <M>   ASoC Simple sound card support                               │ │
  │ │    ...                                                                │ │
  │ └───────────────────────────────────────────────────────────────────────┘ │
  │         <Select>    < Exit >    < Help >    < Save >    < Load >          │
  └───────────────────────────────────────────────────────────────────────────┘

Under the CODEC drivers submenu of the same section enable:

  • Texas Instruments TLV320AIC23 audio CODEC - I2C
  ┌────────────────────────────── CODEC drivers ──────────────────────────────┐
  │ ┌───────────────────────────────────────────────────────────────────────┐ │  
  │ │    ...                                                                │ │
  │ │    <M> Texas Instruments TLV320AIC23 audio CODEC - I2C                │ │
  │ │    ...                                                                │ │
  │ └───────────────────────────────────────────────────────────────────────┘ │
  │         <Select>    < Exit >    < Help >    < Save >    < Load >          │
  └───────────────────────────────────────────────────────────────────────────┘

CAN bus support

In the kernel configuration menu choose Networking support ---> CAN bus subsystem support submenu and enable:

  • Raw CAN Protocol (raw access with CAN-ID filtering)
  • Broadcast Manager CAN Protocol (with content filtering)
 ┌──────────────────────── CAN bus subsystem support ────────────────────────┐
 │ ┌───────────────────────────────────────────────────────────────────────┐ │  
 │ │    --- CAN bus subsystem support                                      │ │  
 │ │    <M>   Raw CAN Protocol (raw access with CAN-ID filtering)          │ │  
 │ │    <M>   Broadcast Manager CAN Protocol (with content filtering)      │ │  
 │ │    < >   CAN Gateway/Router (with netlink configuration)              │ │  
 │ │          CAN Device Drivers  --->                                     │ │  
 │ └───────────────────────────────────────────────────────────────────────┘ │
 │         <Select>    < Exit >    < Help >    < Save >    < Load >          │
 └───────────────────────────────────────────────────────────────────────────┘
 

In the kernel configuration menu choose Networking support ---> CAN bus subsystem support ---> CAN Device Drivers submenu and enable:

  • Platform CAN drivers with Netlink support
  • Bosch C_CAN/D_CAN devices
  ┌─────────────────────────── CAN Device Drivers ────────────────────────────┐
  │ ┌───────────────────────────────────────────────────────────────────────┐ │  
  │ │    < > Virtual Local CAN Interface (vcan)                             │ │
  │ │    < > Serial / USB serial CAN Adaptors (slcan)                       │ │
  │ │    <M> Platform CAN drivers with Netlink support                      │ │
  │ │    [*]   CAN bit-timing calculation                                   │ │
  │ │    [ ]   Enable LED triggers for Netlink based drivers                │ │
  │ │    < >   TI High End CAN Controller                                   │ │
  │ │    < >   Support for Freescale FLEXCAN based chips                    │ │
  │ │    < >   Aeroflex Gaisler GRCAN and GRHCAN CAN devices                │ │
  │ │    < >   Renesas R-Car CAN controller                                 │ │
  │ │    < >   Philips/NXP SJA1000 devices  ----                            │ │
  │ │    <M>   Bosch C_CAN/D_CAN devices  --->                              │ │
  │ │    ...                                                                │ │
  │ └───────────────────────────────────────────────────────────────────────┘ │
  │         <Select>    < Exit >    < Help >    < Save >    < Load >          │
  └───────────────────────────────────────────────────────────────────────────┘

See also