blob: 342fa0477ea6c1d6fce8d7749ac6fc57247c5918 [file] [log] [blame]
Dmitry Shmidt64185fa2017-07-28 15:08:55 -07001ifndef TARGET_KERNEL_USE
Yongqin Liu7788ffd2023-03-03 22:11:00 +08002TARGET_KERNEL_USE=5.10
Dmitry Shmidt64185fa2017-07-28 15:08:55 -07003endif
Yongqin Liuaa064df2020-11-24 16:07:20 +08004LOCAL_KERNEL_HOME ?= device/linaro/hikey-kernel/hikey960/$(TARGET_KERNEL_USE)
5TARGET_PREBUILT_KERNEL := $(LOCAL_KERNEL_HOME)/Image.gz-dtb
6TARGET_PREBUILT_DTB := $(LOCAL_KERNEL_HOME)/hi3660-hikey960.dtb
Dmitry Shmidt64185fa2017-07-28 15:08:55 -07007
John Stultz5d031842020-06-05 06:17:12 +00008ifndef HIKEY_USES_GKI
Yongqin Liu7999a182023-03-14 17:25:17 +08009 ## Please check the following link for the android-mainline
10 ## kernel build instructions:
11 ## https://www.96boards.org/documentation/consumer/hikey/hikey960/build/android-mainline.md.html
Yongqin Liu7788ffd2023-03-03 22:11:00 +080012 ifeq ($(TARGET_KERNEL_USE), mainline)
John Stultz5d031842020-06-05 06:17:12 +000013 HIKEY_USES_GKI := true
Yongqin Liuca30a6e2023-01-03 17:28:09 +080014 else
Yongqin Liu7788ffd2023-03-03 22:11:00 +080015 KERNEL_MAJ := $(word 1, $(subst ., ,$(TARGET_KERNEL_USE)))
16 # kernel since 5.X should support GKI
17 # only 4.X kernels do not support GKI
18 ifneq ($(KERNEL_MAJ), 4)
Yongqin Liuca30a6e2023-01-03 17:28:09 +080019 HIKEY_USES_GKI := true
20 endif
John Stultz5d031842020-06-05 06:17:12 +000021 endif
22endif
23
Yongqin Liu8c352a42023-01-03 17:13:23 +080024# only kernels after 5.10 support KVM
25ifndef HIKEY960_ENABLE_AVF
26 ifeq ($(TARGET_KERNEL_USE), mainline)
27 HIKEY960_ENABLE_AVF := true
28 else
29 KERNEL_MAJ := $(word 1, $(subst ., ,$(TARGET_KERNEL_USE)))
30 KERNEL_MIN := $(word 2, $(subst ., ,$(TARGET_KERNEL_USE)))
31 KER_GT_5 := $(shell [ $(KERNEL_MAJ) -gt 5 ] && echo true)
32 KER_GE_5_10 := $(shell [ $(KERNEL_MIN) -ge 10 ] && echo true)
33
34 ifeq ($(KER_GT_5), true)
35 HIKEY960_ENABLE_AVF := true
36 else
37 ifeq ($(KERNEL_MAJ), 5)
38 # for kernel after 5.10
39 ifeq ($(KER_GE_5_10),true)
40 HIKEY960_ENABLE_AVF := true
41 endif
42 endif # end for 5.10
43 endif # end for 5.X
44 endif # end for mainline
45endif # end for HIKEY960_ENABLE_AVF
46
John Stultzec36f2d2022-02-02 04:37:53 +000047include $(LOCAL_PATH)/vendor-package-ver.mk
48
Robin Lee81bde6d2020-08-15 22:17:32 +020049# Inherit the common device configuration
Anton Hansson1399b122018-02-08 14:57:45 +000050$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
Dmitry Shmidt5d080802017-04-11 14:20:03 -070051$(call inherit-product, device/linaro/hikey/hikey960/device-hikey960.mk)
52$(call inherit-product, device/linaro/hikey/device-common.mk)
John Stultzec36f2d2022-02-02 04:37:53 +000053$(call inherit-product-if-exists, vendor/linaro/hikey960/$(EXPECTED_LINARO_VENDOR_VERSION)/hikey960.mk)
Dmitry Shmidt5d080802017-04-11 14:20:03 -070054
Sahaj Sarup93980e02018-09-11 13:24:20 +000055PRODUCT_PROPERTY_OVERRIDES += ro.opengles.version=196608
56
Dmitry Shmidt5d080802017-04-11 14:20:03 -070057#
58# Overrides
59PRODUCT_NAME := hikey960
60PRODUCT_DEVICE := hikey960
61PRODUCT_BRAND := Android
62PRODUCT_MODEL := AOSP on hikey960
John Stultz3d2ce4c2019-06-24 23:57:29 +000063
John Stultz84925462019-07-12 07:04:13 +000064ifneq ($(HIKEY_USES_GKI),)
Yongqin Liuaa064df2020-11-24 16:07:20 +080065 HIKEY_MOD_DIR := $(LOCAL_KERNEL_HOME)
John Stultz84925462019-07-12 07:04:13 +000066 HIKEY_MODS := $(wildcard $(HIKEY_MOD_DIR)/*.ko)
John Stultz9d126402020-09-15 03:26:56 +000067 SDCARDFS_KO := $(wildcard $(HIKEY_MOD_DIR)/sdcardfs*.ko)
Yongqin Liue05046e2020-11-24 21:00:19 +080068 CMA_HEAP_KO := $(wildcard $(HIKEY_MOD_DIR)/cma_heap.ko)
John Stultzaca358a2021-02-12 04:17:20 +000069 DEFERRED_FREE_KO := $(wildcard $(HIKEY_MOD_DIR)/deferred-free-helper.ko)
70 PAGE_POOL_KO := $(wildcard $(HIKEY_MOD_DIR)/page_pool.ko)
John Stultz4ab665e2021-01-08 04:35:02 +000071 SYSTEM_HEAP_KO := $(wildcard $(HIKEY_MOD_DIR)/system_heap.ko)
Yongqin Liue05046e2020-11-24 21:00:19 +080072 ION_CMA_HEAP_KO := $(wildcard $(HIKEY_MOD_DIR)/ion_cma_heap*.ko)
John Stultz84925462019-07-12 07:04:13 +000073 ifneq ($(HIKEY_MODS),)
74 BOARD_VENDOR_KERNEL_MODULES += $(HIKEY_MODS)
75 BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \
Yongqin Liue05046e2020-11-24 21:00:19 +080076 $(CMA_HEAP_KO) \
John Stultz4ab665e2021-01-08 04:35:02 +000077 $(SYSTEM_HEAP_KO) \
John Stultzaca358a2021-02-12 04:17:20 +000078 $(DEFERRED_FREE_KO) \
79 $(PAGE_POOL_KO) \
Yongqin Liue05046e2020-11-24 21:00:19 +080080 $(ION_CMA_HEAP_KO) \
81 $(SDCARDFS_KO)
John Stultz84925462019-07-12 07:04:13 +000082 endif
John Stultz3d2ce4c2019-06-24 23:57:29 +000083endif
John Stultzec36f2d2022-02-02 04:37:53 +000084
85PRODUCT_SOONG_NAMESPACES += \
86 vendor/linaro/hikey960/$(EXPECTED_LINARO_VENDOR_VERSION)/mali/bifrost