Difference between revisions of "CM-iTC: Linux: Mint"

From Compulab Mediawiki
Jump to: navigation, search
(Watchdog)
(Hardware-accelerated flashplayer)
 
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
Linux Mint for the CM-iTC is based on standard Linux Mint 10 "Julia". [http://compulab.co.il/itc/download/itc-linux.zip The Linux package for CM-iTC] contains run-time image with a full-featured desktop filesystem. Network, sound and graphics should work out of the box.
+
* The Linux distribution on CM-iTC is Linux Mint 13 LTS with full-featured MATE desktop environment.
 
+
* All the necessary drivers and tools are already installed.
== Bootloader ==
+
* Networking, sound, video acceleration, 2D and 3D graphics, watchdog, CAN bus and other features all work out of the box.
In the provided ready-to-run image {{filename|syslinux}} bootloader is installed instead of commonly used {{filename|grub}}. At the current state neither legacy {{filename|grub}} nor {{filename|grub2}} can boot Linux from SD Card on the CM-iTC.
 
 
 
Take this in account if you are planning to install another Linux distribution to an SD card. By default, most Linux distributions use {{filename|grub}} and you will need to replace it with {{filename|syslinux}}.
 
 
 
== Authorization info ==
 
* username: itc
 
* password: 111111
 
 
 
== Customized kernel ==
 
* Based on the 2.6.38 mainline kernel with patches from Ubuntu and Compulab.
 
* Available in packages [http://compulab.co.il/workspace/sw/itc/maverick/source repository]
 
* Supports most features present on the SB-iTC development board and CM-iTC module.
 
* Described in more detail on the [[CM-iTC: Linux: Kernel|Linux kernel for CM-iTC]] page.
 
 
 
== Package management ==
 
* In order to be consistent with Ubuntu/Debian packaging standards, all custom packages provided by CompuLab reside in the  [http://compulab.co.il/workspace/sw/itc/maverick repository].
 
* This repository contains [http://compulab.co.il/workspace/sw/itc/maverick/binary/ binaries] and [http://compulab.co.il/workspace/sw/itc/maverick/source/ sources] for the kernel, graphic drivers, libraries, etc. You will receive all required updates automatically.
 
* Please refer to [http://www.debian.org/doc/manuals/repository-howto/repository-howto Debian Repository HOWTO] for information about working with a Ubuntu/Debian repositories.
 
  
 
== Graphic support ==
 
== Graphic support ==
 
* Intel Processor E6xx Series using the SGX535 graphic module from PowerVR.
 
* Intel Processor E6xx Series using the SGX535 graphic module from PowerVR.
 
* Graphic drivers are [http://edc.intel.com/Software/Downloads/EMGD/ Intel® Embedded Media and Graphics Drivers].
 
* Graphic drivers are [http://edc.intel.com/Software/Downloads/EMGD/ Intel® Embedded Media and Graphics Drivers].
* Intel® Embedded Graphics Drivers specifically target the needs of embedded platform developers. Please review this [http://edc.intel.com/Download.aspx?id=4722&returnurl=/Software/Downloads/EMGD/default.aspx Users Guide].
+
* Intel® Embedded Graphics Drivers specifically target the needs of embedded platform developers. For more info please review the [http://www.intel.com/content/www/us/en/intelligent-systems/intel-embedded-media-and-graphics-driver/emgd-v1-16-user-guide.html Users Guide].
*: {{Note|The current state of the EMGD drivers may be called ''alpha version''. They are not included in any official Linux distribution yet. There are still a few technical issues to be fixed. Known issues are listed below.}}
+
*: {{Note|The EMGD drivers in their current state are not included in any major Linux distribution yet. There are still a few technical and compatibility issues to be fixed. Known issues are listed below.}}
* Known issues
+
::* Required xserver-xorg downgrade to 1.9 version
** Display artefacts when visual effects are enabled. Work-around: Set Preferences->Appearance->Visual Effects to "None"
+
 
 +
== Hardware-accelerated flashplayer ==
 +
* Hardware-accelerated flashplayer is included in EMGD 1.16
 +
* To test it, open any HD video on youtube and it plays well.
  
 
== MPlayer ==
 
== MPlayer ==
The E6xx graphic module provides support for the hardware decoding of the most popular video formats. The well-known MPlayer media player is patched for this purpose and supports the following codecs:
+
The E6xx graphic module provides support for the hardware decoding of the most popular video formats. MPlayer-VAAPI is a branch of well-known MPlayer media player, it uses hardware decoding capabilities and supports the following codecs:
 
* MPEG-2
 
* MPEG-2
 
* MPEG-4 ASP (DivX)
 
* MPEG-4 ASP (DivX)
Line 39: Line 24:
 
* Windows Media Video 9 Advanced (VC-1 Advanced profile)
 
* Windows Media Video 9 Advanced (VC-1 Advanced profile)
 
{{Note|Non-accelerated decoding is currently not supported with the vaapi renderer.}}
 
{{Note|Non-accelerated decoding is currently not supported with the vaapi renderer.}}
 +
* You can run it from command line only!
 +
<pre>
 +
$ mplayer /home/username/Videos/h264_1080p_hp_4.1_40mbps_birds.mkv
 +
</pre>
 +
* mplayer-vaapi source code is available in [http://gitorious.org/vaapi/mplayer gitorious page], compiled .deb files at [http://launchpad.net/~sander-vangrieken/+archive/vaapi mplayer-vaapi ppa]
  
Please refer to [http://www.splitted-desktop.com/~gbeauchesne/mplayer-vaapi official mplayer-vaapi page] for more information.
+
== Audio ==
 +
There are two audio codecs available, one on the CM-iTC module and another on the SB-iTC baseboard. The CM-iTC audio codec is always available.
  
== Sound ==
+
If the E9 jumper is in "HDA-BASE" state - both codecs are visible to the system. Current Linux drivers allow only one of the two codecs to be active at any given time. The ''probe_mask option'' in /etc/modprobe.d/alsa-base.conf file specifies which codec is active.
There are two sound cards available in the evaluation kit, one on the CM-iTC core module and another on the SB-iTC baseboard. Current Linux drivers allow only one of the two cards to be active at any given time. The {{filename|/etc/modprobe.d/alsa-base.conf}} file specifies which card will be active.
+
* To use the CM-iTC audio codec, add the following line to /etc/modprobe.d/alsa-base.conf:
* To use the CM-iTC sound card, add this line to {{filename|/etc/modprobe.d/alsa-base.conf}}:
 
 
<pre>
 
<pre>
options snd-hda-intel probe_mask=0x1
+
options snd-hda-intel probe_mask=1
 
</pre>
 
</pre>
In this case, the out line is CORE-LINE-OUT (P31) and the in line is CORE-LINE-IN (P29)   
+
* In this case, the out line is CORE-LINE-OUT (P31) and the in line is CORE-LINE-IN (P29)   
 
+
* To use the SB-iTC sound codec:
* To use the SB-iTC sound card, add this line to {{filename|/etc/modprobe.d/alsa-base.conf}}:
 
 
<pre>
 
<pre>
options snd-hda-intel probe_mask=0x2
+
options snd-hda-intel probe_mask=2
 
</pre>
 
</pre>
In this case, the out lines are BASE-HOUT-A (P23) and BASE-HOUT-B (P22) and the in line is LINE-IN-C (P21)
+
* In this case, the out lines are BASE-HOUT-A (P23) and BASE-HOUT-B (P22) and the in line is LINE-IN-C (P21)
 
 
  
 
== CAN Bus ==
 
== CAN Bus ==
Line 64: Line 52:
  
 
The {{filename|pch_can}} kernel module is responsible for CAN Bus functionality. Userspace utils for CAN Bus are named {{filename|can-utils}} and can be downloaded
 
The {{filename|pch_can}} kernel module is responsible for CAN Bus functionality. Userspace utils for CAN Bus are named {{filename|can-utils}} and can be downloaded
from [http://developer.berlios.de/projects/socketcan Socket-CAN] project.
+
from [http://gitorious.org/linux-can/can-utils can-utils] project.
  
We present example of basic communication between two SB-iTC boards sharing the same CAN_H and CAN_L lines:
+
We present example of basic communication between two SB-iTC boards sharing the same CAN_H and CAN_L lines.
 +
{{Note|Ensure CAN_VCC, P50-29 is connected to +5V, for example P50-27, and CAN_GND P50-35 is conected to GND, for example P50-37}}
 
<pre>
 
<pre>
 
# Run initial steps on both boards
 
# Run initial steps on both boards
itc@cm-iTC ~ $ sudo modprobe can-raw
+
$ sudo ip link set can0 type can bitrate 500000
itc@cm-iTC ~ $ sudo modprobe can-bcm
+
$ sudo ifconfig can0 up
itc@cm-iTC ~ $ sudo ip link set can0 type can bitrate 500000
 
itc@cm-iTC ~ $ sudo ifconfig can0 up
 
itc@cm-iTC ~ $ cd /var/opt/socketcan/can-utils
 
  
 
# See link configuration and status and RX/TX statistics on both boards
 
# See link configuration and status and RX/TX statistics on both boards
itc@cm-iTC ~ $ ip -d -s link show can0
+
$ ip -d -s link show can0
  
 
# On one board run candump to view all messages on the bus
 
# On one board run candump to view all messages on the bus
itc@cm-iTC ~ $ ./candump -L can0,0:0,#FFFFFFFF
+
$ candump -L can0,0:0,#FFFFFFFF
  
 
# Send message from another board.  
 
# Send message from another board.  
itc@cm-iTC ~ $ ./cansend can0 123#12345678
+
$ cansend can0 123#12345678
  
 
# As result it will be dumped on the first board
 
# As result it will be dumped on the first board
itc@cm-iTC ~ $ ./candump -L can0,0:0,#FFFFFFFF
+
$ candump -L can0,0:0,#FFFFFFFF
 
(1167617833.473521) can0 123#12345678
 
(1167617833.473521) can0 123#12345678
  
 
# See link configuration and status and RX/TX statistics again
 
# See link configuration and status and RX/TX statistics again
itc@cm-iTC ~ $ ip -d -s link show can0
+
$ ip -d -s link show can0
 
</pre>
 
</pre>
  
 
== GPIO’s ==
 
== GPIO’s ==
GPIO on SB-iTC consists of 12 general-purpose I/Os from Topcliff packet hub and 6 from Tunnel Creek processor. All the I/Os have interrupt functions and can support asynchronous interrupts.
+
GPIO on SB-iTC consists of 12 general-purpose I/Os from Topcliff packet hub and 6 from the Tunnel Creek processor. All the I/Os have interrupt functions and can support asynchronous interrupts.
  
 
The {{filename|sch_gpio}} kernel module is responsible for Tunnel Creek GPIOs and the {{filename|pch_gpio}} for Topcliff GPIOs. The kernel modules suppose the following pin naming convention:
 
The {{filename|sch_gpio}} kernel module is responsible for Tunnel Creek GPIOs and the {{filename|pch_gpio}} for Topcliff GPIOs. The kernel modules suppose the following pin naming convention:
Line 221: Line 207:
 
A basic example of GPIO usage (under root):
 
A basic example of GPIO usage (under root):
 
<pre>
 
<pre>
cm-iTC itc # modprobe sch_gpio
+
$ modprobe sch_gpio
cm-iTC itc # echo 4 > /sys/class/gpio/export
+
$ echo 4 > /sys/class/gpio/export
cm-iTC itc # echo out > /sys/class/gpio/gpio4/direction
+
$ echo out > /sys/class/gpio/gpio4/direction
cm-iTC itc # echo 1 > /sys/class/gpio/gpio4/value
+
$ echo 1 > /sys/class/gpio/gpio4/value
 
## at this point the CM-iTC ON LED should be in off-state.
 
## at this point the CM-iTC ON LED should be in off-state.
cm-iTC itc # echo 0 > /sys/class/gpio/gpio4/value
+
$ echo 0 > /sys/class/gpio/gpio4/value
 
## at this point the CM-iTC ON LED should be in on-state again.
 
## at this point the CM-iTC ON LED should be in on-state again.
cm-iTC itc # echo 4 > /sys/class/gpio/unexport
+
$ echo 4 > /sys/class/gpio/unexport
 
</pre>
 
</pre>
  
Line 251: Line 237:
 
* UART0 : from 300 bps to 4Mbps
 
* UART0 : from 300 bps to 4Mbps
 
* UART1-3 : from 300 bps to 1Mbps
 
* UART1-3 : from 300 bps to 1Mbps
Equipped with DMA interface.
 
  
 
== Watchdog ==
 
== Watchdog ==
The Intel® AtomTM Processor E6xx Series supports a user configurable watchdog timer.
+
The Intel® AtomTM E6xx processor supports a user configurable watchdog. Watchdog timer provides a resolution that ranges from 1 sec to 10 min.
It contains selectable prescaler approximately 1 sec to 10 min.
 
  
Once watchdog was enabled the system will be restarted every "timeout" period,
+
Once the watchdog is enabled the system restarts once the timeout period elapses,
so to prevent it user can restart or disable the watchdog. Default "timeout"
+
so in order to prevent it the user needs to either feed the watchdog or to disable it. By default the timeout
value is 60 sec.
+
value is 60 sec and the watchdog deamon feeds the watchdog every 10 sec.
 +
You can overwrite the default settings in /etc/watchdog.conf and /etc/default/watchdog
  
To use it install watchdog utility and edit ''/etc/default/watchdog''.
+
Watchdog is already installed and configured on the Linux image provide by CompuLab. You can simulate kernel panic (as super user)
 
<pre>
 
<pre>
itc@cm-iTC ~ $ sudo apt-get install watchdog
+
$ echo c > /proc/sysrq-trigger
itc@cm-iTC ~ $ sudo nano /etc/default/watchdog
 
# Start watchdog at boot time? 0 or 1
 
run_watchdog=1
 
# Load module before starting watchdog
 
watchdog_module="itc_wdt"
 
# Specify additional watchdog options here (see manpage).
 
 
</pre>
 
</pre>
 
+
As a result, the watchdog is not fed and the system will reboot after 60 sec
By default watchdog deamon will "feed" the watchdog every 10 sec.
 
  
 
== See also ==
 
== See also ==

Latest revision as of 15:20, 19 March 2013

Overview

  • The Linux distribution on CM-iTC is Linux Mint 13 LTS with full-featured MATE desktop environment.
  • All the necessary drivers and tools are already installed.
  • Networking, sound, video acceleration, 2D and 3D graphics, watchdog, CAN bus and other features all work out of the box.

Graphic support

  • Intel Processor E6xx Series using the SGX535 graphic module from PowerVR.
  • Graphic drivers are Intel® Embedded Media and Graphics Drivers.
  • Intel® Embedded Graphics Drivers specifically target the needs of embedded platform developers. For more info please review the Users Guide.
Admolition note.png The EMGD drivers in their current state are not included in any major Linux distribution yet. There are still a few technical and compatibility issues to be fixed. Known issues are listed below.
  • Required xserver-xorg downgrade to 1.9 version

Hardware-accelerated flashplayer

  • Hardware-accelerated flashplayer is included in EMGD 1.16
  • To test it, open any HD video on youtube and it plays well.

MPlayer

The E6xx graphic module provides support for the hardware decoding of the most popular video formats. MPlayer-VAAPI is a branch of well-known MPlayer media player, it uses hardware decoding capabilities and supports the following codecs:

  • MPEG-2
  • MPEG-4 ASP (DivX)
  • H.263 (MPEG-4 short-video header variant)
  • MPEG-4 AVC (H.264)
  • Windows Media Video 9 (WMV3)
  • Windows Media Video 9 Advanced (VC-1 Advanced profile)
Admolition note.png Non-accelerated decoding is currently not supported with the vaapi renderer.
  • You can run it from command line only!
$ mplayer /home/username/Videos/h264_1080p_hp_4.1_40mbps_birds.mkv

Audio

There are two audio codecs available, one on the CM-iTC module and another on the SB-iTC baseboard. The CM-iTC audio codec is always available.

If the E9 jumper is in "HDA-BASE" state - both codecs are visible to the system. Current Linux drivers allow only one of the two codecs to be active at any given time. The probe_mask option in /etc/modprobe.d/alsa-base.conf file specifies which codec is active.

  • To use the CM-iTC audio codec, add the following line to /etc/modprobe.d/alsa-base.conf:
options snd-hda-intel probe_mask=1
  • In this case, the out line is CORE-LINE-OUT (P31) and the in line is CORE-LINE-IN (P29)
  • To use the SB-iTC sound codec:
options snd-hda-intel probe_mask=2
  • In this case, the out lines are BASE-HOUT-A (P23) and BASE-HOUT-B (P22) and the in line is LINE-IN-C (P21)

CAN Bus

The CM-iTC provides a CAN interface for use in commercial systems. The CAN controller performs communication in accordance with the BOSCH CAN Protocol Version 2.0B Active1 (standard format and extended format). The bit rate can be programmed to a maximum of 1Mbit/s.

The pch_can kernel module is responsible for CAN Bus functionality. Userspace utils for CAN Bus are named can-utils and can be downloaded from can-utils project.

We present example of basic communication between two SB-iTC boards sharing the same CAN_H and CAN_L lines.

Admolition note.png Ensure CAN_VCC, P50-29 is connected to +5V, for example P50-27, and CAN_GND P50-35 is conected to GND, for example P50-37
# Run initial steps on both boards
$ sudo ip link set can0 type can bitrate 500000
$ sudo ifconfig can0 up

# See link configuration and status and RX/TX statistics on both boards
$ ip -d -s link show can0

# On one board run candump to view all messages on the bus
$ candump -L can0,0:0,#FFFFFFFF

# Send message from another board. 
$ cansend can0 123#12345678

# As result it will be dumped on the first board
$ candump -L can0,0:0,#FFFFFFFF
(1167617833.473521) can0 123#12345678

# See link configuration and status and RX/TX statistics again
$ ip -d -s link show can0

GPIO’s

GPIO on SB-iTC consists of 12 general-purpose I/Os from Topcliff packet hub and 6 from the Tunnel Creek processor. All the I/Os have interrupt functions and can support asynchronous interrupts.

The sch_gpio kernel module is responsible for Tunnel Creek GPIOs and the pch_gpio for Topcliff GPIOs. The kernel modules suppose the following pin naming convention:

GPIO’s pin naming convention on SB-iTC
GPIO name HW source Name on SB-iTC board Pin on SB-iTC board Notes
GPIO1 Tunnel Creek GPIO1 P50-4
GPIO4 Tunnel Creek GPIO4 P50-10 shared with LED, WD
GPIO7 Tunnel Creek GPIO_SUS2 P1-48 shared with LVDS_BCTL
GPIO8 Tunnel Creek GPIO_SUS3 P1-47 shared with LVDS_DDC_CLK
GPIO9 Tunnel Creek GPIO_SUS4 P1-49 shared with LVDS_DDC_DAT
GPIO12 Tunnel Creek GPIO_SUS7 P50-1
GPIO244 Topcliff SB_GPIO0 P50-5
GPIO245 Topcliff SB_GPIO1 P50-13
GPIO246 Topcliff SB_GPIO2 P50-15
GPIO247 Topcliff SB_GPIO3 P50-6
GPIO248 Topcliff SB_GPIO4 P50-18
GPIO249 Topcliff SB_GPIO5 P50-7
GPIO250 Topcliff SB_GPIO6 P50-9
GPIO251 Topcliff SB_GPIO7 P50-20
GPIO252 Topcliff SB_GPIO8 P50-11
GPIO253 Topcliff SB_GPIO9 P50-14
GPIO254 Topcliff SB_GPIO10 P50-16
GPIO255 Topcliff SB_GPIO11 P50-38

The GPIO sysfs interface allows users to manipulate any GPIO from userspace (also known as programmable flags). Since it uses gpiolib, all GPIO's on the system may be utilized dynamically.

Userspace utilizes a sysfs control interface to dynamically request and release individual GPIO's. Once a GPIO has been requested, writing to the newly created path allows you to control the direction and the data, while reading from it returns the GPIO data (which usually corresponds to a 0 or 1 representing the signal level).

A basic example of GPIO usage (under root):

$ modprobe sch_gpio
$ echo 4 > /sys/class/gpio/export
$ echo out > /sys/class/gpio/gpio4/direction
$ echo 1 > /sys/class/gpio/gpio4/value
## at this point the CM-iTC ON LED should be in off-state.
$ echo 0 > /sys/class/gpio/gpio4/value
## at this point the CM-iTC ON LED should be in on-state again.
$ echo 4 > /sys/class/gpio/unexport

The GPIO framework and GPIO sysfs interface are both documented in Linux Kernel Documentation :: GPIO

UART

Corresponding device nodes are: /dev/ttyPCH[0-3].

Supports full UART and 2-wire UART:

  • UART0 : full UART
  • UART1-3 : 2-wire UART

Full-duplex buffering. Full status reporting. Reduces interrupts to CPU by implementing 256-bytes(UART0) or 64-bytes(UART1-3) transmit and receive FIFOs. Independent control of the following: transmission interrupt, reception interrupt, line status interrupt, and FIFOs.

Programmable serial interface:

  • 5-, 6-, 7-, or 8-bit character
  • Generation and verification of odd parity, even parity, or no parity
  • 1, 1.5, and 2 stop bits

Programmable baud rate generator:

  • UART0 : from 300 bps to 4Mbps
  • UART1-3 : from 300 bps to 1Mbps

Watchdog

The Intel® AtomTM E6xx processor supports a user configurable watchdog. Watchdog timer provides a resolution that ranges from 1 sec to 10 min.

Once the watchdog is enabled the system restarts once the timeout period elapses, so in order to prevent it the user needs to either feed the watchdog or to disable it. By default the timeout value is 60 sec and the watchdog deamon feeds the watchdog every 10 sec. You can overwrite the default settings in /etc/watchdog.conf and /etc/default/watchdog

Watchdog is already installed and configured on the Linux image provide by CompuLab. You can simulate kernel panic (as super user)

$ echo c > /proc/sysrq-trigger

As a result, the watchdog is not fed and the system will reboot after 60 sec

See also