CM-iAM: Linux: Ubuntu

From Compulab Mediawiki
Revision as of 17:20, 4 November 2014 by Grinberg (talk | contribs) (CM-IAM: Linux: Ubuntu moved to CM-iAM: Linux: Ubuntu)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

Ubuntu Linux for the CM-iAM is based on standard Ubuntu 9.10 Karmic Koala. The run-time image supplied contains a full-featured desktop filesystem. Network, sound and graphics should work out of the box.

Authorization info

  • username: fit
  • password: 111111

Customized kernel

  • Based on the 2.6.31 kernel with patches from Ubuntu and Compulab.
  • Supports most features present on the SB-iAM development board and CM-iAM module.
  • Described in more detail on the Linux kernel for CM-iAM page.

Package management

  • To be consistent with Ubuntu/Debian packaging standards, all custom packages provided by CompuLab reside in the trivial repository.
  • This repository contains binaries and sources for the kernel, graphic drivers, libraries, etc. You will receive all required updates automatically.
  • Please read more about working with a repository in Debian Repository HOWTO

Graphic support

  • Intel Poulsbo chipset using the GMA500 graphic module from PowerVR.
  • Graphic drivers are Intel® Embedded Graphics Drivers.
  • Intel® Embedded Graphics Drivers specifically target the needs of embedded platform developers. Please review this Users Guide.
Admolition note.png The current state of the IEGD drivers for GMA500 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.
  • Known issues
    • System hangs when resuming from Suspend and Hibernate states.

MPlayer

The GMA500 graphic module provides support for the hardware decoding of the most popular video codecs. The well-known MPlayer media player is patched for this purpose 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.

Please read the official mplayer-vaapi page for more information.

GPIO’s

The SB-iAM board from Compulab contains 8 or 15 general purpose I/O pins (GPIO’s) depending on the assembly configuration. The CM-iAM provides eight general purpose I/O pins (GPIO’s) from the Poulsbo chipset, seven are dedicated and one is shared with alternate functionality, with different power domain support.

Seven additional GPIO’s are available from the IT8761E super I/O chip when option S (SIO) is assembled.

There are two kernel modules for proper GPIO`s usage: sch_gpio and it8761e_gpio. The kernel modules suppose the following pin naming convention:


GPIO’s pin naming convention on SB-iAM
GPIO name HW source Name on SB-iAM board Pin on SB-iAM board Notes
GPIO1 Poulsbo GPIO1 P50-1
GPIO2 Poulsbo GPIO2 P50-5
GPIO6 Poulsbo GPIO6 P50-4 and P50-33
GPIO8 Poulsbo GPIO8 P50-6 shared with CM-iAM ON Led
GPIO9 Poulsbo GPIO9 P50-10
GPIO10 Poulsbo GPIO_SUS0 P50-13
GPIO11 Poulsbo GPIO_SUS1 P50-15
GPIO13 Poulsbo GPIO_SUS3 P50-17
GPIO240 SIO chip SIO_GPIO10 P50-7
GPIO241 SIO chip SIO_GPIO11 P50-9
GPIO242 SIO chip SIO_GPIO12 P50-20
GPIO243 SIO chip SIO_GPIO13 P50-11
GPIO245 SIO chip SIO_GPIO15 P50-14
GPIO246 SIO chip SIO_GPIO16 P50-16
GPIO248 SIO chip SIO_GPIO20 P50-18


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:

root@ubuntu-fitpc2:/ modprobe sch_gpio
root@ubuntu-fitpc2:/ echo 8 > /sys/class/gpio/export
root@ubuntu-fitpc2:/ echo out > /sys/class/gpio/gpio8/direction
root@ubuntu-fitpc2:/ echo 1 > /sys/class/gpio/gpio8/value
## at this point the CM-iAM ON LED should be in off-state.
root@ubuntu-fitpc2:/ echo 0 > /sys/class/gpio/gpio8/value
## at this point the CM-iAM ON LED should be in on-state again.
root@ubuntu-fitpc2:/ echo 8 > /sys/class/gpio/unexport

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

Watchdog

The CM-iAM provides watchdog functionality. It is possible to enable a watchdog timer either from BIOS [F2] or when running Linux. The CM-iAM watchdog has an operating range between 31 and 255 seconds. The range is defined by the "Watchdog Timer Value" in the BIOS or by a margin parameter of the watchdog driver. Entering the BIOS setup temporarily disables watchdog operation regardless of the current state; therefore, the system will not be restarted during an interactive BIOS session. Once the watchdog has been enabled, the system will be restarted every "Watchdog Timer Value" period, unless the watchdog timer is reset or disabled by software. The driver can be loaded by the modprobe sbc-fitpc2-wdt command.

A basic example of watchdog usage:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>

int main(void)
{
	int fd = open("/dev/watchdog", O_WRONLY);
	int ret = 0;
	if (fd == -1) {
		perror("watchdog");
		exit(EXIT_FAILURE);
	}
	while (1) {
		ret = write(fd, "\0", 1);
		if (ret != 1) {
			ret = -1;
			break;
		}
		sleep(10);
	}
	close(fd);
	return ret;
}

The watchdog interface in Linux is documented in Linux Kernel Documentation :: Watchdog

Sound

There are two sound cards available in the evaluation kit, one on the CM-iAM core module and another on the SB-iAM baseboard. Current Linux drivers allow only one of the two cards to be active at any given time. The /etc/modprobe.d/alsa-base.conf file specifies which card will be active.

  • To use the CM-iAM sound card, add this line to /etc/modprobe.d/alsa-base.conf:
options snd-hda-intel probe_mask=0x1

In this case, the out line is CORE-HOUT (P31) and the in line is CORE-LINE-IN (P29)

  • To use the SB-iAM sound card, add this line to /etc/modprobe.d/alsa-base.conf:
options snd-hda-intel probe_mask=0x2

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)

Admolition note.png Switching between sound cards requires a system reboot.
Admolition note.png Existing IDT sound drivers still have issues; for example, the sound capturing channel on each card is permanent -- it's impossible to select a capturing source.

See also