Changes between Initial Version and Version 1 of ventana/LVDS


Ignore:
Timestamp:
10/22/2017 05:28:45 AM (7 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ventana/LVDS

    v1 v1  
     1{{{#!html
     2          <div id="wikipage" class="trac-content"><p>
     3</p><div class="wiki-toc">
     4<ol>
     5  <li>
     6    <a href="#VentanaLVDSSupport">Ventana LVDS Support</a>
     7    <ol>
     8      <li>
     9        <a href="#GateworksLCDDevelopmentKits">Gateworks LCD Development Kits</a>
     10      </li>
     11      <li>
     12        <a href="#VentanaLVDSConnectorSpecifications">Ventana LVDS Connector Specifications</a>
     13        <ol>
     14          <li>
     15            <a href="#LVDSPowerPins">LVDS Power Pins</a>
     16          </li>
     17        </ol>
     18      </li>
     19      <li>
     20        <a href="#Touchscreensensors">Touchscreen sensors</a>
     21      </li>
     22      <li>
     23        <a href="#SoftwareSupportandConfiguration">Software Support and Configuration</a>
     24        <ol>
     25          <li>
     26            <a href="#TroubleshootingTouchscreenPortion">Troubleshooting Touchscreen Portion</a>
     27            <ol>
     28              <li>
     29                <a href="#Interrupts">Interrupts</a>
     30              </li>
     31              <li>
     32                <a href="#AndroidTouchscreen">Android Touchscreen</a>
     33              </li>
     34            </ol>
     35          </li>
     36        </ol>
     37      </li>
     38      <li>
     39        <a href="#SupportedDisplays">Supported Displays</a>
     40        <ol>
     41          <li>
     42            <a href="#FreescaleMCIMX-LVDS110XGATouchscreenDisplay">Freescale MCIMX-LVDS1 10" XGA Touchscreen Display</a>
     43          </li>
     44          <li>
     45            <a href="#GW17029DLC700JMGT47WSVGATouchscreenDisplay">GW17029 DLC700JMGT4 7" WSVGA Touchscreen Display</a>
     46          </li>
     47          <li>
     48            <a href="#GW17030DLC800FIGT38XGATouchscreenDisplay-SPECIALORDER-250PieceMinimum">GW17030 DLC800FIGT3 8" XGA Touchscreen Display - SPECIAL ORDER - 250 Piece …</a>
     49            <ol>
     50              <li>
     51                <a href="#Setup">Setup</a>
     52              </li>
     53            </ol>
     54          </li>
     55        </ol>
     56      </li>
     57      <li>
     58        <a href="#SelectingaLCDTouchscreenDisplay">Selecting a LCD &amp; Touchscreen Display</a>
     59      </li>
     60      <li>
     61        <a href="#AddingSupportforaNewLCD">Adding Support for a New LCD</a>
     62        <ol>
     63          <li>
     64            <a href="#DeterminingTimingvalues">Determining Timing values</a>
     65          </li>
     66          <li>
     67            <a href="#U-BootBootloaderLCDdisplaysupport">U-Boot Bootloader LCD display support</a>
     68          </li>
     69          <li>
     70            <a href="#Bootloaderbootscript">Bootloader boot script</a>
     71          </li>
     72          <li>
     73            <a href="#LinuxKernelLCDdisplaysupport">Linux Kernel LCD display support</a>
     74          </li>
     75        </ol>
     76      </li>
     77    </ol>
     78  </li>
     79</ol>
     80</div><p>
     81</p>
     82<h1 id="VentanaLVDSSupport">Ventana LVDS Support</h1>
     83<p>
     84<span class="wikianchor" id="devkit"></span>
     85</p>
     86<h2 id="GateworksLCDDevelopmentKits">Gateworks LCD Development Kits</h2>
     87<p>
     88Gateworks offers packaged LCD touchscreens that are plug and play with the Ventana board that have a LVDS interface.
     89</p>
     90<p>
     91Gateworks offers a 7" and 8" display. Use the following part numbers for ordering:
     92</p>
     93<ul><li><a class="wiki" href="/wiki/ventana/LVDS#WSVGA-7in">7" WSVGA (1024x600) display with backlight and 5pt capacitive touch</a>:
     94<ul><li>GW17029 7" LCD <a class="wiki" href="/wiki/ventana/LVDS#DLC700JMGT47WSVGATouchscreenDisplay">Display</a>
     95</li><li>GW10109 (8in) GW16113 (36in) GW16114 (60in) Cable
     96</li><li>GW16114-1 Touch Interface (for 7" LCD)
     97</li></ul></li><li><a class="wiki" href="/wiki/ventana/LVDS#XGA-8in">8" XGA (1024x768) display with backlight and 5pt capacitive touch</a>:
     98<ul><li>Special Order - 250 piece minimum
     99</li><li>GW17030 8" LCD <a class="wiki" href="/wiki/ventana/LVDS#DLC800FIGT38XGATouchscreenDisplay">Display</a>
     100</li><li>GW10109 (8in) GW16113 (36in) GW16114 (60in) Cable
     101</li><li>GW16114-2 Touch Interface (for 8" LCD)
     102</li></ul></li></ul><p>
     103<span class="wikianchor" id="lvdsspecs"></span>
     104</p>
     105<h2 id="VentanaLVDSConnectorSpecifications">Ventana LVDS Connector Specifications</h2>
     106<p>
     107The Ventana GW5400/GW5300/GW5200 designs all support LVDS via a 30 pin connector that provides:
     108</p>
     109<ul><li>3D+C (3 diff pairs data, 1 diff pair clock at 2.5V) for <a class="ext-link" href="http://en.wikipedia.org/wiki/Low-voltage_differential_signaling"><span class="icon">​</span>LVDS Video in compliance iwth EIA-644</a>
     110<ul><li>Signalling is 1.0V to 1.4V (1.2V common mode) with a 400mV swing (3.3V logic level)
     111</li><li>the maximum pixel clock (85MHz) and the maximum clock of the LVDS serializer results in a maximum resolution of WXGA (1366x768@60Hz with 35% blanking)
     112</li><li>3D+C allows for 6bit-per-color for 18bit color (262K colors) for 6bit per color
     113</li><li>displays which support 4D+C for 6bit-per-color (24bit color) typically use the 4th data pair for bit7/bit8 thus can likely be interfaced with Ventana as 6bit 3D+C (consult display datasheets)
     114</li></ul></li><li>1xPWM (3.3V) For backlight brightness
     115</li><li>1xGPIO (3.3V) For control
     116</li><li>1xGPIO (3.3V) for touchscreen controller IRQ#
     117</li><li>1xi2c (3.3V) for EDID and touchscreen or backlight controller
     118</li><li>3.3VDC (always-on power)
     119</li><li>5.0VDC (always-on power)
     120</li></ul><p>
     121Refer to the individual product manuals for more details.
     122</p>
     123<p>
     124The LVDS video output is available through a 30-pin connector in a 1x30 configuration with 1mm pin spacing.
     125</p>
     126<ul><li>The mating connector for a discrete wire plug is a Hirose DF19-30S-1C, available from Digi-Key as part number H3104-ND<a class="ext-link" href="http://www.digikey.com/product-detail/en/DF19-30S-1C/H3104-ND/679730"><span class="icon">​</span>link here</a>.
     127</li><li>The crimp contacts for the discrete wire connector are Hirose DF19A-3032SCFA, available from Digi-Key as part number H12154CT-ND <a class="ext-link" href="http://www.digikey.com/product-detail/en/DF19A-3032SCFA/H12154CT-ND/3739512"><span class="icon">​</span>link here</a>.
     128</li><li>Crimp Gun <a class="ext-link" href="http://www.digikey.com/product-detail/en/HT302%2FDF19S/H3131-ND/679757"><span class="icon">​</span>H3131-ND </a>
     129</li></ul><p>
     130IMX6 LVDS details:
     131</p>
     132<ul><li>Display interface clock: 20-85 MHz
     133</li><li>Serializer clock: 140-595 MHz
     134</li><li>while the IMX6 itself has 2 LVDS ports each supporting up to 4D+C (4 data pairs plus 1 clock pair) which can be used as separate displays or combined (see <a class="ext-link" href="http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf"><span class="icon">​</span>IMX6DQRM section 39.4.2</a>), the Ventana designs only bring out 3D+C (3 data pairs plus 1 clock pair) of the first lvds port
     135</li><li>for details on bitmapping supported see <a class="ext-link" href="http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf"><span class="icon">​</span>IMX6DQRM</a> section 39.5.2
     136</li></ul><p>
     137Ventana 30-pin LVDS connector pinout:
     138</p>
     139<table class="wiki">
     140<tr><th> Pin </th><th> Signal  </th><th> Notes
     141</th></tr><tr><td> 1     </td><td> BACK_EN#  </td><td> GPIO1_IO10 (gpio10)
     142</td></tr><tr><td> 2     </td><td> 3.3V      </td><td>
     143</td></tr><tr><td> 3     </td><td> 3.3V      </td><td>
     144</td></tr><tr><td> 4     </td><td> 3.3V      </td><td>
     145</td></tr><tr><td> 5     </td><td> BACK_ADJ  </td><td> PWM4 or GPIO1_IO18 (gpio18)
     146</td></tr><tr><td> 6     </td><td> SCL       </td><td> I2C3 - /dev/i2c-2
     147</td></tr><tr><td> 7     </td><td> SDA       </td><td> I2C3 - /dev/i2c-2
     148</td></tr><tr><td> 8     </td><td> TX0-      </td><td> differential pair
     149</td></tr><tr><td> 9     </td><td> TX0+      </td><td> differential pair
     150</td></tr><tr><td> 10    </td><td> GND       </td><td>
     151</td></tr><tr><td> 11    </td><td> TX1-      </td><td> differential pair
     152</td></tr><tr><td> 12    </td><td> TX1+      </td><td> differential pair
     153</td></tr><tr><td> 13    </td><td> GND       </td><td>
     154</td></tr><tr><td> 14    </td><td> TX2-      </td><td> differential pair
     155</td></tr><tr><td> 15    </td><td> TX2+      </td><td> differential pair
     156</td></tr><tr><td> 16    </td><td> GND       </td><td>
     157</td></tr><tr><td> 17    </td><td> CLK-      </td><td> differential pair
     158</td></tr><tr><td> 18    </td><td> CLK+      </td><td> differential pair
     159</td></tr><tr><td> 19    </td><td> GND       </td><td>
     160</td></tr><tr><td> 20    </td><td> 5V        </td><td>
     161</td></tr><tr><td> 21    </td><td> 5V        </td><td>
     162</td></tr><tr><td> 22    </td><td> GND       </td><td>
     163</td></tr><tr><td> 23    </td><td> GND       </td><td>
     164</td></tr><tr><td> 24    </td><td> 5V        </td><td>
     165</td></tr><tr><td> 25    </td><td> 5V        </td><td>
     166</td></tr><tr><td> 26    </td><td> 5V        </td><td>
     167</td></tr><tr><td> 27    </td><td> SCL       </td><td> I2C3 - /dev/i2c-2
     168</td></tr><tr><td> 28    </td><td> SDA       </td><td> I2C3 - /dev/i2c-2
     169</td></tr><tr><td> 29    </td><td> TOUCH_IRQ </td><td> IMX6 GPIO7_IO12 (gpio204)
     170</td></tr><tr><td> 30    </td><td> N/C       </td><td>
     171</td></tr></table>
     172<ul><li>The BACK_EN# signal is an ARM GPIO and can be routed to various LVDS display features. Typically this is either used as a RST# or a backlight enable.
     173</li><li>The BACK_ADJ signal can be an ARM GPIO or a PWM.
     174</li></ul><p>
     175Note that the Ventana bootloader always configures BACK_EN# (gpio10) as output-low but leaves BACK_ADJ as a high-impediance input with a 100k pull-up unless the <tt>panel</tt> env is set to one of the supported LVDS configurations (see <a class="wiki" href="/wiki/ventana/LVDS#displays">below</a>) in which case the bootloader <tt>enable_lvds</tt> function drives BACK_EN# low making it appropriate if connected to an active low enable or active high reset and BACK_ADJ high making it 100% brightness.
     176</p>
     177<p>
     178Note that the Ventana Linux kernel does not configure BACK_EN# (gpio10) (thus leaving it configured from the bootloader and exportable/managable by userspace) but does configure BACK_ADJ as PWM4 adjustable via <tt>/sys/class/backlight</tt>.
     179</p>
     180<p>
     181If the above configuration is not compatible with your LVDS display you will need to make adjustments to the bootloader and/or kernel.
     182</p>
     183<p>
     184<span class="wikianchor" id="power"></span>
     185</p>
     186<h3 id="LVDSPowerPins">LVDS Power Pins</h3>
     187<p>
     188The LVDS connector that we use has three pins assigned to 3.3V and five pins assigned to 5V. The maximum current depends on the wire gauge of the cable used with the connector and the 5V supply on the board. A 36 gauge cable is 0.5A per contact, a 30 gauge cable is 0.9A per contact, and a 28 gauge cable is 1A per contact.
     189</p>
     190<p>
     191LVDS Connector 3.3V:
     192</p>
     193<ul><li>The GW52xx, GW53x, and GW54xx all have 30W available from the 3.3V supply and you can subtract ~3W for baseboard operation and additional power depending on PCIe devices (ie radios) to determine what is left for LVDS.
     194</li><li>The limiting factor for the 3.3V current is going to be the connector and cable combination. Since 3.3V power has 3 pins, there is between 1.5A and 3A available depending on the wire gauge.
     195</li></ul><p>
     196LVDS Connector 5V:
     197</p>
     198<ul><li>5V power supplies on the Ventana products have a much lower current rating than  the 3.3V supply therefore you should pay careful attention to the 5V power needs of your display.
     199</li><li>GW52xx has a 1A capable 5V supply shared between CAN transceiver, HDMI DDC, and LVDS.
     200</li><li>GW53xx-B and earlier board revisions have a 800mA capable 5V supply shared between front-panel USB, CAN transceiver, HDMI DDC, and LVDS.
     201</li><li>GW53xx-C, D, and E board revisions have a 1.6A capable 5V supply shared between front-panel USB, CAN transceiver, HDMI DDC, and LVDS.
     202<ul><li><strong>Note</strong> - The 3.3V to 5V boost part used on these revisions has an inrush limitation of 100mA at power-up, causing some displays to not reliably power on
     203</li></ul></li><li>GW53xx-F and above have a 700mA capable 5V supply shared between CAN transceiver, HDMI DDC, and LVDS.
     204</li><li>GW54xx has a 600mA capable 5V supply shared between CAN transceiver, HDMI DDC, FAN power, and LVDS.
     205</li></ul><p>
     206<span class="wikianchor" id="touchcontroller"></span>
     207</p>
     208<h2 id="Touchscreensensors">Touchscreen sensors</h2>
     209<p>
     210Touchscreen's are displays that have bonded to them a thin glass sensor to detect touch events. These can have a variety of features and technologies:
     211</p>
     212<ul><li>resistive touch vs capacitive (each has their pro's and con's)
     213</li><li>communication channels (I2C vs USB typically) - the Ventana LVDS connector itself supports an i2c channel although USB can be picked up from the main-board on different connectors
     214</li><li>multi-touch vs single-touch
     215</li><li>other features...
     216</li></ul><p>
     217There is a large variety of touch sensor controllers (the chip) and touch sensor's (the glass with the micro-wires or elements that connect to the controller chip). Each controller chip has a certain number of sensor circuits that can limit the size of the display.
     218</p>
     219<p>
     220The panels that we offer 'out-of-the-box' support for listed below use one of the following controller chips:
     221</p>
     222<ul><li>eGalax (used on the Freescale MCIMX-LVDS1 10" XGA Touchscreen Display)
     223</li><li>FocalTech FT5x06 (used on the DLC700JMGT4 7" WSVGA Touchscreen Display)
     224</li><li>Goodix GT9110 (used on the DLC800FIGT3 8" XGA Touchscreen Display)
     225</li></ul><p>
     226<span class="wikianchor" id="software"></span>
     227</p>
     228<h2 id="SoftwareSupportandConfiguration">Software Support and Configuration</h2>
     229<p>
     230Gateworks U-Boot Bootloader:
     231</p>
     232<ul><li>supports 'display' (not touch) of the various displays below
     233</li><li>very easy to add additional support to <tt>gw_ventana.c</tt> by knowing the display timings
     234</li><li>the <tt>panel</tt> env variable enables display output maching one of the device names in the displays array
     235<ul><li>un-setting <tt>panel</tt> will auto-detect displays that have that capability (typically i2c probing the touch controller)
     236</li><li>setting <tt>panel</tt> to none disables display out completely
     237</li></ul></li><li>the <tt>display</tt> env variable will select the 'native-mode' device-tree node for the LCD display to timings for the kernel (supported in the 3.10.53 vendor kernel used on the Android Kitkat BSP, Yocto v1.8 BSP, and the latest <a class="wiki" href="/wiki/OpenWrt">OpenWrt</a> (see: <a class="ext-link" href="https://github.com/Gateworks/openwrt"><span class="icon">​</span>https://github.com/Gateworks/openwrt</a>))
     238</li></ul><p>
     239Freescale Linux Kernels (3.0.35, 3.10.17, 3.10.31, 3.10.53, 3.14.28, 3.14.48):
     240</p>
     241<ul><li>the video kernel parameter can specify display details for mxcfb0, mxcfb1, mxcfb2, mxcfb3 devices (IMX6Q can support 4 simultaneous display out, while IMX6DL can support 2).
     242</li><li>see <a class="wiki" href="/wiki/Yocto/Video_Out#DisplaysDevices">here</a> for details
     243<ul><li>For 3.10.31 and later kernels the video mode settings describing resolution and timings are selected through device-tree properties
     244</li><li>For earlier kernels the video mode settings are selected by specifying one of the following in the mxcfb device descriptor in the video command line parameter
     245</li></ul></li></ul><p>
     246Linux Display Driver Support:
     247</p>
     248<ul><li>The Gateworks Yocto and Android BSP's support  A driver supporting the i.MX6 IPU is required for display. This is available in the Gateworks 3.0.35 and 3.10.17 kernels available in our Yocto BSP
     249<ul><li>mainline linux driver support is being worked on currently and targeted for the 3.15 kernel
     250</li></ul></li><li>The touch controller on the EXC7200 is compatible with the 'egalax_ts' linux driver
     251</li><li>The display requires either a panel driver or device-tree configuration depending on kernel
     252</li><li>The backlight can be controlled through the standard Linux pwm-backlight driver
     253</li></ul><p>
     254Linux Touchscreen Driver Support:
     255</p>
     256<ul><li>touchscreen's are typically I2C or USB based devices with drivers in the <tt>drivers/input/touchscreen</tt> directory
     257</li></ul><p>
     258<span class="wikianchor" id="troubleshooting"></span>
     259</p>
     260<h3 id="TroubleshootingTouchscreenPortion">Troubleshooting Touchscreen Portion</h3>
     261<p>
     262There is a command line tool called <tt>evtest</tt> that can be used to check for touch events.
     263</p>
     264<p>
     265An example is shown below:
     266</p>
     267<div class="code"><pre>root@ventana:~# evtest
     268No device specified, trying to scan all of /dev/input/event*
     269Available devices:
     270/dev/input/event0:      EP0810M09
     271/dev/input/event1:      gsc_input
     272/dev/input/event2:      mma845x_a
     273/dev/input/event3:      fxos8700_m
     274Select the device event number <span class="o">[</span>0-3<span class="o">]</span>: 0
     275Input driver version is 1.0.1
     276Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
     277Input device name: <span class="s2">"EP0810M09"</span>
     278Supported events:
     279  Event <span class="nb">type </span>0 <span class="o">(</span>EV_SYN<span class="o">)</span>
     280  Event <span class="nb">type </span>1 <span class="o">(</span>EV_KEY<span class="o">)</span>
     281    Event code 330 <span class="o">(</span>BTN_TOUCH<span class="o">)</span>
     282  Event <span class="nb">type </span>3 <span class="o">(</span>EV_ABS<span class="o">)</span>
     283    Event code 0 <span class="o">(</span>ABS_X<span class="o">)</span>
     284      Value    863
     285      Min        0
     286      Max     1023
     287    Event code 1 <span class="o">(</span>ABS_Y<span class="o">)</span>
     288      Value  -3374
     289      Min        0
     290      Max      599
     291    Event code 47 <span class="o">(</span>ABS_MT_SLOT<span class="o">)</span>
     292      Value      3
     293      Min        0
     294      Max        4
     295    Event code 53 <span class="o">(</span>ABS_MT_POSITION_X<span class="o">)</span>
     296      Value      0
     297      Min        0
     298      Max     1023
     299    Event code 54 <span class="o">(</span>ABS_MT_POSITION_Y<span class="o">)</span>
     300      Value      0
     301      Min        0
     302      Max      599
     303    Event code 57 <span class="o">(</span>ABS_MT_TRACKING_ID<span class="o">)</span>
     304      Value      0
     305      Min        0
     306      Max    65535
     307Properties:
     308Testing ... <span class="o">(</span>interrupt to <span class="nb">exit</span><span class="o">)</span>
     309Event: <span class="nb">time </span>1430493672.054573, <span class="nb">type </span>3 <span class="o">(</span>EV_ABS<span class="o">)</span>, code 47 <span class="o">(</span>ABS_MT_SLOT<span class="o">)</span>, value 0
     310Event: <span class="nb">time </span>1430493672.054573, <span class="nb">type </span>3 <span class="o">(</span>EV_ABS<span class="o">)</span>, code 53 <span class="o">(</span>ABS_MT_POSITION_X<span class="o">)</span>, value 63
     311Event: <span class="nb">time </span>1430493672.054573, <span class="nb">type </span>3 <span class="o">(</span>EV_ABS<span class="o">)</span>, code 54 <span class="o">(</span>ABS_MT_POSITION_Y<span class="o">)</span>, value 128
     312Event: <span class="nb">time </span>1430493672.054573, <span class="nb">type </span>3 <span class="o">(</span>EV_ABS<span class="o">)</span>, code 0 <span class="o">(</span>ABS_X<span class="o">)</span>, value 63
     313Event: <span class="nb">time </span>1430493672.054573, <span class="nb">type </span>3 <span class="o">(</span>EV_ABS<span class="o">)</span>, code 1 <span class="o">(</span>ABS_Y<span class="o">)</span>, value 128
     314Event: <span class="nb">time </span>1430493672.054573, -------------- EV_SYN ------------
     315Event: <span class="nb">time </span>1430493672.129208, <span class="nb">type </span>3 <span class="o">(</span>EV_ABS<span class="o">)</span>, code 57 <span class="o">(</span>ABS_MT_TRACKING_ID<span class="o">)</span>, value -1
     316
     317</pre></div><p>
     318It is important verify the touchscreen is detected by running the following command in the example example:
     319</p>
     320<div class="code"><pre>root@ventana:/ <span class="c"># cat /proc/bus/input/devices
     321</span>I: <span class="nv">Bus</span><span class="o">=</span>0018 <span class="nv">Vendor</span><span class="o">=</span>0416 <span class="nv">Product</span><span class="o">=</span>1001 <span class="nv">Version</span><span class="o">=</span>28bb
     322N: <span class="nv">Name</span><span class="o">=</span><span class="s2">"Goodix Capacitive TouchScreen"</span>
     323P: <span class="nv">Phys</span><span class="o">=</span>input/ts
     324S: <span class="nv">Sysfs</span><span class="o">=</span>/devices/soc0/soc.1/2100000.aips-bus/21a8000.i2c/i2c-2/2-0014/input/input0
     325U: <span class="nv">Uniq</span><span class="o">=</span>
     326H: <span class="nv">Handlers</span><span class="o">=</span>mouse0 event0
     327B: <span class="nv">PROP</span><span class="o">=</span>2
     328B: <span class="nv">EV</span><span class="o">=</span>b
     329B: <span class="nv">KEY</span><span class="o">=</span>400 0 0 0 0 0 0 0 0 0 0
     330B: <span class="nv">ABS</span><span class="o">=</span>2658000 3
     331</pre></div><h4 id="Interrupts">Interrupts</h4>
     332<p>
     333You can see if interrupts are being sent to the touchscreen controller.
     334</p>
     335<p>
     336Run the command:
     337</p>
     338<pre class="wiki">cat /proc/interrupts
     339</pre><p>
     340Find the touch controller in the list.
     341</p>
     342<p>
     343Note the number of interrupts it currently has.
     344</p>
     345<p>
     346Then touch the screen a few times.
     347</p>
     348<p>
     349Then check the interrupts again to verify if it has increased.
     350</p>
     351<h4 id="AndroidTouchscreen">Android Touchscreen</h4>
     352<p>
     353In addition to the above information, here is some more information that may be relevant to Android.
     354</p>
     355<p>
     356To detect touch events on Android, where <tt>evtest</tt> may not exist, try using the <tt>getevent</tt> command.
     357</p>
     358<p>
     359Example shown below, adjust command as necessary.
     360</p>
     361<p>
     362Note that values should appear on the serial console when the screen is touched.
     363</p>
     364<p>
     365This verifies the touchscreen is getting events.
     366</p>
     367<div class="code"><pre>root@ventana:/ <span class="c"># getevent /dev/input/event0
     368</span>0003 0039 00000022
     3690003 0036 00000251
     3700003 0035 0000033b
     3710003 0030 0000003e
     3720003 0032 0000003e
     3730001 014a 00000001
     3740003 0000 0000033b
     3750003 0001 00000251
     3760000 0000 00000000
     3770003 0030 00000038
     3780003 0032 00000038
     3790000 0000 00000000
     3800003 0039 ffffffff
     3810001 014a 00000000
     3820000 0000 00000000
     383</pre></div><p>
     384<span class="wikianchor" id="displays"></span>
     385</p>
     386<h2 id="SupportedDisplays">Supported Displays</h2>
     387<p>
     388While you should be able to make a wide variety of LVDS displays work, Gateworks provides software support and cables for several readily available displays. Please contact sales@… for details.
     389</p>
     390<p>
     391<span class="wikianchor" id="XGA-10in"></span>
     392</p>
     393<h3 id="FreescaleMCIMX-LVDS110XGATouchscreenDisplay">Freescale MCIMX-LVDS1 10" XGA Touchscreen Display</h3>
     394<p>
     395The 'Freescale LVDS1' or 'MCIMX-LVDS1' was originally designed for an i.MX53 dev kit and is a LCD+Backlight-controller+Touchscreen-controller.
     396</p>
     397<p>
     398This is the display used in many of the Gateworks demo videos and is directly compatible with our LVDS connector.
     399</p>
     400<p>
     401Its available from a few distributors if you search but always $500:
     402</p>
     403<ul><li><a class="ext-link" href="https://www.digikey.com/products/en?keywords=MCIMX-LVDS1"><span class="icon">​</span>Digikey</a>
     404</li><li><a class="ext-link" href="http://www.newark.com/freescale-semiconductor/mcimx-lvds1/daughter-card-10-1in-lcd-module/dp/45T2344"><span class="icon">​</span>Newark</a>
     405</li><li><a class="ext-link" href="http://www.mouser.com/ProductDetail/Freescale-Semiconductor/MCIMX-LVDS1/?qs=Bd5/XmnHbhsyKVtPrY51Kg=="><span class="icon">​</span>Mouser</a>
     406</li></ul><p>
     407Details:
     408</p>
     409<ul><li>Display: 10in 1024x768 pixel 128dpi LCD <a class="ext-link" href="http://dev.gateworks.com/datasheets/HSD100PXN1-A00.pdf"><span class="icon">​</span>HSD100PXN1</a>
     410</li><li>Touch Controller: <a class="ext-link" href="http://dev.gateworks.com/datasheets/EXC7200_Datasheet.pdf"><span class="icon">​</span>EXC7200</a> on i2c-2@0x04
     411<ul><li>IRQ via gpio-11 on GW5200/GW5300, gpio-204 on GW5400
     412</li></ul></li><li>Backlight: White LED (PWM Driven) on i.MX6 pwm4
     413</li><li>Power Consumption: approximately 700mW to 1.5mW depending on BL brightness
     414</li><li>supports <a class="ext-link" href="http://www.ecnmag.com/articles/2010/04/content-adaptive-lcd-backlight-control"><span class="icon">​</span>Content Adaptive Backlight Control</a> (CABC) via gpio-10
     415<ul><li>when enabled this sets backlight automatically according to content - this can cause annoying flickering and is usually best disabled by de-asserting the gpio (driving low))
     416</li></ul></li></ul><p>
     417Gateworks Bootloader support:
     418</p>
     419<ul><li>you can enable display out in the bootloader via:
     420<div class="code"><pre>setenv panel Hannstar-XGA
     421saveenv
     422</pre></div></li></ul><p>
     423Yocto support:
     424</p>
     425<ul><li>you can enable display and touch support for Yocto by setting the <tt>video</tt> env variable in the bootloader:
     426<div class="code"><pre>setenv video <span class="s1">'video=mxcfb0:dev=ldb,bpp=32,LDB-XGA,if=RGB666 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off'</span>
     427saveenv
     428</pre></div></li><li>Alternatively, you can enable support for this using version v1.06+ bootscript
     429<div class="code"><pre>setenv display Hannstar-XGA
     430saveenv
     431</pre></div></li></ul><p>
     432Android KitKat+ support:
     433</p>
     434<ul><li>you can enable display and touch support for Android KitKat setting the <tt>display</tt> env variable in the bootloader:
     435<div class="code"><pre>setenv display Hannstar-XGA
     436saveenv
     437</pre></div></li></ul><p>
     438<span class="wikianchor" id="WSVGA-7in"></span>
     439</p>
     440<h3 id="GW17029DLC700JMGT47WSVGATouchscreenDisplay">GW17029 DLC700JMGT4 7" WSVGA Touchscreen Display</h3>
     441<p>
     442The GW17029 DLC700JMGT4 7" WSVGA Touchscreen Display is a low-cost display supporting:
     443</p>
     444<ul><li>7" LCD 1024x600 display with backlight
     445<ul><li>Physical size (W/H/D): 165.75 x 105.39 x 5.39mm
     446</li><li>Active area: 153.6 x 90.00mm
     447</li><li>Resolution: 1024x600 24bit RGB
     448</li><li>Pixel pitch: 0.05 x 0.15mm
     449</li><li>Pixel config: RGB stripes
     450</li><li>Mode: Transmissive, normally black
     451</li><li>Brightness: 200 nits
     452</li><li>Contrast: 700:1
     453</li><li>Backlight: LED
     454</li><li>Interface: LVDS
     455</li><li>Technology: IPS TFT
     456</li><li>Power consuption: 1W to 2W (typ)
     457</li><li>operating temperature: -20C to +70C
     458</li></ul></li><li>5pt Capacitive touch via FT5406 touch controller
     459<ul><li>10-point capacitive touch
     460</li><li>scanning frequency: &gt;100 Hz
     461</li><li>channels: 28 (drive) * 16 (induction)
     462</li><li>active area: up to 8.9"
     463</li><li>transmission: i2c i2c-2@0x38
     464</li><li>operating temperature: -40C to +85C
     465</li></ul></li><li>SmarterGlass LVDS-7 adapter board provides pwm-controlled backlight
     466</li><li><a class="ext-link" href="http://dev.gateworks.com/datasheets/DLC0700DDG-4%20SPEC%20V1.1.pdf"><span class="icon">​</span>DLC0700JMG Datasheet</a>
     467</li></ul><p>
     468Gateworks Bootloader support:
     469</p>
     470<ul><li>you can enable display out in the bootloader via:
     471<div class="code"><pre>setenv panel DLC700JMGT4
     472saveenv
     473</pre></div></li></ul><p>
     474Yocto support:
     475</p>
     476<ul><li>you can enable display and touch support for Yocto by setting the <tt>video</tt> env variable in the bootloader:
     477<div class="code"><pre>setenv video <span class="s1">'video=mxcfb0:dev=ldb,bpp=32,LDB-WSVGA,if=RGB666 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off'</span>
     478saveenv
     479</pre></div></li><li>Alternatively, you can enable support for this using version v1.06+ bootscript
     480<div class="code"><pre>setenv display DLC700JMGT4
     481saveenv
     482</pre></div></li></ul><p>
     483Android Kitkat+ support:
     484</p>
     485<ul><li>you can enable display and touch support for Android KitKat by setting the <tt>display</tt> env variable in the bootloader:
     486<div class="code"><pre>setenv display DLC700JMGT4
     487saveenv
     488</pre></div></li></ul><p>
     489<span class="wikianchor" id="XGA-8in"></span>
     490</p>
     491<h3 id="GW17030DLC800FIGT38XGATouchscreenDisplay-SPECIALORDER-250PieceMinimum">GW17030 DLC800FIGT3 8" XGA Touchscreen Display - SPECIAL ORDER - 250 Piece Minimum</h3>
     492<p>
     493The GW17030 DLC800FIGT3 8" XGA Touchscreen Display is a low-cost display supporting:
     494</p>
     495<ul><li>8" LCD 1024x768 display with backlight
     496<ul><li>Physical size (W/H/D): 168.80 x 139.17 x 4.43mm
     497</li><li>Active area: 162.05 x 121.54mm
     498</li><li>Resolution: 1024x768 24bit RGB
     499</li><li>Pixel pitch: 0.05275 x 0.15825mm
     500</li><li>Pixel config: RGB stripes
     501</li><li>Mode: Transmissive, normally black
     502</li><li>Brightness: 280 nits
     503</li><li>Contrast: 800:1
     504</li><li>Backlight: LED
     505</li><li>Interface: LVDS
     506</li><li>Technology: IPS TFT
     507</li><li>Power consuption: 1W to 2W (typ)
     508</li><li>operating temperature: -10C to +50C
     509</li></ul></li><li>Capacitive touch via GT9110 touch controller
     510<ul><li>10-point capacitive touch
     511</li><li>scanning frequency: 100 Hz
     512</li><li>channels: 42 (drive) * 30 (induction)
     513</li><li>active area: 7" to 12.1"
     514</li><li>transmission: 7.0Kbps (max) i2c i2c-2@0x14
     515</li><li>gesture and HotKnot support
     516</li><li>operating temperature: -40C to +85C
     517</li></ul></li><li>SmarterGlass LVDS-7 adapter board provides pwm-controlled backlight
     518</li><li><a class="ext-link" href="http://dev.gateworks.com/datasheets/DLC0800FIG-5.pdf"><span class="icon">​</span>DLC800FIG Datasheet</a>
     519</li></ul><p>
     520Gateworks Bootloader support:
     521</p>
     522<ul><li>you can enable display out in the bootloader via:
     523<div class="code"><pre>setenv panel DLC800FIGT3
     524saveenv
     525</pre></div></li></ul><p>
     526Yocto support:
     527</p>
     528<ul><li>you can enable display and touch support for Yocto by setting the <tt>video</tt> env variable in the bootloader:
     529<div class="code"><pre>setenv video <span class="s1">'video=mxcfb0:dev=ldb,bpp=32,LDB-XGA,if=RGB666 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off'</span>
     530saveenv
     531</pre></div></li><li>Alternatively, you can enable support for this using version v1.06+ bootscript
     532<div class="code"><pre>setenv display DLC800FIGT3
     533saveenv
     534</pre></div></li></ul><p>
     535Android KitKat+ support:
     536</p>
     537<ul><li>you can enable display support for Android KitKat by setting the <tt>display</tt> env variable in the bootloader:
     538<div class="code"><pre>setenv display DLC800FIGT3
     539saveenv
     540</pre></div></li></ul><h4 id="Setup">Setup</h4>
     541<p>
     542This setup applies to the Gateworks 7 and 8" LCD kits.
     543</p>
     544<ul><li>8" XGA (1024x768) display with backlight and 5pt capacitive touch:
     545<ul><li>GW17030 8" LCD Display
     546</li><li>GW10109 (8in) GW16113 (36in) GW16114 (60in) Cable
     547</li><li>GW16114-2 Adapter Board (for 8" LCD)
     548</li></ul></li></ul><ul><li>7" WSVGA (1024x600) display with backlight and 5pt capacitive touch:
     549<ul><li>GW17029 7" LCD Display
     550</li><li>GW10109 (8in) GW16113 (36in) GW16114 (60in) Cable
     551</li><li>GW16114-1 Adapter Board (for 7" LCD)
     552</li></ul></li></ul><ol><li>Plug the small ribbon cable on the LCD into the adapter board slot as pictured
     553</li></ol><p>
     554<a style="padding:0; border:none" href="/attachment/wiki/ventana/LVDS/lcdadapterboard.jpg"><img width="400px" src="/raw-attachment/wiki/ventana/LVDS/lcdadapterboard.jpg" /></a>
     555</p>
     556<ol start="2"><li>Take the GW10109/GW16113/GW16114 Cable and plug the side with two connectors into the LCD and the Adapter board.
     557</li></ol><p>
     558<a style="padding:0; border:none" href="/attachment/wiki/ventana/LVDS/lcdcables.jpg"><img width="400px" src="/raw-attachment/wiki/ventana/LVDS/lcdcables.jpg" /></a>
     559</p>
     560<ol start="3"><li>Plug the single end of the cable onto the Ventana board LVDS connector.
     561</li></ol><p>
     562<a style="padding:0; border:none" href="/attachment/wiki/ventana/LVDS/ventanalvdsconnector.jpg"><img width="400px" src="/raw-attachment/wiki/ventana/LVDS/ventanalvdsconnector.jpg" /></a>
     563</p>
     564<p>
     565<span class="wikianchor" id="selection"></span>
     566</p>
     567<h2 id="SelectingaLCDTouchscreenDisplay">Selecting a LCD &amp; Touchscreen Display</h2>
     568<p>
     569Selecting a usable display can be complex. Gateworks has broken down the selection process:
     570</p>
     571<ol><li>Size
     572<ul><li>Typical sizes range from 4" to 15", with something like 7" the most common
     573</li></ul></li><li>Backlight
     574<ul><li>Voltage - LED's can require a large boost voltage. If this voltage is not available on the board, display driver boards are often created for boosting to a higher voltage. Current must also be taken into consideration. 5V and 3.3V are supplied on the Gateworks SBC 30 pin connector.
     575</li><li>Backlight Adjustment
     576<ul><li>PWM - Supported on Gateworks 30 pin connector
     577</li><li>Analog
     578</li></ul></li></ul></li><li>Video Interface
     579<ul><li>LVDS - Gateworks has a 30 pin LVDS connector as documented on this wiki page.
     580</li></ul></li><li>Touchscreen
     581<ul><li>Capacitive - Similar to most cell phones. More expensive. More sensitive.
     582</li><li>Resistive - Requires a physical press, less sensitive, but good for gloves, etc
     583</li><li>Controller - The touchscreen itself outputs signals that are typically best interpreted via a specific touchscreen controller. This controller then interfaces with the Gateworks SBC. Gateworks has a I2C interface on the LVDS connector for this interface. USB interfaces also exist, but USB is not on the LVDS connector, and thus a separate cable would be needed.
     584<ul><li><strong>VERY IMPORTANT: Controller software driver</strong> - A touchscreen controller will not work if the proper driver is not loaded in the Linux software. Be sure a driver is supported for this touchscreen controller chip. Look for possibly supported chips here: <a class="ext-link" href="http://lxr.free-electrons.com/source/drivers/input/touchscreen/?v=3.10"><span class="icon">​</span>http://lxr.free-electrons.com/source/drivers/input/touchscreen/?v=3.10</a>
     585</li></ul></li><li>Bonding - Touchscreens are bonded to LCD displays. Some combinations are pre-bonded but otherwise bonding is a very complex process and requires very expensive machinery. It is highly recommended that the LCD and touchscreen be bought pre-bonded.
     586</li></ul></li><li>Cabling
     587<ul><li>Often cabling will need to be created to mate connectors. Gateworks has a 30 pin connector that may have to mate to a 20 pin connector along with backlight and touchscreen. For cabling, companies such as Quadrangle can create a custom cables.
     588</li></ul></li></ol><p>
     589<span class="wikianchor" id="adding"></span>
     590</p>
     591<h2 id="AddingSupportforaNewLCD">Adding Support for a New LCD</h2>
     592<p>
     593Adding support for a new LCD requires modifying the source code of the software.
     594</p>
     595<p>
     596While the code changes are fairly simple, determining the timings can be complicated and involves translating timings from the manufacturers datasheet to the display timings that Linux drivers need.
     597</p>
     598<h3 id="DeterminingTimingvalues">Determining Timing values</h3>
     599<p>
     600You can easily experiment with different timing values by using the Ventana bootloader 'fixfdt' script to alter the timings of the default display which is the 'hsd100pxn1' (unless you've changed it by setting the <tt>display</tt> env variable). Note that the timings represented in the device-tree are hex values.
     601</p>
     602<p>
     603Here is an example of setting up a {{{fixfdt}} script for overriding the values and setting them for a 1280x800 pixel display (0x500 x 0x320) with a refresh rate of 60Hz (0x3c) and a clock-frequency of 68930000Hz (0x41bc9d0) and margins of 220/40/21/7:
     604</p>
     605<pre class="wiki">setenv timing_path '/soc/aips-bus@02000000/ldb@020e0008/lvds-channel@0/display-timings/hsd100pxn1'
     606setenv fixfdt '\
     607 fdt addr ${fdt_addr}; \
     608 fdt set ${timing_path} clock-frequency &lt;0x41bc9d0&gt;; \
     609 fdt set ${timing_path} hactive &lt;0x500&gt;; \
     610 fdt set ${timing_path} vactive &lt;0x320&gt;; \
     611 fdt set ${timing_path} hback-porch &lt;0xdc&gt;; \
     612 fdt set ${timing_path} hfront-porch &lt;0x28&gt;; \
     613 fdt set ${timing_path} vback-porch &lt;0x15&gt;; \
     614 fdt set ${timing_path} vfront-porch &lt;0x0x7&gt;; \
     615 fdt set ${timing_path} hsync-len &lt;0x3c&gt;; \
     616 fdt set ${timing_path} vsync-len &lt;0xa&gt;; \
     617'; saveenv; reset
     618</pre><p>
     619The display timing device-tree bindings are documented in <a class="ext-link" href="https://lxr.missinglinkelectronics.com/linux+v3.14/Documentation/devicetree/bindings/video/display-timing.txt"><span class="icon">​</span>Documentation/devicetree/bindings/video/display-timing.txt</a>.
     620</p>
     621<p>
     622<span class="wikianchor" id="uboot"></span>
     623</p>
     624<h3 id="U-BootBootloaderLCDdisplaysupport">U-Boot Bootloader LCD display support</h3>
     625<p>
     626The Ventana U-Boot Bootloader specifies an array of displays via the <tt>displays</tt> variable <a class="ext-link" href="https://github.com/Gateworks/u-boot-imx6/blob/gateworks_v2015.04/board/gateworks/gw_ventana/gw_ventana.c#L328"><span class="icon">​</span>here</a>. The <tt>struct display_info_t</tt> structure (defined <a class="ext-link" href="https://lxr.missinglinkelectronics.com/uboot/arch/arm/include/asm/imx-common/video.h#L11"><span class="icon">​</span>here</a>) defines a bus/addr, pixel format, detect function, enable function, and video mode which includes a unique name, resolution and timings details. The <tt>panel</tt> env variable is used by U-Boot to determine which panel to configure and the value must match one of the video mode names in the array. Note that the <tt>display</tt> env variable can also be used for configuring the display for the Linux kernel (see below).
     627</p>
     628<p>
     629The video-mode structure is described <a class="ext-link" href="https://lxr.missinglinkelectronics.com/uboot/include/linux/fb.h#L598"><span class="icon">​</span>https://lxr.missinglinkelectronics.com/uboot/include/linux/fb.h#L598</a> - some of it is self-explanatory and comes straight out of the manufacturers datasheet and some is not:
     630</p>
     631<ul><li>name - unique name that needs to match the <tt>panel</tt> and/or <tt>display</tt> env variable
     632</li><li>refresh - refresh rate
     633</li><li>xres/yres - display resolution or 'active pixels'
     634</li><li>left_margin/right_margin/upper_margin/lower_margin - the margins (in units of pixclock periods) for video blanking
     635</li><li>pixclock - the frequency of the pixel clock (from the datasheet) (in units of picoseconds) (for example, 64MHz would be pixclock=(1/64000000)*100000=15625)
     636</li><li>hsync_len/vsync_len - hsync and vsync period (in units of pixclock periods)
     637</li><li>sync - flags describing the polarity details of the sync signals (see <a class="ext-link" href="https://lxr.missinglinkelectronics.com/uboot/include/linux/fb.h#L74"><span class="icon">​</span>here</a>) - for LVDS displays this is always FB_SYNC_EXT
     638</li><li>vmode - videomode flags (see <a class="ext-link" href="https://lxr.missinglinkelectronics.com/uboot/include/linux/fb.h#L83"><span class="icon">​</span>here</a>) - for LVDS displays this is always FB_VMODE_NONINTERLACED
     639</li><li>flag
     640</li></ul><p>
     641As an example, lets take the 'AUO G101EVN01.0' 1280x800 10.1" LVDS display:
     642</p>
     643<ul><li><a class="ext-link" href="http://dev.gateworks.com/datasheets/AUOG101EVN01.0_Datasheet.pdf"><span class="icon">​</span>AUO G101EVN01.0 datasheet</a>
     644</li><li>1280x800 active pixels (6.5.1 Timing Characteristics)
     645</li><li>pixclock = (1/68.93MHz)*(1000000) = 14507 (68.93MHz is from typical clock frequency specified in 6.5.1 Timing Characteristics)
     646</li></ul><p>
     647We would add an additional structure to <tt>displays</tt> in board/gateworks/gw_ventana/gw_ventana.c:
     648</p>
     649<pre class="wiki">{
     650        /* AUO G101EVN01.0 */
     651        .bus    = 0,
     652        .addr   = 0,
     653        .detect = NULL,
     654        .enable = enable_lvds,
     655        .pixfmt = IPU_PIX_FMT_LVDS666,
     656        .mode   = {
     657                .name           = "AUOG101EVN01.0",
     658                .refresh        = 60,
     659                .xres           = 1280,         /* 1024x768 active pixels */
     660                .yres           = 800,
     661                .pixclock       = 14507,        /* 68.93MHz */
     662                .left_margin    = 220,
     663                .right_margin   = 40,
     664                .upper_margin   = 21,
     665                .lower_margin   = 7,
     666                .hsync_len      = 60,
     667                .vsync_len      = 10,
     668                .sync           = FB_SYNC_EXT,
     669                .vmode          = FB_VMODE_NONINTERLACED
     670        }
     671}
     672</pre><p>
     673After rebuilding the bootloader and updating the board, we can set <tt>panel</tt> as such:
     674</p>
     675<pre class="wiki">Ventana &gt; setenv panel AUOG101EVN01.0; saveenv; reset
     676</pre><p>
     677Depending on how you connected the LVDS display to the Gateworks Ventana board, you may need to manipulate the two GPIO signals going to the LVDS connector:
     678</p>
     679<ul><li>GPIO1_IO10 (gpio10 BACK_EN#)
     680</li><li>GPIO1_IO18 (gpio18 BACK_ADJ) (in the kernel this would be the backlight PWM signal)
     681</li></ul><p>
     682By default these are configured in the <tt>enable_lvds</tt> function as gpio10/BACK_GPIO low, and gpio18/BACK_ADJ high. The gpio18/BACK_ADJ signal is configured as a PWM for backlight brightness in the kernel, however the Ventana bootloader does not have PWM support so this is defaulted to a gpio out driven high (which would be 100% backlight). The gpio10/BACK_GPIO signal can be used to connect to a RST# or EN# signal and if connected must be adjusted for your display. As the bootloader defaults this to output-low, you may need to change that to output high if you connected it to an active-high enable:
     683</p>
     684<pre class="wiki">Ventana &gt; setenv preboot 'gpio set 10'; saveenv; reset
     685</pre><p>
     686Note that there is no support for touch-screen control in the Ventana bootloader.
     687</p>
     688<p>
     689<span class="wikianchor" id="bootscript"></span>
     690</p>
     691<h3 id="Bootloaderbootscript">Bootloader boot script</h3>
     692<p>
     693Most Gateworks BSP's load and execute a U-Boot bootscript from the OS that performs any OS specific kernel configuration. The bootloader will load and execute a script (if found) from the first ext2/3/4 partition on a block storage device, or the ubi boot/rootfs volume of a NAND ubi partition named <tt>boot/6x_bootscript-ventana</tt>. The source for these scripts can be found here:
     694</p>
     695<ul><li><a class="ext-link" href="https://github.com/Freescale/meta-freescale-3rdparty/blob/master/recipes-bsp/u-boot/u-boot-script-gateworks-imx/6x_bootscript-yocto.txt"><span class="icon">​</span>Yocto Bootscript</a>
     696</li><li><a class="ext-link" href="https://github.com/Gateworks/android_device_gateworks/blob/imx_l5.1.1_2.1.0-ga/ventana/6x_bootscript.txt"><span class="icon">​</span>Android 5.1 Bootscript</a>
     697</li><li><a class="ext-link" href="https://github.com/Gateworks/openwrt/blob/16.02/target/linux/imx6/image/bootscript-ventana"><span class="icon">​</span>OpenWrt 16.02</a>
     698</li></ul><p>
     699One of the things the Yocto and Android bootscripts do is configure the 'video=' kernel parameters based on the display env variable to values that are appropriate for the kernels used there. You can always override this by setting the bootloader 'video' env parameter manually, or you can add to the bootloader script to configure the parameters for your device specifically.
     700</p>
     701<p>
     702As an example, lets take the 'AUO G101EVN01.0' 1280x800 10.1" LVDS display:
     703</p>
     704<ul><li>for Yocto 1.8 using the 3.14 kernel (see <a class="wiki" href="/wiki/Yocto/Video_Out">wiki:Yocto/Video_Out</a> Yocto/Video_Out)
     705<div class="code"><pre>setenv video <span class="s1">'video=mxcfb0:dev=ldb,LDB-XGA,if=RGB666 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off'</span>
     706</pre></div></li><li>for Android using the 3.14 kernel:
     707<div class="code"><pre>setenv video <span class="s1">'video=mxcfb0:dev=ldb,bpp=32,LDB-XGA,if=RGB666 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off'</span>
     708</pre></div></li><li>for <a class="wiki" href="/wiki/OpenWrt">OpenWrt</a> 16.02 using the 4.4 kernel (see <a class="wiki" href="/wiki/linux/display">wiki:linux/display</a>):
     709<div class="code"><pre>setenv video <span class="s1">'video=LVDS-1:1280x800@60M video=HDMI-A-1:d'</span>
     710</pre></div></li></ul><p>
     711<span class="wikianchor" id="linux"></span>
     712</p>
     713<h3 id="LinuxKernelLCDdisplaysupport">Linux Kernel LCD display support</h3>
     714<p>
     715For Linux Kernel support, the device-tree specifies the display timings. The device tree file you modify will depend on the board you are using, such as GW52xx, GW53xx, or GW54xx. For example, the GW53xx device-tree in the Gateworks 3.14 vendor kernel is <a class="ext-link" href="https://github.com/Gateworks/linux-imx6/blob/gateworks_fslc_3.14_1.0.x_ga/arch/arm/boot/dts/imx6qdl-gw53xx.dtsi"><span class="icon">​</span>here</a>.
     716</p>
     717<p>
     718The Ventana kernel specifies multiple <tt>display-timings</tt> within the <tt>lvds-channel@0</tt> node and the <tt>native-mode</tt> property points to which one to use. This <tt>native-mode</tt> property gets set by the bootloader prior to booting the kernel based on the <tt>display</tt> env variable. Therefore, you can either add an additional timing and set the <tt>display</tt> variable, or you can simply overwrite the default timing0.
     719</p>
     720<p>
     721The display timing device-tree bindings are documented in <a class="ext-link" href="https://lxr.missinglinkelectronics.com/linux+v3.14/Documentation/devicetree/bindings/video/display-timing.txt"><span class="icon">​</span>Documentation/devicetree/bindings/video/display-timing.txt</a>. All values are identical to those used in the bootloader except that the bootloader uses 'pixclock' which is in units of picoseconds, and the kernel uses 'clock-frequency' in units of Hz.
     722</p>
     723<p>
     724As an example, lets take the 'AUO G101EVN01.0' 1280x800 10.1" LVDS display:
     725</p>
     726<ul><li><a class="ext-link" href="http://dev.gateworks.com/datasheets/AUOG101EVN01.0_Datasheet.pdf"><span class="icon">​</span>AUO G101EVN01.0 datasheet</a>
     727</li><li>1280x800 active pixels (6.5.1 Timing Characteristics)
     728</li><li>pixclock = (1/68.93MHz)*(1000000) = 14507 (68.93MHz is from typical clock frequency specified in 6.5.1 Timing Characteristics)
     729</li></ul><p>
     730We would add an additional device-tree node to <tt>display-timings</tt> in arch/arm/boot/dts/imx6qdl-gw53xx.dtsi (to add it to the GW53xx - add it to the other board dtsi files as needed)
     731</p>
     732<pre class="wiki">timing3: g101evn010 {
     733     clock-frequency = &lt;68930000&gt;;
     734     hactive = &lt;1280&gt;;
     735     vactive = &lt;800&gt;;
     736     hback-porch = &lt;220&gt;;
     737     hfront-porch = &lt;40&gt;;
     738     vback-porch = &lt;21&gt;;
     739     vfront-porch = &lt;7&gt;;
     740     hsync-len = &lt;60&gt;;
     741     vsync-len = &lt;10&gt;;
     742     linux,phandle = &lt;&amp;timing3&gt;;
     743};
     744</pre><ul><li>Note that 'timing3' needs to be unique from the other timings already defined
     745</li><li>Note the 'linux,phandle' property that needs to reference itself (timing3 in this example). This is un-conventional but necessary in order for the Ventana U-Boot bootloader to adjust the 'native-timing' property to match (case-insenstive) the display named 'G101EVN010' in this example based on the env variable.
     746</li></ul><p>
     747Now, after our kernel device-tree is built and updated on our target board we can set the <tt>display</tt> variable as follows:
     748</p>
     749<div class="code"><pre>Ventana &gt; setenv display G101EVN010; saveenv; reset
     750</pre></div><p>
     751To verify the device tree has the correct information once the board is booted, browse through the directory structure for the display-timings, and you should see your display:
     752</p>
     753<pre class="wiki">root@ventana:~# ls /proc/device-tree/soc/aips-bus\@02000000/ldb\@020e0008/lvds-channel\@0/display-timings/
     754dlc700ctp    dlc700jmgt4  dlc800figt3  hsd100pxn1   name         native-mode
     755</pre><p>
     756Then, to verify the correct information, you can use something like the following command to see the values:
     757</p>
     758<pre class="wiki">root@ventana:~# hexdump -C /proc/device-tree/soc/aips-bus\@02000000/ldb\@020e0008/lvds-channel\@0/display-timings/dlc700ctp/hactive
     75900000000  00 00 03 20                                       |... |
     76000000004
     761</pre><p>
     762The hex value of 0x0320 is decimal 800, which is correct for this example, of a horizontal active resolution of 800 pixels.
     763</p>
     764<p>
     765If your display has a touch-screen controller you need to add support for that separately which typically involves enabling a driver and adding a device-tree binding for that driver (not described here).
     766</p>
     767}}}