BoardConfigCommon.mk 8.4 KB

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