为HiKey970平台编译Linux Kernel与AOSP

最近新购买了一块HiKey970开发板,想要研究一下NPU的相关功能,同时也想顺便跑一下最新的Android9.0系统,因此根据96Boards网站上面的相关文档对Hikey970官方的Linux Kernel与AOSP进行了编译,现总结步骤如下:

1. 下载Linux Kernel源代码

    git clone https://github.com/96boards-hikey/linux.git -b hikey970-v4.9

2. 下载AOSP源代码

    repo init -u https://android.googlesource.com/platform/manifest -b android-9.0.0_r12   

    git clone https://github.com/96boards-hikey/android-manifest.git -b hikey970_v1.0 .repo/local_manifests

    repo sync -j8 -c

3. 编译Linux Kernel(获得kirin970-hikey970.dtb与Image.gz-dtb)

    export ARCH=arm64

    export CROSS_COMPILE=AOSP_PATH/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-

   make hikey970_defconfig && make -j16 Image.gz modules

 make hisilicon/kirin970-hikey970.dtb

    make Image.gz-dtb

4. 编译AOSP

   cp arch/arm64/boot/dts/hisilicon/kirin970-hikey970.dtb device/linaro/hikey-kernel/kirin970-hikey970.dtb-4.9

   cp arch/arm64/boot/Image.gz-dtb device/linaro/hikey-kernel/Image.gz-hikey970-4.9

  source build/envsetup.sh

  lunch hikey970-userdebug

  make -j16 

  

 

    

          

你可能感兴趣的:(为HiKey970平台编译Linux Kernel与AOSP)