====== 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.
++++$ lsmod |
* tqmx86
* i2c-machxo2
* tqmx86_wdt
* gpio_tqmx86
* at24
* nct7802
* i2c-i801
++++
If any of these drivers have not been loaded automatically, load them manually with modprobe:
$ sudo modprobe
Lastly check config: these Device special- and sysfs files and directories must be present:
++++ config |
* /dev/watchdog
* /dev/watchdog0
* /sys/devices/platform/tqmx86/
* /sys/devices/platform/tqmx86/i2c-machxo2/
* /sys/devices/platform/tqmx86/tqmx86-wdt/
* /sys/devices/platform/tqmx86/tqmx86-gpio/
* /sys/devices/pci0000:00/0000:00:1f.3/i2c-X/X-002c/hwmon/hwmonY
* /sys/devices/platform/tqmx86/i2c-machxo2/i2c-Z/Z-0050/
('X', 'Y' and 'Z' variables depend on modules load order)
++++
==== 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.
++++ $ i2cdetect -1 |
$ i2cdetect -l
i2c-0 unknown i915 gmbus ssc N/A
i2c-1 unknown i915 gmbus vga N/A
i2c-2 unknown i915 gmbus panel N/A
i2c-3 unknown i915 gmbus dpc N/A
i2c-4 unknown i915 gmbus dpb N/A
i2c-5 unknown i915 gmbus dpd N/A
i2c-6 unknown DPDDC-B N/A
i2c-7 unknown DPDDC-C N/A
i2c-8 unknown i2c-machxo2 N/A
i2c-9 unknown SMBus I801 adapter at 3000 N/A
According to the output above, it's 8.
++++
Then read all 4 GPIO ports of PCA9538 located on this I2C bus:
++++ i2cdump |
$ sudo i2cdump -r 0-3 8 0x70
[part of the output skipped]
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 05 ff 00 ff
All pins are configured as input, pins 0 and 2 are pulled up to 3.3V.
++++
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 |
$ sudo ./i2c-rw -s 8 0x57 0 0x40
Time: 6344 usec
0000: 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ................
0010: 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ................
0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
++++
++++
Read EEPROM at address 0x57 with offset 0xa00 and size 512 |
$ sudo ./i2c-rw -s 8 0x57 0xa00 0x200
Time: 47233 usec
0a00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
[skipped]
0af0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
0b00: 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b ................
0b10: 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b ................
0b20: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
[skipped]
0bf0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
++++
++++ Write "Hello!" to the same EEPROM at offset 0x30 |
$ echo -n "Hello!" |sudo ./i2c-rw -s -w 8 0x57 0x30
Time: 978 usec
$ sudo ./i2c-rw -s 8 0x57 0x20 0x20
Time: 3400 usec
0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
0030: 48 65 6c 6c 6f 21 ff ff ff ff ff ff ff ff ff ff Hello!..........
++++
==== 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.