Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision |
en:x86:eapi_linux [2019/11/22 13:45] – [x86 COM Express® EAPI Linux] weinholdo | en:x86:eapi_linux [2022/08/04 15:02] – external edit 127.0.0.1 |
---|
====== x86 COM Express® EAPI Linux ====== | ====== TQMx86 EAPI Linux ====== |
| |
<WRAP round info>Please note that the x86 COM Express® EAPI Linux package is only available on request: [[Support@tq-group.com?subject=[EAPI Request] Linux|Request EAPI]]</WRAP> | <callout type="primary" icon="true">Please note that the TQx86 EAPI Linux package is only available on request: [[Support@tq-group.com?subject=[EAPI Request] Linux|Request EAPI]]</callout> |
\\ | \\ |
| |
===== Preface ===== | ===== Preface ===== |
<WRAP round important 60%> | <callout type="warning" icon="true"> |
The Linux drivers package **tqmx86-dist-1.3.tar.gz** is intended to be installed on TQ modules based on the COM Express® standard. | The Linux drivers package **EAPI_Linux-1.x.zip** is intended to be installed on TQ modules based on the COM Express® or SMARC® standard. |
</WRAP> | </callout> |
<WRAP round info 60%> | <callout> |
**Tested operating systems:** | **Tested operating systems:** |
* Ubuntu 14.04 (Trusty Tahr) i386 | * Ubuntu 14.04 (Trusty Tahr) i386 |
* Ubuntu 16.04 (XenialXerus) i386 | * Ubuntu 16.04 (XenialXerus) i386 |
* Ubuntu 16.04 (XenialXerus) x86_64 | * Ubuntu 16.04 (XenialXerus) x86_64 |
</WRAP> | * Ubuntu 18.04 (Bionic Beaver) x86_64 |
| </callout> |
\\ | \\ |
| |
===== Installation and set up procedure===== | ===== Installation and set up procedure===== |
| |
* Boot Ubuntu, unpack //tqmx86-dist-1.3.tar.gz// and deploy provided drivers, configs and examples to rootfs | * Boot Ubuntu, unpack //EAPI_Linux-1.x.zip// and deploy provided drivers, configs and examples to rootfs |
* Install additional test and developer tools, drivers package and corresponding dependencies: <code>$ sudo apt-get install i2c-tools lm-sensors | * Install additional test and developer tools, drivers package and corresponding dependencies: <code>$ sudo apt-get install i2c-tools lm-sensors |
$ sudo apt-get install dkms linux-headers-$(uname -r) | $ sudo apt-get install dkms linux-headers-$(uname -r) |
$ sudo dpkg -i tqmx86-drivers_1.3_{i386,amd64}.deb </code> | $ sudo dpkg -i tqmx86-drivers_1.3_{i386,amd64}.deb </code> |
* Copy ''configs/sensors.tqmx'' from //tqmx86-dist-1.3.tar.gz// to ''/etc/sensors.d/''<code>$ cp configs/sensors.tqmx /etc/sensors.d/</code> <wrap info>**//Note://** this configuration file has been tested on TQMxE38x module. For other TQ COMExpress modules, a following change may be required to make CPU-Temp sensor functional:\\ **label <wrap hi>temp1</wrap> “CPUtemp”** should be changed to **label <wrap hi>temp5</wrap> “CPUtemp”**</wrap> | * Copy ''configs/sensors.tqmx'' from //tqmx86-dist-1.6// to ''/etc/sensors.d/''<code>$ cp configs/sensors.tqmx /etc/sensors.d/</code> <wrap info>**//Note://** this configuration file has been tested on TQMxE38x module. For other TQ COMExpress modules, a following change may be required to make CPU-Temp sensor functional:\\ **label <wrap hi>temp1</wrap> “CPUtemp”** should be changed to **label <wrap hi>temp5</wrap> “CPUtemp”**</wrap> |
* Copy ''configs/tqmx86.conf'' from //tqmx86-dist-1.3.tar.gz// to ''/etc/modules-load.d/''<code>$ cp configs/tqmx86.conf /etc/modules-load.d/</code> | * Copy ''configs/tqmx86.conf'' from //tqmx86-dist-1.6// to ''/etc/modules-load.d/''<code>$ cp configs/tqmx86.conf /etc/modules-load.d/</code> |
* Edit ''/etc/modprobe.d/blacklist.conf'': Comment out '**blacklist i2c_i801**'<code>$ nano /etc/modprobe.d/blacklist.conf</code> | * Edit ''/etc/modprobe.d/blacklist.conf'': Comment out '**blacklist i2c_i801**'<code>$ nano /etc/modprobe.d/blacklist.conf</code> |
* Edit ''/etc/default/grub'': Add '**acpi_enforce_resources=lax**' parameter to the '**GRUB_CMDLINE_LINUX_DEFAULT**' variable definition <code>$ nano /etc/default/grub</code> | * Edit ''/etc/default/grub'': Add '**acpi_enforce_resources=lax**' parameter to the '**GRUB_CMDLINE_LINUX_DEFAULT**' variable definition <code>$ nano /etc/default/grub</code> |
A standard Watchdog API is provided by the driver. Please refer to official documentation | 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|https://www.kernel.org/doc/Documentation/watchdog/watchdog-api.txt]] | for further reference: \\ [[https://www.kernel.org/doc/Documentation/watchdog/watchdog-api.txt|https://www.kernel.org/doc/Documentation/watchdog/watchdog-api.txt]] |
- 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: <code>$ gcc wdtest.c -o wdtest</code> | - An example test program (**wdtest**) makes use of this API provided in //examples// directory of the //tqmx86-dist-1.6// archive. It can be compiled with following command: <code>$ gcc wdtest.c -o wdtest</code> |
- Normal usage for the program is to run as daemon which periodically "pings" watchdog: <code>sudo sh -c "./wdtest -p 20 &" </code> The above command pings watchdog every 20 seconds - this is short enough for the default timeout period of 32 sec. \\ <wrap important>**//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.</wrap> | - Normal usage for the program is to run as daemon which periodically "pings" watchdog: <code>sudo sh -c "./wdtest -p 20 &" </code> The above command pings watchdog every 20 seconds - this is short enough for the default timeout period of 32 sec. \\ <wrap important>**//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.</wrap> |
- The wdtest command can also print watchdog info and set timeout. Following sequence of commands can be used to get watchdog info: <code>$ ps ax | grep wdtest | - The wdtest command can also print watchdog info and set timeout. Following sequence of commands can be used to get watchdog info: <code>$ ps ax | grep wdtest |
[[https://www.kernel.org/doc/Documentation/gpio/sysfs.txt|https://www.kernel.org/doc/Documentation/gpio/sysfs.txt]] \\ | [[https://www.kernel.org/doc/Documentation/gpio/sysfs.txt|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: <code>sudo ./gpio-test.sh 2 | GPIO functionality may be tested by a **gpio-test.sh** shell script provided in //examples// directory of the //tqmx86-dist-1.6// 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: <code>sudo ./gpio-test.sh 2 |
Direction: out | Direction: out |
Value: 0 | Value: 0 |
Direction: out | Direction: out |
Value: 1 </code> | Value: 1 </code> |
<wrap info>**//Note://** GPIO[0:3] are hardwired as outputs and GPIO[4:7] as inputs. Direction cannot be changed.</wrap> | <wrap info>**//Note://** On COM-Express modules the pins GPIO[0:3] are hardwired as outputs and GPIO[4:7] as inputs. Direction cannot be changed.</wrap> |
\\ | \\ |
\\ | \\ |
\\ | \\ |
* Accessing EEPROM on carrier using **i2c-rw** program: | * Accessing EEPROM on carrier using **i2c-rw** program: |
* Source code for **i2c-rw** test program is provided in //examples// directory of the //tqmx86-dist-1.3.tar.gz// archive. To compile it, execute following command: <code>$ gcc i2c-rw.c -o i2c-rw </code> | * Source code for **i2c-rw** test program is provided in //examples// directory of the //tqmx86-dist-1.6// archive. To compile it, execute following command: <code>$ gcc i2c-rw.c -o i2c-rw </code> |
* Read EEPROM on i2c bus 8 at address 0x57 from offset 0, size 64: <code>$ sudo ./i2c-rw -s 8 0x57 0 0x40 | * Read EEPROM on i2c bus 8 at address 0x57 from offset 0, size 64: <code>$ sudo ./i2c-rw -s 8 0x57 0 0x40 |
Time: 6344 usec | Time: 6344 usec |