Changes between Initial Version and Version 1 of Android/Booting

10/22/2017 05:28:45 AM (5 years ago)



  • Android/Booting

    v1 v1  
     2          <div id="wikipage" class="trac-content"><p>
     3</p><div class="wiki-toc">
     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>
     60<h2 id="BootingAndroid">Booting Android</h2>
     62In this section you will find instructions on various ways to boot Android on the Ventana boards.
     65<span class="wikianchor" id="prebuilt"></span>
     67<h3 id="a4GBUSBFlashDrivePre-LoadedwithAndroid">4GB USB Flash Drive Pre-Loaded with Android</h3>
     69Developers can get started quickly by purchasing a USB Stick Pre-Loaded with Android 4.3 on the <a class="ext-link" href=";path=70_82&amp;product_id=133"><span class="icon">​</span>Gateworks Online Shop</a>
     71<h3 id="InstallingPre-builtimageontobootmedia">Installing Pre-built image onto boot media</h3>
     73You can download a pre-built disk image or build an image yourself from source:
     75<ul><li><a class="ext-link" href=""><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>
     79<span class="wikianchor" id="bootdevs"></span>
     81<h3 id="BootDevices">Boot Devices</h3>
     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.
     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.
     88<h4 id="SettingUSBDelay">Setting USB Delay</h4>
     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=""><span class="icon">​</span>Setting USB Delay</a>
     93<h4 id="BootingfromUSBOTGAndroidJellybeanonly">Booting from USB OTG (Android Jellybean only)</h4>
     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.
     98To change the Android USB boot device set the 'usbdevport' env variable in u-boot:
     100<ul><li>To boot off fsl-ehci.0 USB_OTG:
     101<pre class="wiki">setenv usbdevport 0
     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
     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>
     112<span class="wikianchor" id="display"></span>
     114<h3 id="DisplayOutputSelection">Display Output Selection</h3>
     116The Gateworks Android BSP supports various LVDS touchscreen displays as well as HDMI output and Dual-Display by mirroring the two.
     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.
     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:
     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)
     131<ul><li>1080p HDMI display with bootloader splash:
     132<div class="code"><pre>setenv panel HDMI
     133setenv display HDMI
     134setenv hdmi 1080p
     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
     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
     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
     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
     154<span class="wikianchor" id="hdmi-out"></span>
     156<h4 id="HDMIResolutionsSupported">HDMI Resolutions Supported</h4>
     158The <tt>mxc_hdmi</tt> driver by default supports the following progressive CEA modes:
     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
     183Out of the above list of supported modes only those present in the monitor's Extended Display Identification Data (<a class="ext-link" href=""><span class="icon">​</span>EDID</a>) are considered.
     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:
     188<div class="code"><pre>setenv extra <span class="s1">'mxc_hdmi.only_cea=0'</span>
     191The default mode is specified in the kernel device-tree (for example, <a class="ext-link" href=""><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:
     193<pre class="wiki">setenv video 'video=mxcfb0:dev=hdmi,1680x1050M@59 video=mxcfb1:off'
     196Note that the Android BSP has a <a class="ext-link" href=""><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:
     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
     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
     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.
     210Once booted, you can see the list of available video modes via /sys/class/graphics:
     212<ul><li>see current video mode:
     213<div class="code"><pre><span class="c"># cat /sys/class/graphics/fb0/mode
     215</pre></div></li><li>see available modes:
     216<div class="code"><pre><span class="c"># cat /sys/class/graphics/fb0/modes
     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
     235<span class="wikianchor" id="mirrored-display"></span>
     237<h4 id="DualDisplayMirroredDisplay">Dual Display (Mirrored Display)</h4>
     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.
     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.
     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
     253<span class="wikianchor" id="console"></span>
     255<h3 id="SerialConsole">Serial Console</h3>
     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:
     259<pre class="wiki">setenv extra 'androidboot.selinux=disabled'; saveenv
     261<span class="wikianchor" id="mem"></span>
     263<h3 id="MemoryRequirements">Memory Requirements</h3>
     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.
     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.
     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.
     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=""><span class="icon">​</span>bootloader script</a> for examples.
     279<ul><li><a class="ext-link" href=""><span class="icon">​</span></a>
     280</li><li>Freescale IMX6 Android release notes
     282<span class="wikianchor" id="tips"></span>
     284<h3 id="BootingTips">Booting Tips</h3>
     286Once booted you will likely want to disable the screen-blanking right away (as there is no 'power button' configured to wake the device).
     289To do this for Android Jellybean 4.3 / KitKat 4.4.3:
     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.
     295While you are also in settings you probably also want to:
     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
     301<span class="wikianchor" id="troubleshooting"></span>
     303<h3 id="Troubleshooting">Troubleshooting</h3>
     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.
     308<span class="wikianchor" id="bootspeed"></span>
     310<h2 id="BootSpeedSpeedingUp">Boot Speed / Speeding Up</h2>
     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):
     314<ul><li>See Wiki Page -&gt; <a class="wiki" href="/wiki/boot_speed">Boot Speed Wiki Page</a>