COM iMX6 Linux: Difference between revisions

From Wiki-DB
Jump to navigationJump to search
Lzenz (talk | contribs)
Added Subpage for calibration of resistive touchscreens
 
(112 intermediate revisions by 5 users not shown)
Line 1: Line 1:
==<br/>FAQ ==
== Storage Layout ==
<br/>
::[[Image:DHCM_Boot_Storage_imx6.jpg|500px|DHCOM Boot Storage i.MX6]]
<br/>
:[[Image:DHCM_Storage_Layout_imx6.jpg|1000px|DHCOM Storage Layout i.MX6]]


=== Ethernet does not work ===
== Linux virtual machine for development ==
Check if the line "allow-hotplug eth0" in the file "/etc/network/interfaces" is activated. You can activate the ethernet interface on a running system with the command:
:* Please have a look at: '''[[Virtual Machine for Application Development]]'''
:{| class="wikitable"
 
|<code>''ifconfig eth0 up''</code>
== Linux Kernel ==
=== Sources: Look at page [[DHCOM iMX6-D2#BSP Sources|i.MX6 BSP Sources]] ===
 
=== How to build a Kernel ===
{| class="wikitable" align="center" |  style="width: 98%; background: #f3f3f3;" valign="top" |
|
Get sources from Github
{| class="wikitable" style="width: 100%; color: #000000; background: #ffffff;" |
|
1. Start the Console on Linux<br/>
2. <tt>''git clone https://github.com/dh-electronics/linux-imx6qdl.git --branch dev/4.4.60_dhcom''</tt><br/>
3. <tt>''cd linux-imx6qdl''</tt>
|}
|}
:'''Remark:''' To work with a nfs-rootfilesystem you have to disable the line "allow-hotplug eth0" in the file "/etc/network/interfaces". Maybe the system was prepared for this method for development and nobody did change it back.
Configure and build the Device Tree + Kernel
 
{| class="wikitable" style="width: 100%; color: #000000; background: #ffffff;" |
=== How to set a Linux environment variable? ===
|
This example shows you how to configure the system to use a proxy-server with a environment variable.
4. <tt>''ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make imx6_dhcom_defconfig''</tt><br/>
:{| class="wikitable"
5. <tt>''ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make menuconfig''</tt> (optional: If you want to add/remove Kernel features)<br/>
|<code>''export http_proxy=http://192.168.xxx.xxx:xxxx</code>
6. <tt>''ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make dtbs''</tt><br/>
7. <tt>''ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make zImage</tt>
|}
|}
 
*The built <font size=5><tt>imx6<font color="#B8A71A">x</font>-dhcom<font color="#0000FF">#</font><font color="#0EC3C1">Y</font>-<font color="#C90646">BOARD</font>.dtb</tt></font> devicetree files are available in <tt>arch/arm/boot/dts</tt>
=== How to schedule jobs to run periodically at certain times or dates? ===
**<font color="#B8A71A">x = s, dl, d, q</font>
You can use the cron daemon and/or anacron. To use anacron you have to copy or link your program or script into one of the the following folders:
**<font color="#0000FF"># = 2 for HW200, 3 for HW300, 4 for HW400</font>
:{| class="wikitable"
**<font color="#0EC3C1">Y = B for Base, H for Hi-Speed-Interfaces</font>
|<code>/etc/cron.hourly</code>
**<font color="#C90646">BOARD = pdk1, pdk2, ...</font>
|-
*The built <tt>zImage</tt> kernel file will you find in <tt>arch/arm/boot</tt>
|<code>/etc/cron.daily</code>
|-
|<code>/etc/cron.weekly</code>
|-
|<code>/etc/cron.monthly</code>
|}
|}
For further information have a look at the general linux documentation.


== Linux virtual machine for development ==
=== Update the Kernel and Device Tree with U-Boot ===
{{DebianVM Development}}
:Please refere to the [[DHCOM Update Mechanism|DHCOM Update Mechanism for i.MX6]].


==<br/>Building your own Kernel ==
=== Update Kernel and Device Tree on a running Linux ===
{| class="wikitable" align="center" |  style="width: 98%; background: #f3f3f3;" valign="top" |
|
==== Kernel ====
{| class="wikitable" style="width: 100%; color: #000000; background: #ffffff;" |
|
'''1.''' Copy the kernel '''zImage''' file to the path '''/boot''' (You can rename it after the Kernel version '''zImage_X.Y.Z''')<br/>
'''2.''' Check '''zImage_file''' variable in '''/boot/uLinuxEnv.txt''' (e.g. <tt>'''zImage_file=zImage_4.4.60'''</tt>)<br/>
|}
==== Device Tree ====
{| class="wikitable" style="width: 100%; color: #000000; background: #ffffff;" |
|
'''3.''' Copy the Device Tree '''*.dtb''' file to the path '''/boot/dtbs_X.Y.Z'''<br/>
'''4.''' Check '''fdt_file''' variable in '''/boot/uLinuxEnv.txt''' (e.g. <tt>'''fdtfile=/dtbs_4.4.60/imx6dl-dhcom4B-pdk2.dtb'''</tt>) <br/>
|}
==== Reboot System ====
{| class="wikitable" style="width: 100%; color: #000000; background: #ffffff;" |
|
'''5.''' Restart the system (e.g. <tt>'''reboot'''</tt>)
|}
|}


=== Sources for the i.MX6 Kernel: ===
=== Make your own Device Tree for your board ===
:The recommended proceeding for making your our Device Tree should be the following:


:* [https://github.com/dh-electronics/linux-imx6qdl Kernel version: 3.14.12 on GitHub]
:1. Clone the DH Device Tree Board file and change it to fit for your board
::- Based on i.MX6 and PDK1 (works with i.MX6 HW200)
:::<code>imx6qdl-dh_pdk1.dtsi --> imx6qdl-COMPANY_BOARDNAME.dtsi</code>
::- Based on i.MX6 and PDK2 (works with i.MX6 HW300)
:::<code>imx6qdl-dh_pdk2.dtsi --> imx6qdl-COMPANY_BOARDNAME.dtsi</code>


=== How to build a kernel: ===
:2. Clone the main Device Tree file and change the included boad file to yours
:: E.g. based on i.MX6DL HW300 with PDK2
:::<code>imx6dl-dhcom3B-pdk2.dts --> imx6dl-dhcom3B-BOARDNAME.dts</code>


:{| class="wikitable"
:3. Add your new main Device Tree file to <code>Makefile</code> (located in the same folder)
|1. Start the Console on Linux
<br/>
|-
:'''DH Device Tree pattern (Kernel 4.4.x)''':
|2. <code>''git clone https://github.com/dh-electronics/linux-imx6qdl.git''</code>
:[[Image:DHCM_Device_Tree_pattern.jpg|1200px|DHCOM Device Tree pattern]]
|-
|3. <code>''cd linux-imx6qdl''</code>
|-
|4. <code>''ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make imx6_dhcom_defconfig''</code>
|-
|5. <code>''ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make menuconfig''</code> (optional: If you want to add/remove Kernel features)
|-
|6. <code>''ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make dtbs''</code>
|-
|7. <code>''ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make zImage LOADADDR=0x12000000''</code>
|}
:The built <code>imx6xx-dheva01.dtb</code> device tree files will you find in <code>arch/arm/boot/dts</code>
:The built <code>zImage</code> kernel file will you find in <code>arch/arm/boot</code>


==<br/>Update the kernel with U-Boot ==
== Rootfilesystem ==


: Coming soon
=== Available Rootfilesystems ===
:Please have a look at the [[DHCOM_iMX6-D2#Download binaries/images | iMX6 Images]] section.


==<br/>Update the kernel in running Linux ==
=== Login ===
:{| class="wikitable" align="center" |  style="width: 400px; color: #000000; background: #FFFFFF;" valign="top" |
||
<tt>
dhcom login: '''root'''<br/>
Password: '''foo'''
</tt>
|}


:{| class="wikitable"
=== Reboot ===
|1. Copy the kernel zImage file to the path <code>'''/boot'''</code>
:{| class="wikitable" align="center" |  style="width: 400px; color: #000000; background: #FFFFFF;" valign="top" |
|-
|<tt># reboot</tt>
|2. Check whether the correct zImage file name is set in <code>'''/boot/uLinuxEnv.txt'''</code> (e.g. <code>'''zImage_file=zImage'''</code>)
|}
|-
:or
|3. Restart the system (e.g. <code>'''reboot'''</code>)
:{| class="wikitable" align="center" |  style="width: 400px; color: #000000; background: #FFFFFF;" valign="top" |
|<tt># shutdown -r now</tt>
|}
|}


== Debian system ==
=== Shutdown ===
 
:{| class="wikitable" align="center" |  style="width: 400px; color: #000000; background: #FFFFFF;" valign="top" |
=== Get Rootfilesystem ===
|<tt># poweroff</tt>
 
|}
:* [https://dl.dropboxusercontent.com/u/19433555/DHCOM/2014-10-30_developer-rootfs_DN6_imx6.tar.bz2 Debian rootfilesystem, based on Debian 6.0 "Squeeze" (2014-10-30)]
:or
:: Remark: Shellshock (CVE-2014-6271) is already fixed.
:{| class="wikitable" align="center" |  style="width: 400px; color: #000000; background: #FFFFFF;" valign="top" |
 
|<tt># shutdown -h now</tt>
=== How to create a microSD-card with a rootfilesystem on it ===
|}
:Note: If the watchdog is active, the system will be reset.


:1. Format a microSD card like following (in linux e.g. you can use palimpsest) with '''Master Boot Record''' partition scheme
=== Calibrating the touchscreen (only on Debian 6.0) ===
::{| class="wikitable"
:{| class="wikitable" align="center" | style="width: 400px; color: #000000; background: #FFFFFF;" valign="top" |
|P1: '''ext3''', name="boot" (Primary partition: 100MiB)
|<tt># ts_calibrate</tt>
|-
|P2: '''ext3''', name="rootfs" (Primary partition: Residual space)
|}
|}
:Check the enviroment variable "TSLIB_TSDEVICE=/dev/input/event0" with <tt> printenv </tt> if an error occurs.


:2. Untar the root file system to the "rootfs" partition of the microSD card (Don't copy the tar archive directly to the microSD card)
=== How to calibrate resistive touchscreens (only on Yocto images) ===
::{| class="wikitable"
{{:Calibration of resistive touchscreens}}
|Start the Console on Linux
|-
|<code>''su''</code>
|-
|<code>''chmod 755 /path/of/the/microSD_card''</code>
|-
|<code>''cd /path/of/the/microSD_card''</code>
|-
|<code>''tar xfjv path/to/RootFS/Name_of_RootFS_file.tar.bz2''</code>
|}
:'''Remark:''' If you got a *.tar.gz file so type <code> tar xfzv ...  </code> to extract the rootfilesystem.


== Kernel Userspace Interfaces to Access Hardware ==


=== Login/Shutdown system ===
=== Ethernet Interfaces ===
:{| class="wikitable" style="width: 120px"
:{| class="wikitable" style="width: 400px"
  ||Username: ||root
  ||DHCOM ENET 1||<tt>ethsom0</tt>
  |-
  |-
  ||Password: ||foo
  ||DHCOM ENET 2||<tt>ethsom1</tt>
  |}
  |}
:{| class="wikitable"
|<code>''shutdown -h now''</code>
|}
=== Calibrating the touchscreen ===
:{| class="wikitable"
|<code>''ts_calibrate''</code>
|}
:Check the enviroment variable "TSLIB_TSDEVICE=/dev/input/event0" with <code> printenv </code> if an error occurs.
== Kernel Userspace Interfaces to Access Hardware ==


=== Serial (UART) Interfaces ===
=== Serial (UART) Interfaces ===
:{| class="wikitable" style="width: 400px"
:{| class="wikitable" style="width: 400px"
  ||DHCOM (FF) UART 1||<code>/dev/ttymxc0</code>
  ||DHCOM (FF) UART 1||<tt>/dev/ttymxc0</tt>
  |-
  |-
  ||DHCOM (BT) UART 2 ||<code>/dev/ttymxc4</code>
  ||DHCOM (BT) UART 2 ||<tt>/dev/ttymxc4</tt>
  |-
  |-
  ||DHCOM (STD) UART 3 ||<code>/dev/ttymxc3</code>
  ||DHCOM (STD) UART 3 ||<tt>/dev/ttymxc3</tt>
  |}
  |}


=== I2C Interfaces ===
=== I2C Interfaces ===
:Hardware revision '''300''' and '''newer''' (dhcom3.., dhcom4.., ...)
:{| class="wikitable" style="width: 400px"
||DHCOM I2C 1||<tt>/dev/i2c-1</tt>
|-
||DHCOM I2C 2 ||<tt>/dev/i2c-0</tt>
|-
||On Module Devices ||<tt>/dev/i2c-2</tt>
|}
:Hardware revision '''100 / 200''' (dhcom1.. / dhcom2..)
:{| class="wikitable" style="width: 400px"
:{| class="wikitable" style="width: 400px"
  ||DHCOM I2C 1||<code>/dev/i2c-0</code>
  ||DHCOM I2C 1||<tt>/dev/i2c-0</tt>
  |-
  |-
  ||DHCOM I2C 2 ||<code>/dev/i2c-1</code>
  ||DHCOM I2C 2 ||<tt>/dev/i2c-1</tt>
  |-
  |-
  ||On Module Devices ||<code>/dev/i2c-2</code>
  ||On Module Devices ||<tt>/dev/i2c-2</tt>
  |}
  |}


=== SPI Interfaces ===
=== SPI Interfaces ===
:{| class="wikitable" style="width: 400px"
:{| class="wikitable" style="width: 400px"
  ||DHCOM SPI 1||<code>/dev/spidev0.2</code>
||<b>Device</b>||<b>Kernel <= 5.4.xxx</b>||<b>Kernel >= 5.10.xxx</b>
|-
  ||DHCOM SPI 1||<tt>/dev/spidev0.2</tt>||<tt>/dev/spidev0.1</tt>
  |-
  |-
  ||DHCOM SPI 2 ||<code>/dev/spidev1.0</code>
  ||DHCOM SPI 2 ||<tt>/dev/spidev1.0</tt>||<tt>/dev/spidev1.0</tt>
  |}
  |}


Line 149: Line 173:
=== MMC/SD/eMMC Interfaces ===
=== MMC/SD/eMMC Interfaces ===
:{| class="wikitable" style="width: 400px"
:{| class="wikitable" style="width: 400px"
  ||DHCOM SD-Interface ||<code>/dev/mmcblk0pX</code>
  ||DHCOM SD-Interface ||<tt>/dev/mmcblk0pX</tt>
  |-
  |-
  ||on module µSD Card ||<code>/dev/mmcblk1pX</code>
  ||on module µSD Card ||<tt>/dev/mmcblk1pX</tt>
  |-
  |-
  ||on module eMMC ||<code>/dev/mmcblk2pX</code>
  ||on module eMMC ||<tt>/dev/mmcblk2pX</tt>
  |}
  |}


Line 159: Line 183:


=== Control the display brightness ===
=== Control the display brightness ===
: Coming soon
:Set brightness level (X = 0...10)
:{| class="wikitable"
|<tt>''echo X >/sys/class/backlight/display/brightness''</tt>
|}


=== Control GPIOs ===
=== Control GPIOs ===
:{|class="wikitable" style="text-align: center; width: 600px"
:See which gpio is already used by the system
:{| class="wikitable"
|<tt>''cat /sys/kernel/debug/gpio &#x007C; grep -v "gpio-... ( "''</tt> <br>or<br> <tt>''gpioinfo &#x007C; grep -v unnamed''</tt>
|}
 
:{|class="wikitable" style="text-align: center; width: 1000px"
|-
! DHCOM Name: !! alt. DHCOM Name: !! SO-DIMM Pin# !! CPU Pad Name !! Linux <GPIO#> * !! gpiod label (deprecated): !! gpiod label:
|-
|-
! DHCOM Name: !! alt. DHCOM Name: !! SO-DIMM Pin# !! Linux <GPIO#>
| GPIO A || || 154 || PAD_GPIO_2 || 2 || A || DHCOM-A
|-
|-
| GPIO A || || 154 || 2
| GPIO B || || 156 || PAD_GPIO_4 || 4 || B || DHCOM-B
|-
|-
| GPIO B || || 156 || 4
| GPIO C || || 162 || PAD_GPIO_5 || 5 || C || DHCOM-C
|-
|-
| GPIO C || || 162 || 5
| GPIO D || || 163 || PAD_CSI0_DAT17 || 163 || D || DHCOM-D
|-
|-
| GPIO D || || 163 || 163
| GPIO E || || 164 || PAD_GPIO_19 || 101 || E || DHCOM-E
|-
|-
| GPIO E || || 164 || 101
| GPIO F || || 165 || PAD_DI0_PIN4 || 116 || F || DHCOM-F
|-
|-
| GPIO F || || 165 || 116
| GPIO G || || 167 || PAD_EIM_D27 || 91 || G || DHCOM-G
|-
|-
| GPIO G || || 167 || 91
| GPIO H || || 173 || PAD_KEY_ROW0 || 103 || H || DHCOM-H
|-
|-
| GPIO H || || 173 || 103
| GPIO I || || 175 || PAD_KEY_COL1 || 104 || I || DHCOM-I
|-
|-
| GPIO I || || 175 || 104
| GPIO J || CIF HSYNC || 74 || PAD_NANDF_CS1 || 174 || J || DHCOM-J
|-
|-
| CIF HSYNC || GPIO J || 74 || 174
| GPIO K || CIF PCLK || 72 || PAD_NANDF_CS2 || 175 || K || DHCOM-K
|-
|-
| CIF PCLK || GPIO K || 72 || 175
| GPIO L || CIF MCLK || 70 || PAD_KEY_ROW1 || 105 || L || DHCOM-L
|-
|-
| CIF MCLK || GPIO L || 70 || 105
| GPIO M || CIF VSYNC || 68 || PAD_SD3_DAT5 || 192 || M || DHCOM-M
|-
|-
| CIF VSYNC || GPIO M || 68 || 192
| GPIO N || CIF D9 || 66 || PAD_SD3_DAT4 || 193 || N || DHCOM-N
|-
|-
| CIF D9 || GPIO N || 66 || 193
| GPIO O || CIF D8 || 64 || PAD_CSI0_VSYNC || 149 || O || DHCOM-O
|-
|-
| CIF D8 || GPIO O || 64 || 149
| GPIO P || CIF D7 || 62 || PAD_GPIO_18 || 205 || P || DHCOM-P
|-
|-
| CIF D7 || GPIO P || 62 || 205
| GPIO Q || CIF D6 || 60 || PAD_SD1_CMD || 18 || Q || DHCOM-Q
|-
|-
| CIF D6 || GPIO Q || 60 || 18
| GPIO R || CIF D5 || 58 || PAD_SD1_DAT0 || 16 || R || DHCOM-R
|-
|-
| CIF D5 || GPIO R || 58 || 16
| GPIO S || CIF D4 || 56 || PAD_SD1_DAT1 || 17 || S || DHCOM-S
|-
|-
| CIF D4 || GPIO S || 56 || 17
| GPIO T || CIF D3 || 54 || PAD_SD1_DAT2 || 19 || T || DHCOM-T
|-
|-
| CIF D3 || GPIO T || 54 || 19
| GPIO U || CIF D2 || 52 || PAD_SD1_CLK || 20 || U || DHCOM-U
|-
|-
| CIF D2 || GPIO U || 52 || 20
| GPIO V || CIF D1 || 50 || PAD_CSI0_PIXCLK || 146 || V || DHCOM-V
|-
|-
| CIF D1 || GPIO V || 50 || 146
| GPIO W || CIF D0 || 48 || PAD_CSI0_MCLK || 147 || W || DHCOM-W
|-
|-
| CIF D0 || GPIO W || 48 || 147
| INT HIGHEST PRIORITY || || 151 || PAD_KEY_COL0|| 102 || INT || DHCOM-INT
|}
|}
:: * = Valid if you didn't change the CONFIG_ARCH_NR_GPIO value in kernel config '''AND''' if your kernel doesn't probe another GPIO controller before the imx6 GPIO controller
:: '''Remark:''' Depending on your board configuration some of the additional gpios shared with the camera interface are not available on your system.
:: '''Remark:''' Depending on your board configuration some of the additional gpios shared with the camera interface are not available on your system.


:Export
 
:{| class="wikitable"
:'''GPIO pin configuration'''
|<code>''echo <GPIO#> >/sys/class/gpio/export''</code>
:: The default Linux Device Tree pin configurarion of the DHCOM GPIOs A - W is <code>0x400120b0</code>
::{| class="wikitable"
|
Pad Mux Register (0x020E_xxxx) = 0x0000_0015
  SION:        1  Enabled (Force input path of pad)
  MUX_MODE: 0101  ALT5
Pad Control Register (0x020E_xxxx) = 0x0001_20B0
  HYS:        1  Hysteresis enabled (Schmitt trigger input)
  ==============
  PUS:        00  100k Pull Down
  PUE:        1  PULL (Pull enabled)
  PKE:        0  Disable (Pull/Keeper disabled)
  ODE:        0  Disable (Output is CMOS)
  RESERVED:  000
  --------------
  SPEED:      10  imx6:    100MHz (medium)
                  imx6ull: 100MHz (medium)
  DSE:      110  Drive strength imx6:    40 Ohm
                                imx6ull:  43 Ohm @ 3.3V
  RESERVED    00
  SRE:        0  SLOW (Slow Slew Rate)
|}
 
:'''Controlled by gpiod tools (need Kernel v4.7 or higher)'''
::Set state
::{| class="wikitable"
|<tt>''gpioset $(gpiofind GPIO_LABEL)=0''</tt>
|-
|<tt>''gpioset $(gpiofind GPIO_LABEL)=1''</tt>
|}
 
::Get state
::{| class="wikitable"
|<tt>''gpioget $(gpiofind GPIO_LABEL)''</tt>
|-
|<tt>''gpioget $(gpiofind GPIO_LABEL)''</tt>
|}
:: '''Remark:''' GPIO_LABEL could be DHCOM-A, DHCOM-B, DHCOM-C, ... see table above
 
:'''Controlled by sysfs (since Kernel v4.8 deprecated)'''
::Export
::{| class="wikitable"
|<tt>''echo <GPIO#> >/sys/class/gpio/export''</tt>
|}
|}
:: '''Remark:''' Have a look into <code> /sys/class/gpio/ </code> for already configured gpios.
:: '''Remark:''' Have a look into <tt> /sys/class/gpio/ </tt> for already configured gpios.
:Set direction
::Set direction
:{| class="wikitable"
::{| class="wikitable"
|<code>''echo in >/sys/class/gpio/gpio<GPIO#>/direction''</code>
|<tt>''echo in >/sys/class/gpio/gpio<GPIO#>/direction''</tt>
|-
|-
|<code>''echo out >/sys/class/gpio/gpio<GPIO#>/direction''</code>
|<tt>''echo out >/sys/class/gpio/gpio<GPIO#>/direction''</tt>
|}
|}


:Set state
::Set state
:{| class="wikitable"
::{| class="wikitable"
|<code>''echo 0 >/sys/class/gpio/gpio<GPIO#>/value''</code>
|<tt>''echo 0 >/sys/class/gpio/gpio<GPIO#>/value''</tt>
|-
|-
|<code>''echo 1 >/sys/class/gpio/gpio<GPIO#>/value''</code>
|<tt>''echo 1 >/sys/class/gpio/gpio<GPIO#>/value''</tt>
|}
 
::Get state
::{| class="wikitable"
|<tt>''cat /sys/class/gpio/gpio<GPIO#>/value''</tt>
|}
|}


Line 236: Line 319:
:Initialize:
:Initialize:
:{| class="wikitable"
:{| class="wikitable"
|<code>''ip link set can0 up type can bitrate 500000''</code>
|<tt>''ip link set can0 up type can bitrate 500000''</tt>
|}
|}
   
   
:Send test message via cansend (part of can-utils):
:Send test message via cansend (part of can-utils):
:{| class="wikitable"
:{| class="wikitable"
|<code>''cansend can0 100#11.2233.44556677.88''</code>
|<tt>''cansend can0 100#11.2233.44556677.88''</tt>
|}
|}


:Receive can messages (part of can-utils):
:Receive can messages (part of can-utils):
:{| class="wikitable"
:{| class="wikitable"
|<code>''candump can0''</code>
|<tt>''candump can0''</tt>
|}
|}


:Get can-utils:
:Get can-utils:
:* [[media:can-utils_armel.zip|Debian package containing can-utils (ARM)]]
:{| class="wikitable"
|<tt>''apt-get install can-utils''</tt>
|}


=== Parallel Address- / Databus ===
=== Parallel Address- / Databus ===


:To use the 16-bit address / databus from Linux userspace you can use the UIO driver interface. To enable and configure the interface it is necessary to setup the i.MX6 WEIM controller with the device tree. See the documentation of the device tree bindings of weim [https://github.com/dh-electronics/linux-imx6qdl/blob/master/Documentation/devicetree/bindings/bus/imx-weim.txt here].
:To use the 16-bit address / databus from Linux userspace you can use the UIO driver interface. To enable and configure the interface it is necessary to setup the WEIM controller with the device tree. See the documentation of the device tree bindings of weim [https://github.com/dh-electronics/linux-imx6qdl/blob/dev/4.4.60_dhcom/Documentation/devicetree/bindings/bus/imx-weim.txt here].


:Here is an example code which demonstrates how to do enable and configure the WEIM interface (parallel address- / databus):
:Here is an example code which demonstrates how to do enable and configure the WEIM interface (parallel address- / databus):
:{|
:{|
|<code>
|<tt>
  &weim {
  &weim {
    pinctrl-names = "default";
pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_weim_dhcom_1 &pinctrl_weim_cs0_1>;
pinctrl-0 = <&pinctrl_dhcom_weim &pinctrl_dhcom_weim_cs0 &pinctrl_dhcom_weim_cs1>;
    #address-cells = <2>;
#address-cells = <2>;
    #size-cells = <1>;
#size-cells = <1>;
    /* it is necessary to setup 2x 64MB otherwise setting gpr fails */
/* it is necessary to setup 2x 64MB otherwise setting gpr fails */
    ranges = <0 0 0x08000000 0x04000000>, // Chipselect A
ranges = <0 0 0x08000000 0x04000000>, // Chip select 0 == DHCOM CS A
              <1 0 0x0c000000 0x04000000>; // Chipselect B
<1 0 0x0c000000 0x04000000>; // Chip select 1 == DHCOM CS B
    fsl,weim-cs-gpr = <&gpr>;
fsl,weim-cs-gpr = <&gpr>;
    status = "okay";
status = "okay";
   
        /* use CS 0 */
uiomap_cs0@0,0 {
        uio_pdrv_genirq@0,0 {
compatible = "generic-uio";
        compatible = "generic-uio";
reg = <0 0x00000000 0x04000000>;
        reg = <0 0x00000000 0x02000000>,
reg-names = "uio_cs0";
              <0 0x02000000 0x02000000>;
interrupt-parent = <&gpio1>;
        reg-names = "mem_cs0_first_map", "mem_cs0_second_map";
interrupts = <2 2>; // Add gpio A == interrupt
        #address-cells = <1>;
#address-cells = <1>;
        #size-cells = <1>;
#size-cells = <1>;
        fsl,weim-cs-timing = <0x00610089 0x00001002 0x0F011061
fsl,weim-cs-timing = <0x00610089 0x00001002 0x0F011061
                              0x00000000 0x0F068A31 0x00000000>;
      0x00000000 0x0F068A31 0x00000000>;
    };
status = "okay";
};
uiomap_cs1@0,1 {
compatible = "generic-uio";
reg = <1 0x00000000 0x04000000>;
reg-names = "uio_cs1";
interrupt-parent = <&gpio1>;
interrupts = <4 2>; // Add gpio B == interrupt
#address-cells = <1>;
#size-cells = <1>;
fsl,weim-cs-timing = <0x00610089 0x00001002 0x0F011061
      0x00000000 0x0F068A31 0x00000000>;
status = "disabled";
};
  };
  };
</code>
</tt>
|}
|}
: We have already written some demo code at [https://github.com/dh-electronics/linux-imx6qdl/blob/master/arch/arm/boot/dts/imx6qdl-dhcom-weim.dtsi /arch/arm/boot/dts/imx6qdl-dhcom-weim.dtsi]. It is easy to enable in the matching device-tree file:
: We have already written some demo code at [https://github.com/dh-electronics/linux-imx6qdl/blob/dev/4.4.60_dhcom/arch/arm/boot/dts/imx6qdl-dhcom_cfg-weim.dtsi /arch/arm/boot/dts/imx6qdl-dhcom_cfg-weim.dtsi]. It is easy to enable in the matching device-tree file:
::*[https://github.com/dh-electronics/linux-imx6qdl/blob/master/arch/arm/boot/dts/imx6q-dheva01.dts /arch/arm/boot/dts/imx6q-dheva01.dts]
::*[https://github.com/dh-electronics/linux-imx6qdl/blob/dev/4.4.60_dhcom/arch/arm/boot/dts/imx6s-dhcom3B-pdk2.dts /arch/arm/boot/dts/imx6s-dhcom3B-pdk2.dts]
::*[https://github.com/dh-electronics/linux-imx6qdl/blob/master/arch/arm/boot/dts/imx6dl-dheva01.dts /arch/arm/boot/dts/imx6dl-dheva01.dts]
::*[https://github.com/dh-electronics/linux-imx6qdl/blob/dev/4.4.60_dhcom/arch/arm/boot/dts/imx6dl-dhcom3B-pdk2.dts /arch/arm/boot/dts/imx6dl-dhcom3B-pdk2.dts]
::*[https://github.com/dh-electronics/linux-imx6qdl/blob/master/arch/arm/boot/dts/imx6s-dheva01.dts /arch/arm/boot/dts/imx6s-dheva01.dts]
::*[https://github.com/dh-electronics/linux-imx6qdl/blob/dev/4.4.60_dhcom/arch/arm/boot/dts/imx6d-dhcom3B-pdk2.dts /arch/arm/boot/dts/imx6d-dhcom3B-pdk2.dts]
::*[https://github.com/dh-electronics/linux-imx6qdl/blob/dev/4.4.60_dhcom/arch/arm/boot/dts/imx6q-dhcom3B-pdk2.dts /arch/arm/boot/dts/imx6q-dhcom3B-pdk2.dts]
:{|
:{|
| <code>
| <tt>
  <font color="#FF1010">- // #include "imx6qdl-dhcom-weim.dtsi" // enables WEIM example config with UIO-Driver, </font>
  <font color="#FF1010">- // #include "imx6qdl-dhcom_cfg-weim.dtsi</font>
  <font color="#00FF10">+ #include "imx6qdl-dhcom-weim.dtsi" // enables WEIM example config with UIO-Driver </font>
  <font color="#00FF10">+ #include "imx6qdl-dhcom_cfg-weim.dtsi </font>
</code>
</tt>
|}
|}


:To use the generic uio driver it has to be enabled in the kernel configuration (<code>[[COM_iMX6_Linux#How to build a kernel:|make menuconfig]]</code>)
:To use the generic uio driver it has to be enabled in the kernel configuration (<code>[[#Linux Kernel|make menuconfig]]</code>)
::*Device Drivers -> Userspace I/O Drivers -> Userspace I/O platform driver with generic IRQ handling
::*Device Drivers -> Userspace I/O Drivers -> Userspace I/O platform driver with generic IRQ handling
: The device-tree of_id of the uio driver has to be set via kernel command line
: The device-tree of_id of the uio driver has to be set via kernel command line
::*Add "optargs='uio_pdrv_genirq.of_id=generic-uio'" to uLinuxEnv.txt
::*Add "optargs='uio_pdrv_genirq.of_id=generic-uio'" to uLinuxEnv.txt
:Example for a UIO userspace driver:
:* [[media:uio_access.zip| uio_access.cpp]]
:* for further information have a look at the paper [https://www.osadl.org/fileadmin/dam/rtlws/12/Koch.pdf Userspace I/O drivers in a realtime context]


=== Configure your own display ===
=== Configure your own display ===
Line 304: Line 408:
:To configure your own display you have to do the following steps:
:To configure your own display you have to do the following steps:


:1. Type in the display values into the device tree file <code>[https://github.com/dh-electronics/linux-imx6qdl/blob/master/arch/arm/boot/dts/imx6qdl-dheva01.dtsi /arch/arm/boot/dts/imx6qdl-dheva01.dtsi]</code>
:1. Configure your display and build a settings file by our tool DHCOMSettingsGenerator ([[media:DHCOMSettingsGeneratorV2_V2.0.0.2.zip|Download v2.0.0.2]])
::*Where in the file?


:::{|
:2. Place generated file into the first partition (label: "boot")
|style="width: 8em"|Parallel display:||<code>display@di0</code>
|-
|style="width: 8em"|LVDS display:||<code>&ldb</code>
|-
|colspan="2"|Remarks: If you don't want to use both interfaces comment the unwanted out! The frame buffer resolution depends on the higher display resolution of both displays
|}


::*How?
:3. Create a symbolic link to the file settings.bin ($ ln -s YourSettingsFile.bin settings.bin)
:::Here is an example:
:::{|
|<code>
  display-timings {
    DataImage_7inch_FG0700G3DSSW {
    clock-frequency = <33260000>;
    hactive = <800>;
    vactive = <480>;
    hback-porch = <86>;
    hfront-porch = <42>;
    vback-porch = <33>;
    vfront-porch = <10>;
    hsync-len = <128>;
    vsync-len = <2>;
    hsync-active = <0>;
    vsync-active = <0>;
    de-active = <1>;
    pixelclk-active = <1>;
    };
  };
</code>
|}
:2. Build the device tree dtb files <code>ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make dtbs</code>
:3. Copy the dtb files onto your boot partition <code>/dtbs</code> (SD, µSD or eMMC)
:The built <code>imx6xx-dheva01.dtb</code> device tree files will you find in <code>arch/arm/boot/dts</code>


==[[Linux Kernel Features | Linux Kernel Features ]]==
:Remake: It is still possible to config the display via Device Tree e.g. <code>[https://github.com/dh-electronics/linux-imx6qdl/blob/dev/4.4.60_dhcom/arch/arm/boot/dts/imx6qdl-dh_pdk2.dtsi dev/4.4.60_dhcom/arch/arm/boot/dts/imx6qdl-dh_pdk2.dtsi]</code> (not recommended by DH)
<br/>
:'''The following picture showing the sequence and priorities:'''
:[[Image:DHCM_Display_Settings.jpg|1300px|DHCOM Display Settings]]
<br/>
For detailed description of the '''display boot args''' please have a look at [[DHCOM iMX6 Bootloader U-Boot#Display and Hardware settings|Display and Hardware settings]] of the iMX6 Bootloader.


==[[ELBE Overview| Embedded Linux Build Environment (ELBE)]]==
== Additional Information ==
:*[[Linux Kernel Features | Linux Kernel Features ]]
:*[[ELBE Overview| Embedded Linux Build Environment (ELBE)]]

Latest revision as of 07:45, 20 October 2023

Storage Layout


DHCOM Boot Storage i.MX6


DHCOM Storage Layout i.MX6

Linux virtual machine for development

Linux Kernel

Sources: Look at page i.MX6 BSP Sources

How to build a Kernel

Get sources from Github

1. Start the Console on Linux
2. git clone https://github.com/dh-electronics/linux-imx6qdl.git --branch dev/4.4.60_dhcom
3. cd linux-imx6qdl

Configure and build the Device Tree + Kernel

4. ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make imx6_dhcom_defconfig
5. ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make menuconfig (optional: If you want to add/remove Kernel features)
6. ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make dtbs
7. ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make zImage

  • The built imx6x-dhcom#Y-BOARD.dtb devicetree files are available in arch/arm/boot/dts
    • x = s, dl, d, q
    • # = 2 for HW200, 3 for HW300, 4 for HW400
    • Y = B for Base, H for Hi-Speed-Interfaces
    • BOARD = pdk1, pdk2, ...
  • The built zImage kernel file will you find in arch/arm/boot

Update the Kernel and Device Tree with U-Boot

Please refere to the DHCOM Update Mechanism for i.MX6.

Update Kernel and Device Tree on a running Linux

Kernel

1. Copy the kernel zImage file to the path /boot (You can rename it after the Kernel version zImage_X.Y.Z)
2. Check zImage_file variable in /boot/uLinuxEnv.txt (e.g. zImage_file=zImage_4.4.60)

Device Tree

3. Copy the Device Tree *.dtb file to the path /boot/dtbs_X.Y.Z
4. Check fdt_file variable in /boot/uLinuxEnv.txt (e.g. fdtfile=/dtbs_4.4.60/imx6dl-dhcom4B-pdk2.dtb)

Reboot System

5. Restart the system (e.g. reboot)

Make your own Device Tree for your board

The recommended proceeding for making your our Device Tree should be the following:
1. Clone the DH Device Tree Board file and change it to fit for your board
- Based on i.MX6 and PDK1 (works with i.MX6 HW200)
imx6qdl-dh_pdk1.dtsi --> imx6qdl-COMPANY_BOARDNAME.dtsi
- Based on i.MX6 and PDK2 (works with i.MX6 HW300)
imx6qdl-dh_pdk2.dtsi --> imx6qdl-COMPANY_BOARDNAME.dtsi
2. Clone the main Device Tree file and change the included boad file to yours
E.g. based on i.MX6DL HW300 with PDK2
imx6dl-dhcom3B-pdk2.dts --> imx6dl-dhcom3B-BOARDNAME.dts
3. Add your new main Device Tree file to Makefile (located in the same folder)


DH Device Tree pattern (Kernel 4.4.x):
DHCOM Device Tree pattern

Rootfilesystem

Available Rootfilesystems

Please have a look at the iMX6 Images section.

Login

dhcom login: root
Password: foo

Reboot

# reboot
or
# shutdown -r now

Shutdown

# poweroff
or
# shutdown -h now
Note: If the watchdog is active, the system will be reset.

Calibrating the touchscreen (only on Debian 6.0)

# ts_calibrate
Check the enviroment variable "TSLIB_TSDEVICE=/dev/input/event0" with printenv if an error occurs.

How to calibrate resistive touchscreens (only on Yocto images)

On devices with resistive touchscreens, the touchscreen has to be calibrated.

At our yocto images, we usually use libinput as library for handling input.

Prerequisites

  • Yocto packages weston, weston-init and weston-examples have to be installed inside the image.
  • The config file /etc/xdg/weston/weston.ini needs the following lines (to enable touchscreen calibration):
[libinput]
touchscreen_calibrator=true

After changing the configuration of weston, weston needs to be restarted:

systemctl restart weston

Steps for calibration

1. Get the touchscreen device name with weston-touch-calibrator

XDG_RUNTIME_DIR=/var/run/user/$(id -u weston) weston-touch-calibrator

Example result (bold part is needed for next steps):

device "/sys/devices/platform/soc/2100000.bus/21a8000.i2c/i2c-2/2-0049/input/input0/event0" - head "DPI-1"

2. Run weston-touch-calibrator on the device for starting the calibration. With the example part of the last result, the command looks like this (bold part is from the last result):

XDG_RUNTIME_DIR=/var/run/user/$(id -u weston) weston-touch-calibrator -v /sys/devices/platform/soc/2100000.bus/21a8000.i2c/i2c-2/2-0049/input/input0/event0

Now you press the highlighted points at the touchscreen to calibrate it. You will now get an output on the console like this (the important part is marked bold):

Calibration values: -0.001472 -1.081086 1.033880 -1.135099 0.000319 1.082698

3. To make the calibration permanent, you need to add a udev rule. Create the file /etc/udev/rules.d/touchscreen-cal.rules and use the calibration values there. With the result of the previous example, the file looks like this (bold part is the result of the last example):

SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="-0.001472 -1.081086 1.033880 -1.135099 0.000319 1.082698"

Kernel Userspace Interfaces to Access Hardware

Ethernet Interfaces

DHCOM ENET 1 ethsom0
DHCOM ENET 2 ethsom1

Serial (UART) Interfaces

DHCOM (FF) UART 1 /dev/ttymxc0
DHCOM (BT) UART 2 /dev/ttymxc4
DHCOM (STD) UART 3 /dev/ttymxc3

I2C Interfaces

Hardware revision 300 and newer (dhcom3.., dhcom4.., ...)
DHCOM I2C 1 /dev/i2c-1
DHCOM I2C 2 /dev/i2c-0
On Module Devices /dev/i2c-2
Hardware revision 100 / 200 (dhcom1.. / dhcom2..)
DHCOM I2C 1 /dev/i2c-0
DHCOM I2C 2 /dev/i2c-1
On Module Devices /dev/i2c-2

SPI Interfaces

Device Kernel <= 5.4.xxx Kernel >= 5.10.xxx
DHCOM SPI 1 /dev/spidev0.2 /dev/spidev0.1
DHCOM SPI 2 /dev/spidev1.0 /dev/spidev1.0
Remark: DHCOM SPI1 interface doesn‘t work with DHCOM Premium Developer Kit (HD00013).
Reason: At DHCOM Premium Developer Kit SPI 1 isn‘t connected, because otherwise i.MX6 doesn‘t boot with the current schematic.

MMC/SD/eMMC Interfaces

DHCOM SD-Interface /dev/mmcblk0pX
on module µSD Card /dev/mmcblk1pX
on module eMMC /dev/mmcblk2pX
'X' has to be replaced with the partition number

Control the display brightness

Set brightness level (X = 0...10)
echo X >/sys/class/backlight/display/brightness

Control GPIOs

See which gpio is already used by the system
cat /sys/kernel/debug/gpio | grep -v "gpio-... ( "
or
gpioinfo | grep -v unnamed
DHCOM Name: alt. DHCOM Name: SO-DIMM Pin# CPU Pad Name Linux <GPIO#> * gpiod label (deprecated): gpiod label:
GPIO A 154 PAD_GPIO_2 2 A DHCOM-A
GPIO B 156 PAD_GPIO_4 4 B DHCOM-B
GPIO C 162 PAD_GPIO_5 5 C DHCOM-C
GPIO D 163 PAD_CSI0_DAT17 163 D DHCOM-D
GPIO E 164 PAD_GPIO_19 101 E DHCOM-E
GPIO F 165 PAD_DI0_PIN4 116 F DHCOM-F
GPIO G 167 PAD_EIM_D27 91 G DHCOM-G
GPIO H 173 PAD_KEY_ROW0 103 H DHCOM-H
GPIO I 175 PAD_KEY_COL1 104 I DHCOM-I
GPIO J CIF HSYNC 74 PAD_NANDF_CS1 174 J DHCOM-J
GPIO K CIF PCLK 72 PAD_NANDF_CS2 175 K DHCOM-K
GPIO L CIF MCLK 70 PAD_KEY_ROW1 105 L DHCOM-L
GPIO M CIF VSYNC 68 PAD_SD3_DAT5 192 M DHCOM-M
GPIO N CIF D9 66 PAD_SD3_DAT4 193 N DHCOM-N
GPIO O CIF D8 64 PAD_CSI0_VSYNC 149 O DHCOM-O
GPIO P CIF D7 62 PAD_GPIO_18 205 P DHCOM-P
GPIO Q CIF D6 60 PAD_SD1_CMD 18 Q DHCOM-Q
GPIO R CIF D5 58 PAD_SD1_DAT0 16 R DHCOM-R
GPIO S CIF D4 56 PAD_SD1_DAT1 17 S DHCOM-S
GPIO T CIF D3 54 PAD_SD1_DAT2 19 T DHCOM-T
GPIO U CIF D2 52 PAD_SD1_CLK 20 U DHCOM-U
GPIO V CIF D1 50 PAD_CSI0_PIXCLK 146 V DHCOM-V
GPIO W CIF D0 48 PAD_CSI0_MCLK 147 W DHCOM-W
INT HIGHEST PRIORITY 151 PAD_KEY_COL0 102 INT DHCOM-INT
* = Valid if you didn't change the CONFIG_ARCH_NR_GPIO value in kernel config AND if your kernel doesn't probe another GPIO controller before the imx6 GPIO controller
Remark: Depending on your board configuration some of the additional gpios shared with the camera interface are not available on your system.


GPIO pin configuration
The default Linux Device Tree pin configurarion of the DHCOM GPIOs A - W is 0x400120b0
Pad Mux Register (0x020E_xxxx) = 0x0000_0015
 SION:        1  Enabled (Force input path of pad)
 MUX_MODE: 0101  ALT5

Pad Control Register (0x020E_xxxx) = 0x0001_20B0
 HYS:         1  Hysteresis enabled (Schmitt trigger input)
 ==============
 PUS:        00  100k Pull Down
 PUE:         1  PULL (Pull enabled)
 PKE:         0  Disable (Pull/Keeper disabled)
 ODE:         0  Disable (Output is CMOS)
 RESERVED:  000
 --------------
 SPEED:      10  imx6:    100MHz (medium)
                 imx6ull: 100MHz (medium)
 DSE:       110  Drive strength imx6:     40 Ohm
                                imx6ull:  43 Ohm @ 3.3V
 RESERVED    00
 SRE:         0  SLOW (Slow Slew Rate)
Controlled by gpiod tools (need Kernel v4.7 or higher)
Set state
gpioset $(gpiofind GPIO_LABEL)=0
gpioset $(gpiofind GPIO_LABEL)=1
Get state
gpioget $(gpiofind GPIO_LABEL)
gpioget $(gpiofind GPIO_LABEL)
Remark: GPIO_LABEL could be DHCOM-A, DHCOM-B, DHCOM-C, ... see table above
Controlled by sysfs (since Kernel v4.8 deprecated)
Export
echo <GPIO#> >/sys/class/gpio/export
Remark: Have a look into /sys/class/gpio/ for already configured gpios.
Set direction
echo in >/sys/class/gpio/gpio<GPIO#>/direction
echo out >/sys/class/gpio/gpio<GPIO#>/direction
Set state
echo 0 >/sys/class/gpio/gpio<GPIO#>/value
echo 1 >/sys/class/gpio/gpio<GPIO#>/value
Get state
cat /sys/class/gpio/gpio<GPIO#>/value

Initialize and Test CAN Interface

Initialize:
ip link set can0 up type can bitrate 500000
Send test message via cansend (part of can-utils):
cansend can0 100#11.2233.44556677.88
Receive can messages (part of can-utils):
candump can0
Get can-utils:
apt-get install can-utils

Parallel Address- / Databus

To use the 16-bit address / databus from Linux userspace you can use the UIO driver interface. To enable and configure the interface it is necessary to setup the WEIM controller with the device tree. See the documentation of the device tree bindings of weim here.
Here is an example code which demonstrates how to do enable and configure the WEIM interface (parallel address- / databus):
&weim {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_dhcom_weim &pinctrl_dhcom_weim_cs0 &pinctrl_dhcom_weim_cs1>;
	#address-cells = <2>;
	#size-cells = <1>;
	/* it is necessary to setup 2x 64MB otherwise setting gpr fails */
	ranges = <0 0  0x08000000  0x04000000>,					// Chip select 0 == DHCOM CS A
		 <1 0  0x0c000000  0x04000000>;					// Chip select 1 == DHCOM CS B
	fsl,weim-cs-gpr = <&gpr>;
	status = "okay";

	uiomap_cs0@0,0 {
		compatible = "generic-uio";
		reg = <0 0x00000000 0x04000000>;
		reg-names = "uio_cs0";
		interrupt-parent = <&gpio1>;
		interrupts = <2 2>;						// Add gpio A == interrupt
		#address-cells = <1>;
		#size-cells = <1>;
		fsl,weim-cs-timing = <0x00610089 0x00001002 0x0F011061
				      0x00000000 0x0F068A31 0x00000000>;
		status = "okay";
	};

	uiomap_cs1@0,1 {
		compatible = "generic-uio";
		reg = <1 0x00000000 0x04000000>;
		reg-names = "uio_cs1";
		interrupt-parent = <&gpio1>;
		interrupts = <4 2>;						// Add gpio B == interrupt
		#address-cells = <1>;
		#size-cells = <1>;
		fsl,weim-cs-timing = <0x00610089 0x00001002 0x0F011061
				      0x00000000 0x0F068A31 0x00000000>;
		status = "disabled";
	};
};

We have already written some demo code at /arch/arm/boot/dts/imx6qdl-dhcom_cfg-weim.dtsi. It is easy to enable in the matching device-tree file:
- // #include "imx6qdl-dhcom_cfg-weim.dtsi
+ #include "imx6qdl-dhcom_cfg-weim.dtsi 

To use the generic uio driver it has to be enabled in the kernel configuration (make menuconfig)
  • Device Drivers -> Userspace I/O Drivers -> Userspace I/O platform driver with generic IRQ handling
The device-tree of_id of the uio driver has to be set via kernel command line
  • Add "optargs='uio_pdrv_genirq.of_id=generic-uio'" to uLinuxEnv.txt
Example for a UIO userspace driver:

Configure your own display

To configure your own display you have to do the following steps:
1. Configure your display and build a settings file by our tool DHCOMSettingsGenerator (Download v2.0.0.2)
2. Place generated file into the first partition (label: "boot")
3. Create a symbolic link to the file settings.bin ($ ln -s YourSettingsFile.bin settings.bin)
Remake: It is still possible to config the display via Device Tree e.g. dev/4.4.60_dhcom/arch/arm/boot/dts/imx6qdl-dh_pdk2.dtsi (not recommended by DH)


The following picture showing the sequence and priorities:
DHCOM Display Settings


For detailed description of the display boot args please have a look at Display and Hardware settings of the iMX6 Bootloader.

Additional Information