1#
2# Copyright (C) 2016 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#
16
17include build/make/target/board/BoardConfigMainlineCommon.mk
18
19TARGET_BOARD_PLATFORM := sdm845
20TARGET_BOARD_INFO_FILE := device/google/crosshatch/board-info.txt
21USES_DEVICE_GOOGLE_B1C1 := true
22
23TARGET_ARCH := arm64
24TARGET_ARCH_VARIANT := armv8-a
25TARGET_CPU_ABI := arm64-v8a
26TARGET_CPU_ABI2 :=
27TARGET_CPU_VARIANT := generic
28TARGET_CPU_VARIANT_RUNTIME := kryo385
29
30TARGET_2ND_ARCH := arm
31TARGET_2ND_ARCH_VARIANT := armv8-a
32TARGET_2ND_CPU_ABI := armeabi-v7a
33TARGET_2ND_CPU_ABI2 := armeabi
34TARGET_2ND_CPU_VARIANT := generic
35TARGET_2ND_CPU_VARIANT_RUNTIME := kryo385
36
37TARGET_BOARD_COMMON_PATH := device/google/crosshatch/sdm845
38
39BUILD_BROKEN_DUP_RULES := true
40
41BOARD_KERNEL_CMDLINE += console=ttyMSM0,115200n8 androidboot.console=ttyMSM0 printk.devkmsg=on
42BOARD_KERNEL_CMDLINE += msm_rtb.filter=0x237
43BOARD_KERNEL_CMDLINE += ehci-hcd.park=3
44BOARD_KERNEL_CMDLINE += service_locator.enable=1
45BOARD_KERNEL_CMDLINE += cgroup.memory=nokmem
46BOARD_KERNEL_CMDLINE += lpm_levels.sleep_disabled=1
47BOARD_KERNEL_CMDLINE += usbcore.autosuspend=7
48BOARD_KERNEL_CMDLINE += loop.max_part=7
49BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc/1d84000.ufshc
50
51BOARD_KERNEL_BASE        := 0x00000000
52BOARD_KERNEL_PAGESIZE    := 4096
53
54BOARD_INCLUDE_DTB_IN_BOOTIMG := true
55BOARD_BOOT_HEADER_VERSION := 2
56BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)
57
58# DTBO partition definitions
59BOARD_PREBUILT_DTBOIMAGE := device/google/crosshatch-kernel/dtbo.img
60BOARD_DTBOIMG_PARTITION_SIZE := 8388608
61
62TARGET_NO_KERNEL := false
63BOARD_USES_RECOVERY_AS_BOOT := true
64BOARD_USES_METADATA_PARTITION := true
65
66# Board uses A/B OTA.
67AB_OTA_UPDATER := true
68
69AB_OTA_PARTITIONS += \
70    boot \
71    system \
72    vbmeta \
73    dtbo
74
75# Skip product and system_ext partition for nodap build
76ifeq ($(filter %_nodap,$(TARGET_PRODUCT)),)
77AB_OTA_PARTITIONS += \
78    product \
79    system_ext
80endif
81
82ifneq ($(filter %_mainline,$(TARGET_PRODUCT)),)
83AB_OTA_PARTITIONS += \
84    vbmeta_system
85endif
86
87# Partitions (listed in the file) to be wiped under recovery.
88TARGET_RECOVERY_WIPE := device/google/crosshatch/recovery.wipe
89ifneq ($(filter %_mainline,$(TARGET_PRODUCT)),)
90TARGET_RECOVERY_FSTAB := device/google/crosshatch/fstab.mainline.hardware
91else
92TARGET_RECOVERY_FSTAB := device/google/crosshatch/fstab.hardware
93endif
94TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888
95TARGET_RECOVERY_UI_LIB := \
96    librecovery_ui_pixel \
97    libfstab
98
99ifneq ($(filter %_mainline,$(TARGET_PRODUCT)),)
100BOARD_AVB_VBMETA_SYSTEM := system system_ext
101BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
102BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048
103BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
104BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 1
105endif
106
107# product.img
108ifneq ($(PRODUCT_NO_PRODUCT_PARTITION), true)
109ifneq ($(PRODUCT_USE_DYNAMIC_PARTITIONS), true)
110  BOARD_PRODUCTIMAGE_PARTITION_SIZE := 314572800
111endif
112BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
113else
114TARGET_COPY_OUT_PRODUCT := system/product
115endif
116
117# system.img
118ifneq ($(PRODUCT_USE_DYNAMIC_PARTITIONS), true)
119  BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2952790016
120ifeq ($(PRODUCT_NO_PRODUCT_PARTITION), true)
121  # Increase inode count to add product modules
122  BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := 8192
123else
124  BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := 4096
125endif
126endif
127BOARD_SYSTEMIMAGE_JOURNAL_SIZE := 0
128
129# userdata.img
130BOARD_USERDATAIMAGE_PARTITION_SIZE := 10737418240
131BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
132
133# persist.img
134BOARD_PERSISTIMAGE_PARTITION_SIZE := 41943040
135BOARD_PERSISTIMAGE_FILE_SYSTEM_TYPE := ext4
136
137# boot.img
138BOARD_BOOTIMAGE_PARTITION_SIZE := 0x04000000
139
140# system_ext.img
141ifneq ($(PRODUCT_USE_DYNAMIC_PARTITIONS), true)
142TARGET_COPY_OUT_SYSTEM_EXT := system/system_ext
143else
144BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
145endif
146ifeq ($(PRODUCT_NO_PRODUCT_PARTITION), true)
147# no system_ext partition as well
148TARGET_COPY_OUT_SYSTEM_EXT := system/system_ext
149endif
150
151ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS), true)
152BOARD_SUPER_PARTITION_GROUPS := google_dynamic_partitions
153BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST := \
154    system \
155    vendor \
156    product \
157    system_ext
158
159ifeq ($(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS), true)
160# Normal Pixel 3 must retrofit dynamic partitions.
161BOARD_SUPER_PARTITION_SIZE := 4072669184
162BOARD_SUPER_PARTITION_METADATA_DEVICE := system
163BOARD_SUPER_PARTITION_BLOCK_DEVICES := system vendor product
164BOARD_SUPER_PARTITION_SYSTEM_DEVICE_SIZE := 2952790016
165BOARD_SUPER_PARTITION_VENDOR_DEVICE_SIZE := 805306368
166BOARD_SUPER_PARTITION_PRODUCT_DEVICE_SIZE := 314572800
167# Assume 4MB metadata size.
168# TODO(b/117997386): Use correct metadata size.
169BOARD_GOOGLE_DYNAMIC_PARTITIONS_SIZE := 4069523456
170else
171# Mainline Pixel 3 has an actual super partition.
172
173BOARD_SUPER_PARTITION_SIZE := 12884901888
174# Assume 1MB metadata size.
175# TODO(b/117997386): Use correct metadata size.
176BOARD_GOOGLE_DYNAMIC_PARTITIONS_SIZE := 6441402368
177
178endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
179endif # PRODUCT_USE_DYNAMIC_PARTITIONS
180
181BOARD_FLASH_BLOCK_SIZE := 131072
182
183# Generate an APEX image for experiment b/119800099.
184DEXPREOPT_GENERATE_APEX_IMAGE := true
185
186BOARD_ROOT_EXTRA_SYMLINKS := /vendor/dsp:/dsp
187BOARD_ROOT_EXTRA_SYMLINKS += /mnt/vendor/persist:/persist
188
189# Add QC specific symlinks for backward compatibility
190# Move the symlinks here instead of removing them
191ifeq ($(PRODUCT_USE_QC_SPECIFIC_SYMLINKS), true)
192BOARD_ROOT_EXTRA_SYMLINKS += /vendor/firmware_mnt:/firmware
193endif
194
195include device/google/crosshatch-sepolicy/crosshatch-sepolicy.mk
196
197TARGET_FS_CONFIG_GEN := device/google/crosshatch/config.fs
198
199QCOM_BOARD_PLATFORMS += sdm845
200BOARD_HAVE_BLUETOOTH_QCOM := true
201BOARD_HAVE_QCOM_FM := false
202BOARD_USES_COMMON_BLUETOOTH_HAL := true
203
204# Camera
205TARGET_USES_AOSP := true
206BOARD_QTI_CAMERA_32BIT_ONLY := false
207CAMERA_DAEMON_NOT_PRESENT := true
208TARGET_USES_ION := true
209TARGET_USES_EASEL := true
210BOARD_USES_EASEL := true
211
212# GPS
213TARGET_NO_RPC := true
214BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default
215BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET := true
216
217# RenderScript
218OVERRIDE_RS_DRIVER := libRSDriver_adreno.so
219
220# Sensors
221USE_SENSOR_MULTI_HAL := true
222TARGET_SUPPORT_DIRECT_REPORT := true
223
224# wlan
225BOARD_WLAN_DEVICE := qcwcn
226BOARD_WPA_SUPPLICANT_DRIVER := NL80211
227BOARD_HOSTAPD_DRIVER := NL80211
228WIFI_DRIVER_DEFAULT := qca_cld3
229WPA_SUPPLICANT_VERSION := VER_0_8_X
230BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
231BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
232WIFI_HIDL_FEATURE_AWARE := true
233WIFI_HIDL_FEATURE_DUAL_INTERFACE:= true
234
235# Audio
236BOARD_USES_ALSA_AUDIO := true
237AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
238AUDIO_FEATURE_ENABLED_SND_MONITOR := true
239AUDIO_FEATURE_ENABLED_USB_TUNNEL := true
240AUDIO_FEATURE_ENABLED_CIRRUS_SPKR_PROTECTION := true
241BOARD_SUPPORTS_SOUND_TRIGGER := true
242AUDIO_FEATURE_FLICKER_SENSOR_INPUT := true
243SOUND_TRIGGER_FEATURE_LPMA_ENABLED := true
244AUDIO_FEATURE_ENABLED_MAXX_AUDIO := true
245AUDIO_FEATURE_ENABLED_24BITS_CAMCORDER := true
246
247# Graphics
248TARGET_USES_GRALLOC1 := true
249TARGET_USES_HWC2 := true
250
251VSYNC_EVENT_PHASE_OFFSET_NS := 2000000
252SF_VSYNC_EVENT_PHASE_OFFSET_NS := 6000000
253
254# Display
255TARGET_HAS_WIDE_COLOR_DISPLAY := true
256TARGET_HAS_HDR_DISPLAY := true
257TARGET_USES_DISPLAY_RENDER_INTENTS := true
258TARGET_USES_COLOR_METADATA := true
259TARGET_USES_DRM_PP := true
260
261# Vendor Interface Manifest
262DEVICE_MANIFEST_FILE := device/google/crosshatch/manifest.xml
263DEVICE_MATRIX_FILE := device/google/crosshatch/compatibility_matrix.xml
264DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := device/google/crosshatch/device_framework_matrix.xml
265
266# Userdebug only Vendor Interface Manifest
267ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
268DEVICE_FRAMEWORK_MANIFEST_FILE += device/google/crosshatch/framework_manifest_userdebug.xml
269DEVICE_MATRIX_FILE += device/google/crosshatch/compatibility_matrix_userdebug.xml
270endif
271
272ODM_MANIFEST_SKUS += \
273    G013A \
274    G013B \
275    G013C \
276    G013D \
277
278ODM_MANIFEST_G013A_FILES := device/google/crosshatch/nfc/manifest_se_SIM1.xml
279ODM_MANIFEST_G013B_FILES := device/google/crosshatch/nfc/manifest_se_eSE1.xml
280ODM_MANIFEST_G013C_FILES := device/google/crosshatch/nfc/manifest_se_SIM1.xml
281ODM_MANIFEST_G013D_FILES := device/google/crosshatch/nfc/manifest_se_eSE1.xml
282
283# Use mke2fs to create ext4 images
284TARGET_USES_MKE2FS := true
285
286# Kernel modules
287ifeq (,$(filter-out blueline_kasan crosshatch_kasan, $(TARGET_PRODUCT)))
288BOARD_VENDOR_KERNEL_MODULES += \
289    $(wildcard device/google/crosshatch-kernel/kasan/*.ko)
290else ifeq (,$(filter-out blueline_kernel_debug_memory crosshatch_kernel_debug_memory, $(TARGET_PRODUCT)))
291BOARD_VENDOR_KERNEL_MODULES += \
292    $(wildcard device/google/crosshatch-kernel/debug_memory/*.ko)
293else ifeq (,$(filter-out blueline_kernel_debug_locking crosshatch_kernel_debug_locking, $(TARGET_PRODUCT)))
294BOARD_VENDOR_KERNEL_MODULES += \
295    $(wildcard device/google/crosshatch-kernel/debug_locking/*.ko)
296else ifeq (,$(filter-out blueline_kernel_debug_hang crosshatch_kernel_debug_hang, $(TARGET_PRODUCT)))
297BOARD_VENDOR_KERNEL_MODULES += \
298    $(wildcard device/google/crosshatch-kernel/debug_hang/*.ko)
299else ifeq (,$(filter-out blueline_kernel_debug_api crosshatch_kernel_debug_api, $(TARGET_PRODUCT)))
300BOARD_VENDOR_KERNEL_MODULES += \
301    $(wildcard device/google/crosshatch-kernel/debug_api/*.ko)
302else ifneq (,$(TARGET_PREBUILT_KERNEL))
303    # If TARGET_PREBUILT_KERNEL is set, check whether there are modules packaged with that kernel
304    # image. If so, use them, otherwise fall back to the default directory.
305    TARGET_PREBUILT_KERNEL_PREBUILT_VENDOR_KERNEL_MODULES := \
306        $(wildcard $(dir $(TARGET_PREBUILT_KERNEL))/*.ko)
307    ifneq (,$(TARGET_PREBUILT_KERNEL_PREBUILT_VENDOR_KERNEL_MODULES))
308        BOARD_VENDOR_KERNEL_MODULES += $(TARGET_PREBUILT_KERNEL_PREBUILT_VENDOR_KERNEL_MODULES)
309    else
310        BOARD_VENDOR_KERNEL_MODULES += $(wildcard device/google/crosshatch-kernel/*.ko)
311    endif
312    # Do NOT delete TARGET_PREBUILT..., it will lead to empty BOARD_VENDOR_KERNEL_MODULES.
313else
314BOARD_VENDOR_KERNEL_MODULES += \
315    $(wildcard device/google/crosshatch-kernel/*.ko)
316endif
317
318# DTB
319ifeq (,$(filter-out blueline_kasan crosshatch_kasan, $(TARGET_PRODUCT)))
320BOARD_PREBUILT_DTBIMAGE_DIR := device/google/crosshatch-kernel/kasan
321else ifeq (,$(filter-out blueline_kernel_debug_memory crosshatch_kernel_debug_memory, $(TARGET_PRODUCT)))
322BOARD_PREBUILT_DTBIMAGE_DIR := device/google/crosshatch-kernel/debug_memory
323else ifeq (,$(filter-out blueline_kernel_debug_locking crosshatch_kernel_debug_locking, $(TARGET_PRODUCT)))
324BOARD_PREBUILT_DTBIMAGE_DIR := device/google/crosshatch-kernel/debug_locking
325else ifeq (,$(filter-out blueline_kernel_debug_hang crosshatch_kernel_debug_hang, $(TARGET_PRODUCT)))
326BOARD_PREBUILT_DTBIMAGE_DIR := device/google/crosshatch-kernel/debug_hang
327else ifeq (,$(filter-out blueline_kernel_debug_api crosshatch_kernel_debug_api, $(TARGET_PRODUCT)))
328BOARD_PREBUILT_DTBIMAGE_DIR := device/google/crosshatch-kernel/debug_api
329else ifneq (,$(TARGET_PREBUILT_KERNEL))
330    # If TARGET_PREBUILT_KERNEL is set, check whether there are dtb files packaged with that kernel
331    # image. If so, use them, otherwise fall back to the default directory.
332    PREBUILT_PREBUILT_DTBIMAGE_DIR := $(wildcard $(dir $(TARGET_PREBUILT_KERNEL))/*.dtb)
333    ifneq (,$(PREBUILT_PREBUILT_DTBIMAGE_DIR)
334        BOARD_PREBUILT_DTBIMAGE_DIR := $(dir $(TARGET_PREBUILT_KERNEL))
335    else
336        BOARD_PREBUILT_DTBIMAGE_DIR += device/google/crosshatch-kernel
337    endif
338    PREBUILT_VENDOR_KERNEL_MODULES :=
339else
340BOARD_PREBUILT_DTBIMAGE_DIR := device/google/crosshatch-kernel
341endif
342
343# Testing related defines
344BOARD_PERFSETUP_SCRIPT := platform_testing/scripts/perf-setup/b1c1-setup.sh
345-include vendor/google_devices/crosshatch/proprietary/BoardConfigVendor.mk
346