How to build HiKey960 Android from ground zero

来自个人维基
2019年10月23日 (三) 17:46free6d1823讨论 | 贡献的版本

跳转至: 导航搜索

很簡單, 但是坑很多, 一不小心跌下去就爬不出來.
HiKey960 board.jpg

example here:
Host: Ubuntu 16.04
Board: Hikey960 Ver B.
Target Linux version: v4.9
Target Android version: R


1. Download: download all source in ~/hikey960 folder
1.1 Download AOSP source

 mkdir ~/hikey960
 cd ~/hikey960
 mkdir android
 export AOSP_ROOTDIR=~/hikey960/android
 cd ${AOSP_ROOTDIR}
 git clone 
 #download vendor patches
 wget hisilicon-hikey960-OPR-3c243263.tgz
 tar -xvf hisilicon-hikey960-OPR-3c243263.tgz
 #extract to vendor folder. key in "I ACCEPT" in the end
 ./extract-hisilicon-hikey960.sh
 #now you have full Hikey AOSP BSP

1.2 Download linux kernel source

 cd ~/hikey960
 git clone https://github.com/96boards-hikey/linux.git
 #extrac Linux kernel to ~/hikey960/linux folder
 tar -xvf hikey-linaro_4.9.tar.gz

1.3 Download new gcc from where?

 ## gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz
 cd /opt
 #install gcc in /opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu
 tar -xvf gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz

2. Build
2.1 Build kernel

export AOSP_ROOTDIR=~/hikey960/android
export KERNEL_DIR=~/hikey960/linux
export ARCH=arm64
export CROSS_COMPILE=/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- 
cd ${KERNEL_DIR}
make distclean
make hikey960_defconfig
make -j7 Image.gz
make hisilicon/hi3660-hikey960.dtb
cp ${KERNEL_DIR}/arch/arm64/boot/Image.gz-dtb ${AOSP_ROOTDIR}/device/linaro/hikey-kernel/Image.gz-dtb-4.9
cp ${KERNEL_DIR}/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb ${AOSP_ROOTDIR}/device/linaro/hikey-kernel/hi3660-hikey960.dtb-4.9

2.2 Build AOSP


3. Flash

4. Run