1# 2# Copyright (C) 2019 The Android Open-Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16include build/make/target/board/BoardConfigMainlineCommon.mk 17include build/make/target/board/BoardConfigPixelCommon.mk 18 19# Should be uncommented after fixing vndk-sp violation is fixed. 20PRODUCT_FULL_TREBLE_OVERRIDE := true 21 22# HACK : To fix up after bring up multimedia devices. 23TARGET_SOC := gs201 24 25TARGET_SOC_NAME := google 26 27USES_DEVICE_GOOGLE_GS201 := true 28 29TARGET_ARCH := arm64 30TARGET_ARCH_VARIANT := armv8-2a 31TARGET_CPU_ABI := arm64-v8a 32TARGET_CPU_VARIANT := cortex-a55 33TARGET_CPU_VARIANT_RUNTIME := cortex-a55 34 35# Enable 64-bit for non-zygote. 36ZYGOTE_FORCE_64 := true 37 38# Force any prefer32 targets to be compiled as 64 bit. 39IGNORE_PREFER32_ON_DEVICE := true 40 41# Build the 32 bit targets 42TARGET_2ND_ARCH := arm 43TARGET_2ND_ARCH_VARIANT := armv8-a 44TARGET_2ND_CPU_ABI := armeabi-v7a 45TARGET_2ND_CPU_ABI2 := armeabi 46TARGET_2ND_CPU_VARIANT := generic 47TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a53 48 49BOARD_KERNEL_CMDLINE += dyndbg=\"func alloc_contig_dump_pages +p\" 50BOARD_KERNEL_CMDLINE += earlycon=exynos4210,0x10A00000 console=ttySAC0,115200 androidboot.console=ttySAC0 printk.devkmsg=on 51BOARD_KERNEL_CMDLINE += cma_sysfs.experimental=Y 52BOARD_KERNEL_CMDLINE += cgroup_disable=memory 53BOARD_KERNEL_CMDLINE += rcupdate.rcu_expedited=1 rcu_nocbs=all 54BOARD_KERNEL_CMDLINE += stack_depot_disable=off page_pinner=on 55BOARD_KERNEL_CMDLINE += swiotlb=1024 56BOARD_KERNEL_CMDLINE += disable_dma32=on 57BOARD_BOOTCONFIG += androidboot.boot_devices=14700000.ufs 58 59TARGET_NO_BOOTLOADER := true 60TARGET_NO_RADIOIMAGE := true 61BOARD_PREBUILT_BOOTIMAGE := $(wildcard $(TARGET_KERNEL_DIR)/boot.img) 62ifneq (,$(BOARD_PREBUILT_BOOTIMAGE)) 63TARGET_NO_KERNEL := true 64else 65TARGET_NO_KERNEL := false 66endif 67BOARD_USES_GENERIC_KERNEL_IMAGE := true 68BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT := true 69BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT := true 70TARGET_RECOVERY_WIPE := device/google/gs201/conf/recovery.wipe 71 72# This is the fstab file that will be included in the recovery image. Note that 73# recovery doesn't care about the encryption settings, so it doesn't matter 74# whether we use the normal or the fips fstab here. 75TARGET_RECOVERY_FSTAB_GENRULE := gen_fstab.gs201 76 77TARGET_RECOVERY_PIXEL_FORMAT := ABGR_8888 78TARGET_RECOVERY_UI_MARGIN_HEIGHT := 165 79TARGET_RECOVERY_UI_LIB := \ 80 librecovery_ui_pixel \ 81 libfstab 82 83AB_OTA_UPDATER := true 84 85AB_OTA_PARTITIONS += \ 86 system \ 87 system_dlkm \ 88 system_ext \ 89 product \ 90 vbmeta_system 91 92ifneq ($(PRODUCT_BUILD_BOOT_IMAGE),false) 93AB_OTA_PARTITIONS += boot 94endif 95ifneq ($(PRODUCT_BUILD_INIT_BOOT_IMAGE), false) 96AB_OTA_PARTITIONS += init_boot 97endif 98ifneq ($(PRODUCT_BUILD_VENDOR_BOOT_IMAGE),false) 99AB_OTA_PARTITIONS += vendor_boot 100AB_OTA_PARTITIONS += dtbo 101endif 102ifeq ($(PRODUCT_BUILD_VENDOR_KERNEL_BOOT_IMAGE),true) 103AB_OTA_PARTITIONS += vendor_kernel_boot 104endif 105ifneq ($(PRODUCT_BUILD_VBMETA_IMAGE),false) 106AB_OTA_PARTITIONS += vbmeta 107endif 108ifneq ($(PRODUCT_BUILD_PVMFW_IMAGE),false) 109AB_OTA_PARTITIONS += pvmfw 110endif 111 112# EMULATOR common modules 113BOARD_EMULATOR_COMMON_MODULES := liblight 114 115OVERRIDE_RS_DRIVER := libRSDriverArm.so 116BOARD_EGL_CFG := device/google/gs201/conf/egl.cfg 117#BOARD_USES_HGL := true 118USE_OPENGL_RENDERER := true 119NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 120BOARD_USES_EXYNOS5_COMMON_GRALLOC := true 121BOARD_USES_ALIGN_RESTRICTION := false 122BOARD_USES_GRALLOC_ION_SYNC := true 123 124# This should be the same value as USE_SWIFTSHADER in device.mk 125BOARD_USES_SWIFTSHADER := false 126 127# Gralloc4 128ifeq ($(BOARD_USES_SWIFTSHADER),true) 129$(call soong_config_set,arm_gralloc,gralloc_arm_no_external_afbc,true) 130$(call soong_config_set,arm_gralloc,mali_gpu_support_afbc_basic,false) 131$(call soong_config_set,arm_gralloc,mali_gpu_support_afbc_wideblk,false) 132$(call soong_config_set,arm_gralloc,gralloc_init_afbc,false) 133$(call soong_config_set,arm_gralloc,dpu_support_1010102_afbc,false) 134else 135$(call soong_config_set,arm_gralloc,gralloc_arm_no_external_afbc,false) 136$(call soong_config_set,arm_gralloc,mali_gpu_support_afbc_basic,true) 137$(call soong_config_set,arm_gralloc,mali_gpu_support_afbc_wideblk,true) 138$(call soong_config_set,arm_gralloc,gralloc_init_afbc,true) 139$(call soong_config_set,arm_gralloc,dpu_support_1010102_afbc,true) 140endif # ifeq ($(BOARD_USES_SWIFTSHADER),true) 141 142$(call soong_config_set,arm_gralloc,gralloc_ion_sync_on_lock,$(BOARD_USES_GRALLOC_ION_SYNC)) 143 144# Graphics 145#BOARD_USES_EXYNOS_DATASPACE_FEATURE := true 146 147# Enable chain partition for system. 148BOARD_AVB_VBMETA_SYSTEM := system system_dlkm system_ext product 149BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem 150BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048 151BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) 152BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 1 153 154ifneq ($(PRODUCT_BUILD_PVMFW_IMAGE),false) 155BOARD_AVB_VBMETA_SYSTEM += pvmfw 156endif 157 158# Enable chained vbmeta for boot images 159BOARD_AVB_BOOT_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem 160BOARD_AVB_BOOT_ALGORITHM := SHA256_RSA2048 161BOARD_AVB_BOOT_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) 162BOARD_AVB_BOOT_ROLLBACK_INDEX_LOCATION := 2 163 164# Enable chained vbmeta for init_boot images 165BOARD_AVB_INIT_BOOT_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem 166BOARD_AVB_INIT_BOOT_ALGORITHM := SHA256_RSA2048 167BOARD_AVB_INIT_BOOT_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) 168BOARD_AVB_INIT_BOOT_ROLLBACK_INDEX_LOCATION := 4 169 170TARGET_USERIMAGES_USE_EXT4 := true 171TARGET_USERIMAGES_USE_F2FS := true 172BOARD_USERDATAIMAGE_PARTITION_SIZE := 11796480000 173BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs 174PRODUCT_FS_COMPRESSION := 1 175BOARD_FLASH_BLOCK_SIZE := 4096 176BOARD_MOUNT_SDCARD_RW := true 177 178# product.img 179BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4 180TARGET_COPY_OUT_PRODUCT := product 181 182# system_ext.img 183BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4 184TARGET_COPY_OUT_SYSTEM_EXT := system_ext 185 186# persist.img 187BOARD_PERSISTIMAGE_FILE_SYSTEM_TYPE := ext4 188 189######################## 190# Video Codec 191######################## 192# 1. Exynos C2 193BOARD_USE_CODEC2_HIDL_1_2 := true 194BOARD_USE_CSC_FILTER := false 195BOARD_USE_DEC_SW_CSC := true 196BOARD_USE_ENC_SW_CSC := true 197BOARD_SUPPORT_MFC_ENC_RGB := true 198BOARD_USE_BLOB_ALLOCATOR := false 199BOARD_SUPPORT_MFC_ENC_BT2020 := true 200BOARD_SUPPORT_FLEXIBLE_P010 := true 201 202######################## 203 204BOARD_SUPER_PARTITION_SIZE := 8531214336 205BOARD_SUPER_PARTITION_GROUPS := google_dynamic_partitions 206# Set size to BOARD_SUPER_PARTITION_SIZE - overhead (4MiB) (b/182237294) 207BOARD_GOOGLE_DYNAMIC_PARTITIONS_SIZE := 8527020032 208BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST := \ 209 system \ 210 system_dlkm \ 211 system_ext \ 212 product \ 213 vendor \ 214 vendor_dlkm 215 216# Set error limit to BOARD_SUPER_PARTITON_SIZE - 500MB 217BOARD_SUPER_PARTITION_ERROR_LIMIT := 8006926336 218 219# Build a separate system_dlkm partition 220BOARD_USES_SYSTEM_DLKMIMAGE := true 221BOARD_SYSTEM_DLKMIMAGE_FILE_SYSTEM_TYPE := ext4 222TARGET_COPY_OUT_SYSTEM_DLKM := system_dlkm 223 224# Testing related defines 225BOARD_PERFSETUP_SCRIPT := platform_testing/scripts/perf-setup/p10c10-setup.sh 226 227# 228# AUDIO & VOICE 229# 230BOARD_USES_GENERIC_AUDIO := true 231 232$(call soong_config_set,aoc_audio_func,ext_hidl,true) 233 234ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) 235$(call soong_config_set,aoc_audio_func,dump_usecase_data,true) 236$(call soong_config_set,aoc_audio_func,hal_socket_control,true) 237$(call soong_config_set,aoc_audio_func,record_tuning_keys,true) 238endif 239 240ifneq (,$(filter aosp_%,$(TARGET_PRODUCT))) 241$(call soong_config_set,aoc_audio_func,aosp_build,true) 242endif 243 244# Primary AudioHAL Configuration 245#BOARD_USE_COMMON_AUDIOHAL := true 246#BOARD_USE_CALLIOPE_AUDIOHAL := false 247#BOARD_USE_AUDIOHAL := true 248 249# Compress Offload Configuration 250#BOARD_USE_OFFLOAD_AUDIO := true 251#BOARD_USE_OFFLOAD_EFFECT := false 252 253# SoundTriggerHAL Configuration 254#BOARD_USE_SOUNDTRIGGER_HAL := false 255 256# Vibrator HAL actuator model and adaptive haptics configuration 257$(call soong_config_set,haptics,actuator_model,$(ACTUATOR_MODEL)) 258$(call soong_config_set,haptics,adaptive_haptics_feature,$(ADAPTIVE_HAPTICS_FEATURE)) 259 260# HWComposer 261BOARD_HWC_VERSION := hwc3 262TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK := false 263BOARD_HDMI_INCAPABLE := true 264TARGET_USES_HWC2 := true 265HWC_SUPPORT_RENDER_INTENT := true 266HWC_SUPPORT_COLOR_TRANSFORM := true 267#BOARD_USES_DISPLAYPORT := true 268# if AFBC is enabled, must set ro.vendor.ddk.set.afbc=1 269BOARD_USES_EXYNOS_AFBC_FEATURE := true 270#BOARD_USES_HDRUI_GLES_CONVERSION := true 271 272BOARD_LIBACRYL_DEFAULT_COMPOSITOR := fimg2d_gs201 273BOARD_LIBACRYL_G2D_HDR_PLUGIN := libacryl_hdr_plugin 274 275# HWCServices 276BOARD_USES_HWC_SERVICES := true 277 278# WiFiDisplay 279# BOARD_USES_VIRTUAL_DISPLAY := true 280# BOARD_USES_VDS_EXYNOS_HWC := true 281# BOARD_USES_WIFI_DISPLAY:= true 282# BOARD_USES_EGL_SURFACE_FOR_COMPOSITION_MIXED := true 283# BOARD_USES_VDS_YUV420SPM := true 284# BOARD_USES_VDS_OTHERFORMAT := true 285# BOARD_USES_VDS_DEBUG_FLAG := true 286# BOARD_USES_DISABLE_COMPOSITIONTYPE_GLES := true 287# BOARD_USES_SECURE_ENCODER_ONLY := true 288# BOARD_USES_TSMUX := true 289 290# SCALER 291BOARD_USES_DEFAULT_CSC_HW_SCALER := true 292BOARD_DEFAULT_CSC_HW_SCALER := 4 293BOARD_USES_SCALER_M2M1SHOT := true 294 295# Device Tree 296BOARD_USES_DT := true 297BOARD_INCLUDE_DTB_IN_BOOTIMG := true 298BOARD_PREBUILT_DTBIMAGE_DIR := $(TARGET_KERNEL_DIR) 299BOARD_PREBUILT_DTBOIMAGE := $(BOARD_PREBUILT_DTBIMAGE_DIR)/dtbo.img 300 301# PLATFORM LOG 302TARGET_USES_LOGD := true 303 304# LIBHWJPEG 305#TARGET_USES_UNIVERSAL_LIBHWJPEG := true 306#LIBHWJPEG_HWSCALER_ID := 0 307 308#Keymaster 309#BOARD_USES_KEYMASTER_VER1 := true 310 311#FMP 312#BOARD_USES_FMP_DM_CRYPT := true 313#BOARD_USES_FMP_FSCRYPTO := true 314BOARD_USES_METADATA_PARTITION := true 315 316# SKIA 317#BOARD_USES_SKIA_MULTITHREADING := true 318#BOARD_USES_FIMGAPI_V5X := true 319 320# SECCOMP Policy 321BOARD_SECCOMP_POLICY = device/google/gs201/seccomp_policy 322 323#CURL 324BOARD_USES_CURL := true 325 326# Sensor HAL 327BOARD_USES_EXYNOS_SENSORS_DUMMY := true 328 329# VISION 330# Exynos vision framework (EVF) 331#TARGET_USES_EVF := true 332# HW acceleration 333#TARGET_USES_VPU_KERNEL := true 334#TARGET_USES_SCORE_KERNEL := true 335#TARGET_USES_CL_KERNEL := false 336 337# exynos RIL 338TARGET_EXYNOS_RIL_SOURCE := true 339ENABLE_VENDOR_RIL_SERVICE := true 340 341# GNSS 342# BOARD_USES_EXYNOS_GNSS_DUMMY := true 343 344# Bluetooth defines 345# TODO(b/123695868): Remove the need for this 346BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := \ 347 build/make/target/board/mainline_arm64/bluetooth 348 349#VNDK 350BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true 351BOARD_VNDK_VERSION := current 352 353# H/W align restriction of MM IPs 354BOARD_EXYNOS_S10B_FORMAT_ALIGN := 64 355 356# Boot.img 357BOARD_RAMDISK_USE_LZ4 := true 358#BOARD_KERNEL_BASE := 0x80000000 359#BOARD_KERNEL_PAGESIZE := 2048 360#BOARD_KERNEL_OFFSET := 0x80000 361#BOARD_RAMDISK_OFFSET := 0x4000000 362BOARD_BOOT_HEADER_VERSION := 4 363BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION) 364 365BOARD_INIT_BOOT_HEADER_VERSION := 4 366BOARD_MKBOOTIMG_INIT_ARGS += --header_version $(BOARD_INIT_BOOT_HEADER_VERSION) 367 368# Enable AVB2.0 369BOARD_AVB_ENABLE := true 370BOARD_BOOTIMAGE_PARTITION_SIZE := 0x04000000 371BOARD_INIT_BOOT_IMAGE_PARTITION_SIZE := 0x800000 372BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 0x04000000 373BOARD_DTBOIMG_PARTITION_SIZE := 0x01000000 374 375# Build vendor kernel boot image 376BOARD_VENDOR_KERNEL_BOOTIMAGE_PARTITION_SIZE := 0x04000000 377 378# Vendor ramdisk image for kernel development 379BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true 380 381KERNEL_MODULE_DIR := $(TARGET_KERNEL_DIR) 382KERNEL_MODULES := $(wildcard $(KERNEL_MODULE_DIR)/*.ko) 383 384ifneq ($(wildcard $(KERNEL_MODULE_DIR)/system_dlkm.modules.blocklist),) 385BOARD_SYSTEM_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_MODULE_DIR)/system_dlkm.modules.blocklist 386endif 387BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.blocklist 388 389# Prebuilt kernel modules that are *not* listed in vendor_kernel_boot.modules.load 390BOARD_PREBUILT_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES = fips140.ko 391BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD_EXTRA = $(foreach k,$(BOARD_PREBUILT_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES),$(if $(wildcard $(KERNEL_MODULE_DIR)/$(k)), $(k))) 392 393# Kernel modules that are listed in vendor_kernel_boot.modules.load 394BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD_FILE := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_kernel_boot.modules.load)) 395ifndef BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD_FILE 396$(error vendor_kernel_boot.modules.load not found or empty) 397endif 398BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD := $(BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD_EXTRA) 399BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD += $(BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD_FILE) 400BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES := $(addprefix $(KERNEL_MODULE_DIR)/, $(BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD_EXTRA)) 401BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES += $(addprefix $(KERNEL_MODULE_DIR)/, $(notdir $(BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD_FILE))) 402 403BOARD_VENDOR_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.load)) 404ifndef BOARD_VENDOR_KERNEL_MODULES_LOAD 405$(error vendor_dlkm.modules.load not found or empty) 406endif 407 408# staging kernels might have modules split between system/vendor_dlkm. If 409# the target defined modules on the system_dlkm image, honor the split. 410# Otherwise, assume all modules are stored on the vendor_dlkm image. 411ifneq ($(BOARD_SYSTEM_KERNEL_MODULES),) 412BOARD_VENDOR_KERNEL_MODULES := $(addprefix $(KERNEL_MODULE_DIR)/, $(notdir $(BOARD_VENDOR_KERNEL_MODULES_LOAD))) 413else 414BOARD_VENDOR_KERNEL_MODULES := $(KERNEL_MODULES) 415endif 416 417BOARD_SYSTEM_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_MODULE_DIR)/system_dlkm.modules.load)) 418BOARD_SYSTEM_KERNEL_MODULES := $(addprefix $(KERNEL_MODULE_DIR)/, $(notdir $(BOARD_SYSTEM_KERNEL_MODULES_LOAD))) 419 420# Using BUILD_COPY_HEADERS 421BUILD_BROKEN_USES_BUILD_COPY_HEADERS := true 422 423include device/google/gs201-sepolicy/gs201-sepolicy.mk 424 425# Battery options 426BOARD_KERNEL_CMDLINE += at24.write_timeout=100 427 428# Enable larger logbuf 429BOARD_KERNEL_CMDLINE += log_buf_len=1024K 430 431# Protected VM firmware 432BOARD_PVMFWIMAGE_PARTITION_SIZE := 0x00100000 433 434# pick up library for cleaning digital car keys on factory reset 435-include vendor/google_devices/gs-common/proprietary/BoardConfigVendor.mk 436