Home | History | Annotate | Download | only in source
      1 <html devsite>
      2   <head>
      3     <title>Using Reference Boards</title>
      4     <meta name="project_path" value="/_project.yaml" />
      5     <meta name="book_path" value="/_book.yaml" />
      6   </head>
      7   <body>
      8   <!--
      9       Copyright 2017 The Android Open Source Project
     10 
     11       Licensed under the Apache License, Version 2.0 (the "License");
     12       you may not use this file except in compliance with the License.
     13       You may obtain a copy of the License at
     14 
     15           http://www.apache.org/licenses/LICENSE-2.0
     16 
     17       Unless required by applicable law or agreed to in writing, software
     18       distributed under the License is distributed on an "AS IS" BASIS,
     19       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     20       See the License for the specific language governing permissions and
     21       limitations under the License.
     22   -->
     23 
     24 
     25 <p>You can create builds for Nexus devices using Android Open Source Project
     26 (AOSP) builds and the relevant hardware-specific binaries. For available
     27 Android builds and targeted devices, see
     28 <a href="/source/build-numbers.html#source-code-tags-and-builds">Source Code,
     29 Tags, and Builds</a>.</p>
     30 
     31 <p class="note"><strong>Note:</strong> Due to hardware differences, do not use
     32 Android 4.1.1 on a Nexus 7 originally sold with Android 4.1.2 or later.</p>
     33 
     34 <p>You can also create builds for
     35 <a href="https://android.googlesource.com/device/linaro/hikey/">HiKey</a>
     36 Android reference boards, which are designed to help non-Nexus component vendors
     37 develop and port drivers to Android releases. Using a reference board can ease
     38 upgrade efforts, reduce time-to-market for new Android devices, lower device
     39 costs by enabling ODM/OEMs to choose from a wider range of compatible
     40 components, and increase the speed of innovation among component suppliers.</p>
     41 
     42 <p>Google supports <a href="#960hikey">HiKey960</a> and
     43 <a href="#620hikey">HiKey</a> certified
     44 <a href="https://www.96boards.org/products/ce/hikey/">96Boards</a> as Android
     45 reference boards. AOSP provides kernel source and board support for HiKey so
     46 developers can easily create and debug new and existing peripheral drivers, do
     47 kernel development, and perform other tasks with fewer OEM encumbrances.</p>
     48 
     49 
     50 <h2 id="960hikey">HiKey960 boards</h2>
     51 
     52 <p>The HiKey960 board is available in a 3GB RAM configuration from LeMaker (via
     53 <a href="https://www.amazon.com/dp/B071RD3V34">Amazon.com</a>) and from
     54 <a href=" http://www.lenovator.com/product/132.html">Lenovator<a/>.</a></p>
     55 
     56 <img src="images/hikey960.png" alt="HiKey960 board image" />
     57 <p class="img-caption"><strong>Figure 2.</strong> HiKey960 board by Lenovator</p>
     58 
     59 <p>Additional resources:</p>
     60 <ul>
     61 <li>
     62 <a href="https://github.com/96boards/documentation/blob/master/ConsumerEdition/HiKey960/HardwareDocs/HiKey960_Schematics.pdf">HiKey960
     63 schematics</a></li>
     64 <li>
     65 <a href="http://www.96boards.org/documentation/ConsumerEdition/HiKey960/HardwareDocs/HardwareUserManual.md/">HiKey960
     66 user guide</a></li>
     67 <li>
     68 <a href="https://github.com/96boards/documentation/wiki/">96boards wiki</a></li>
     69 </ul>
     70 
     71 <p>Use the following commands to download, build, and run Android on the
     72 HiKey960 board.</p>
     73 
     74 <h3 id="960userspace">Compiling userspace</h3>
     75 <ol>
     76   <li>Download the Android source tree:
     77 <pre class="devsite-click-to-copy">
     78 <code class="devsite-terminal">repo init -u <a href="https://android.googlesource.com/platform/manifest">https://android.googlesource.com/platform/manifest</a> -b master</code>
     79 <code class="devsite-terminal">repo sync -j24</code>
     80 </pre>
     81   </li>
     82   <li>Download and extract binaries into the Android source tree:
     83 <pre class="devsite-click-to-copy">
     84 <code class="devsite-terminal">wget https://dl.google.com/dl/android/aosp/arm-hikey960-NOU-7ad3cccc.tgz</code>
     85 <code class="devsite-terminal">tar xzf arm-hikey960-NOU-7ad3cccc.tgz</code>
     86 <code class="devsite-terimnal">./extract-arm-hikey960.sh</code>
     87 </pre>
     88   </li>
     89   <li>Build:
     90 <pre class="devsite-click-to-copy">
     91 <code class="devsite-terminal">. ./build/envsetup.sh</code>
     92 <code class="devsite-terminal">lunch hikey960-userdebug</code>
     93 <code class="devsite-terminal">make -j32</code>
     94 </pre>
     95   </li>
     96 </ol>
     97 
     98 <h3 id="960fastboot">Installing initial images</h3>
     99 <ol>
    100   <li>Select fastboot mode turning ON switch 1 and 3 (for details, refer to the
    101 HiKey960 user guide).</li>
    102   <li>Power the board.</li>
    103   <li>Flash initial images:
    104 <pre class="devsite-click-to-copy">
    105 <code class="devsite-terminal">cd device/linaro/hikey/installer/hikey960</code>
    106 <code class="devsite-terminal">./flash-all.sh</code>
    107 </pre>
    108   </li>
    109   <li>Turn OFF switch 3 and power cycle the board.</li>
    110 </ol>
    111 
    112 <h3 id="960images">Flashing images</h3>
    113 <ol>
    114   <li>Enter fastboot mode by turning ON switch 1 and 3.</li>
    115   <li>Flash images by running the following commands:
    116 <pre class="devsite-click-to-copy">
    117 <code class="devsite-terminal">fastboot flash boot out/target/product/hikey960/boot.img</code>
    118 <code class="devsite-terminal">fastboot flash dts out/target/product/hikey960/dt.img</code>
    119 <code class="devsite-terminal">fastboot flash system out/target/product/hikey960/system.img</code>
    120 <code class="devsite-terminal">fastboot flash cache out/target/product/hikey960/cache.img</code>
    121 <code class="devsite-terminal">fastboot flash userdata out/target/product/hikey960/userdata.img</code>
    122 </pre>
    123   </li>
    124   <li>Turn OFF switch 3 and power cycle the board.</li>
    125 </ol>
    126 
    127 <h3 id="960kernel">Building the kernel</h3>
    128 <ol>
    129   <li>Run the following commands:
    130 <pre class="devsite-click-to-copy">
    131 <code class="devsite-terminal">git clone <a href="https://android.googlesource.com/kernel/hikey-linaro">https://android.googlesource.com/kernel/hikey-linaro</a></code>
    132 <code class="devsite-terminal">cd hikey-linaro</code>
    133 <code class="devsite-terminal">git checkout -b android-hikey-linaro-4.4 origin/android-hikey-linaro-4.4</code>
    134 <code class="devsite-terminal">make ARCH=arm64 hikey960_defconfig</code>
    135 <code class="devsite-terminal">make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24</code>
    136 </pre>
    137   </li>
    138   <li>Update the kernel in the boot image.
    139     <ul>
    140       <li>Copy hi3660-hikey960.dtb (<code>arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb</code>) to the hikey-kernel directory as file hi3660-hikey960.dtb.</li>
    141       <li>Copy the Image file <code>(arch/arm64/boot/Image.gz</code>) to the hikey-kernel directory as file Image.gz-hikey960.</li>
    142     </ul>
    143   <li>Make the boot image:
    144 <pre class="devsite-terminal devsite-click-to-copy">
    145 make bootimage -j24
    146 </pre>
    147   </li>
    148 </ol>
    149 
    150 <h3 id="960serial">Setting serial number</h3>
    151 <p>To set random serial number, run:
    152 <pre class="devsite-terminal devsite-click-to-copy">
    153 fastboot getvar nve:SN@<var>16_DIGIT_NUMBER</var>
    154 </pre>
    155 <p>Bootloader exports the generated serial number to kernel via
    156 <code>androidboot.serialno=</code>.
    157 
    158 <h3 id="960resolution">Setting monitor resolution</h3>
    159 <p>Edit the <code>device/linaro/hikey/hikey960/BoardConfig.mk</code> parameter
    160 <code>BOARD_KERNEL_CMDLINE</code> and configure the <code>video</code> setting.
    161 Example setting for a 24" monitor is <code>video=HDMI-A-1:1280x800@60</code>.
    162 </p>
    163 
    164 <h2 id="620hikey">HiKey boards</h2>
    165 
    166 <p>The HiKey board (also known as HiKey620) is available in
    167 <a href="http://www.lenovator.com/product/86.html">1GB RAM</a> and
    168 <a href="http://www.lenovator.com/product/90.html">2GB RAM</a> configurations
    169 from <a href="http://www.lenovator.com">Lenovator</a>:</p>
    170 
    171 <img src="images/hikey620.png" alt="HiKey620 board image" />
    172 <p class="img-caption"><strong>Figure 1.</strong> HiKey board by Lenovator</p>
    173 
    174 <p>Additional resources:</p>
    175 <ul>
    176 <li>
    177 <a href="https://github.com/96boards/documentation/blob/master/ConsumerEdition/HiKey960/HardwareDocs/HiKey960_Schematics.pdf">HiKey
    178 schematics</a></li>
    179 <li>
    180 <a href="http://www.96boards.org/documentation/ConsumerEdition/HiKey960/HardwareDocs/HardwareUserManual.md/">HiKey
    181 user guide</a></li>
    182 <li><a href="https://github.com/96boards/documentation/wiki/">96boards wiki</a></li>
    183 </ul>
    184 
    185 <p>Use the following commands to download, build, and run Android on the HiKey
    186 board.</p>
    187 
    188 <h3 id="620userspace">Compiling userspace</h3>
    189 <ol>
    190   <li>Download the Android source tree:
    191 <pre class="devsite-click-to-copy">
    192 <code class="devsite-terminal">repo init -u <a href="https://android.googlesource.com/platform/manifest">https://android.googlesource.com/platform/manifest</a> -b master</code>
    193 <code class="devsite-terminal">repo sync -j24</code>
    194 </pre>
    195   </li>
    196   <li>Download and extract HDMI binaries into the Android source tree:
    197 <pre class="devsite-click-to-copy">
    198 <code class="devsite-terminal">wget <a href="https://dl.google.com/dl/android/aosp/linaro-hikey-20170523-4b9ebaff.tgz">https://dl.google.com/dl/android/aosp/linaro-hikey-20170523-4b9ebaff.tgz</a></code>
    199 <code class="devsite-terminal">tar xzf linaro-hikey-20170523-4b9ebaff.tgz</code>
    200 <code class="devsite-terminal">./extract-linaro-hikey.sh</code>
    201 </pre>
    202   </li>
    203   <li>Install mcopy utility:
    204 <pre class="devsite-terminal devsite-click-to-copy">
    205 apt-get install mtools
    206 </pre>
    207   </li>
    208   <li>Build:
    209 <pre class="devsite-click-to-copy">
    210 <code class="devsite-terminal">. ./build/envsetup.sh</code>
    211 <code class="devsite-terminal">lunch hikey-userdebug</code>
    212 <code class="devsite-terminal">make -j32</code>
    213 </pre>
    214   </li>
    215 </ol>
    216 
    217 <p class="note"><strong>Note:</strong> For 4GB eMMC, instead of <code>$ make -j32</code>
    218 use: <code>$ make -j32 TARGET_USERDATAIMAGE_4GB=true</code>.</p>
    219 
    220 <h3 id="620fastboot">Installing initial fastboot and ptable</h3>
    221 <ol>
    222   <li>Select special bootloader mode by linking J15 1-2 and 3-4 pins (for details,
    223 refer to the
    224 <a href="https://www.96boards.org/wp-content/uploads/2015/02/HiKey_User_Guide_Rev0.2.pdf">HiKey
    225 user guide</a>).</li>
    226   <li>Connect USB to PC to get ttyUSB device (ex: <code>/dev/ttyUSB1</code>).</li>
    227   <li>Power the board:
    228 <pre class="devsite-click-to-copy">
    229 <code class="devsite-terminal">cd device/linaro/hikey/installer/hikey</code>
    230 <code class="devsite-terminal">./flash-all.sh /dev/ttyUSB1 [4g]</code>
    231 </pre>
    232   </li>
    233   <li>Remove jumper 3-4 and power the board.</li>
    234 </ol>
    235 
    236 <h3 id="620images">Flashing images</h3>
    237 <ol>
    238   <li>Enter fastboot mode by linking J15 1-2 and 5-6 pins.</li>
    239   <li>Run the following commands:
    240 <pre class="devsite-click-to-copy">
    241 <code class="devsite-terminal">fastboot flash boot out/target/product/hikey/boot.img</code>
    242 <code class="devsite-terminal">fastboot flash -w system out/target/product/hikey/system.img</code>
    243 </pre>
    244   </li>
    245   <li>Remove jumper 5-6 and power the board.</li>
    246 </ol>
    247 
    248 <h3 id="620kernel">Building the kernel</h3>
    249 <ol>
    250   <li>Run the following commands:
    251 <pre class="devsite-click-to-copy">
    252 <code class="devsite-terminal">git clone <a href="https://android.googlesource.com/kernel/hikey-linaro">https://android.googlesource.com/kernel/hikey-linaro</a></code>
    253 <code class="devsite-terminal">cd hikey-linaro</code>
    254 <code class="devsite-terminal">git checkout -b android-hikey-linaro-4.9 origin/android-hikey-linaro-4.9</code>
    255 <code class="devsite-terminal">make ARCH=arm64 hikey_defconfig</code>
    256 <code class="devsite-terminal">make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24</code>
    257 </pre>
    258   </li>
    259   <li>Copy output to the hikey kernel directory (<code>/kernel/hikey-linaro</code>):
    260     <ul>
    261       <li>Copy hi6220-hikey.dtb (<code>arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb</code>) to the
    262 hikey-kernel directory as file hi6220-hikey.dtb-4.9.</li>
    263   <li>Copy the Image file <code>(arch/arm64/boot/Image-dtb</code>) to the
    264 hikey-kernel directory as file Image-dtb-4.9.</li>
    265     </ul>
    266   <li>Make the boot image:
    267 <pre class="devsite-terminal devsite-click-to-copy">
    268 make bootimage -j24
    269 </pre>
    270   </li>
    271 </ol>
    272 
    273 <h3 id="620resolution">Setting monitor resolution</h3>
    274 <p>Edit <code>device/linaro/hikey/hikey/BoardConfig.mk</code> parameter
    275 <code>BOARD_KERNEL_CMDLINE</code> and configure the <code>video</code> setting.
    276 Example setting for a 24" monitor: <code>video=HDMI-A-1:1280x800@60</code>.</p>
    277 
    278 <h3 id="620serial">Configuring kernel serial output (uart3)</h3>
    279 <p>Set the J2 low speed expansion connector to 1 - Gnd, 11 - Rx, 13 - Tx. For
    280 details, refer to the
    281 <a href="https://www.96boards.org/wp-content/uploads/2015/02/HiKey_User_Guide_Rev0.2.pdf">HiKey
    282 user guide</a>.</p>
    283 
    284   </body>
    285 </html>
    286