Linux version
Installation
First you have to unpack tqmx86-dist-0.1.tar.gz and deploy packages with dpkg, which is part of the dkms package.
$ sudo dpkg -i package-name.deb
Then install additional test and developer tools, drivers package and corresponding dependencies:
$ sudo apt-get i2c-tools lm-sensors $ sudo apt-get install dkms linux-headers --> $(uname -r) $ sudo dpkg -i tqmx86-drivers_0.1_amd64.deb
Now copy configs/sensors.tqmx to /etc/sensors.d/ and configs/tqmx86.conf to /lib/modules-load.d/ .
After that you have to edit the /etc/default/grub file by adding 'acpi_enforce_resources=lax' parameter to 'GRUB_CMDLINE_LINUX_DEFAULT', then reboot.
After the reboot check the output of “$ lsmod”, the following Kernel Modules/ Drivers must have loaded automatically.
If any of these drivers have not been loaded automatically, load them manually with modprobe:
$ sudo modprobe <Driver_name>
Lastly check config: these Device special- and sysfs files and directories must be present:
Board and System Information
Board Manufacturer
$ cat /sys/class/dmi/id/sys_vendor TQ-Group
Board Name
$ cat /sys/devices/platform/tqmx86/board_id TQMxE38C
Board Hardware Revision
$ cat /sys/devices/platform/tqmx86/board_version 1
Board BIOS Revision
$ cat /sys/class/dmi/id/bios_version TQMxE38C.5.4.48.0025.02
Watchdog
Source code for watchdog test program ('wdtest') is provided in “examples” directory. To compile it, use the following command:
$ gcc wdtest.c -o wdtest
Intended usage of this program is to run as daemon and periodically ping watchdog. The following command pings watchdog every 20 seconds, this is short enough for the default timeout period of 32 seconds.
$ sudo sh -c $ ./wdtest -p 20 &
The wdtest command can also print watchdog info and set timeout. The following sequence of commands will kill the running daemon, provide watchdog info and start a new daemon:
$ 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 process of changing the watchdog timeout is similar. Make sure the delay between 'kill' and 'start is short as to not allow the watchdog to reset the board.
$ ps ax |grep wdtest 1703 pts/8 S 0:00 $ ./wdtest -p 20 $ sudo kill -9 1703; $ sudo ./wdtest -t 800 Timeout set to 1024sec $ sudo sh -c $ ./wdtest -p 500 &
Once the watchdog is first accessed it is started and cannot be stopped by any means, it can only be restarted by 'wdtest' or a similar watchdog daemon program. Alternatively simply write a charecter into /dev/watchdog (dev/watchdog0) file
GPIO
GPIO functionality can be tested with the gpio-test.sh shell script provided in the “examples” directory.
The program requires root priviliges to export a pin and to change the output value.
Pins 0-3 are hardwired as output only and pins 4-7 as input only. Their direction cannot be changed.
With a single pin argument the program reports pin status (direction and value). When a second argument is provided it changes the state of the 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
I2C
Read module EEPROM
You can read “on-module” EEPROM at address 0x50 (* are variables in the file-path). You can also read/ write EEPROM as a regular file.
$ sudo hexdump -C /sys/devices/platform/tqmx86/i2c-machxo2/i2c-*/*-0050/eeprom 00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 00000010 54 51 4d 78 45 33 38 4d 0a ff ff ff ff ff ff ff |TQMxE38M........| 00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| * 000002a0 ff a1 ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 000002b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| * 00001000
Accessing PCA9538 GPIO Chip using i2c-tools
You can also access the GPIO chip PCA9538 using i2c-tools:
First you have to determine the number of the i2c-machxo2 bus.
Then read all 4 GPIO ports of PCA9538 located on this I2C bus:
Now configure pins 0 - 3 as outputs:
$ sudo i2cset 8 0x70 3 0xf0 $ sudo i2cdump -r 0-3 8 0x70 00: 0f ff 00 f0
Lastly you have to change the output state for pins 0-1 (pins 4-7 are not affected as they are hardwired inputs).
Setting pin 0 to 0 output should turn on an LED.
$ sudo i2cset 8 0x70 1 0x06 $ sudo i2cdump -r 0-3 8 0x70 00: 06 06 00 f0
Accessing EEPROM on carrier using i2c-rw program
Source code for i2c-rw test program is provided in the “examples” directory. Use the following command to compile it:
$ gcc i2c-rw.c -o i2c-rw
Examples:
Read EEPROM at address 0x57 with offset 0 and size 64
HWMon Sensors
Standard linux '$ sensors' command can read 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-virtual-0 Adapter: Virtual device temp1: +29.0°C soc_dts1-virtual-0 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) RTC-bat: +3.02 V 5VSB: +5.08 V (min = +0.00 V, max = +6.24 V) COMe-input: +12.38 V (min = +0.00 V, max = +21.99 V) CPU-fan: 0 RPM (min = 0 RPM) COMe-fan: 3936 RPM (min = 0 RPM) CPU-temp: +30.2°C (low = +0.0°C, high = +85.0°C) (crit = +100.0°C) SYS-temp: +30.0°C (low = +0.0°C, high = +85.0°C) (crit = +100.0°C)
Known Issues
- Due to BIOS incompatibility ACPI SMBus driver (i2c-scmi) does not work and legacy i801 SMBus driver reports “resource conflict”. To resolve the issue “acpi_enforce_resources=lax” needs to be added to the kernel command line.
- Setting I2C bus speed is possible only on driver startup. Default speed is 100KHz. If 50 or 400KHz is desired, specify that in driver parameters: $ sudo modprobe tqmx86 i2c_speed=50 | This parameter may be also added to a file in /lib/modprobe.d/ as: install tqmx86 i2c_speed=50
- The I2C driver is designed to work in interrupt mode on boards that support configuring the IRQ number in PLD. The IRQ number can be specified in tqmx86 driver parameters as “i2c_irq=7” (i2c_irq=0 selects polling mode). However, this was not tested and is not guaranteed to work.
- I2C driver operation in 'poll' mode at 400KHz speed is sometimes unstable.
TQ-Systems GmbH provides the Board Support Packages (BSP) free of charge. The software included in the shipment has been configured individually for the starter kits. The software is only intended to evaluate the module. The use of the Board Support Packages (BSP) is only allowed within the scope of functionality described by TQ-Systems GmbH. TQ-Systems GmbH does not accept any liability for all further changes of the Board Support Package and for any damage resulting from its use.