blob: 8c3467313869fd787ef33b2ce6b827c6b663b48e [file] [log] [blame]
merothh54856102021-11-04 12:07:41 +05301#
2# Copyright (C) 2021 The LineageOS Project
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6
merothh750fa002022-01-02 19:42:51 +05307BUILD_BROKEN_DUP_RULES := true
Roger Ellis3a515082020-05-13 16:56:10 -07008BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
merothh750fa002022-01-02 19:42:51 +05309
merothh54856102021-11-04 12:07:41 +053010BOARD_VENDOR := fairphone
11DEVICE_PATH := device/fairphone/FP4
12
Luca Stefani82ac4352019-09-12 23:47:56 +020013# APEX
14DEXPREOPT_GENERATE_APEX_IMAGE := true
15
merothh54856102021-11-04 12:07:41 +053016# Architecture
17TARGET_ARCH := arm64
18TARGET_ARCH_VARIANT := armv8-a
19TARGET_CPU_ABI := arm64-v8a
20TARGET_CPU_ABI2 :=
21TARGET_CPU_VARIANT := cortex-a76
22
23TARGET_2ND_ARCH := arm
24TARGET_2ND_ARCH_VARIANT := armv8-a
25TARGET_2ND_CPU_ABI := armeabi-v7a
26TARGET_2ND_CPU_ABI2 := armeabi
27TARGET_2ND_CPU_VARIANT := cortex-a76
28
merothh54856102021-11-04 12:07:41 +053029# A/B
30AB_OTA_UPDATER := true
31AB_OTA_PARTITIONS += \
merothh726fc3a2022-01-03 04:59:57 +053032 boot \
33 dtbo \
34 odm \
35 product \
36 recovery \
37 system \
38 system_ext \
39 vbmeta \
40 vbmeta_system \
41 vendor
merothh54856102021-11-04 12:07:41 +053042
merothh750fa002022-01-02 19:42:51 +053043# Audio
44AUDIO_FEATURE_ENABLED_EXTENDED_COMPRESS_FORMAT := true
45AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true
merothh750fa002022-01-02 19:42:51 +053046AUDIO_FEATURE_ENABLED_HDMI_SPK := true
47AUDIO_FEATURE_ENABLED_INSTANCE_ID := true
48AUDIO_FEATURE_ENABLED_SSR := true
49AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true
50USE_CUSTOM_AUDIO_POLICY := 1
51
merothh750fa002022-01-02 19:42:51 +053052# Bluetooth
53BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_PATH)/bluetooth/include
merothh750fa002022-01-02 19:42:51 +053054
Michael Bestasb08b3cc2022-02-16 21:47:07 +020055# Bootloader
56TARGET_BOOTLOADER_BOARD_NAME := FP4
57
merothh54856102021-11-04 12:07:41 +053058# Display
merothh7af51cb2022-01-02 20:14:21 +053059MAX_VIRTUAL_DISPLAY_DIMENSION := 4096
60NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
61TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS := true
62TARGET_HAS_HDR_DISPLAY := true
63TARGET_HAS_WIDE_COLOR_DISPLAY := true
merothh54856102021-11-04 12:07:41 +053064TARGET_SCREEN_DENSITY := 440
merothh7af51cb2022-01-02 20:14:21 +053065TARGET_USES_DISPLAY_RENDER_INTENTS := true
66TARGET_USES_GRALLOC4 := true
67TARGET_USES_HWC2 := true
merothh54856102021-11-04 12:07:41 +053068
Sebastiano Barezzi2789dea2021-02-10 22:01:11 +010069# DRM
70TARGET_ENABLE_MEDIADRM_64 := true
71
merothh1b7e5302022-01-03 00:41:34 +053072# Filesystem
73TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/config.fs
74
merothh74ca26a2022-01-02 19:12:01 +053075# HIDL
76DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \
77 $(DEVICE_PATH)/framework_compatibility_matrix.xml \
78 vendor/lineage/config/device_framework_matrix.xml
79DEVICE_MATRIX_FILE := $(DEVICE_PATH)/compatibility_matrix.xml
80DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/manifest.xml
81ODM_MANIFEST_FILES := $(DEVICE_PATH)/manifest-qva.xml
82
merothh54856102021-11-04 12:07:41 +053083# Kernel
84BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom androidboot.console=ttyMSM0 androidboot.memcg=1 lpm_levels.sleep_disabled=1 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 service_locator.enable=1 androidboot.usbcontroller=a600000.dwc3 swiotlb=2048 cgroup.memory=nokmem,nosocket loop.max_part=7
merothh54856102021-11-04 12:07:41 +053085BOARD_INCLUDE_DTB_IN_BOOTIMG := true
86BOARD_INCLUDE_RECOVERY_DTBO := true
87BOARD_KERNEL_SEPARATED_DTBO := true
88BOARD_BOOTIMG_HEADER_VERSION := 2
89BOARD_KERNEL_BASE := 0x00000000
90BOARD_KERNEL_PAGESIZE := 4096
91BOARD_FLASH_BLOCK_SIZE := 262144 # (BOARD_KERNEL_PAGESIZE * 64)
92BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOTIMG_HEADER_VERSION)
93BOARD_KERNEL_IMAGE_NAME := Image
94TARGET_KERNEL_ARCH := arm64
95TARGET_KERNEL_ADDITIONAL_FLAGS := DTC_EXT=$(shell pwd)/prebuilts/misc/linux-x86/dtc/dtc
Daniel Köster1ded3fc2022-01-23 10:24:04 +010096TARGET_KERNEL_SOURCE := kernel/fairphone/sm7225
Michael Bestasba281bc2022-03-01 23:07:06 +020097TARGET_KERNEL_CONFIG := FP4_defconfig
merothh54856102021-11-04 12:07:41 +053098
Erfan Abdidfd36632020-12-18 01:12:50 +033099# Kernel modules - Audio
100TARGET_MODULE_ALIASES += \
101 adsp_loader_dlkm.ko:audio_adsp_loader.ko \
102 apr_dlkm.ko:audio_apr.ko \
103 bolero_cdc_dlkm.ko:audio_bolero_cdc.ko \
104 hdmi_dlkm.ko:audio_hdmi.ko \
105 machine_dlkm.ko:audio_machine_lito.ko \
106 mbhc_dlkm.ko:audio_mbhc.ko \
107 native_dlkm.ko:audio_native.ko \
108 pinctrl_lpi_dlkm.ko:audio_pinctrl_lpi.ko \
109 platform_dlkm.ko:audio_platform.ko \
110 q6_dlkm.ko:audio_q6.ko \
111 q6_notifier_dlkm.ko:audio_q6_notifier.ko \
112 q6_pdr_dlkm.ko:audio_q6_pdr.ko \
113 rx_macro_dlkm.ko:audio_rx_macro.ko \
114 snd_event_dlkm.ko:audio_snd_event.ko \
115 stub_dlkm.ko:audio_stub.ko \
116 swr_ctrl_dlkm.ko:audio_swr_ctrl.ko \
117 swr_dlkm.ko:audio_swr.ko \
118 tx_macro_dlkm.ko:audio_tx_macro.ko \
119 usf_dlkm.ko:audio_usf.ko \
120 va_macro_dlkm.ko:audio_va_macro.ko \
121 wcd937x_dlkm.ko:audio_wcd937x.ko \
122 wcd937x_slave_dlkm.ko:audio_wcd937x_slave.ko \
123 wcd938x_dlkm.ko:audio_wcd938x.ko \
124 wcd938x_slave_dlkm.ko:audio_wcd938x_slave.ko \
125 wcd9xxx_dlkm.ko:audio_wcd9xxx.ko \
126 wcd_core_dlkm.ko:audio_wcd_core.ko \
127 wsa881x_dlkm.ko:audio_wsa881x.ko \
128 wsa883x_dlkm.ko:audio_wsa883x.ko \
129 wsa_macro_dlkm.ko:audio_wsa_macro.ko
130
131# Kernel modules - WLAN
132TARGET_MODULE_ALIASES += \
133 wlan.ko:qca_cld3_wlan.ko
134
Hyejin Kim49e328f2015-03-06 14:49:37 +0900135# Media
136TARGET_USES_ION := true
137
merothh726fc3a2022-01-03 04:59:57 +0530138# Metadata
139BOARD_USES_METADATA_PARTITION := true
140
141# Partitions (Sizes)
142BOARD_BOOTIMAGE_PARTITION_SIZE := 100663296
143BOARD_DTBOIMG_PARTITION_SIZE := 25165824
merothh54856102021-11-04 12:07:41 +0530144BOARD_RECOVERYIMAGE_PARTITION_SIZE := 100663296
merothh726fc3a2022-01-03 04:59:57 +0530145BOARD_METADATAIMAGE_PARTITION_SIZE := 16777216
146BOARD_SUPER_PARTITION_SIZE := 6442450944
147BOARD_SUPER_PARTITION_GROUPS := qti_dynamic_partitions
148BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST := odm product system system_ext vendor
149BOARD_QTI_DYNAMIC_PARTITIONS_SIZE := 6438256640
150
Michael Bestase4aeb222022-02-26 23:24:28 +0200151# Reserve space for gapps install
152ifneq ($(WITH_GMS),true)
153BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT := -1
154BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE := 614400000
155BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := -1
Michael Bestasfbb924c2022-04-04 00:48:47 +0300156BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 3158932684
Michael Bestase4aeb222022-02-26 23:24:28 +0200157BOARD_SYSTEM_EXTIMAGE_EXTFS_INODE_COUNT := -1
158BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE := 92160000
159endif
160BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE:= 30720000
161BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE := 30720000
merothh726fc3a2022-01-03 04:59:57 +0530162
163# Partitions (Other)
164BOARD_ODMIMAGE_FILE_SYSTEM_TYPE := ext4
165BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
166BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
167BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := ext4
168BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
169TARGET_COPY_OUT_ODM := odm
170TARGET_COPY_OUT_PRODUCT := product
171TARGET_COPY_OUT_SYSTEM_EXT := system_ext
merothh54856102021-11-04 12:07:41 +0530172TARGET_COPY_OUT_VENDOR := vendor
173
merothh750fa002022-01-02 19:42:51 +0530174# Platform
175BOARD_USES_QCOM_HARDWARE := true
176TARGET_BOARD_PLATFORM := lito
177
merothh397bd7e2022-01-03 01:21:55 +0530178# Properties
179TARGET_SYSTEM_PROP += $(DEVICE_PATH)/system.prop
180TARGET_PRODUCT_PROP += $(DEVICE_PATH)/product.prop
181TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop
182TARGET_ODM_PROP += $(DEVICE_PATH)/odm.prop
183
merothh54856102021-11-04 12:07:41 +0530184# Recovery
185TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.default
186TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888
187TARGET_RECOVERY_UI_MARGIN_HEIGHT := 50
188TARGET_RECOVERY_UI_MARGIN_WIDTH := 10
189TARGET_USERIMAGES_USE_EXT4 := true
190TARGET_USERIMAGES_USE_F2FS := true
merothhacf1dfa2022-01-02 18:21:21 +0530191
Sebastiano Barezzid70ce292021-02-10 22:08:35 +0100192# RIL
193ENABLE_VENDOR_RIL_SERVICE := true
194
merothhacf1dfa2022-01-02 18:21:21 +0530195# Security patch level
merothhd8216322022-02-07 12:58:04 +0530196VENDOR_SECURITY_PATCH := 2021-12-05
merothhacf1dfa2022-01-02 18:21:21 +0530197
merothh3b429fa2022-01-03 05:10:38 +0530198# SEPolicy
199include device/qcom/sepolicy_vndr/SEPolicy.mk
200BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor
201
merothhbeea4332022-01-03 05:02:03 +0530202# Verified Boot
203BOARD_AVB_ENABLE := true
Rashed Abdel-Tawab95c87ca2019-09-07 11:13:09 -0700204BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3
merothhbeea4332022-01-03 05:02:03 +0530205BOARD_AVB_VBMETA_SYSTEM := system system_ext product
206BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
207BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048
208BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
209BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 2
210
Sebastiano Barezzifd6e1f82021-02-10 22:10:19 +0100211# Wifi
212BOARD_WLAN_DEVICE := qcwcn
213BOARD_HOSTAPD_DRIVER := NL80211
214BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
215BOARD_WPA_SUPPLICANT_DRIVER := NL80211
216BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
217WIFI_DRIVER_DEFAULT := qca_cld3
218WIFI_DRIVER_STATE_CTRL_PARAM := "/dev/wlan"
219WIFI_DRIVER_STATE_OFF := "OFF"
220WIFI_DRIVER_STATE_ON := "ON"
221WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
222WIFI_HIDL_FEATURE_AWARE := true
223WPA_SUPPLICANT_VERSION := VER_0_8_X
224
merothhacf1dfa2022-01-02 18:21:21 +0530225# Inherit the proprietary files
226include vendor/fairphone/FP4/BoardConfigVendor.mk