Table of Contents

x86 COM Express® EAPI Linux

Please note that the x86 COM Express® EAPI Linux package is only available on request. Please contact support@tq-group.com.


Preface

The Linux drivers package tqmx86-dist-1.3.tar.gz is intended to be installed on TQ modules based on the COM Express® standard.

Tested operating systems:

  • Ubuntu 14.04 (Trusty Tahr) i386
  • Ubuntu 16.04 (XenialXerus) i386
  • Ubuntu 16.04 (XenialXerus) x86_64


Supported Features


Installation and set up procedure

Example



Example



Evaluating functionality

Board and System information

To obtain board and system information, following commands can be used:

  1. BOARD_MANUFACTURER:
    $ cat /sys/class/dmi/id/sys_vendor
  2. BOARD_NAME:
    $ cat /sys/devices/platform/tqmx86/board_id
  3. BOARD_HW_REVISION:
    $ cat /sys/devices/platform/tqmx86/board_version
  4. BOARD_BIOS_REVISION:
    $ cat /sys/class/dmi/id/bios_version

Example


Watchdog

A standard Watchdog API is provided by the driver. Please refer to official documentation for further reference:
https://www.kernel.org/doc/Documentation/watchdog/watchdog-api.txt

  1. An example test program (wdtest) makes use of this API provided in examples directory of the tqmx86-dist-1.3.tar.gz archive. It can be compiled with following command:
    $ gcc wdtest.c -o wdtest
  2. Normal usage for the program is to run as daemon which periodically “pings” watchdog:
    sudo sh -c "./wdtest -p 20 &" 

    The above command pings watchdog every 20 seconds - this is short enough for the default timeout period of 32 sec.
    WARNING: once the watchdog is first accessed it is started and cannot be stopped by any means - it can only be restarted by wdtest or similar watchdog daemon program or just by writing a character into /dev/watchdog (/dev/watchdog0) file.

  3. The wdtest command can also print watchdog info and set timeout. Following sequence of commands can be used to get watchdog info:
    $ ps ax | grep wdtest
    1686 pts/8 S 0:00 ./wdtest -p 20
    $ sudo kill -9 1686 ;sudo ./wdtest i ;sudo sh -c "./wdtest -p 20 &"
    Options: 8080, Version: 0, Id: TQMx86 Watchdog
    Status: 0
    Timeout: 32 

    The above command kills the running daemon, requests watchdog info and starts new daemon.

  4. The watchdog timeout can be changed in similar way:
    $ ps ax |grep wdtest
    1703 pts/8 S 0:00 ./wdtest -p 20
    $ sudo kill -9 1703; sudo ./wdtest -t 800
    $ sudo sh -c "./wdtest -p 500 &" 

    The timeout is set to 1024sec
    Note: delay between 'kill' and 'start' commands should be short not to allow watchdog to reset the board.


GPIO

A standard GPIO API is provided by the driver. Please refer to official documentation for further reference:
https://www.kernel.org/doc/Documentation/gpio/sysfs.txt

GPIO functionality may be tested by a gpio-test.sh shell script provided in examples directory of the tqmx86-dist-1.3.tar.gz archive. The program requires root privileges to export a 'pin' (once) and to change the output value. With a single 'pin' argument the program reports pin status (direction and value). When the second argument is provided it changes state of (output) pin accordingly:

sudo ./gpio-test.sh 2
Direction: out
Value: 0
$ sudo ./gpio-test.sh 5
Direction: in
Value: 1
$ sudo ./gpio-test.sh 2 1
$ ./gpio-test.sh 2
Direction: out
Value: 1 

Note: GPIO[0:3] are hardwired as outputs and GPIO[4:7] as inputs. Direction cannot be changed.

I2C and EEPROM

A standard I2C dev API is provided by the driver. Please refer to official documentation for further reference:
https://www.kernel.org/doc/Documentation/i2c/dev-interface

Let's consider several examples how to access devices on I2C bus:


Option: PCA9540 I/O multiplexer



Hardware Monitor sensors

A standard hwmon API is provided by the driver via sysfs. But a high-level wrapper/library libsensors can be used to access sensors as well. Please refer to official documentation for further reference:
https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface

Standard Linux 'sensors' command can be used to obtain NCT7802 and coretemp (MSR registers of CPU) hardware monitor data:

$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0:        +30.0°C (high = +110.0°C, crit = +110.0°C)
Core 1:        +30.0°C (high = +110.0°C, crit = +110.0°C)
Core 2:        +31.0°C (high = +110.0°C, crit = +110.0°C)
Core 3:        +31.0°C (high = +110.0°C, crit = +110.0°C)

soc_dts0-virtual0
Adapter: Virtual device
temp1:        +29.0°C

soc_dts1-virtual0
Adapter: Virtual device
temp1:        +30.0°C

nct7802-i2c-9-2c
Adapter: SMBus I801 adapter at 3000
3V3:          +3.37 V (min = +0.00 V, max = +4.09 V)
RTCbat:       +3.02 V
5VSB:         +5.08 V (min = +0.00 V, max = +6.24 V)
COMeinput:    +12.38 V (min = +0.00 V, max = +21.99 V)
CPUfan:          0 RPM (min = 0 RPM)
COMefan:      3936 RPM (min = 0 RPM)
CPUtemp:      +30.2°C (low = +0.0°C, high = +85.0°C)
                      (crit = +100.0°C)
SYStemp:      +30.0°C (low = +0.0°C, high = +85.0°C)
                      (crit = +100.0°C) 


Known issues and limitations