2023-10-13 11:44:49 -07:00
|
|
|
#
|
|
|
|
# Copyright (C) 2023 The LineageOS Project
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
#
|
|
|
|
|
2024-05-22 05:40:46 -07:00
|
|
|
DEVICE_PATH := device/tecno/LG8n
|
2023-10-13 12:26:22 -07:00
|
|
|
KERNEL_PATH := $(DEVICE_PATH)-kernel
|
2023-12-06 07:40:11 -08:00
|
|
|
CONFIGS_PATH := $(DEVICE_PATH)/configs
|
2023-10-13 11:44:49 -07:00
|
|
|
|
2023-10-13 11:50:58 -07:00
|
|
|
# Architecture
|
|
|
|
TARGET_ARCH := arm64
|
|
|
|
TARGET_ARCH_VARIANT := armv8-2a-dotprod
|
|
|
|
TARGET_CPU_ABI := arm64-v8a
|
|
|
|
TARGET_CPU_ABI2 :=
|
|
|
|
TARGET_CPU_VARIANT := generic
|
2024-07-17 10:38:07 -07:00
|
|
|
TARGET_CPU_VARIANT_RUNTIME := cortex-a55
|
2023-10-13 11:50:58 -07:00
|
|
|
|
|
|
|
TARGET_2ND_ARCH := arm
|
|
|
|
TARGET_2ND_ARCH_VARIANT := armv8-2a
|
|
|
|
TARGET_2ND_CPU_ABI := armeabi-v7a
|
|
|
|
TARGET_2ND_CPU_ABI2 := armeabi
|
|
|
|
TARGET_2ND_CPU_VARIANT := generic
|
|
|
|
TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a55
|
|
|
|
|
2024-07-25 09:38:22 -07:00
|
|
|
# Audio
|
|
|
|
BOARD_USES_ALSA_AUDIO := true
|
|
|
|
|
2023-02-27 03:12:04 -08:00
|
|
|
# Boot image
|
|
|
|
BOARD_BOOT_HEADER_VERSION := 4
|
|
|
|
BOARD_USES_GENERIC_KERNEL_IMAGE := true
|
|
|
|
BOARD_RAMDISK_USE_LZ4 := true
|
|
|
|
BOARD_KERNEL_SEPARATED_DTBO := true
|
2023-10-13 12:26:22 -07:00
|
|
|
BOARD_INCLUDE_DTB_IN_BOOTIMG := true
|
2023-02-27 03:12:04 -08:00
|
|
|
BOARD_KERNEL_CMDLINE += bootopt=64S3,32N2,64N2
|
2024-05-23 17:50:33 -07:00
|
|
|
BOARD_KERNEL_CMDLINE += androidboot.init_fatal_reboot_target=recovery
|
2023-02-27 03:12:04 -08:00
|
|
|
|
|
|
|
BOARD_KERNEL_PAGESIZE := 4096
|
|
|
|
BOARD_KERNEL_BASE := 0x3fff8000
|
|
|
|
BOARD_KERNEL_OFFSET := 0x00008000
|
|
|
|
BOARD_RAMDISK_OFFSET := 0x26f08000
|
|
|
|
BOARD_KERNEL_TAGS_OFFSET := 0x07c88000
|
|
|
|
BOARD_DTB_OFFSET := 0x07c88000
|
|
|
|
|
|
|
|
BOARD_MKBOOTIMG_ARGS += --kernel_offset $(BOARD_KERNEL_OFFSET)
|
|
|
|
BOARD_MKBOOTIMG_ARGS += --ramdisk_offset $(BOARD_RAMDISK_OFFSET)
|
|
|
|
BOARD_MKBOOTIMG_ARGS += --tags_offset $(BOARD_KERNEL_TAGS_OFFSET)
|
|
|
|
BOARD_MKBOOTIMG_ARGS += --dtb_offset $(BOARD_DTB_OFFSET)
|
|
|
|
BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)
|
|
|
|
|
2023-07-01 03:14:30 -07:00
|
|
|
# Bootloader
|
2024-05-22 05:40:46 -07:00
|
|
|
TARGET_BOOTLOADER_BOARD_NAME := lg8n
|
2023-07-01 03:14:30 -07:00
|
|
|
TARGET_NO_BOOTLOADER := true
|
|
|
|
|
2023-11-09 20:14:53 -08:00
|
|
|
# Broken Rules
|
|
|
|
BUILD_BROKEN_DUP_RULES := true
|
|
|
|
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
|
2024-07-25 08:00:48 -07:00
|
|
|
BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE := true
|
2023-11-09 20:14:53 -08:00
|
|
|
|
2024-08-14 05:37:50 -07:00
|
|
|
# DT2W
|
|
|
|
TARGET_TAP_TO_WAKE_NODE := /proc/gesture_function
|
2024-08-14 08:40:40 -07:00
|
|
|
TARGET_POWER_LIBPERFMGR_MODE_EXTENSION_LIB := //$(DEVICE_PATH):libperfmgr-ext-transsion
|
2024-08-14 05:37:50 -07:00
|
|
|
|
2023-10-13 12:26:22 -07:00
|
|
|
# DTB
|
|
|
|
BOARD_PREBUILT_DTBOIMAGE := $(KERNEL_PATH)/dtbo.img
|
|
|
|
BOARD_PREBUILT_DTBIMAGE_DIR := $(KERNEL_PATH)/dtb
|
|
|
|
|
2023-10-15 07:12:09 -07:00
|
|
|
# Display
|
|
|
|
TARGET_SCREEN_DENSITY := 396
|
2022-09-17 14:44:17 -07:00
|
|
|
TARGET_ADDITIONAL_GRALLOC_10_USAGE_BITS := 0x2000U
|
2024-08-08 06:16:09 -07:00
|
|
|
TARGET_USES_VULKAN := true
|
2023-10-15 07:12:09 -07:00
|
|
|
|
2023-03-31 09:51:47 -07:00
|
|
|
# Enable F2FS Compression
|
|
|
|
PRODUCT_FS_COMPRESSION := 1
|
|
|
|
|
2023-10-13 12:26:22 -07:00
|
|
|
# Kernel
|
|
|
|
TARGET_NO_KERNEL_OVERRIDE := true
|
|
|
|
LOCAL_KERNEL := $(KERNEL_PATH)/Image.gz
|
|
|
|
PRODUCT_COPY_FILES += \
|
|
|
|
$(LOCAL_KERNEL):kernel
|
|
|
|
|
2023-02-27 09:36:45 -08:00
|
|
|
# Kernel modules
|
2024-07-17 10:38:07 -07:00
|
|
|
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_PATH)/ramdisk/modules.load))
|
|
|
|
BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(addprefix $(KERNEL_PATH)/ramdisk/, $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD))
|
2023-02-27 09:36:45 -08:00
|
|
|
|
2023-03-02 11:40:16 -08:00
|
|
|
# Also add recovery modules to vendor ramdisk
|
2024-07-17 10:38:07 -07:00
|
|
|
BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_PATH)/ramdisk/modules.load.recovery))
|
|
|
|
RECOVERY_MODULES := $(addprefix $(KERNEL_PATH)/ramdisk/, $(BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD))
|
2023-03-02 11:40:16 -08:00
|
|
|
|
|
|
|
# Prevent duplicated entries (to solve duplicated build rules problem)
|
|
|
|
BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(sort $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES) $(RECOVERY_MODULES))
|
|
|
|
|
2023-03-18 08:09:51 -07:00
|
|
|
# Vendor modules (installed to vendor_dlkm)
|
2024-07-17 10:38:07 -07:00
|
|
|
BOARD_VENDOR_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_PATH)/vendor_dlkm/modules.load))
|
|
|
|
BOARD_VENDOR_KERNEL_MODULES := $(wildcard $(KERNEL_PATH)/vendor_dlkm/*.ko)
|
2023-02-27 09:36:45 -08:00
|
|
|
|
2023-02-27 06:31:40 -08:00
|
|
|
# Partitions
|
|
|
|
BOARD_FLASH_BLOCK_SIZE := 262144 # BOARD_KERNEL_PAGESIZE * 64
|
|
|
|
BOARD_DTBOIMG_PARTITION_SIZE := 33554432
|
|
|
|
BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864
|
|
|
|
BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 67108864
|
|
|
|
|
|
|
|
BOARD_SUPER_PARTITION_SIZE := 9126805504
|
|
|
|
BOARD_SUPER_PARTITION_GROUPS := mtk_dynamic_partitions
|
|
|
|
|
2023-10-15 06:58:25 -07:00
|
|
|
BOARD_MTK_DYNAMIC_PARTITIONS_PARTITION_LIST := odm_dlkm product system system_ext vendor vendor_dlkm
|
2023-02-27 06:31:40 -08:00
|
|
|
BOARD_MTK_DYNAMIC_PARTITIONS_SIZE := 9122611200
|
|
|
|
|
|
|
|
BOARD_EROFS_PCLUSTER_SIZE := 262144
|
|
|
|
|
|
|
|
BOARD_USES_METADATA_PARTITION := true
|
2023-10-15 06:58:25 -07:00
|
|
|
BOARD_USES_ODM_DLKIMAGE := true
|
2023-03-18 08:09:51 -07:00
|
|
|
BOARD_USES_VENDOR_DLKMIMAGE := true
|
2023-02-27 06:31:40 -08:00
|
|
|
|
2023-10-15 06:58:25 -07:00
|
|
|
BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE := ext4
|
2023-05-12 07:36:08 -07:00
|
|
|
# Make GApps installation possible
|
|
|
|
ifneq ($(WITH_GMS),true)
|
|
|
|
BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
|
2019-10-18 22:06:11 -07:00
|
|
|
BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT := -1
|
|
|
|
BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE := 614400000
|
|
|
|
|
2023-05-12 07:36:08 -07:00
|
|
|
BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := ext4
|
2019-10-18 22:06:11 -07:00
|
|
|
BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := -1
|
|
|
|
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 906969088
|
|
|
|
|
2023-05-12 07:36:08 -07:00
|
|
|
BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
|
2019-10-18 22:06:11 -07:00
|
|
|
BOARD_SYSTEM_EXTIMAGE_EXTFS_INODE_COUNT := -1
|
|
|
|
BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE := 92160000
|
2023-05-12 07:36:08 -07:00
|
|
|
else
|
2023-02-27 06:31:40 -08:00
|
|
|
BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := erofs
|
2023-04-01 02:27:43 -07:00
|
|
|
BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := erofs
|
2023-02-27 06:31:40 -08:00
|
|
|
BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := erofs
|
2023-05-12 07:36:08 -07:00
|
|
|
endif
|
2023-02-27 06:31:40 -08:00
|
|
|
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := erofs
|
2023-10-15 11:59:24 -07:00
|
|
|
BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE := ext4
|
2023-02-27 06:31:40 -08:00
|
|
|
|
2023-10-15 06:58:25 -07:00
|
|
|
TARGET_COPY_OUT_ODM_DLKM := odm_dlkm
|
2023-02-27 06:31:40 -08:00
|
|
|
TARGET_COPY_OUT_PRODUCT := product
|
2023-04-01 02:27:43 -07:00
|
|
|
TARGET_COPY_OUT_SYSTEM_EXT := system_ext
|
2023-02-27 06:31:40 -08:00
|
|
|
TARGET_COPY_OUT_VENDOR := vendor
|
2023-03-18 08:09:51 -07:00
|
|
|
TARGET_COPY_OUT_VENDOR_DLKM := vendor_dlkm
|
2023-02-27 06:31:40 -08:00
|
|
|
|
2024-07-16 23:19:23 -07:00
|
|
|
# OTA assert
|
|
|
|
TARGET_OTA_ASSERT_DEVICE := LG8n,TECNO-LG8n
|
|
|
|
|
2023-07-01 03:14:30 -07:00
|
|
|
# Platform
|
|
|
|
TARGET_BOARD_PLATFORM := mt6789
|
|
|
|
BOARD_HAS_MTK_HARDWARE := true
|
|
|
|
|
2023-12-06 19:50:54 -08:00
|
|
|
# Properties
|
2023-12-10 17:44:02 -08:00
|
|
|
TARGET_SYSTEM_PROP += $(CONFIGS_PATH)/properties/system.prop
|
2023-12-06 19:50:54 -08:00
|
|
|
TARGET_VENDOR_PROP += $(CONFIGS_PATH)/properties/vendor.prop
|
2024-08-01 13:59:36 -07:00
|
|
|
TARGET_PRODUCT_PROP += $(CONFIGS_PATH)/properties/product.prop
|
2023-12-06 19:50:54 -08:00
|
|
|
|
2023-02-27 09:37:44 -08:00
|
|
|
# Recovery
|
2023-03-02 11:42:34 -08:00
|
|
|
BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT := true
|
2023-02-27 09:37:44 -08:00
|
|
|
BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT := true
|
|
|
|
TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.mt6789
|
|
|
|
TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
|
|
|
|
TARGET_USERIMAGES_USE_F2FS := true
|
|
|
|
|
2023-07-07 09:00:45 -07:00
|
|
|
# RIL
|
|
|
|
ENABLE_VENDOR_RIL_SERVICE := true
|
|
|
|
|
2024-07-16 23:18:30 -07:00
|
|
|
# Selinux
|
|
|
|
include device/mediatek/sepolicy_vndr/SEPolicy.mk
|
|
|
|
|
2024-07-17 06:23:08 -07:00
|
|
|
SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/private
|
|
|
|
SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/public
|
2024-07-16 23:56:04 -07:00
|
|
|
BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor
|
|
|
|
|
2023-02-27 10:07:44 -08:00
|
|
|
# Vendor Security Patch
|
2024-07-23 03:15:47 -07:00
|
|
|
VENDOR_SECURITY_PATCH := 2024-05-05
|
2023-02-27 10:07:44 -08:00
|
|
|
|
2023-07-01 03:20:17 -07:00
|
|
|
# Verified Boot
|
|
|
|
BOARD_AVB_ENABLE := true
|
2023-07-19 01:46:32 -07:00
|
|
|
BOARD_AVB_ALGORITHM := SHA256_RSA2048
|
|
|
|
BOARD_AVB_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
|
2023-07-21 09:30:20 -07:00
|
|
|
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --set_hashtree_disabled_flag
|
2023-07-19 01:46:32 -07:00
|
|
|
|
|
|
|
BOARD_AVB_BOOT_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
|
|
|
|
BOARD_AVB_BOOT_ALGORITHM := SHA256_RSA2048
|
|
|
|
BOARD_AVB_BOOT_ROLLBACK_INDEX := 1
|
|
|
|
BOARD_AVB_BOOT_ROLLBACK_INDEX_LOCATION := 1
|
|
|
|
|
2023-04-01 02:27:43 -07:00
|
|
|
BOARD_AVB_VBMETA_SYSTEM := product system system_ext
|
2023-07-19 01:46:32 -07:00
|
|
|
BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
|
|
|
|
BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048
|
|
|
|
BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := 1
|
|
|
|
BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 2
|
|
|
|
|
|
|
|
BOARD_AVB_VBMETA_VENDOR := vendor
|
|
|
|
BOARD_AVB_VBMETA_VENDOR_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
|
|
|
|
BOARD_AVB_VBMETA_VENDOR_ALGORITHM := SHA256_RSA2048
|
|
|
|
BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX := 1
|
|
|
|
BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX_LOCATION := 3
|
2023-07-01 03:20:17 -07:00
|
|
|
|
2022-12-10 02:24:13 -08:00
|
|
|
# VNDK
|
|
|
|
BOARD_VNDK_VERSION := current
|
|
|
|
|
2023-12-06 07:40:11 -08:00
|
|
|
# VINTF
|
|
|
|
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := $(CONFIGS_PATH)/vintf/framework_compatibility_matrix.xml
|
|
|
|
DEVICE_MANIFEST_FILE := $(CONFIGS_PATH)/vintf/manifest.xml
|
|
|
|
DEVICE_MATRIX_FILE := $(CONFIGS_PATH)/vintf/compatibility_matrix.xml
|
|
|
|
|
2023-12-09 01:23:01 -08:00
|
|
|
# Wi-Fi
|
|
|
|
WPA_SUPPLICANT_VERSION := VER_0_8_X
|
|
|
|
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
|
|
|
|
BOARD_HOSTAPD_DRIVER := NL80211
|
2024-07-25 08:18:46 -07:00
|
|
|
WIFI_DRIVER_FW_PATH_PARAM := "/dev/wmtWifi"
|
|
|
|
WIFI_DRIVER_FW_PATH_STA := "STA"
|
|
|
|
WIFI_DRIVER_FW_PATH_AP := "AP"
|
|
|
|
WIFI_DRIVER_FW_PATH_P2P := "P2P"
|
|
|
|
WIFI_DRIVER_STATE_CTRL_PARAM := "/dev/wmtWifi"
|
|
|
|
WIFI_DRIVER_STATE_ON := "1"
|
|
|
|
WIFI_DRIVER_STATE_OFF := "0"
|
2023-12-09 01:23:01 -08:00
|
|
|
WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true
|
2024-07-16 23:16:53 -07:00
|
|
|
WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
|
2023-12-09 01:23:01 -08:00
|
|
|
|
2023-05-12 07:18:18 -07:00
|
|
|
# Workaround to make lineage's soong generator work
|
|
|
|
TARGET_KERNEL_SOURCE := $(KERNEL_PATH)/kernel-headers
|
|
|
|
|
2023-10-13 11:44:49 -07:00
|
|
|
# Inherit the proprietary files
|
2024-05-22 05:40:46 -07:00
|
|
|
include vendor/tecno/LG8n/BoardConfigVendor.mk
|