alext-mkrs / meta-acpi

Yocto BSP layer for ACPI enabled boards

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This README file contains information on building the meta-acpi BSP
layer. Please see the corresponding sections below for details.

Dependencies
============

This layer depends on:

  URI: git://git.yoctoproject.org/poky.git
  branch: krogoth

  URI: git://git.yoctoproject.org/meta-intel
  branch: krogoth

Table of Contents
=================

  I. Overview
  II. Building the meta-acpi BSP layer
  III. ACPI tables
  IV. Sample ACPI tables

I. Overview
===========

This layer provides extended support for Intel ACPI enabled development
boards such as Minnowboard, Minnowboard MAX, Galileo and Joule.

The driving force here is that the BIOS shipped with these boards cannot
possibly support all possible devices you can connect them. For example
Minnowboard MAX has a low speed expansion connector providing access to
I2C, SPI and UART buses. It is up to the developer to connect additional
devices to the board.

This layer makes it possible to include ACPI tables with the image. Each
table contains description of one device connected to the board. The
kernel loads these tables during boot and is able to enumerate devices
included in those.

We include sample ACPI tables for each board that can be used as base
for the actual devices the developer wants to connect to these boards.

II. Building the meta-acpi BSP layer
===========================================

This layer builds on top of meta-intel (see dependencies above) so you
need to download it first.

Having done that, and assuming you extracted the BSP tarball contents at
the top-level of your yocto build tree, you can build an image by adding
the location of the meta-acpi layer to bblayers.conf, along with any
other layers needed (to access common metadata shared between BSPs)
e.g.:

  /path/to/poky/meta-intel \
  /path/to/poky/meta-acpi \

Currently supported boards include Galileo, Minnowboard, MinnowBoard
MAX, Minnowboard Turbot and Joule. You can pick the board including
default ACPI tables by setting MACHINE in local.conf either of:

  MACHINE = "galileo"
  MACHINE = "minnowboard"
  MACHINE = "minnowboard-max"
  MACHINE = "joule"

Depending on the board.

You should then be able to build an image as such:

  % source oe-init-build-env
  % bitbake core-image-base

At the end of a successful build, you should have a live image that you
can boot from a USB flash drive.

In order to write the image to the USB flash drive, you can do
something like this:

  % dd if=core-image-base-minnowboard.hddimg of=/dev/sdf bs=1M

You may need to run this as root using sudo but before doing that, make
sure you have the right device in place of /dev/sdf.

III. ACPI tables
================

The recipes-bsp/acpi-tables/samples/${MACHINE}/* includes sample ACPI
tables for each board. The default configuration enables some of those.
For example if you build for Minnowboard the
conf/machine/minnowboard.conf has following line by default:

  ACPI_TABLES ?= "buttons.asl leds.asl"

This asks acpi-tables package to include following sample ACPI tables:

  recipes-bsp/acpi-tables/samples/minnowboard/buttons.asl
  recipes-bsp/acpi-tables/samples/minnowboard/leds.asl

These effectively create two new devices: A GPIO Buttons input device
and a GPIO LEDS device. When you an image created with this
configuration, you should see that the on board LED0 starts blinking
approximately at human heartbeat rate. Also if you insert a SD-card, the
LED1 on the board blinks as long as there is some I/O happening.

You can use your own devices instead by overriding ACPI_TABLES in
your local.conf. For example we can add a custom device to our
Minnowboard like:

  ACPI_TABLES = "${TOPDIR}/acpi-tables/device.asl"

This includes only device.asl and nothing more. Leaving ACPI_TABLES
empty means no devices will be added.

When you make changes to the device.asl or edit the ACPI_TABLES variable,
in order for the changes to take effect, you need to clean and rebuild
core-image-base. Otherwise, the changes to acpi-tables are not copied
to the initramfs on the image.

  % bitbake -c clean core-image-base
  % bitbake core-image-base

When you are adding your own devices, it is important that you look at
the original ACPI tables of the board in question. Typically host
controllers, like SPI and I2C, might have different path from board to
board.

When you are adding you own devices remember that paths and devices
(host controller, like SPI and I2C) differ from board to board so it is
important that you look at the actual ACPI tables of the board in
question. For example here is one way you can dissasemble ACPI DSDT
table.

Run this on the target machine (acpidump is included with this meta
layer):

  # acpidump -o acpi.dump

Copy this file to your host (you can use SSH for example). Then on the
host you can run:

  % acpixtract acpi.dump
  % iasl -d dsdt.dat

The resulting dsdt.dsl contains ASL code of the DSDT table. By
inspecting this DSDT you should be able to figure out where to connect
your device.

IV. Sample ACPI tables
======================

Here is a description of the sample ACPI tables for each supported
board. You can use these directly by just specifying the filename in
ACPI_TABLES variable.

All these live under recipes-bsp/acpi-tables/samples directory.

Galileo
--------

Galileo has rather peculiar way of muxing pins. It uses several discrete
mux chips and GPIOs to control them. We provide gpiomux-*.asl files
which provide both names to GPIOs and pin muxing accordingly. User can
select which buses are muxed on the pins of the board.

  gpiomux.asl - Just adds names to GPIOs, no muxing is done.
  gpiomux-i2c.asl - Adds names to GPIOs and muxes out native I2C.
  gpiomux-spi.asl - Adds names to GPIOs and muxes out native SPI.
  gpiomux-uart0.asl - Adds names to GPIOs and muxes out UART0.
  gpiomux-all.asl - Adds names to GPIOs and muxes out native
                    I2C, SPI and UART0.
  spidev.asl - Adds raw access SPI test device to the SPI bus using the
               GPIO chip select.
  at25.asl - Adds Atmel AT25 compatible 1k EEPROM device connected to
             the GPIO chip select.

Note this uses some features (like GPIO hogging) not yet available in
the mainline kernel. We are working to get these upstreamed.

Minnowboard
-----------

  buttons.asl - Adds GPIO buttons device for all 4 buttons available
                on the board.
  leds.asl - Adds GPIO LEDs device for the two user programmable LEDs
             available on the board and connects heartbeat and mmc
             triggers to them.

Minnowboard MAX / Turbot
------------------------

  at25.asl - Adds Atmel AT25 compatible 1k EEPROM device connected to
             the first chip select on the SPI bus of the low speed
             connector.
  m25p80.asl - Adds M25P80 compatible SPI-NOR flash connected to the
               first chip select on the SPI bus of the low speed
               connector.
  spidev.asl - Adds raw access SPI test device to the first chip select
               on the SPI bus of the low speed connector.
  leds.asl - Adds GPIO LEDs device for the D2 LED available on
             Minnowboard Turbot.

Joule
-----

  am2315.asl - Adds Aosong AM2315 temperature and humidity sensor to the
               first I2C bus available on breakout #1 header.
  at25.asl - Adds Atmel AT25 compatible 1k EEPROM device to the first
             chip select on the SPI bus of breakout #1 header.
  buttons.asl - Adds GPIO buttons device for the button labeled "GP BTN"
                on the board.
  i2c1.asl - Configures the first I2C bus to use 100 kHz standard mode
             instead of the default 400 kHz.
  isl29125.asl - Adds Intersil isl29125 RGB color sensor to the second
                 I2C bus available on Intel Joule Gumstix Sensor board.
  leds.asl - Adds GPIO LEDs device for all 4 user programmable LEDs on
             the board. First and second LEDs have default triggers for
             hearbeat and mmc respectively.
  spidev0.asl - Adds raw access SPI test device to the first chip
                select on the SPI bus of breakout #1 header.
  spidev2.asl - Adds raw access SPI test device to the third chip
                select on the SPI bus of breakout #1 header.

About

Yocto BSP layer for ACPI enabled boards

License:MIT License


Languages

Language:BitBake 94.3%Language:C++ 5.7%