Changes between Initial Version and Version 1 of Android/Booting


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

--

Legend:

Unmodified
Added
Removed
Modified
  • Android/Booting

    v1 v1  
     1{{{#!html
     2          <div id="wikipage" class="trac-content"><p>
     3</p><div class="wiki-toc">
     4<ol>
     5  <li>
     6    <ol>
     7      <li>
     8        <a href="#BootingAndroid">Booting Android</a>
     9        <ol>
     10          <li>
     11            <a href="#a4GBUSBFlashDrivePre-LoadedwithAndroid">4GB USB Flash Drive Pre-Loaded with Android</a>
     12          </li>
     13          <li>
     14            <a href="#InstallingPre-builtimageontobootmedia">Installing Pre-built image onto boot media</a>
     15          </li>
     16          <li>
     17            <a href="#BootDevices">Boot Devices</a>
     18            <ol>
     19              <li>
     20                <a href="#SettingUSBDelay">Setting USB Delay</a>
     21              </li>
     22              <li>
     23                <a href="#BootingfromUSBOTGAndroidJellybeanonly">Booting from USB OTG (Android Jellybean only)</a>
     24              </li>
     25            </ol>
     26          </li>
     27          <li>
     28            <a href="#DisplayOutputSelection">Display Output Selection</a>
     29            <ol>
     30              <li>
     31                <a href="#HDMIResolutionsSupported">HDMI Resolutions Supported</a>
     32              </li>
     33              <li>
     34                <a href="#DualDisplayMirroredDisplay">Dual Display (Mirrored Display)</a>
     35              </li>
     36            </ol>
     37          </li>
     38          <li>
     39            <a href="#SerialConsole">Serial Console</a>
     40          </li>
     41          <li>
     42            <a href="#MemoryRequirements">Memory Requirements</a>
     43          </li>
     44          <li>
     45            <a href="#BootingTips">Booting Tips</a>
     46          </li>
     47          <li>
     48            <a href="#Troubleshooting">Troubleshooting</a>
     49          </li>
     50        </ol>
     51      </li>
     52      <li>
     53        <a href="#BootSpeedSpeedingUp">Boot Speed / Speeding Up</a>
     54      </li>
     55    </ol>
     56  </li>
     57</ol>
     58</div><p>
     59</p>
     60<h2 id="BootingAndroid">Booting Android</h2>
     61<p>
     62In this section you will find instructions on various ways to boot Android on the Ventana boards.
     63</p>
     64<p>
     65<span class="wikianchor" id="prebuilt"></span>
     66</p>
     67<h3 id="a4GBUSBFlashDrivePre-LoadedwithAndroid">4GB USB Flash Drive Pre-Loaded with Android</h3>
     68<p>
     69Developers can get started quickly by purchasing a USB Stick Pre-Loaded with Android 4.3 on the <a class="ext-link" href="http://shop.gateworks.com/index.php?route=product/product&amp;path=70_82&amp;product_id=133"><span class="icon">​</span>Gateworks Online Shop</a>
     70</p>
     71<h3 id="InstallingPre-builtimageontobootmedia">Installing Pre-built image onto boot media</h3>
     72<p>
     73You can download a pre-built disk image or build an image yourself from source:
     74</p>
     75<ul><li><a class="ext-link" href="http://trac.gateworks.com/wiki/Android/Building#GateworksPrecompiledAndroidBinary"><span class="icon">​</span>Pre-Built Android Images</a>
     76</li><li><a class="wiki" href="/wiki/Android/Building#GateworksPrecompiledAndroidBinary">Installing Gateworks Android Precompiled Binary onto Removable Media</a>
     77</li><li><a class="wiki" href="/wiki/Android/Building">Building/Installing Android Instructions for the Ventana Family</a>
     78</li></ul><p>
     79<span class="wikianchor" id="bootdevs"></span>
     80</p>
     81<h3 id="BootDevices">Boot Devices</h3>
     82<p>
     83The <a class="wiki" href="/wiki/Android/OSDevelopment#bootscript">Gateworks Android bootloader script</a> will boot by default from a USB stick, micro-SD, mSata, Flash, in that order (checking for /boot/uImage on the 1st (ext2 in the case of all but Flash) partition) therefore simply powering the board with a storage device created with one of the methods described on this page will boot to Android.
     84</p>
     85<p>
     86If you are not booting from USB you can change the uboot 'bootdevs' env variable to specify the boot device which can save a few seconds during boot depending on your configuration.
     87</p>
     88<h4 id="SettingUSBDelay">Setting USB Delay</h4>
     89<p>
     90If using a USB flash storage device, some USB storage devices need a longer than typical delay to properly initialize.
     91Please see the following link for setting this delay: <a class="ext-link" href="http://trac.gateworks.com/wiki/ventana/bootloader#USBMassStorageSupport"><span class="icon">​</span>Setting USB Delay</a>
     92</p>
     93<h4 id="BootingfromUSBOTGAndroidJellybeanonly">Booting from USB OTG (Android Jellybean only)</h4>
     94<p>
     95By default, The Android boot script is configured to boot from a USB Mass Storage device on the EHCI host port and auto-detection of which port was used is not currently possible.
     96</p>
     97<p>
     98To change the Android USB boot device set the 'usbdevport' env variable in u-boot:
     99</p>
     100<ul><li>To boot off fsl-ehci.0 USB_OTG:
     101<pre class="wiki">setenv usbdevport 0
     102saveenv
     103boot
     104</pre></li><li>To boot off fsl-ehci.1 USB_EHCI (Standard type-B front-panel host connector):
     105<pre class="wiki">setenv usbdevport 1
     106saveenv
     107boot
     108</pre></li></ul><p>
     109<em>You do not need to do this when booting from SATA or micro-SD or if using Android KitKat  or beyond - the Android boot script will auto-detect</em>
     110</p>
     111<p>
     112<span class="wikianchor" id="display"></span>
     113</p>
     114<h3 id="DisplayOutputSelection">Display Output Selection</h3>
     115<p>
     116The Gateworks Android BSP supports various LVDS touchscreen displays as well as HDMI output and Dual-Display by mirroring the two.
     117</p>
     118<p>
     119The Gateworks bootloader will display a splash-screen on boot based on the <tt>panel</tt> env variable. The bootloader splash will be a Gateworks logo for the most recent bootloader or a Linux tux for earlier bootloader versions. If you wish to disable the bootloader splash you can set this to <em>none</em>. See <a class="wiki" href="/wiki/ventana/bootloader#display">ventana/bootloader</a> for more details.
     120</p>
     121<p>
     122The Gateworks bootloader will configure display timings and the <a class="wiki" href="/wiki/Android/OSDevelopment#bootscript">Gateworks Android bootloader script</a> will configure kernel parameters for specific displays based on the <tt>display</tt> bootloader env variable. This can be one of the following:
     123</p>
     124<ul><li><strong>Hannstar-XGA</strong> (for 10" 1024x768 Freescale MXC-LVDS1 display with a egalax touch controller at i2c 0x04)
     125</li><li><strong>AUO-G070VW01</strong> (for 7" 800x480 display with a tsc2007 touch controller at i2c 0x49)
     126</li><li><strong>DLC700JMGT4</strong> - 7in WSVGA (1024x600) with capacitive multitouch touchscreen - not detected (must be assigned manually - see below)
     127</li><li><strong>HDMI</strong> (for HDMI display - set the <tt>hdmi</tt> env variable to <strong>480p</strong>, <strong>720p</strong>, <strong>1080p</strong> to specific the specific resolution)
     128</li></ul><p>
     129Examples:
     130</p>
     131<ul><li>1080p HDMI display with bootloader splash:
     132<div class="code"><pre>setenv panel HDMI
     133setenv display HDMI
     134setenv hdmi 1080p
     135saveenv
     136</pre></div></li><li>720p HDMI display without bootloader splash:
     137<div class="code"><pre>setenv panel none
     138setenv display HDMI
     139setenv hdmi 720p
     140saveenv
     141</pre></div></li><li><a class="wiki" href="/wiki/ventana/LVDS#XGA-10in">Freescale MCIMX-LVDS1 10" XGA Touchscreen Display</a> with bootloader splash:
     142<div class="code"><pre>setenv panel Hannstar-XGA
     143setenv display Hannstar-XGA
     144saveenv
     145</pre></div></li><li><a class="wiki" href="/wiki/ventana/LVDS#WSVGA-7in">Gateworks GW17029 DLC700JMGT4 7" WSVGA Touchscreen Display</a> with bootloader splash:
     146<div class="code"><pre>setenv panel DLC700JMGT4
     147setenv display DLC700JMGT4
     148saveenv
     149</pre></div></li><li><a class="wiki" href="/wiki/ventana/LVDS#XGA-8in">Gateworks GW17039 DLC800FIGT3 8" XGA Touchscreen Display</a> with bootloader splash:
     150<div class="code"><pre>setenv panel DLC800FIGT3
     151setenv display DLC800FIGT3
     152saveenv
     153</pre></div></li></ul><p>
     154<span class="wikianchor" id="hdmi-out"></span>
     155</p>
     156<h4 id="HDMIResolutionsSupported">HDMI Resolutions Supported</h4>
     157<p>
     158The <tt>mxc_hdmi</tt> driver by default supports the following progressive CEA modes:
     159</p>
     160<ul><li>#1: 640x480p@59.94/60Hz 4:3
     161</li><li>#2: 720x480p@59.94/60Hz 4:3
     162</li><li>#3: 720x480p@59.94/60Hz 16:9
     163</li><li>#4: 1280x720p@59.94/60Hz 16:9
     164</li><li>#8: 720(1440)x240pH@59.94/60Hz 4:3
     165</li><li>#9: 720(1440)x240pH@59.94/60Hz 16:9
     166</li><li>#14: 1440x480p@59.94/60Hz 4:3
     167</li><li>#15: 1440x480p@59.94/60Hz 16:9
     168</li><li>#16: 1920x1080p@60Hz 16:9
     169</li><li>#17: 720x576pH@50Hz 4:3
     170</li><li>#18: 720x576pH@50Hz 16:9
     171</li><li>#19: 1280x720p@50Hz
     172</li><li>#23: 720(1440)x288pH@50Hz 4:3
     173</li><li>#24: 720(1440)x288pH@50Hz 16:9
     174</li><li>#29: 720(1440)x576pH@50Hz 4:3
     175</li><li>#30: 720(1440)x576pH@50Hz 16:9
     176</li><li>#31: 1920x1080p@50Hz
     177</li><li>#32: 1920x1080p@23.98/24Hz
     178</li><li>#33: 1920x1080p@25Hz
     179</li><li>#34: 1920x1080p@30Hz
     180</li><li>#41: 1280x720p@100Hz 16:9
     181</li><li>#47: 1280x720p@119.88/120Hz 16:9
     182</li></ul><p>
     183Out of the above list of supported modes only those present in the monitor's Extended Display Identification Data (<a class="ext-link" href="https://en.wikipedia.org/wiki/Extended_Display_Identification_Data"><span class="icon">​</span>EDID</a>) are considered.
     184</p>
     185<p>
     186If your monitor supports a non-CEA mode or mode not listed above you can set the <tt>only_cea=0</tt> kernel commandline parameter to allow it, however you may find that this disables HDMI audio output. This can be set in the bootloader for example:
     187</p>
     188<div class="code"><pre>setenv extra <span class="s1">'mxc_hdmi.only_cea=0'</span>
     189saveenv
     190</pre></div><p>
     191The default mode is specified in the kernel device-tree (for example, <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-gw52xx.dtsi#L141"><span class="icon">​</span>here</a> for the GW52xx) as '1920x1080M@60' for 1080p@60Hz. This can be overridden with a <tt>video=</tt> kernel parameter (see <a class="wiki" href="/wiki/Android/Booting#kernel-param">above</a>). For example, if you monitor is defaulting to 1920x1080p@60Hz and you want it instead to be 1680x1050@59Hz from a matching mode of 'D:1680x1050p-59' in <tt>/sys/class/graphics/fb0/modes</tt> you could use:
     192</p>
     193<pre class="wiki">setenv video 'video=mxcfb0:dev=hdmi,1680x1050M@59 video=mxcfb1:off'
     194saveenv
     195</pre><p>
     196Note that the Android BSP has a <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>bootloader script</a> which will set the kernel commandline (unless the <tt>video</tt> bootloader env variable is set to override it). The script will use the <tt>hdmi</tt> env variable (and defaults to 1080p if not set) to determine the resolution and use this for HDMI if an HDMI monitor is connected at bootup. For example:
     197</p>
     198<ul><li>specify 720p
     199<div class="code"><pre>setenv video <span class="c"># make sure video var is blank for auto-configuration to work
     200</span>setenv hdmi 720p <span class="c"># set to 1280x720M@60
     201</span>saveenv
     202</pre></div></li><li>specify 1080p
     203<div class="code"><pre>setenv video <span class="c"># make sure video var is blank for auto-configuration to work
     204</span>setenv hdmi 1080p <span class="c"># set to 1920x1080M@60
     205</span>saveenv
     206</pre></div></li></ul><p>
     207Note that if you specify a video mode that the monitor's EDID does not support (or supports per the EDID but doesn't appear in <tt>/sys/class/graphics/fb0/modes</tt> because only_cea=1) the <tt>mxc_hdmi</tt> driver will try to find the nearest supported resolution to what you specified.
     208</p>
     209<p>
     210Once booted, you can see the list of available video modes via /sys/class/graphics:
     211</p>
     212<ul><li>see current video mode:
     213<div class="code"><pre><span class="c"># cat /sys/class/graphics/fb0/mode
     214</span>D:1680x1050p-59
     215</pre></div></li><li>see available modes:
     216<div class="code"><pre><span class="c"># cat /sys/class/graphics/fb0/modes
     217</span>S:1280x1024p-60
     218S:1152x864p-75
     219V:1280x1024p-75
     220V:1024x768p-75
     221V:1024x768p-60
     222V:800x600p-75
     223V:800x600p-60
     224V:640x480p-75
     225V:640x480p-60
     226U:720x400p-70
     227D:1680x1050p-59
     228V:640x480p-60
     229</pre></div><ul><li>'S' refers to an EDID 'Standard Timing' in EDID
     230</li><li>'V' refers to a VESA mode from 'Established Timings' in EDID
     231</li><li>'D' refers to the 'Detailed mode' in EDID (which should be the monitors preferred or native mode)
     232</li></ul></li><li>change the resolution (must provide a mode matching those show from <tt>modes</tt>):
     233<div class="code"><pre><span class="nb">echo</span> <span class="s2">"V:1024x768p-60"</span> &gt; /sys/class/graphics/fb0/mode
     234</pre></div></li></ul><p>
     235<span class="wikianchor" id="mirrored-display"></span>
     236</p>
     237<h4 id="DualDisplayMirroredDisplay">Dual Display (Mirrored Display)</h4>
     238<p>
     239To mirror the Android OS to both HDMI and LVDS displays you can set the <tt>display</tt> env variable to multiple options described above.
     240</p>
     241<p>
     242The Android OS will use the resolution of the first display specified therefore you should typically specify the LVDS display first and HDMI after if you have a lower resolution LVDS display than the HDMI monitor. In this case the HDMI monitor will show a letter-boxed display of what is present on the LVDS touch-screen. The bootloader does not support dual-display so if you want to show the bootloader splashscreen you must specify one display argument.
     243</p>
     244<p>
     245Examples:
     246</p>
     247<ul><li><a class="wiki" href="/wiki/ventana/LVDS#XGA-10in">Freescale MCIMX-LVDS1 10" XGA Touchscreen Display</a> and a standard 1080p HDMI monitor with bootloader splash on LVDS:
     248<div class="code"><pre>setenv panel Hannstar-XGA
     249setenv display <span class="s2">"Hannstar-XGA HDMI"</span>
     250setenv hdmi 1080p
     251saveenv
     252</pre></div></li></ul><p>
     253<span class="wikianchor" id="console"></span>
     254</p>
     255<h3 id="SerialConsole">Serial Console</h3>
     256<p>
     257When using Android 5.x (Lollipop) serial console "input" is disabled by default as a requirement for passing Android Certification Test Suite (CTS). To use serial console input you must disable selinux by adding the 'androidboot.selinux=disabled' to the kernel command line. You can do this by using the <tt>extra</tt> env variable in the bootloader as such:
     258</p>
     259<pre class="wiki">setenv extra 'androidboot.selinux=disabled'; saveenv
     260</pre><p>
     261<span class="wikianchor" id="mem"></span>
     262</p>
     263<h3 id="MemoryRequirements">Memory Requirements</h3>
     264<p>
     265Android on Gateworks Ventana boards requires 512MB of DRAM but 1GB+ is highly recommended. In low memory situations you will find that tasks are constantly being killed and re-started and/or are slow to start.
     266</p>
     267<p>
     268A certain amount of DRAM is carved out using the Linux Contiguous Memory Allocator (CMA) for VPU and GPU based on the amount of system memory available. This is done automatically by the Android boot scripts based on the <tt>mem_mb</tt> U-Boot env variable.
     269</p>
     270<p>
     271Please ensure you have a bootloader built from 2015 or later to ensure the <tt>mem_mb</tt> env variable is set automatically by the bootloader.
     272</p>
     273<p>
     274You can override the allocation manually if you desire however it is not clear what the overall effect would be if you limit this beyond the Freescale recommended values. See the <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>bootloader script</a> for examples.
     275</p>
     276<p>
     277References:
     278</p>
     279<ul><li><a class="ext-link" href="https://source.android.com/devices/tech/low-ram.html"><span class="icon">​</span>https://source.android.com/devices/tech/low-ram.html</a>
     280</li><li>Freescale IMX6 Android release notes
     281</li></ul><p>
     282<span class="wikianchor" id="tips"></span>
     283</p>
     284<h3 id="BootingTips">Booting Tips</h3>
     285<p>
     286Once booted you will likely want to disable the screen-blanking right away (as there is no 'power button' configured to wake the device).
     287</p>
     288<p>
     289To do this for Android Jellybean 4.3 / KitKat 4.4.3:
     290</p>
     291<ol><li>Launch 'Settings' application
     292</li><li>Select 'Developer options' menu and select 'Stay awake'
     293<ul><li>if you are using a 'user' build you need to head to 'Settings' -&gt; 'About tablet' and click on 'Build number' 6 times to enable the 'Settings' -&gt; 'Developer options' menu.
     294</li></ul></li></ol><p>
     295While you are also in settings you probably also want to:
     296</p>
     297<ul><li>enable USB debugging: Developer options -&gt; USB debugging (if you want to use adb over a USB OTG cable to a host PC)
     298</li><li>enable installing apps from unknown sources: Security -&gt; Unknown sources (to allow installation of apps from unknown sources if you want to sideload apps)
     299</li><li>disable auto-rotate screen: Accessibility -&gt; System: Auto-rotate screen
     300</li></ul><p>
     301<span class="wikianchor" id="troubleshooting"></span>
     302</p>
     303<h3 id="Troubleshooting">Troubleshooting</h3>
     304<p>
     305Android may have issues booting up if there is no video source connected or the video source has not been defined in the bootloader. Please confirm that the bootloader has been configured for the proper display device.
     306</p>
     307<p>
     308<span class="wikianchor" id="bootspeed"></span>
     309</p>
     310<h2 id="BootSpeedSpeedingUp">Boot Speed / Speeding Up</h2>
     311<p>
     312It typically requires 30 to 40 seconds to boot to the lock screen but to achieve this you need to do a bit of uboot environment tuning (such as setting bootdevs to just your boot device, minimizing or eliminating bootdelay, and disabling kernel console):
     313</p>
     314<ul><li>See Wiki Page -&gt; <a class="wiki" href="/wiki/boot_speed">Boot Speed Wiki Page</a>
     315</li></ul
     316}}}