diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-04-20 15:56:05 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-04-20 15:56:05 +0000 |
commit | ff3829856c8be0c6701e43938b59aa60e894dd01 (patch) | |
tree | c692e0963bb2bee0ebde37b821eeeccb367e0f06 | |
parent | d56809c37d23995547372e3950de87ed4f7213c7 (diff) | |
parent | 8c352a4c5cacded3a9e3bd499768df3d5aedaed0 (diff) | |
download | hikey-platform-tools-34.0.3.tar.gz |
Snap for 9979206 from 8c352a4c5cacded3a9e3bd499768df3d5aedaed0 to sdk-releaseplatform-tools-34.0.3
Change-Id: I7b62d9f714a5afb6330315f8166f3d11a5ce2cc7
-rw-r--r-- | hikey960.mk | 31 | ||||
-rw-r--r-- | hikey960/BoardConfig.mk | 12 | ||||
-rw-r--r-- | hikey960/device-hikey960.mk | 7 |
3 files changed, 47 insertions, 3 deletions
diff --git a/hikey960.mk b/hikey960.mk index 673181c6..1888158d 100644 --- a/hikey960.mk +++ b/hikey960.mk @@ -1,20 +1,45 @@ ifndef TARGET_KERNEL_USE -TARGET_KERNEL_USE=5.4 +TARGET_KERNEL_USE=5.10 endif LOCAL_KERNEL_HOME ?= device/linaro/hikey-kernel/hikey960/$(TARGET_KERNEL_USE) TARGET_PREBUILT_KERNEL := $(LOCAL_KERNEL_HOME)/Image.gz-dtb TARGET_PREBUILT_DTB := $(LOCAL_KERNEL_HOME)/hi3660-hikey960.dtb ifndef HIKEY_USES_GKI - ifeq ($(TARGET_KERNEL_USE), 5.4) + ifeq ($(TARGET_KERNEL_USE), mainline) HIKEY_USES_GKI := true else - ifeq ($(TARGET_KERNEL_USE), mainline) + KERNEL_MAJ := $(word 1, $(subst ., ,$(TARGET_KERNEL_USE))) + # kernel since 5.X should support GKI + # only 4.X kernels do not support GKI + ifneq ($(KERNEL_MAJ), 4) HIKEY_USES_GKI := true endif 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 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 += \ |