diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2023-03-16 19:25:08 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-03-16 19:25:08 +0000 |
commit | 51b130fad094da3ca0b168e51eadccb299f280e7 (patch) | |
tree | c692e0963bb2bee0ebde37b821eeeccb367e0f06 | |
parent | 4d14b2dcce6692bc865fe83a9eed775add81e034 (diff) | |
parent | da7b7bed7837d29a5afc030979bd1dc42393f094 (diff) | |
download | hikey-android-14.0.0_r22.tar.gz |
hikey960: enable Android Virtualization am: 8c352a4c5c am: 28d58e37f5 am: bd636d7b35 am: da7b7bed78android-14.0.0_r45android-14.0.0_r44android-14.0.0_r43android-14.0.0_r42android-14.0.0_r41android-14.0.0_r40android-14.0.0_r39android-14.0.0_r38android-14.0.0_r27android-14.0.0_r26android-14.0.0_r25android-14.0.0_r24android-14.0.0_r23android-14.0.0_r22android-14.0.0_r21android-14.0.0_r20android-14.0.0_r19android-14.0.0_r18android-14.0.0_r17android-14.0.0_r16android14-qpr1-s2-releaseandroid14-qpr1-releaseandroid14-d2-s5-releaseandroid14-d2-s4-releaseandroid14-d2-s3-releaseandroid14-d2-s2-releaseandroid14-d2-s1-releaseandroid14-d2-release
Original change: https://android-review.googlesource.com/c/device/linaro/hikey/+/2373270
Change-Id: I9157599b22a63d573a4b233b13e6fdf7daf82146
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | hikey960.mk | 23 | ||||
-rw-r--r-- | hikey960/BoardConfig.mk | 12 | ||||
-rw-r--r-- | hikey960/device-hikey960.mk | 7 |
3 files changed, 42 insertions, 0 deletions
diff --git a/hikey960.mk b/hikey960.mk index 7a35a224..1888158d 100644 --- a/hikey960.mk +++ b/hikey960.mk @@ -18,6 +18,29 @@ ifndef HIKEY_USES_GKI endif endif +# only kernels after 5.10 support KVM +ifndef HIKEY960_ENABLE_AVF + ifeq ($(TARGET_KERNEL_USE), mainline) + HIKEY960_ENABLE_AVF := true + else + KERNEL_MAJ := $(word 1, $(subst ., ,$(TARGET_KERNEL_USE))) + KERNEL_MIN := $(word 2, $(subst ., ,$(TARGET_KERNEL_USE))) + KER_GT_5 := $(shell [ $(KERNEL_MAJ) -gt 5 ] && echo true) + KER_GE_5_10 := $(shell [ $(KERNEL_MIN) -ge 10 ] && echo true) + + ifeq ($(KER_GT_5), true) + HIKEY960_ENABLE_AVF := true + else + ifeq ($(KERNEL_MAJ), 5) + # for kernel after 5.10 + ifeq ($(KER_GE_5_10),true) + HIKEY960_ENABLE_AVF := true + endif + endif # end for 5.10 + endif # end for 5.X + endif # end for mainline +endif # end for HIKEY960_ENABLE_AVF + include $(LOCAL_PATH)/vendor-package-ver.mk # Inherit the common device configuration diff --git a/hikey960/BoardConfig.mk b/hikey960/BoardConfig.mk index f7deb4c1..71a6273f 100644 --- a/hikey960/BoardConfig.mk +++ b/hikey960/BoardConfig.mk @@ -12,6 +12,18 @@ BOARD_KERNEL_CMDLINE := androidboot.hardware=hikey960 firmware_class.path=/vendo BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc/ff3b0000.ufs BOARD_KERNEL_CMDLINE += loglevel=15 androidboot.slot_suffix=_a +ifeq ($(HIKEY960_ENABLE_AVF), true) +# The GKI kernel set protected mode by default via gki_defconfig, +# but hikey960 does not support the protected kvm mode, here overwriting +# to make it possible to play with AVF in the non-protected mode. +BOARD_KERNEL_CMDLINE += kvm-arm.mode=nvhe +# hypervisor.version would be better to be the same as CROSVM_PLATFORM_VERSION in +# packages/modules/Virtualization/virtualizationmanager/src/crosvm.rs +BOARD_KERNEL_CMDLINE += androidboot.hypervisor.version=1.0.0 +BOARD_KERNEL_CMDLINE += androidboot.hypervisor.vm.supported=1 +BOARD_KERNEL_CMDLINE += androidboot.hypervisor.protected_vm.supported=0 +endif + ifeq ($(TARGET_BUILTIN_EDID), true) BOARD_KERNEL_CMDLINE += drm_kms_helper.edid_firmware=edid/1920x1080.bin endif diff --git a/hikey960/device-hikey960.mk b/hikey960/device-hikey960.mk index d3118653..7d178801 100644 --- a/hikey960/device-hikey960.mk +++ b/hikey960/device-hikey960.mk @@ -14,6 +14,13 @@ # limitations under the License. # +ifeq ($(HIKEY960_ENABLE_AVF), true) +# Based on the instructions in the following link: +# https://android.googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/master/microdroid/README.md +# Tested with the android13-5.10 and android-mainline kernels. +$(call inherit-product, packages/modules/Virtualization/apex/product_packages.mk) +endif + # Enable Virtual A/B AB_OTA_UPDATER := true AB_OTA_PARTITIONS += \ |