Dmitry Shmidt | 64185fa | 2017-07-28 15:08:55 -0700 | [diff] [blame] | 1 | ifndef TARGET_KERNEL_USE |
Yongqin Liu | 7788ffd | 2023-03-03 22:11:00 +0800 | [diff] [blame] | 2 | TARGET_KERNEL_USE=5.10 |
Dmitry Shmidt | 64185fa | 2017-07-28 15:08:55 -0700 | [diff] [blame] | 3 | endif |
Yongqin Liu | aa064df | 2020-11-24 16:07:20 +0800 | [diff] [blame] | 4 | LOCAL_KERNEL_HOME ?= device/linaro/hikey-kernel/hikey960/$(TARGET_KERNEL_USE) |
| 5 | TARGET_PREBUILT_KERNEL := $(LOCAL_KERNEL_HOME)/Image.gz-dtb |
| 6 | TARGET_PREBUILT_DTB := $(LOCAL_KERNEL_HOME)/hi3660-hikey960.dtb |
Dmitry Shmidt | 64185fa | 2017-07-28 15:08:55 -0700 | [diff] [blame] | 7 | |
John Stultz | 5d03184 | 2020-06-05 06:17:12 +0000 | [diff] [blame] | 8 | ifndef HIKEY_USES_GKI |
Yongqin Liu | 7788ffd | 2023-03-03 22:11:00 +0800 | [diff] [blame] | 9 | ifeq ($(TARGET_KERNEL_USE), mainline) |
John Stultz | 5d03184 | 2020-06-05 06:17:12 +0000 | [diff] [blame] | 10 | HIKEY_USES_GKI := true |
Yongqin Liu | ca30a6e | 2023-01-03 17:28:09 +0800 | [diff] [blame] | 11 | else |
Yongqin Liu | 7788ffd | 2023-03-03 22:11:00 +0800 | [diff] [blame] | 12 | KERNEL_MAJ := $(word 1, $(subst ., ,$(TARGET_KERNEL_USE))) |
| 13 | # kernel since 5.X should support GKI |
| 14 | # only 4.X kernels do not support GKI |
| 15 | ifneq ($(KERNEL_MAJ), 4) |
Yongqin Liu | ca30a6e | 2023-01-03 17:28:09 +0800 | [diff] [blame] | 16 | HIKEY_USES_GKI := true |
| 17 | endif |
John Stultz | 5d03184 | 2020-06-05 06:17:12 +0000 | [diff] [blame] | 18 | endif |
| 19 | endif |
| 20 | |
Yongqin Liu | 8c352a4 | 2023-01-03 17:13:23 +0800 | [diff] [blame^] | 21 | # only kernels after 5.10 support KVM |
| 22 | ifndef HIKEY960_ENABLE_AVF |
| 23 | ifeq ($(TARGET_KERNEL_USE), mainline) |
| 24 | HIKEY960_ENABLE_AVF := true |
| 25 | else |
| 26 | KERNEL_MAJ := $(word 1, $(subst ., ,$(TARGET_KERNEL_USE))) |
| 27 | KERNEL_MIN := $(word 2, $(subst ., ,$(TARGET_KERNEL_USE))) |
| 28 | KER_GT_5 := $(shell [ $(KERNEL_MAJ) -gt 5 ] && echo true) |
| 29 | KER_GE_5_10 := $(shell [ $(KERNEL_MIN) -ge 10 ] && echo true) |
| 30 | |
| 31 | ifeq ($(KER_GT_5), true) |
| 32 | HIKEY960_ENABLE_AVF := true |
| 33 | else |
| 34 | ifeq ($(KERNEL_MAJ), 5) |
| 35 | # for kernel after 5.10 |
| 36 | ifeq ($(KER_GE_5_10),true) |
| 37 | HIKEY960_ENABLE_AVF := true |
| 38 | endif |
| 39 | endif # end for 5.10 |
| 40 | endif # end for 5.X |
| 41 | endif # end for mainline |
| 42 | endif # end for HIKEY960_ENABLE_AVF |
| 43 | |
John Stultz | ec36f2d | 2022-02-02 04:37:53 +0000 | [diff] [blame] | 44 | include $(LOCAL_PATH)/vendor-package-ver.mk |
| 45 | |
Robin Lee | 81bde6d | 2020-08-15 22:17:32 +0200 | [diff] [blame] | 46 | # Inherit the common device configuration |
Anton Hansson | 1399b12 | 2018-02-08 14:57:45 +0000 | [diff] [blame] | 47 | $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) |
Dmitry Shmidt | 5d08080 | 2017-04-11 14:20:03 -0700 | [diff] [blame] | 48 | $(call inherit-product, device/linaro/hikey/hikey960/device-hikey960.mk) |
| 49 | $(call inherit-product, device/linaro/hikey/device-common.mk) |
John Stultz | ec36f2d | 2022-02-02 04:37:53 +0000 | [diff] [blame] | 50 | $(call inherit-product-if-exists, vendor/linaro/hikey960/$(EXPECTED_LINARO_VENDOR_VERSION)/hikey960.mk) |
Dmitry Shmidt | 5d08080 | 2017-04-11 14:20:03 -0700 | [diff] [blame] | 51 | |
Sahaj Sarup | 93980e0 | 2018-09-11 13:24:20 +0000 | [diff] [blame] | 52 | PRODUCT_PROPERTY_OVERRIDES += ro.opengles.version=196608 |
| 53 | |
Dmitry Shmidt | 5d08080 | 2017-04-11 14:20:03 -0700 | [diff] [blame] | 54 | # |
| 55 | # Overrides |
| 56 | PRODUCT_NAME := hikey960 |
| 57 | PRODUCT_DEVICE := hikey960 |
| 58 | PRODUCT_BRAND := Android |
| 59 | PRODUCT_MODEL := AOSP on hikey960 |
John Stultz | 3d2ce4c | 2019-06-24 23:57:29 +0000 | [diff] [blame] | 60 | |
John Stultz | 8492546 | 2019-07-12 07:04:13 +0000 | [diff] [blame] | 61 | ifneq ($(HIKEY_USES_GKI),) |
Yongqin Liu | aa064df | 2020-11-24 16:07:20 +0800 | [diff] [blame] | 62 | HIKEY_MOD_DIR := $(LOCAL_KERNEL_HOME) |
John Stultz | 8492546 | 2019-07-12 07:04:13 +0000 | [diff] [blame] | 63 | HIKEY_MODS := $(wildcard $(HIKEY_MOD_DIR)/*.ko) |
John Stultz | 9d12640 | 2020-09-15 03:26:56 +0000 | [diff] [blame] | 64 | SDCARDFS_KO := $(wildcard $(HIKEY_MOD_DIR)/sdcardfs*.ko) |
Yongqin Liu | e05046e | 2020-11-24 21:00:19 +0800 | [diff] [blame] | 65 | CMA_HEAP_KO := $(wildcard $(HIKEY_MOD_DIR)/cma_heap.ko) |
John Stultz | aca358a | 2021-02-12 04:17:20 +0000 | [diff] [blame] | 66 | DEFERRED_FREE_KO := $(wildcard $(HIKEY_MOD_DIR)/deferred-free-helper.ko) |
| 67 | PAGE_POOL_KO := $(wildcard $(HIKEY_MOD_DIR)/page_pool.ko) |
John Stultz | 4ab665e | 2021-01-08 04:35:02 +0000 | [diff] [blame] | 68 | SYSTEM_HEAP_KO := $(wildcard $(HIKEY_MOD_DIR)/system_heap.ko) |
Yongqin Liu | e05046e | 2020-11-24 21:00:19 +0800 | [diff] [blame] | 69 | ION_CMA_HEAP_KO := $(wildcard $(HIKEY_MOD_DIR)/ion_cma_heap*.ko) |
John Stultz | 8492546 | 2019-07-12 07:04:13 +0000 | [diff] [blame] | 70 | ifneq ($(HIKEY_MODS),) |
| 71 | BOARD_VENDOR_KERNEL_MODULES += $(HIKEY_MODS) |
| 72 | BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \ |
Yongqin Liu | e05046e | 2020-11-24 21:00:19 +0800 | [diff] [blame] | 73 | $(CMA_HEAP_KO) \ |
John Stultz | 4ab665e | 2021-01-08 04:35:02 +0000 | [diff] [blame] | 74 | $(SYSTEM_HEAP_KO) \ |
John Stultz | aca358a | 2021-02-12 04:17:20 +0000 | [diff] [blame] | 75 | $(DEFERRED_FREE_KO) \ |
| 76 | $(PAGE_POOL_KO) \ |
Yongqin Liu | e05046e | 2020-11-24 21:00:19 +0800 | [diff] [blame] | 77 | $(ION_CMA_HEAP_KO) \ |
| 78 | $(SDCARDFS_KO) |
John Stultz | 8492546 | 2019-07-12 07:04:13 +0000 | [diff] [blame] | 79 | endif |
John Stultz | 3d2ce4c | 2019-06-24 23:57:29 +0000 | [diff] [blame] | 80 | endif |
John Stultz | ec36f2d | 2022-02-02 04:37:53 +0000 | [diff] [blame] | 81 | |
| 82 | PRODUCT_SOONG_NAMESPACES += \ |
| 83 | vendor/linaro/hikey960/$(EXPECTED_LINARO_VENDOR_VERSION)/mali/bifrost |