BoardConfigCommon.mk 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. #
  2. # Copyright (C) 2022 The LineageOS Project
  3. #
  4. # SPDX-License-Identifier: Apache-2.0
  5. #
  6. # Inherit from the proprietary version
  7. include vendor/xiaomi/sm8450-common/BoardConfigVendor.mk
  8. COMMON_PATH := device/xiaomi/sm8450-common
  9. BUILD_BROKEN_DUP_RULES := true
  10. # A/B
  11. AB_OTA_UPDATER := true
  12. AB_OTA_PARTITIONS += \
  13. boot \
  14. dtbo \
  15. odm \
  16. product \
  17. recovery \
  18. system \
  19. system_ext \
  20. vbmeta \
  21. vbmeta_system \
  22. vendor \
  23. vendor_boot \
  24. vendor_dlkm
  25. # Architecture
  26. TARGET_ARCH := arm64
  27. TARGET_ARCH_VARIANT := armv8-a-branchprot
  28. TARGET_CPU_ABI := arm64-v8a
  29. TARGET_CPU_ABI2 :=
  30. TARGET_CPU_VARIANT := generic
  31. TARGET_CPU_VARIANT_RUNTIME := kryo300
  32. TARGET_2ND_ARCH := arm
  33. TARGET_2ND_ARCH_VARIANT := armv8-2a
  34. TARGET_2ND_CPU_ABI := armeabi-v7a
  35. TARGET_2ND_CPU_ABI2 := armeabi
  36. TARGET_2ND_CPU_VARIANT := generic
  37. TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a75
  38. # Audio
  39. $(call soong_config_set, android_hardware_audio, run_64bit, true)
  40. AUDIO_FEATURE_ENABLED_DLKM := true
  41. AUDIO_FEATURE_ENABLED_DTS_EAGLE := false
  42. AUDIO_FEATURE_ENABLED_GEF_SUPPORT := true
  43. AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS := false
  44. AUDIO_FEATURE_ENABLED_INSTANCE_ID := true
  45. AUDIO_FEATURE_ENABLED_LSM_HIDL := true
  46. AUDIO_FEATURE_ENABLED_PAL_HIDL := true
  47. AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true
  48. TARGET_USES_QCOM_MM_AUDIO := true
  49. # Boot control
  50. $(call soong_config_set, ufsbsg, ufsframework, bsg)
  51. # Bootloader
  52. TARGET_BOOTLOADER_BOARD_NAME := taro
  53. TARGET_NO_BOOTLOADER := true
  54. # Camera
  55. TARGET_CAMERA_OVERRIDE_FORMAT_FROM_RESERVED := true
  56. # Display
  57. TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS := true
  58. TARGET_GRALLOC_HANDLE_HAS_CUSTOM_CONTENT_MD_RESERVED_SIZE := false
  59. TARGET_USES_DISPLAY_RENDER_INTENTS := true
  60. TARGET_USES_GRALLOC4 := true
  61. TARGET_USES_HWC2 := true
  62. MAX_VIRTUAL_DISPLAY_DIMENSION := 4096
  63. NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
  64. # Filesystem
  65. TARGET_FS_CONFIG_GEN := $(COMMON_PATH)/configs/config.fs
  66. # Kernel
  67. BOARD_INCLUDE_DTB_IN_BOOTIMG := true
  68. BOARD_RAMDISK_USE_LZ4 := true
  69. BOARD_USES_GENERIC_KERNEL_IMAGE := true
  70. BOARD_USES_QCOM_MERGE_DTBS_SCRIPT := true
  71. TARGET_NEEDS_DTBOIMAGE := true
  72. BOARD_KERNEL_BASE := 0x00000000
  73. BOARD_KERNEL_PAGESIZE := 4096
  74. BOARD_KERNEL_IMAGE_NAME := Image
  75. TARGET_KERNEL_ADDITIONAL_FLAGS := TARGET_PRODUCT=$(PRODUCT_DEVICE)
  76. TARGET_KERNEL_SOURCE := kernel/xiaomi/sm8450
  77. TARGET_KERNEL_CONFIG := \
  78. gki_defconfig \
  79. vendor/waipio_GKI.config \
  80. vendor/xiaomi_GKI.config \
  81. vendor/$(PRODUCT_DEVICE)_GKI.config
  82. BOARD_BOOT_HEADER_VERSION := 4
  83. BOARD_MKBOOTIMG_ARGS := --header_version $(BOARD_BOOT_HEADER_VERSION)
  84. BOARD_VENDOR_RAMDISK_FRAGMENTS := dlkm
  85. BOARD_VENDOR_RAMDISK_FRAGMENT.dlkm.KERNEL_MODULE_DIRS := top
  86. BOARD_KERNEL_CMDLINE := \
  87. video=vfb:640x400,bpp=32,memsize=3072000 \
  88. disable_dma32=on \
  89. mtdoops.fingerprint=$(LINEAGE_VERSION)
  90. BOARD_BOOTCONFIG := \
  91. androidboot.hardware=qcom \
  92. androidboot.memcg=1 \
  93. androidboot.usbcontroller=a600000.dwc3
  94. # Kernel modules
  95. first_stage_modules := $(strip $(shell cat $(TARGET_KERNEL_SOURCE)/modules.list.msm.waipio))
  96. second_stage_modules := $(strip $(shell cat $(COMMON_PATH)/modules.list.second_stage))
  97. vendor_dlkm_exclusive_modules := $(strip $(shell cat $(COMMON_PATH)/modules.list.vendor_dlkm))
  98. BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD += $(first_stage_modules)
  99. BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD += $(first_stage_modules) $(second_stage_modules)
  100. BOARD_VENDOR_KERNEL_MODULES_LOAD += $(second_stage_modules) $(vendor_dlkm_exclusive_modules)
  101. BOOT_KERNEL_MODULES += $(first_stage_modules) $(second_stage_modules)
  102. BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(TARGET_KERNEL_SOURCE)/modules.vendor_blocklist.msm.waipio
  103. BOARD_VENDOR_RAMDISK_KERNEL_MODULES_BLOCKLIST_FILE := $(BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE)
  104. TARGET_KERNEL_EXT_MODULE_ROOT := kernel/xiaomi/sm8450-modules
  105. TARGET_KERNEL_EXT_MODULES := \
  106. qcom/opensource/mmrm-driver \
  107. qcom/opensource/audio-kernel \
  108. qcom/opensource/camera-kernel \
  109. qcom/opensource/cvp-kernel \
  110. qcom/opensource/dataipa/drivers/platform/msm \
  111. qcom/opensource/datarmnet/core \
  112. qcom/opensource/datarmnet-ext/aps \
  113. qcom/opensource/datarmnet-ext/offload \
  114. qcom/opensource/datarmnet-ext/shs \
  115. qcom/opensource/datarmnet-ext/perf \
  116. qcom/opensource/datarmnet-ext/perf_tether \
  117. qcom/opensource/datarmnet-ext/sch \
  118. qcom/opensource/datarmnet-ext/wlan \
  119. qcom/opensource/display-drivers/msm \
  120. qcom/opensource/eva-kernel \
  121. qcom/opensource/video-driver \
  122. qcom/opensource/wlan/qcacld-3.0/.qca6490
  123. # Metadata
  124. BOARD_USES_METADATA_PARTITION := true
  125. # Partitions
  126. BOARD_FLASH_BLOCK_SIZE := 0x020000 # (BOARD_KERNEL_PAGESIZE * 64)
  127. BOARD_BOOTIMAGE_PARTITION_SIZE := 0x0C000000
  128. BOARD_DTBOIMG_PARTITION_SIZE := 0x01800000
  129. BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x06400000
  130. BOARD_SUPER_PARTITION_SIZE := 9126805504 # 0x220000000
  131. BOARD_USERDATAIMAGE_PARTITION_SIZE := 239033364480 # 0x37A77FB000
  132. BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 0x06000000
  133. BOARD_SUPER_PARTITION_GROUPS := qti_dynamic_partitions
  134. BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST := odm product system system_ext vendor vendor_dlkm
  135. BOARD_QTI_DYNAMIC_PARTITIONS_SIZE := 9122611200 # 0x21FC00000 # BOARD_SUPER_PARTITION_SIZE - overhead (4MiB)
  136. BOARD_ODMIMAGE_FILE_SYSTEM_TYPE := ext4
  137. BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
  138. BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := ext4
  139. BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
  140. BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
  141. BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE := ext4
  142. TARGET_COPY_OUT_ODM := odm
  143. TARGET_COPY_OUT_PRODUCT := product
  144. TARGET_COPY_OUT_SYSTEM_EXT := system_ext
  145. TARGET_COPY_OUT_VENDOR := vendor
  146. TARGET_COPY_OUT_VENDOR_DLKM := vendor_dlkm
  147. # Platform
  148. BOARD_USES_QCOM_HARDWARE := true
  149. TARGET_BOARD_PLATFORM := taro
  150. # Power
  151. TARGET_POWERHAL_MODE_EXT := $(COMMON_PATH)/power/power-mode.cpp
  152. # Properties
  153. TARGET_ODM_PROP += $(COMMON_PATH)/properties/odm.prop
  154. TARGET_PRODUCT_PROP += $(COMMON_PATH)/properties/product.prop
  155. TARGET_SYSTEM_PROP += $(COMMON_PATH)/properties/system.prop
  156. TARGET_SYSTEM_EXT_PROP += $(COMMON_PATH)/properties/system_ext.prop
  157. TARGET_VENDOR_PROP += $(COMMON_PATH)/properties/vendor.prop
  158. # Recovery
  159. TARGET_RECOVERY_FSTAB := $(COMMON_PATH)/rootdir/etc/recovery.fstab
  160. TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888
  161. TARGET_USERIMAGES_USE_EXT4 := true
  162. TARGET_USERIMAGES_USE_F2FS := true
  163. BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE := true
  164. # RIL
  165. ENABLE_VENDOR_RIL_SERVICE := true
  166. # Security patch level
  167. VENDOR_SECURITY_PATCH := 2023-11-01
  168. # Sepolicy
  169. include device/qcom/sepolicy_vndr/SEPolicy.mk
  170. SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/private
  171. SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/public
  172. BOARD_VENDOR_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/vendor
  173. # VINTF
  174. DEVICE_MATRIX_FILE := $(COMMON_PATH)/vintf/compatibility_matrix.xml
  175. DEVICE_MANIFEST_SKUS := taro diwali cape ukee
  176. $(foreach sku, $(call to-upper, $(DEVICE_MANIFEST_SKUS)), \
  177. $(eval DEVICE_MANIFEST_$(sku)_FILES := \
  178. $(COMMON_PATH)/vintf/manifest.xml \
  179. $(COMMON_PATH)/vintf/manifest_xiaomi.xml \
  180. ))
  181. DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \
  182. $(COMMON_PATH)/vintf/xiaomi_framework_compatibility_matrix.xml \
  183. hardware/qcom-caf/common/vendor_framework_compatibility_matrix.xml \
  184. hardware/xiaomi/vintf/xiaomi_framework_compatibility_matrix.xml \
  185. vendor/lineage/config/device_framework_matrix.xml
  186. # Verified Boot
  187. BOARD_AVB_ENABLE := true
  188. BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3
  189. BOARD_AVB_RECOVERY_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
  190. BOARD_AVB_RECOVERY_ALGORITHM := SHA256_RSA2048
  191. BOARD_AVB_RECOVERY_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
  192. BOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION := 1
  193. BOARD_AVB_VBMETA_SYSTEM := system system_ext product
  194. BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
  195. BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048
  196. BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
  197. BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 2
  198. BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT := true
  199. # WiFi
  200. BOARD_WLAN_DEVICE := qcwcn
  201. BOARD_HOSTAPD_DRIVER := NL80211
  202. BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
  203. BOARD_WPA_SUPPLICANT_DRIVER := NL80211
  204. BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
  205. QC_WIFI_HIDL_FEATURE_DUAL_AP := true
  206. QC_WIFI_HIDL_FEATURE_DUAL_STA := true
  207. WIFI_DRIVER_BUILT := qca_cld3
  208. WIFI_DRIVER_DEFAULT := qca_cld3
  209. WIFI_DRIVER_STATE_CTRL_PARAM := "/dev/wlan"
  210. WIFI_DRIVER_STATE_OFF := "OFF"
  211. WIFI_DRIVER_STATE_ON := "ON"
  212. WIFI_HIDL_FEATURE_AWARE := true
  213. WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
  214. WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true
  215. WPA_SUPPLICANT_VERSION := VER_0_8_X