步驟整理-華為海思Hikey970開發板的AOSP編譯燒寫
最近結合第三方廠家與官方提供的編譯文檔,實踐整理了Hikey970單板編譯與燒寫Google原生AOSP(Android Open Source Project)系統的步驟。
單板參數:6GB LPDDR4
64GB UFS
具體流程如下。
一、Bootloader
1、sudo apt-get install uuid-dev build-essential2、mkdir bootloader cd bootloader3、git clone https://github.com/96boards-hikey/tools-images-hikey970.git git clone https://github.com/96boards-hikey/OpenPlatformPkg.git -b hikey970_v1.0 git clone https://github.com/96boards-hikey/arm-trusted-firmware.git -b hikey970_v1.0 git clone https://github.com/96boards-hikey/l-loader.git -b hikey970_v1.0 git clone https://github.com/96boards-hikey/edk2.git -b hikey970_v1.0 git clone https://github.com/96boards-hikey/uefi-tools.git -b hikey970_v1.04、cd edk2 ln -sf ../OpenPlatformPkg5、vim ${BUILD_PATH}/l-loader/build_uefi.sh 具體改動見下圖6、 編譯 l-loader/build_uefi.sh hikey970
二、Kernel
1、mkdir kernel cd kernel2、git clone https://github.com/96boards-hikey/linux.git -b hikey970-v4.93、設置環境變數export ARCH=arm64export CROSS_COMPILE=/xxx/aarch64-linux-android-4.9/bin/aarch64-linux-android-(編譯鏈下載:git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9)4、make hikey970_defconfig make -j4 make hisilicon/kirin970-hikey970.dtb
三、AOSP
1、mkdir aosp cd aosp2、1)牆外用戶:repo init -u https://android.googlesource.com/platform/manifest -b master 2)牆內用戶:repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b master (建議先離線下載壓縮包,而後到Linux環境下解壓)3、git clone https://github.com/96boards-hikey/android-manifest.git -b hikey970_v1.0 .repo/local_manifest4、sudo repo sync (最終大約100+G)5、編譯 Copy kirin970-hikey970.dtb (arch/arm64/boot/dts/hisilicon/ kirin970-hikey970.dtb) to the device/linaro/hikey-kernel directory as file: kirin970-hikey970.dtb-4.9 Copy the Image file (arch/arm64/boot/Image.gz-dtb) to the device/linaro/hikey-kernel directory as file: Image.gz-hikey970-4.9 source ./build/envsetup.sh lunch hikey970-userdebug make -j16
生成 boot.img:
1、Copy Image and kirin970-hikey970.dtb from kernel directory2、copy ramdisk.img from android out/3、cat Image kirin970-hikey970.dtb > Image-dtb mkbootimg --kernel Image-dtb --ramdisk ramdisk.img --cmdline "androidboot.hardware=hikey970 firmware_class.path=/system/etc/firmware loglevel=15 buildvariant=userdebug androidboot.selinux=permissive clk_ignore_unused=true initrd=0xBE19D000,0x16677F earlycon=pl011,0xfff32000,115200 console=ttyAMA6 androidboot.serialno=54DA9CD5022525E4 clk_ignore_unused=true" -o boot.img
四、燒寫
1、將單板上的撥碼開關撥到1、3 ON,2、4 OFF,即fastboot mode everytime模式
2、用Type-C線將單板上非串口調試的Type-C口與電腦USB口相連
3、在Windows CMD中使用fastboot工具燒寫各鏡像文件
fastboot flash ptable l-loader/ptable-aosp-64g.imgfastboot flash xloader tools-images-hikey970/sec_xloader.imgfastboot flash fastboot l-loader/l-loader.binfastboot flash fip l-loader/fip.binfastboot flash boot boot.imgfastboot flash cache cache.imgfastboot flash system system.imgfastboot flash userdata userdata.img
另,由於hikey970官方與第三方廠商均未提供官方QQ群以供開發者交流,在此特創建QQ群:609941175,希望Hikey970的開發者或者Android/Linux 各層開發者加入,大家一起交流學習,共同進步!
大家也可前往我的博客瀏覽,博客鏈接:01-步驟整理-華為海思Hikey970開發板的AOSP編譯燒寫 - CSDN博客/*
* 以上步驟為自己實踐總結,親測有效,歡迎轉載,轉載請註明出處!
* 歡迎各開發者加群共同討論學習!
*
*/
推薦閱讀:
※高通伺服器晶元業務遇挫,僅靠中國市場難成功
※走進華為海思麒麟晶元的背後故事
※麒麟980本季度量產!首批採用台積電7nm工藝
※華為晶元到底是怎麼發展起來的?