Ubuntu Linux for CM-iAM

From Compulab Mediawiki
Revision as of 08:00, 29 October 2009 by Mike (talk | contribs) (1 revision(s))
Jump to: navigation, search

Overview

Ubuntu Linux for the CM-iAM is based on standard Ubuntu 9.04 Jaunty Jackalope. sb-iam.ubuntu-9.04.NAND.img run-time image contain a full-featured desktop filesystem. Network, sound, graphics should work out of the box.

Authorization info

  • username: user
  • password: 111111

Customized kernel

  • Based on 2.6.28 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.

Graphic support

  • Intel Poulsbo chipset using GMA500 graphic module from PowerVR.
  • Graphic drivers taken from PPA for Ubuntu Mobile Team, slightly patched and re-organized.
Admolition note.png The current state of graphic drivers for GMA500 may be called alpha version. They are not included in any official Linux distribution yet. There are still a couple of technical issues to be fixed.

Mplayer

The GMA500 graphic module provides support for hardware decoding of 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 check out the official mplayer-vaapi page for more info.

GPIO’s

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

Seven additional GPIO’s are available from IT8761E super I/O chip when option S (SIO) is assembled. The kernel driver supposes 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
GPIO0 Poulsbo GPIO1 P50-1
GPIO1 Poulsbo GPIO6 P50-4 and P50-33
GPIO2 Poulsbo GPIO2 P50-5
GPIO3 Poulsbo GPIO8 P50-6 shared with CM-iAM ON Led
GPIO4 Poulsbo GPIO9 P50-10
GPIO5 Poulsbo GPIO_SUS0 P50-13
GPIO6 Poulsbo GPIO_SUS1 P50-15
GPIO7 Poulsbo GPIO_SUS3 P50-17
GPIO8 SIO chip SIO_GPIO10 P50-7
GPIO9 SIO chip SIO_GPIO11 P50-9
GPIO10 SIO chip SIO_GPIO12 P50-20
GPIO11 SIO chip SIO_GPIO13 P50-11
GPIO12 SIO chip SIO_GPIO15 P50-14
GPIO13 SIO chip SIO_GPIO16 P50-16
GPIO14 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, it is able to dynamically utilize all GPIO's on the system.

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).

Basic example of GPIO usage:

root@sb-iam:/ echo 3 > /sys/class/gpio/export
root@sb-iam:/ echo out > /sys/class/gpio/gpio3/direction
root@sb-iam:/ echo 1 > /sys/class/gpio/gpio3/value
## at this point CM-iAM ON LED should be in off-state.
root@sb-iam:/ echo 0 > /sys/class/gpio/gpio3/value
## at this point CM-iAM ON LED should be in on-state again.
root@sb-iam:/ echo 3 > /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 from the 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 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 watchdog timer is reset or disabled by the software. The driver can be loaded by the modprobe cm-iam-wdt command.

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 core module CM-iAM 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 is responsible for choosing 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 model=ref
  • To use the SB-iAM sound card, add this line to /etc/modprobe.d/alsa-base.conf:
options snd-hda-intel probe_mask=0x2 model=ref


Admolition note.png Switching between sound cards requires a system reboot.
Admolition note.png The sound capturing channel on each card is permanent -- it's impossible to choose the capturing source. The CM-iAM sound card takes input from CORE-LINE-IN (P29 connector), while the SB-iAM sound card takes input from BASE-LINE-IN-C (P21 connector).

See also