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 := zumapro
24
25TARGET_SOC_NAME := google
26
27USES_DEVICE_GOOGLE_ZUMAPRO := 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
35BOARD_KERNEL_CMDLINE += dyndbg=\"func alloc_contig_dump_pages +p\"
36BOARD_KERNEL_CMDLINE += earlycon=exynos4210,0x10870000 console=ttySAC0,115200 androidboot.console=ttySAC0 printk.devkmsg=on
37BOARD_KERNEL_CMDLINE += cma_sysfs.experimental=Y
38BOARD_KERNEL_CMDLINE += cgroup_disable=memory
39BOARD_KERNEL_CMDLINE += cgroup.memory=nokmem
40BOARD_KERNEL_CMDLINE += rcupdate.rcu_expedited=1 rcu_nocbs=all rcutree.enable_rcu_lazy
41BOARD_KERNEL_CMDLINE += swiotlb=noforce
42BOARD_KERNEL_CMDLINE += disable_dma32=on
43BOARD_KERNEL_CMDLINE += sysctl.kernel.sched_pelt_multiplier=4
44ifeq (,$(filter %_fullmte,$(TARGET_PRODUCT)))
45BOARD_KERNEL_CMDLINE += kasan=off
46endif
47BOARD_BOOTCONFIG += androidboot.boot_devices=13200000.ufs
48
49# Enable KUnit for userdebug and eng builds
50ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
51  BOARD_KERNEL_CMDLINE += kunit.enable=1
52endif
53
54TARGET_NO_BOOTLOADER := true
55TARGET_NO_RADIOIMAGE := true
56BOARD_PREBUILT_BOOTIMAGE := $(wildcard $(TARGET_KERNEL_DIR)/boot.img)
57ifneq (,$(BOARD_PREBUILT_BOOTIMAGE))
58TARGET_NO_KERNEL := true
59else
60TARGET_NO_KERNEL := false
61endif
62BOARD_USES_GENERIC_KERNEL_IMAGE := true
63BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT := true
64BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT := true
65TARGET_RECOVERY_WIPE := device/google/zumapro/conf/recovery.wipe
66
67# This is the fstab file that will be included in the recovery image.  Note that
68# recovery doesn't care about the encryption settings, so it doesn't matter
69# whether we use the normal or the fips fstab here.
70TARGET_RECOVERY_FSTAB_GENRULE := gen_fstab.zumapro-sw-encrypt
71
72TARGET_RECOVERY_PIXEL_FORMAT := ABGR_8888
73TARGET_RECOVERY_UI_MARGIN_HEIGHT := 165
74TARGET_RECOVERY_UI_LIB := \
75	librecovery_ui_pixel \
76	libfstab
77
78AB_OTA_UPDATER := true
79
80AB_OTA_PARTITIONS += \
81	system \
82	system_dlkm \
83	system_ext \
84	product \
85	vbmeta_system
86
87ifneq ($(PRODUCT_BUILD_BOOT_IMAGE),false)
88AB_OTA_PARTITIONS += boot
89endif
90ifneq ($(PRODUCT_BUILD_INIT_BOOT_IMAGE), false)
91AB_OTA_PARTITIONS += init_boot
92endif
93ifneq ($(PRODUCT_BUILD_VENDOR_BOOT_IMAGE),false)
94AB_OTA_PARTITIONS += vendor_boot
95AB_OTA_PARTITIONS += dtbo
96endif
97ifeq ($(PRODUCT_BUILD_VENDOR_KERNEL_BOOT_IMAGE),true)
98AB_OTA_PARTITIONS += vendor_kernel_boot
99endif
100ifneq ($(PRODUCT_BUILD_VBMETA_IMAGE),false)
101AB_OTA_PARTITIONS += vbmeta
102endif
103ifneq ($(PRODUCT_BUILD_PVMFW_IMAGE),false)
104AB_OTA_PARTITIONS += pvmfw
105endif
106
107# EMULATOR common modules
108BOARD_EMULATOR_COMMON_MODULES := liblight
109
110OVERRIDE_RS_DRIVER := libRSDriverArm.so
111BOARD_EGL_CFG := device/google/zumapro/conf/egl.cfg
112#BOARD_USES_HGL := true
113USE_OPENGL_RENDERER := true
114NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
115BOARD_USES_EXYNOS5_COMMON_GRALLOC := true
116BOARD_USES_EXYNOS_GRALLOC_VERSION := 4
117#BOARD_USES_EXYNOS_GRALLOC_VERSION := $(DEVICE_USES_EXYNOS_GRALLOC_VERSION)
118BOARD_USES_ALIGN_RESTRICTION := false
119BOARD_USES_GRALLOC_ION_SYNC := true
120
121# This should be the same value as USE_SWIFTSHADER in device.mk
122BOARD_USES_SWIFTSHADER ?= false
123
124# Gralloc4
125ifeq ($(BOARD_USES_EXYNOS_GRALLOC_VERSION),4)
126ifeq ($(BOARD_USES_SWIFTSHADER),true)
127$(warning BOARD_USES_SWIFTSHADER set to current target)
128TARGET_DISABLE_TRIPLE_BUFFERING := 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$(call soong_config_set,arm_gralloc,gralloc_ion_sync_on_lock,$(BOARD_USES_GRALLOC_ION_SYNC))
142endif # ifeq ($(BOARD_USES_EXYNOS_GRALLOC_VERSION),4)
143
144# libVendorGraphicbuffer
145ifeq ($(BOARD_USES_EXYNOS_GRALLOC_VERSION),4)
146$(call soong_config_set,vendorgraphicbuffer,gralloc_version,four)
147else
148$(call soong_config_set,vendorgraphicbuffer,gralloc_version,three)
149endif
150
151#display_unit_test
152ifeq ($(USES_DEVICE_GOOGLE_ZUMAPRO),true)
153$(call soong_config_set,display_unit_test,soc,zuma)
154endif
155
156# Graphics
157#BOARD_USES_EXYNOS_DATASPACE_FEATURE := true
158
159# Enable chain partition for system.
160BOARD_AVB_VBMETA_SYSTEM := system system_dlkm system_ext product
161BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
162BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048
163BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
164BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 1
165
166# Enable chained vbmeta for boot images
167BOARD_AVB_BOOT_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
168BOARD_AVB_BOOT_ALGORITHM := SHA256_RSA2048
169BOARD_AVB_BOOT_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
170BOARD_AVB_BOOT_ROLLBACK_INDEX_LOCATION := 2
171
172# Enable chained vbmeta for init_boot images
173BOARD_AVB_INIT_BOOT_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
174BOARD_AVB_INIT_BOOT_ALGORITHM := SHA256_RSA2048
175BOARD_AVB_INIT_BOOT_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
176BOARD_AVB_INIT_BOOT_ROLLBACK_INDEX_LOCATION := 4
177
178TARGET_USERIMAGES_USE_EXT4 := true
179TARGET_USERIMAGES_USE_F2FS := true
180BOARD_USERDATAIMAGE_PARTITION_SIZE := 11796480000
181BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
182PRODUCT_FS_COMPRESSION := 1
183BOARD_FLASH_BLOCK_SIZE := 4096
184BOARD_MOUNT_SDCARD_RW := true
185
186# system.img
187BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := ext4
188
189# product.img
190BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
191TARGET_COPY_OUT_PRODUCT := product
192
193# system_ext.img
194BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
195TARGET_COPY_OUT_SYSTEM_EXT := system_ext
196
197# persist.img
198BOARD_PERSISTIMAGE_FILE_SYSTEM_TYPE := f2fs
199
200########################
201# Video Codec
202########################
203# 1. Exynos C2
204BOARD_USE_CODEC2_HIDL_1_2 := true
205BOARD_USE_CSC_FILTER := false
206BOARD_USE_DEC_SW_CSC := true
207BOARD_USE_ENC_SW_CSC := true
208BOARD_SUPPORT_MFC_ENC_RGB := true
209BOARD_USE_BLOB_ALLOCATOR := false
210BOARD_SUPPORT_MFC_ENC_BT2020 := true
211BOARD_SUPPORT_FLEXIBLE_P010 := true
212BOARD_SUPPORT_MFC_VERSION := 1660
213########################
214
215BOARD_SUPER_PARTITION_SIZE := 8531214336
216BOARD_SUPER_PARTITION_GROUPS := google_dynamic_partitions
217# Set size to BOARD_SUPER_PARTITION_SIZE - overhead (4MiB) (b/182237294)
218BOARD_GOOGLE_DYNAMIC_PARTITIONS_SIZE := 8527020032
219BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST := \
220    system \
221    system_dlkm \
222    system_ext \
223    product \
224    vendor \
225    vendor_dlkm
226
227# Set error limit to BOARD_SUPER_PARTITON_SIZE - 500MB
228BOARD_SUPER_PARTITION_ERROR_LIMIT := 8006926336
229
230# Build a separate system_dlkm partition
231BOARD_USES_SYSTEM_DLKMIMAGE := true
232BOARD_SYSTEM_DLKMIMAGE_FILE_SYSTEM_TYPE := ext4
233TARGET_COPY_OUT_SYSTEM_DLKM := system_dlkm
234
235#
236# AUDIO & VOICE
237#
238BOARD_USES_GENERIC_AUDIO := true
239
240$(call soong_config_set,aoc_audio_func,ext_hidl,true)
241
242ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
243$(call soong_config_set,aoc_audio_func,dump_usecase_data,true)
244$(call soong_config_set,aoc_audio_func,hal_socket_control,true)
245$(call soong_config_set,aoc_audio_func,record_tuning_keys,true)
246$(call soong_config_set,aoc_audio_func,aidl_command_interface,true)
247endif
248
249ifneq (,$(filter aosp_%,$(TARGET_PRODUCT)))
250$(call soong_config_set,aoc_audio_func,aosp_build,true)
251endif
252
253# Primary AudioHAL Configuration
254#BOARD_USE_COMMON_AUDIOHAL := true
255#BOARD_USE_CALLIOPE_AUDIOHAL := false
256#BOARD_USE_AUDIOHAL := true
257
258# Compress Offload Configuration
259#BOARD_USE_OFFLOAD_AUDIO := true
260#BOARD_USE_OFFLOAD_EFFECT := false
261
262# SoundTriggerHAL Configuration
263#BOARD_USE_SOUNDTRIGGER_HAL := false
264
265# Vibrator HAL actuator model configuration
266$(call soong_config_set,haptics,actuator_model,$(ACTUATOR_MODEL))
267$(call soong_config_set,haptics,adaptive_haptics_feature,$(ADAPTIVE_HAPTICS_FEATURE))
268
269# HWComposer
270BOARD_HWC_VERSION := hwc3
271TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK := false
272BOARD_HDMI_INCAPABLE := true
273TARGET_USES_HWC2 := true
274HWC_SUPPORT_RENDER_INTENT := true
275HWC_SUPPORT_COLOR_TRANSFORM := true
276#BOARD_USES_DISPLAYPORT := true
277# if AFBC is enabled, must set ro.vendor.ddk.set.afbc=1
278BOARD_USES_EXYNOS_AFBC_FEATURE := true
279#BOARD_USES_HDRUI_GLES_CONVERSION := true
280
281BOARD_LIBACRYL_DEFAULT_COMPOSITOR := fimg2d_zuma
282BOARD_LIBACRYL_G2D_HDR_PLUGIN := libacryl_hdr_plugin
283
284# HWCServices
285BOARD_USES_HWC_SERVICES := true
286
287# WiFiDisplay
288# BOARD_USES_VIRTUAL_DISPLAY := true
289# BOARD_USES_VDS_EXYNOS_HWC := true
290# BOARD_USES_WIFI_DISPLAY:= true
291# BOARD_USES_EGL_SURFACE_FOR_COMPOSITION_MIXED := true
292# BOARD_USES_VDS_YUV420SPM := true
293# BOARD_USES_VDS_OTHERFORMAT := true
294# BOARD_USES_VDS_DEBUG_FLAG := true
295# BOARD_USES_DISABLE_COMPOSITIONTYPE_GLES := true
296# BOARD_USES_SECURE_ENCODER_ONLY := true
297# BOARD_USES_TSMUX := true
298
299# SCALER
300BOARD_USES_DEFAULT_CSC_HW_SCALER := true
301BOARD_DEFAULT_CSC_HW_SCALER := 4
302BOARD_USES_SCALER_M2M1SHOT := true
303
304# Device Tree
305BOARD_USES_DT := true
306BOARD_INCLUDE_DTB_IN_BOOTIMG := true
307BOARD_PREBUILT_DTBIMAGE_DIR := $(TARGET_KERNEL_DIR)
308BOARD_PREBUILT_DTBOIMAGE := $(BOARD_PREBUILT_DTBIMAGE_DIR)/dtbo.img
309
310# PLATFORM LOG
311TARGET_USES_LOGD := true
312
313# LIBHWJPEG
314#TARGET_USES_UNIVERSAL_LIBHWJPEG := true
315#LIBHWJPEG_HWSCALER_ID := 0
316
317#Keymaster
318#BOARD_USES_KEYMASTER_VER1 := true
319
320#FMP
321#BOARD_USES_FMP_DM_CRYPT := true
322#BOARD_USES_FMP_FSCRYPTO := true
323BOARD_USES_METADATA_PARTITION := true
324
325# SKIA
326#BOARD_USES_SKIA_MULTITHREADING := true
327#BOARD_USES_FIMGAPI_V5X := true
328
329# SECCOMP Policy
330BOARD_SECCOMP_POLICY = device/google/zumapro/seccomp_policy
331
332#CURL
333BOARD_USES_CURL := true
334
335# Sensor HAL
336BOARD_USES_EXYNOS_SENSORS_DUMMY := true
337
338# VISION
339# Exynos vision framework (EVF)
340#TARGET_USES_EVF := true
341# HW acceleration
342#TARGET_USES_VPU_KERNEL := true
343#TARGET_USES_SCORE_KERNEL := true
344#TARGET_USES_CL_KERNEL := false
345
346# exynos RIL
347TARGET_EXYNOS_RIL_SOURCE := true
348ENABLE_VENDOR_RIL_SERVICE := true
349
350# GNSS
351# BOARD_USES_EXYNOS_GNSS_DUMMY := true
352
353# Bluetooth defines
354# TODO(b/123695868): Remove the need for this
355BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := \
356	build/make/target/board/mainline_arm64/bluetooth
357
358#VNDK
359BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
360BOARD_VNDK_VERSION := current
361
362# H/W align restriction of MM IPs
363BOARD_EXYNOS_S10B_FORMAT_ALIGN := 64
364
365# Boot.img
366BOARD_RAMDISK_USE_LZ4     := true
367#BOARD_KERNEL_BASE        := 0x80000000
368#BOARD_KERNEL_PAGESIZE    := 2048
369#BOARD_KERNEL_OFFSET      := 0x80000
370#BOARD_RAMDISK_OFFSET     := 0x4000000
371BOARD_BOOT_HEADER_VERSION := 4
372BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)
373
374BOARD_INIT_BOOT_HEADER_VERSION := 4
375BOARD_MKBOOTIMG_INIT_ARGS += --header_version $(BOARD_INIT_BOOT_HEADER_VERSION)
376
377# Enable AVB2.0
378BOARD_AVB_ENABLE := true
379BOARD_BOOTIMAGE_PARTITION_SIZE := 0x04000000
380BOARD_INIT_BOOT_IMAGE_PARTITION_SIZE := 0x800000
381BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 0x04000000
382BOARD_DTBOIMG_PARTITION_SIZE := 0x01000000
383
384# Build vendor kernel boot image
385BOARD_VENDOR_KERNEL_BOOTIMAGE_PARTITION_SIZE := 0x04000000
386
387# Vendor ramdisk image for kernel development
388BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true
389
390KERNEL_MODULE_DIR := $(TARGET_KERNEL_DIR)
391KERNEL_MODULES := $(wildcard $(KERNEL_MODULE_DIR)/*.ko)
392
393BOARD_SYSTEM_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_MODULE_DIR)/system_dlkm.modules.blocklist
394BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.blocklist
395
396# Prebuilt kernel modules that are *not* listed in vendor_kernel_boot.modules.load
397BOARD_PREBUILT_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES = fips140.ko
398BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD_EXTRA = $(foreach k,$(BOARD_PREBUILT_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES),$(if $(wildcard $(KERNEL_MODULE_DIR)/$(k)), $(k)))
399
400# Kernel modules that are listed in vendor_kernel_boot.modules.load
401BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD_FILE := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_kernel_boot.modules.load))
402ifndef BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD_FILE
403$(error vendor_kernel_boot.modules.load not found or empty)
404endif
405BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD := $(BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD_EXTRA)
406BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD += $(BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD_FILE)
407BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES := $(addprefix $(KERNEL_MODULE_DIR)/, $(BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD_EXTRA))
408BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES += $(addprefix $(KERNEL_MODULE_DIR)/, $(notdir $(BOARD_VENDOR_KERNEL_RAMDISK_KERNEL_MODULES_LOAD_FILE)))
409
410BOARD_VENDOR_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.load))
411ifndef BOARD_VENDOR_KERNEL_MODULES_LOAD
412$(error vendor_dlkm.modules.load not found or empty)
413endif
414BOARD_VENDOR_KERNEL_MODULES := $(addprefix $(KERNEL_MODULE_DIR)/, $(notdir $(BOARD_VENDOR_KERNEL_MODULES_LOAD)))
415
416BOARD_SYSTEM_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_MODULE_DIR)/system_dlkm.modules.load))
417ifndef BOARD_SYSTEM_KERNEL_MODULES_LOAD
418$(error system_dlkm.modules.load not found or empty)
419endif
420BOARD_SYSTEM_KERNEL_MODULES := $(addprefix $(KERNEL_MODULE_DIR)/, $(notdir $(BOARD_SYSTEM_KERNEL_MODULES_LOAD)))
421
422# Using BUILD_COPY_HEADERS
423BUILD_BROKEN_USES_BUILD_COPY_HEADERS := true
424
425include device/google/zumapro-sepolicy/zumapro-sepolicy.mk
426
427# Battery options
428BOARD_KERNEL_CMDLINE += at24.write_timeout=100
429
430# Enable larger logbuf
431BOARD_KERNEL_CMDLINE += log_buf_len=1024K
432
433# Protected VM firmware
434BOARD_PVMFWIMAGE_PARTITION_SIZE := 0x00100000
435
436# pick up library for cleaning digital car keys on factory reset
437-include vendor/google_devices/gs-common/proprietary/BoardConfigVendor.mk
438