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 := gs101
24
25TARGET_SOC_NAME := google
26
27USES_DEVICE_GOOGLE_GS101 := 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
35DEVICE_IS_64BIT_ONLY ?= $(if $(filter %_64,$(TARGET_PRODUCT)),true,false)
36
37ifneq ($(DEVICE_IS_64BIT_ONLY),true)
38TARGET_2ND_ARCH := arm
39TARGET_2ND_ARCH_VARIANT := armv8-a
40TARGET_2ND_CPU_ABI := armeabi-v7a
41TARGET_2ND_CPU_ABI2 := armeabi
42TARGET_2ND_CPU_VARIANT := generic
43TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a53
44endif
45
46BOARD_KERNEL_CMDLINE += dyndbg=\"func alloc_contig_dump_pages +p\"
47BOARD_KERNEL_CMDLINE += earlycon=exynos4210,0x10A00000 console=ttySAC0,115200 androidboot.console=ttySAC0 printk.devkmsg=on
48BOARD_KERNEL_CMDLINE += cma_sysfs.experimental=Y
49BOARD_KERNEL_CMDLINE += swiotlb=noforce
50BOARD_BOOTCONFIG += androidboot.boot_devices=14700000.ufs
51
52# Enable KUnit for userdebug and eng builds
53ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
54  BOARD_KERNEL_CMDLINE += kunit.enable=1
55endif
56
57TARGET_NO_BOOTLOADER := true
58TARGET_NO_RADIOIMAGE := true
59BOARD_PREBUILT_BOOTIMAGE := $(wildcard $(TARGET_KERNEL_DIR)/boot.img)
60ifneq (,$(BOARD_PREBUILT_BOOTIMAGE))
61TARGET_NO_KERNEL := true
62else
63TARGET_NO_KERNEL := false
64endif
65BOARD_USES_GENERIC_KERNEL_IMAGE := true
66BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT := true
67BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT := true
68TARGET_RECOVERY_WIPE := device/google/gs101/conf/recovery.wipe
69
70# This is the fstab file that will be included in the recovery image.  Note that
71# recovery doesn't care about the encryption settings, so it doesn't matter
72# whether we use the normal or the fips fstab here.
73TARGET_RECOVERY_FSTAB_GENRULE = gen_fstab.gs101
74
75TARGET_RECOVERY_PIXEL_FORMAT := ABGR_8888
76TARGET_RECOVERY_UI_MARGIN_HEIGHT := 165
77TARGET_RECOVERY_UI_LIB := \
78	librecovery_ui_pixel \
79	libfstab
80
81AB_OTA_UPDATER := true
82
83AB_OTA_PARTITIONS += \
84	system \
85	system_ext \
86	product \
87	vbmeta_system
88
89ifneq ($(PRODUCT_BUILD_BOOT_IMAGE),false)
90AB_OTA_PARTITIONS += boot
91endif
92ifneq ($(PRODUCT_BUILD_VENDOR_BOOT_IMAGE),false)
93AB_OTA_PARTITIONS += vendor_boot
94AB_OTA_PARTITIONS += dtbo
95endif
96ifneq ($(PRODUCT_BUILD_VBMETA_IMAGE),false)
97AB_OTA_PARTITIONS += vbmeta
98endif
99
100# EMULATOR common modules
101BOARD_EMULATOR_COMMON_MODULES := liblight
102
103OVERRIDE_RS_DRIVER := libRSDriverArm.so
104BOARD_EGL_CFG := device/google/gs101/conf/egl.cfg
105#BOARD_USES_HGL := true
106USE_OPENGL_RENDERER := true
107NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
108BOARD_USES_EXYNOS5_COMMON_GRALLOC := true
109BOARD_USES_ALIGN_RESTRICTION := false
110BOARD_USES_GRALLOC_ION_SYNC := true
111
112# This should be the same value as USE_SWIFTSHADER in device.mk
113BOARD_USES_SWIFTSHADER := false
114
115# Gralloc4
116ifeq ($(BOARD_USES_SWIFTSHADER),true)
117$(call soong_config_set,arm_gralloc,gralloc_arm_no_external_afbc,true)
118$(call soong_config_set,arm_gralloc,mali_gpu_support_afbc_basic,false)
119$(call soong_config_set,arm_gralloc,mali_gpu_support_afbc_wideblk,false)
120$(call soong_config_set,arm_gralloc,gralloc_init_afbc,false)
121$(call soong_config_set,arm_gralloc,dpu_support_1010102_afbc,false)
122else
123$(call soong_config_set,arm_gralloc,gralloc_arm_no_external_afbc,false)
124$(call soong_config_set,arm_gralloc,mali_gpu_support_afbc_basic,true)
125$(call soong_config_set,arm_gralloc,mali_gpu_support_afbc_wideblk,true)
126$(call soong_config_set,arm_gralloc,gralloc_init_afbc,true)
127$(call soong_config_set,arm_gralloc,dpu_support_1010102_afbc,true)
128endif # ifeq ($(BOARD_USES_SWIFTSHADER),true)
129$(call soong_config_set,arm_gralloc,gralloc_ion_sync_on_lock,$(BOARD_USES_GRALLOC_ION_SYNC))
130
131# Graphics
132#BOARD_USES_EXYNOS_DATASPACE_FEATURE := true
133
134# Enable chain partition for system.
135BOARD_AVB_VBMETA_SYSTEM := system system_ext product
136BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
137BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048
138BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
139BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 1
140
141ifneq ($(PRODUCT_BUILD_PVMFW_IMAGE),false)
142BOARD_AVB_VBMETA_SYSTEM += pvmfw
143endif
144
145# Enable chained vbmeta for boot images
146BOARD_AVB_BOOT_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
147BOARD_AVB_BOOT_ALGORITHM := SHA256_RSA2048
148BOARD_AVB_BOOT_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
149BOARD_AVB_BOOT_ROLLBACK_INDEX_LOCATION := 2
150
151TARGET_USERIMAGES_USE_EXT4 := true
152TARGET_USERIMAGES_USE_F2FS := true
153BOARD_USERDATAIMAGE_PARTITION_SIZE := 11796480000
154BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
155PRODUCT_FS_COMPRESSION := 1
156BOARD_FLASH_BLOCK_SIZE := 4096
157BOARD_MOUNT_SDCARD_RW := true
158
159# product.img
160BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
161TARGET_COPY_OUT_PRODUCT := product
162
163# system_ext.img
164BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
165TARGET_COPY_OUT_SYSTEM_EXT := system_ext
166
167########################
168# Video Codec
169########################
170# 1. Exynos C2
171BOARD_USE_CODEC2_HIDL_1_2 := true
172BOARD_USE_CSC_FILTER := false
173BOARD_USE_DEC_SW_CSC := true
174BOARD_USE_ENC_SW_CSC := true
175BOARD_SUPPORT_MFC_ENC_RGB := true
176BOARD_USE_BLOB_ALLOCATOR := false
177BOARD_SUPPORT_MFC_ENC_BT2020 := true
178BOARD_SUPPORT_FLEXIBLE_P010 := true
179
180########################
181
182BOARD_SUPER_PARTITION_SIZE := 8531214336
183BOARD_SUPER_PARTITION_GROUPS := google_dynamic_partitions
184# Set size to BOARD_SUPER_PARTITION_SIZE - overhead (4MiB) (b/182237294)
185BOARD_GOOGLE_DYNAMIC_PARTITIONS_SIZE := 8527020032
186BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST := \
187    system \
188    system_ext \
189    product \
190    vendor \
191    vendor_dlkm
192
193# Set error limit to BOARD_SUPER_PARTITON_SIZE - 400MB
194BOARD_SUPER_PARTITION_ERROR_LIMIT := 8111783936
195
196# Testing related defines
197BOARD_PERFSETUP_SCRIPT := platform_testing/scripts/perf-setup/r4o6-setup.sh
198
199#
200# AUDIO & VOICE
201#
202BOARD_USES_GENERIC_AUDIO := true
203
204$(call soong_config_set,aoc_audio_func,ext_hidl,true)
205
206ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
207$(call soong_config_set,aoc_audio_func,dump_usecase_data,true)
208$(call soong_config_set,aoc_audio_func,hal_socket_control,true)
209$(call soong_config_set,aoc_audio_func,record_tuning_keys,true)
210endif
211
212ifneq (,$(filter aosp_%,$(TARGET_PRODUCT)))
213$(call soong_config_set,aoc_audio_func,aosp_build,true)
214endif
215
216$(call soong_config_set,haptics,actuator_model,$(ACTUATOR_MODEL))
217
218# Primary AudioHAL Configuration
219#BOARD_USE_COMMON_AUDIOHAL := true
220#BOARD_USE_CALLIOPE_AUDIOHAL := false
221#BOARD_USE_AUDIOHAL := true
222
223# Compress Offload Configuration
224#BOARD_USE_OFFLOAD_AUDIO := true
225#BOARD_USE_OFFLOAD_EFFECT := false
226
227# SoundTriggerHAL Configuration
228#BOARD_USE_SOUNDTRIGGER_HAL := false
229
230# Vibrator HAL actuator model and adaptive haptics configuration
231$(call soong_config_set,haptics,actuator_model,$(ACTUATOR_MODEL))
232$(call soong_config_set,haptics,adaptive_haptics_feature,$(ADAPTIVE_HAPTICS_FEATURE))
233
234# HWComposer
235BOARD_HWC_VERSION := libhwc2.1
236TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK := false
237BOARD_HDMI_INCAPABLE := true
238TARGET_USES_HWC2 := true
239HWC_SUPPORT_RENDER_INTENT := true
240HWC_SUPPORT_COLOR_TRANSFORM := true
241#BOARD_USES_DISPLAYPORT := true
242# if AFBC is enabled, must set ro.vendor.ddk.set.afbc=1
243BOARD_USES_EXYNOS_AFBC_FEATURE := true
244#BOARD_USES_HDRUI_GLES_CONVERSION := true
245
246BOARD_LIBACRYL_DEFAULT_COMPOSITOR := fimg2d_gs101
247BOARD_LIBACRYL_G2D_HDR_PLUGIN := libacryl_hdr_plugin
248
249# HWCServices
250BOARD_USES_HWC_SERVICES := true
251
252# WiFiDisplay
253# BOARD_USES_VIRTUAL_DISPLAY := true
254# BOARD_USES_VDS_EXYNOS_HWC := true
255# BOARD_USES_WIFI_DISPLAY:= true
256# BOARD_USES_EGL_SURFACE_FOR_COMPOSITION_MIXED := true
257# BOARD_USES_VDS_YUV420SPM := true
258# BOARD_USES_VDS_OTHERFORMAT := true
259# BOARD_USES_VDS_DEBUG_FLAG := true
260# BOARD_USES_DISABLE_COMPOSITIONTYPE_GLES := true
261# BOARD_USES_SECURE_ENCODER_ONLY := true
262# BOARD_USES_TSMUX := true
263
264# SCALER
265BOARD_USES_DEFAULT_CSC_HW_SCALER := true
266BOARD_DEFAULT_CSC_HW_SCALER := 4
267BOARD_USES_SCALER_M2M1SHOT := true
268
269# Device Tree
270BOARD_USES_DT := true
271BOARD_INCLUDE_DTB_IN_BOOTIMG := true
272BOARD_PREBUILT_DTBIMAGE_DIR := $(TARGET_KERNEL_DIR)
273BOARD_PREBUILT_DTBOIMAGE := $(BOARD_PREBUILT_DTBIMAGE_DIR)/dtbo.img
274
275# PLATFORM LOG
276TARGET_USES_LOGD := true
277
278# LIBHWJPEG
279#TARGET_USES_UNIVERSAL_LIBHWJPEG := true
280#LIBHWJPEG_HWSCALER_ID := 0
281
282#Keymaster
283#BOARD_USES_KEYMASTER_VER1 := true
284
285#FMP
286#BOARD_USES_FMP_DM_CRYPT := true
287#BOARD_USES_FMP_FSCRYPTO := true
288BOARD_USES_METADATA_PARTITION := true
289
290# SKIA
291#BOARD_USES_SKIA_MULTITHREADING := true
292#BOARD_USES_FIMGAPI_V5X := true
293
294# SECCOMP Policy
295BOARD_SECCOMP_POLICY = device/google/gs101/seccomp_policy
296
297#CURL
298BOARD_USES_CURL := true
299
300# Sensor HAL
301BOARD_USES_EXYNOS_SENSORS_DUMMY := true
302
303# VISION
304# Exynos vision framework (EVF)
305#TARGET_USES_EVF := true
306# HW acceleration
307#TARGET_USES_VPU_KERNEL := true
308#TARGET_USES_SCORE_KERNEL := true
309#TARGET_USES_CL_KERNEL := false
310
311# exynos RIL
312TARGET_EXYNOS_RIL_SOURCE := true
313ENABLE_VENDOR_RIL_SERVICE := true
314
315# GNSS
316# BOARD_USES_EXYNOS_GNSS_DUMMY := true
317
318# Bluetooth defines
319# TODO(b/123695868): Remove the need for this
320BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := \
321	build/make/target/board/mainline_arm64/bluetooth
322
323#VNDK
324BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
325BOARD_VNDK_VERSION := current
326
327# H/W align restriction of MM IPs
328BOARD_EXYNOS_S10B_FORMAT_ALIGN := 64
329
330# Boot.img
331BOARD_RAMDISK_USE_LZ4     := true
332#BOARD_KERNEL_BASE        := 0x80000000
333#BOARD_KERNEL_PAGESIZE    := 2048
334#BOARD_KERNEL_OFFSET      := 0x80000
335#BOARD_RAMDISK_OFFSET     := 0x4000000
336BOARD_BOOT_HEADER_VERSION := 4
337BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)
338
339BOARD_VENDOR_RAMDISK_FRAGMENTS := dlkm
340BOARD_VENDOR_RAMDISK_FRAGMENT.dlkm.KERNEL_MODULE_DIRS := top
341
342# Enable AVB2.0
343BOARD_AVB_ENABLE := true
344BOARD_BOOTIMAGE_PARTITION_SIZE := 0x04000000
345BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 0x04000000
346BOARD_DTBOIMG_PARTITION_SIZE := 0x01000000
347
348# Vendor ramdisk image for kernel development
349BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true
350
351KERNEL_MODULE_DIR := $(TARGET_KERNEL_DIR)
352KERNEL_MODULES := $(wildcard $(KERNEL_MODULE_DIR)/*.ko)
353
354BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.blocklist
355
356# Since Pixel 6/6pro doesn't have a system_dlkm partition, the GKI modules are
357# on the vendor_dlkm partition. In order to allow them to load properly, we
358# need to retain the module signature which would normally get stripped during
359# packaging. Disable stripping the vendor_dlkm modules to retain the GKI
360# modules' signature. Note, the pixel kernel builds always strip the modules in
361# favor of saving space via the kleaf property: strip_modules = True.
362BOARD_DO_NOT_STRIP_VENDOR_MODULES := true
363
364# Prebuilt kernel modules that are *not* listed in vendor_boot.modules.load
365BOARD_PREBUILT_VENDOR_RAMDISK_KERNEL_MODULES = fips140.ko
366BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_EXTRA = $(foreach k,$(BOARD_PREBUILT_VENDOR_RAMDISK_KERNEL_MODULES),$(if $(wildcard $(KERNEL_MODULE_DIR)/$(k)), $(k)))
367
368# Kernel modules that are listed in vendor_boot.modules.load
369BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_FILE := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_boot.modules.load))
370ifndef BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_FILE
371$(error vendor_boot.modules.load not found or empty)
372endif
373BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_EXTRA)
374BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD += $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_FILE)
375BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(addprefix $(KERNEL_MODULE_DIR)/, $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_EXTRA))
376BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(addprefix $(KERNEL_MODULE_DIR)/, $(notdir $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_FILE)))
377
378BOARD_VENDOR_KERNEL_MODULES_LOAD += $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.load))
379ifndef BOARD_VENDOR_KERNEL_MODULES_LOAD
380$(error vendor_dlkm.modules.load not found or empty)
381endif
382BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES)
383
384# Using BUILD_COPY_HEADERS
385BUILD_BROKEN_USES_BUILD_COPY_HEADERS := true
386
387include device/google/gs101-sepolicy/gs101-sepolicy.mk
388
389# Battery options
390BOARD_KERNEL_CMDLINE += at24.write_timeout=100
391
392# Enable larger logbuf
393BOARD_KERNEL_CMDLINE += log_buf_len=1024K
394
395# Protected VM firmware
396BOARD_PVMFWIMAGE_PARTITION_SIZE := 0x00100000
397
398-include vendor/google_devices/gs-common/proprietary/BoardConfigVendor.mk
399