blob: 0e1b3cb322c66fe93232fc783b2aa1c1bbbd217d [file] [log] [blame]
Android Partner Docs57543d42017-04-06 19:19:47 +00001<html devsite>
2 <head>
Android Partner Docs16b426b2017-05-08 14:16:00 -07003 <title>Using Reference Boards</title>
Android Partner Docs57543d42017-04-06 19:19:47 +00004 <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
Heidi von Markhamc3dc1962016-03-02 14:30:50 -080010
Android Partner Docs57543d42017-04-06 19:19:47 +000011 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
Heidi von Markhamc3dc1962016-03-02 14:30:50 -080014
Android Partner Docs57543d42017-04-06 19:19:47 +000015 http://www.apache.org/licenses/LICENSE-2.0
Heidi von Markhamc3dc1962016-03-02 14:30:50 -080016
Android Partner Docs57543d42017-04-06 19:19:47 +000017 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 -->
Heidi von Markhamc3dc1962016-03-02 14:30:50 -080023
Android Partner Docs57543d42017-04-06 19:19:47 +000024
Heidi von Markhamc3dc1962016-03-02 14:30:50 -080025<p>You can create builds for Nexus devices using Android Open Source Project
Android Partner Docsd1af55d2017-05-02 09:38:08 -070026(AOSP) builds and the relevant hardware-specific binaries. For available
27Android builds and targeted devices, see
28<a href="/source/build-numbers.html#source-code-tags-and-builds">Source Code,
29Tags, and Builds</a>.</p>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -080030
Android Partner Docsd1af55d2017-05-02 09:38:08 -070031<p class="note"><strong>Note:</strong> Due to hardware differences, do not use
32Android 4.1.1 on a Nexus 7 originally sold with Android 4.1.2 or later.</p>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -080033
Android Partner Docsd1af55d2017-05-02 09:38:08 -070034<p>You can also create builds for
Heidi von Markhamc3dc1962016-03-02 14:30:50 -080035<a href="https://android.googlesource.com/device/linaro/hikey/">HiKey</a>
Android Partner Docsd1af55d2017-05-02 09:38:08 -070036Android reference boards, which are designed to help non-Nexus component vendors
37develop and port drivers to Android releases. Using a reference board can ease
38upgrade efforts, reduce time-to-market for new Android devices, lower device
39costs by enabling ODM/OEMs to choose from a wider range of compatible
40components, and increase the speed of innovation among component suppliers.</p>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -080041
Android Partner Docs16b426b2017-05-08 14:16:00 -070042<p>Google supports <a href="#960hikey">HiKey960</a> and
43<a href="#620hikey">HiKey</a> certified
Android Partner Docsd1af55d2017-05-02 09:38:08 -070044<a href="https://www.96boards.org/products/ce/hikey/">96Boards</a> as Android
45reference boards. AOSP provides kernel source and board support for HiKey so
46developers can easily create and debug new and existing peripheral drivers, do
47kernel development, and perform other tasks with fewer OEM encumbrances.</p>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -080048
Android Partner Docs16b426b2017-05-08 14:16:00 -070049
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
63schematics</a></li>
64<li>
65<a href="http://www.96boards.org/documentation/ConsumerEdition/HiKey960/HardwareDocs/HardwareUserManual.md/">HiKey960
66user 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
72HiKey960 board.</p>
73
74<h3 id="960userspace">Compiling userspace</h3>
75<ol>
Android Partner Docsddbca902017-06-13 09:11:47 -070076 <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>
Android Partner Docs16b426b2017-05-08 14:16:00 -070096</ol>
97
98<h3 id="960fastboot">Installing initial images</h3>
99<ol>
Android Partner Docsddbca902017-06-13 09:11:47 -0700100 <li>Select fastboot mode turning ON switch 1 and 3 (for details, refer to the
Android Partner Docs16b426b2017-05-08 14:16:00 -0700101HiKey960 user guide).</li>
Android Partner Docsddbca902017-06-13 09:11:47 -0700102 <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>
Android Partner Docs16b426b2017-05-08 14:16:00 -0700110</ol>
111
112<h3 id="960images">Flashing images</h3>
113<ol>
Android Partner Docsddbca902017-06-13 09:11:47 -0700114 <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>
Android Partner Docs16b426b2017-05-08 14:16:00 -0700125</ol>
126
127<h3 id="960kernel">Building the kernel</h3>
128<ol>
Android Partner Docsddbca902017-06-13 09:11:47 -0700129 <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">
145make bootimage -j24
146</pre>
147 </li>
Android Partner Docs16b426b2017-05-08 14:16:00 -0700148</ol>
149
150<h3 id="960serial">Setting serial number</h3>
151<p>To set random serial number, run:
Android Partner Docsddbca902017-06-13 09:11:47 -0700152<pre class="devsite-terminal devsite-click-to-copy">
153fastboot getvar nve:SN@<var>16_DIGIT_NUMBER</var>
154</pre>
Android Partner Docs16b426b2017-05-08 14:16:00 -0700155<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.
161Example setting for a 24" monitor is <code>video=HDMI-A-1:1280x800@60</code>.
Android Partner Docsdb839ff2017-05-31 17:05:57 -0700162</p>
Android Partner Docs16b426b2017-05-08 14:16:00 -0700163
164<h2 id="620hikey">HiKey boards</h2>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800165
Android Partner Docsd1af55d2017-05-02 09:38:08 -0700166<p>The HiKey board (also known as HiKey620) is available in
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800167<a href="http://www.lenovator.com/product/86.html">1GB RAM</a> and
Android Partner Docsd1af55d2017-05-02 09:38:08 -0700168<a href="http://www.lenovator.com/product/90.html">2GB RAM</a> configurations
169from <a href="http://www.lenovator.com">Lenovator</a>:</p>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800170
Android Partner Docsd1af55d2017-05-02 09:38:08 -0700171<img src="images/hikey620.png" alt="HiKey620 board image" />
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800172<p class="img-caption"><strong>Figure 1.</strong> HiKey board by Lenovator</p>
173
174<p>Additional resources:</p>
175<ul>
176<li>
Android Partner Docs16b426b2017-05-08 14:16:00 -0700177<a href="https://github.com/96boards/documentation/blob/master/ConsumerEdition/HiKey960/HardwareDocs/HiKey960_Schematics.pdf">HiKey
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800178schematics</a></li>
179<li>
Android Partner Docs16b426b2017-05-08 14:16:00 -0700180<a href="http://www.96boards.org/documentation/ConsumerEdition/HiKey960/HardwareDocs/HardwareUserManual.md/">HiKey
Android Partner Docsd1af55d2017-05-02 09:38:08 -0700181user guide</a></li>
182<li><a href="https://github.com/96boards/documentation/wiki/">96boards wiki</a></li>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800183</ul>
184
Android Partner Docsd1af55d2017-05-02 09:38:08 -0700185<p>Use the following commands to download, build, and run Android on the HiKey
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800186board.</p>
187
Android Partner Docsd1af55d2017-05-02 09:38:08 -0700188<h3 id="620userspace">Compiling userspace</h3>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800189<ol>
Android Partner Docsddbca902017-06-13 09:11:47 -0700190 <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">
205apt-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>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800215</ol>
216
Android Partner Docsd1af55d2017-05-02 09:38:08 -0700217<p class="note"><strong>Note:</strong> For 4GB eMMC, instead of <code>$ make -j32</code>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800218use: <code>$ make -j32 TARGET_USERDATAIMAGE_4GB=true</code>.</p>
219
Android Partner Docsd1af55d2017-05-02 09:38:08 -0700220<h3 id="620fastboot">Installing initial fastboot and ptable</h3>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800221<ol>
Android Partner Docsddbca902017-06-13 09:11:47 -0700222 <li>Select special bootloader mode by linking J15 1-2 and 3-4 pins (for details,
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800223refer to the
224<a href="https://www.96boards.org/wp-content/uploads/2015/02/HiKey_User_Guide_Rev0.2.pdf">HiKey
Android Partner Docsd1af55d2017-05-02 09:38:08 -0700225user guide</a>).</li>
Android Partner Docsddbca902017-06-13 09:11:47 -0700226 <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>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800234</ol>
235
Android Partner Docsd1af55d2017-05-02 09:38:08 -0700236<h3 id="620images">Flashing images</h3>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800237<ol>
Android Partner Docsddbca902017-06-13 09:11:47 -0700238 <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>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800246</ol>
247
Android Partner Docsd1af55d2017-05-02 09:38:08 -0700248<h3 id="620kernel">Building the kernel</h3>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800249<ol>
Android Partner Docsddbca902017-06-13 09:11:47 -0700250 <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
Heidi von Markham031399b2017-02-22 13:57:53 -0800262hikey-kernel directory as file hi6220-hikey.dtb-4.9.</li>
Android Partner Docsddbca902017-06-13 09:11:47 -0700263 <li>Copy the Image file <code>(arch/arm64/boot/Image-dtb</code>) to the
264hikey-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">
268make bootimage -j24
269</pre>
270 </li>
Clay Murphyb3a2c252016-05-31 10:19:37 -0700271</ol>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800272
Android Partner Docsd1af55d2017-05-02 09:38:08 -0700273<h3 id="620resolution">Setting monitor resolution</h3>
Heidi von Markham031399b2017-02-22 13:57:53 -0800274<p>Edit <code>device/linaro/hikey/hikey/BoardConfig.mk</code> parameter
Clay Murphyb8d22342016-05-27 14:37:48 -0700275<code>BOARD_KERNEL_CMDLINE</code> and configure the <code>video</code> setting.
276Example setting for a 24" monitor: <code>video=HDMI-A-1:1280x800@60</code>.</p>
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800277
Android Partner Docsd1af55d2017-05-02 09:38:08 -0700278<h3 id="620serial">Configuring kernel serial output (uart3)</h3>
Heidi von Markham031399b2017-02-22 13:57:53 -0800279<p>Set the J2 low speed expansion connector to 1 - Gnd, 11 - Rx, 13 - Tx. For
Heidi von Markhamc3dc1962016-03-02 14:30:50 -0800280details, refer to the
281<a href="https://www.96boards.org/wp-content/uploads/2015/02/HiKey_User_Guide_Rev0.2.pdf">HiKey
Android Partner Docsd1af55d2017-05-02 09:38:08 -0700282user guide</a>.</p>
283
Android Partner Docs57543d42017-04-06 19:19:47 +0000284 </body>
285</html>