Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 1 | # |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 2 | # Copyright (C) 2021 SHIFT GmbH |
| 3 | # Copyright (C) 2021 The LineageOS Project |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 4 | # |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 5 | # SPDX-License-Identifier: Apache-2.0 |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 6 | # |
| 7 | |
| 8 | # Use the non-open-source parts, if they're present |
| 9 | -include vendor/shift/axolotl/BoardConfigVendor.mk |
| 10 | |
| 11 | DEVICE_PATH := device/shift/axolotl |
| 12 | |
| 13 | BOARD_VENDOR := shift |
| 14 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 15 | # We ship prebuilt files, which override source built components, eg "audio.primary.sdm845.so" |
| 16 | BUILD_BROKEN_DUP_RULES := true |
| 17 | |
| 18 | ##### |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 19 | |
| 20 | # Architecture |
| 21 | TARGET_ARCH := arm64 |
| 22 | TARGET_ARCH_VARIANT := armv8-a |
| 23 | TARGET_CPU_ABI := arm64-v8a |
| 24 | TARGET_CPU_ABI2 := |
| 25 | TARGET_CPU_VARIANT := generic |
| 26 | TARGET_CPU_VARIANT_RUNTIME := kryo385 |
| 27 | |
| 28 | TARGET_2ND_ARCH := arm |
| 29 | TARGET_2ND_ARCH_VARIANT := armv8-2a |
| 30 | TARGET_2ND_CPU_ABI := armeabi-v7a |
| 31 | TARGET_2ND_CPU_ABI2 := armeabi |
| 32 | TARGET_2ND_CPU_VARIANT := generic |
| 33 | TARGET_2ND_CPU_VARIANT_RUNTIME := kryo385 |
| 34 | |
| 35 | # Bootloader |
| 36 | TARGET_BOOTLOADER_BOARD_NAME := sdm845 |
| 37 | TARGET_NO_BOOTLOADER := true |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 38 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 39 | # Display |
| 40 | TARGET_SCREEN_DENSITY := 420 |
| 41 | |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 42 | # Kernel |
Alexander Martinz | 904f987 | 2021-08-05 12:55:04 +0200 | [diff] [blame] | 43 | TARGET_NO_KERNEL := false |
| 44 | TARGET_NO_KERNEL_OVERRIDE := false |
| 45 | |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 46 | TARGET_KERNEL_ARCH := arm64 |
| 47 | TARGET_KERNEL_HEADER_ARCH := arm64 |
| 48 | TARGET_KERNEL_CLANG_COMPILE := true |
| 49 | TARGET_KERNEL_CONFIG := lineage_axolotl_defconfig |
| 50 | TARGET_KERNEL_SOURCE := kernel/shift/sdm845 |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 51 | TARGET_KERNEL_APPEND_DTB := false |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 52 | TARGET_USES_UNCOMPRESSED_KERNEL := false |
| 53 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 54 | TARGET_KERNEL_ADDITIONAL_FLAGS := \ |
| 55 | MKDTIMG=$(shell pwd)/prebuilts/misc/$(HOST_OS)-x86/libufdt/mkdtimg \ |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 56 | |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 57 | BOARD_KERNEL_IMAGE_NAME := Image.gz-dtb |
| 58 | BOARD_KERNEL_BASE := 0x00000000 |
| 59 | BOARD_KERNEL_PAGESIZE := 4096 |
| 60 | BOARD_KERNEL_TAGS_OFFSET := 0x01E00000 |
| 61 | BOARD_RAMDISK_OFFSET := 0x02000000 |
| 62 | |
Alexander Martinz | 6c8576c | 2021-09-23 20:14:05 +0200 | [diff] [blame] | 63 | BOARD_KERNEL_CMDLINE := androidboot.console=ttyMSM0 printk.devkmsg=on |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 64 | BOARD_KERNEL_CMDLINE += androidboot.hardware=qcom video=vfb:640x400,bpp=32,memsize=3072000 androidboot.configfs=true loop.max_part=7 |
| 65 | BOARD_KERNEL_CMDLINE += msm_rtb.filter=0x237 |
| 66 | BOARD_KERNEL_CMDLINE += ehci-hcd.park=3 |
| 67 | BOARD_KERNEL_CMDLINE += service_locator.enable=1 |
| 68 | BOARD_KERNEL_CMDLINE += androidboot.memcg=1 cgroup.memory=nokmem |
| 69 | BOARD_KERNEL_CMDLINE += androidboot.usbcontroller=a600000.dwc3 swiotlb=2048 |
| 70 | BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc/1d84000.ufshc |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 71 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 72 | # (BOARD_KERNEL_PAGESIZE * 32) |
| 73 | BOARD_FLASH_BLOCK_SIZE := 131072 |
| 74 | |
| 75 | BOARD_KERNEL_SEPARATED_DTBO := true |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 76 | BOARD_INCLUDE_DTB_IN_BOOTIMG := true |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 77 | BOARD_BOOT_HEADER_VERSION := 2 |
| 78 | BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION) |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 79 | |
| 80 | # Platform |
| 81 | TARGET_BOARD_PLATFORM := sdm845 |
| 82 | TARGET_BOARD_PLATFORM_GPU := qcom-adreno630 |
| 83 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 84 | ##### |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 85 | |
| 86 | # AB |
| 87 | AB_OTA_UPDATER := true |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 88 | AB_OTA_PARTITIONS += \ |
| 89 | boot \ |
| 90 | dtbo \ |
| 91 | recovery \ |
| 92 | |
| 93 | AB_OTA_PARTITIONS += \ |
| 94 | product \ |
| 95 | system \ |
| 96 | system_ext \ |
| 97 | vendor \ |
| 98 | |
| 99 | AB_OTA_PARTITIONS += \ |
| 100 | vbmeta \ |
| 101 | vbmeta_system \ |
| 102 | vbmeta_vendor \ |
| 103 | |
| 104 | # AVB |
| 105 | BOARD_AVB_VBMETA_SYSTEM := system system_ext |
| 106 | BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem |
| 107 | BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA4096 |
| 108 | BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) |
| 109 | BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 2 |
| 110 | |
| 111 | BOARD_AVB_VBMETA_VENDOR := vendor |
| 112 | BOARD_AVB_VBMETA_VENDOR_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem |
| 113 | BOARD_AVB_VBMETA_VENDOR_ALGORITHM := SHA256_RSA4096 |
| 114 | BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) |
| 115 | BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX_LOCATION := 3 |
| 116 | |
| 117 | # Enable AVB 2.0 |
| 118 | BOARD_AVB_ENABLE := true |
| 119 | |
| 120 | # Build the image with verity pre-disabled - https://android.googlesource.com/platform/external/avb/+/58305521295e51cb52a74d8d8bbaed738cf0767a |
| 121 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --set_hashtree_disabled_flag |
| 122 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 2 |
| 123 | |
| 124 | ##### |
| 125 | |
| 126 | # ANT+ |
| 127 | BOARD_ANT_WIRELESS_DEVICE := "qualcomm-hidl" |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 128 | |
| 129 | # APEX |
| 130 | DEXPREOPT_GENERATE_APEX_IMAGE := true |
| 131 | |
| 132 | # Audio |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 133 | #AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD := true |
| 134 | #AUDIO_FEATURE_ENABLED_AHAL_EXT := true |
| 135 | AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true |
| 136 | AUDIO_FEATURE_ENABLED_EXTENDED_COMPRESS_FORMAT := true |
| 137 | AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true |
| 138 | AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true |
| 139 | AUDIO_FEATURE_ENABLED_GEF_SUPPORT := true |
| 140 | AUDIO_FEATURE_ENABLED_HDMI_SPK := true |
| 141 | AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true |
| 142 | BOARD_SUPPORTS_SOUND_TRIGGER := true |
| 143 | BOARD_USES_ALSA_AUDIO := true |
| 144 | TARGET_PROVIDES_AUDIO_EXTNS := true |
| 145 | USE_CUSTOM_AUDIO_POLICY := 1 |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 146 | USE_XML_AUDIO_POLICY_CONF := 1 |
| 147 | |
| 148 | # Bluetooth |
| 149 | BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_PATH)/bluetooth |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 150 | BOARD_HAVE_BLUETOOTH_QCOM := true |
| 151 | TARGET_USE_QTI_BT_STACK := true |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 152 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 153 | # Camera |
| 154 | TARGET_USES_QTI_CAMERA_DEVICE := true |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 155 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 156 | # DRM |
| 157 | TARGET_ENABLE_MEDIADRM_64 := true |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 158 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 159 | # Filesystem |
| 160 | TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/rootdir/config.fs |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 161 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 162 | # FM |
| 163 | BOARD_HAVE_QCOM_FM := true |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 164 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 165 | # GPS |
| 166 | TARGET_NO_RPC := true |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 167 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 168 | # Graphics |
| 169 | TARGET_USES_GRALLOC1 := true |
| 170 | TARGET_USES_HWC2 := true |
| 171 | TARGET_USES_ION := true |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 172 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 173 | # HIDL |
| 174 | DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/vintf/manifest.xml |
| 175 | DEVICE_MATRIX_FILE := $(DEVICE_PATH)/vintf/compatibility_matrix.xml |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 176 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 177 | # Init |
| 178 | TARGET_PLATFORM_DEVICE_BASE := /devices/soc.0/ |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 179 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 180 | # Light |
| 181 | TARGET_PROVIDES_LIBLIGHT := true |
| 182 | |
| 183 | # LMKD |
| 184 | TARGET_LMKD_STATS_LOG := true |
| 185 | |
| 186 | # Media |
| 187 | TARGET_USES_MEDIA_EXTENSIONS := true |
| 188 | |
| 189 | # Power |
| 190 | TARGET_TAP_TO_WAKE_NODE := "/proc/touchpanel/double_tap_enable" |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 191 | |
| 192 | # Qualcomm BSP |
| 193 | BOARD_USES_QCOM_HARDWARE := true |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 194 | TARGET_FWK_SUPPORTS_FULL_VALUEADDS := true |
Alexander Martinz | 54fdc2d | 2021-04-22 14:19:05 +0200 | [diff] [blame] | 195 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 196 | # Recovery |
| 197 | BOARD_INCLUDE_RECOVERY_DTBO := true |
Alexander Martinz | 32079de | 2022-01-07 12:18:10 +0100 | [diff] [blame] | 198 | TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.axolotl |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 199 | TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888 |
| 200 | TARGET_RECOVERY_UI_LIB := libfstab |
| 201 | |
| 202 | # RenderScript |
| 203 | OVERRIDE_RS_DRIVER := libRSDriver_adreno.so |
| 204 | |
| 205 | # RIL |
| 206 | ENABLE_VENDOR_RIL_SERVICE := true |
| 207 | |
| 208 | # Security patch level |
| 209 | VENDOR_SECURITY_PATCH := 2021-08-05 |
| 210 | |
| 211 | # SELinux - TODO |
| 212 | include device/qcom/sepolicy_vndr/SEPolicy.mk |
| 213 | #BOARD_PLAT_PRIVATE_SEPOLICY_DIR += $(DEVICE_PATH)/sepolicy/private |
| 214 | #BOARD_PLAT_PUBLIC_SEPOLICY_DIR += $(DEVICE_PATH)/sepolicy/public |
| 215 | BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor |
| 216 | |
| 217 | # Treble |
| 218 | BOARD_VNDK_VERSION := current |
| 219 | BOARD_SYSTEMSDK_VERSIONS := 29 |
| 220 | |
| 221 | # WLAN |
| 222 | BOARD_WLAN_DEVICE := qcwcn |
| 223 | BOARD_HOSTAPD_DRIVER := NL80211 |
| 224 | BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE) |
| 225 | BOARD_WPA_SUPPLICANT_DRIVER := NL80211 |
| 226 | BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE) |
Alexander Martinz | c61256d | 2021-11-02 18:58:27 +0100 | [diff] [blame] | 227 | WIFI_DRIVER_DEFAULT := wlan |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 228 | WIFI_DRIVER_STATE_CTRL_PARAM := "/dev/wlan" |
| 229 | WIFI_DRIVER_STATE_OFF := "OFF" |
| 230 | WIFI_DRIVER_STATE_ON := "ON" |
| 231 | WIFI_HIDL_FEATURE_DUAL_INTERFACE := true |
| 232 | WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true |
| 233 | WPA_SUPPLICANT_VERSION := VER_0_8_X |
| 234 | |
| 235 | ##### Partition handling |
| 236 | |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 237 | BOARD_DYNAMIC_PARTITION_ENABLE := true |
| 238 | |
| 239 | # Define the Dynamic Partition sizes and groups. |
| 240 | BOARD_SUPER_PARTITION_SIZE := 12884901888 |
| 241 | BOARD_SUPER_PARTITION_GROUPS := axolotl_dynamic_partitions |
| 242 | BOARD_AXOLOTL_DYNAMIC_PARTITIONS_SIZE := 6438256640 |
| 243 | BOARD_AXOLOTL_DYNAMIC_PARTITIONS_PARTITION_LIST := \ |
| 244 | product \ |
| 245 | system \ |
| 246 | system_ext \ |
| 247 | vendor \ |
| 248 | |
| 249 | # Set error limit to BOARD_SUPER_PARTITON_SIZE - 500MB |
| 250 | BOARD_SUPER_PARTITION_ERROR_LIMIT := 12360613888 |
| 251 | |
| 252 | # boot.img |
| 253 | BOARD_BOOTIMAGE_PARTITION_SIZE := 0x04000000 |
| 254 | |
| 255 | # dtbo.img |
| 256 | BOARD_DTBOIMG_PARTITION_SIZE := 0x0800000 |
| 257 | |
| 258 | # metadata.img |
| 259 | BOARD_METADATAIMAGE_PARTITION_SIZE := 16777216 |
| 260 | BOARD_USES_METADATA_PARTITION := true |
| 261 | |
| 262 | # persist.img |
| 263 | BOARD_PERSISTIMAGE_PARTITION_SIZE := 33554432 |
| 264 | BOARD_PERSISTIMAGE_FILE_SYSTEM_TYPE := ext4 |
| 265 | |
| 266 | # product.img |
| 267 | BOARD_USES_PRODUCTIMAGE := true |
| 268 | BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4 |
| 269 | TARGET_COPY_OUT_PRODUCT := product |
| 270 | |
| 271 | # recovery.img |
| 272 | BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x06000000 |
| 273 | |
| 274 | # system.img |
| 275 | BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := ext4 |
| 276 | |
| 277 | # system_ext.img |
| 278 | BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4 |
| 279 | TARGET_COPY_OUT_SYSTEM_EXT := system_ext |
| 280 | |
| 281 | # userdata.img |
| 282 | TARGET_USERIMAGES_USE_EXT4 := true |
| 283 | TARGET_USERIMAGES_USE_F2FS := true |
| 284 | BOARD_USERDATAIMAGE_PARTITION_SIZE := 10737418240 |
| 285 | BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs |
| 286 | |
| 287 | # vendor.img |
| 288 | BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 |
| 289 | |
| 290 | # vendor.img - split |
Alexander Martinz | ae2138e | 2021-08-26 17:27:03 +0200 | [diff] [blame] | 291 | TARGET_COPY_OUT_VENDOR := vendor |
| 292 | BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true |
| 293 | |
| 294 | # Reserve space for gapps installation and other customizations |
| 295 | # product: 1500 MB |
| 296 | # system: 500 MB |
| 297 | # system_ext: 500 MB |
| 298 | # vendor: 250 MB |
| 299 | BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT := -1 |
| 300 | BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE := 1572864000 |
| 301 | BOARD_SYSTEM_EXTIMAGE_EXTFS_INODE_COUNT := -1 |
| 302 | BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE := 524288000 |
| 303 | BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := -1 |
| 304 | BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 524288000 |
| 305 | BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE := 262144000 |