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 := msmnile
20TARGET_BOARD_INFO_FILE := device/google/coral/board-info.txt
21USES_DEVICE_GOOGLE_CORAL := 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 := cortex-a76
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 := cortex-a76
36
37TARGET_BOARD_COMMON_PATH := device/google/coral/sm8150
38
39BOARD_KERNEL_CMDLINE += console=ttyMSM0,115200n8 androidboot.console=ttyMSM0 printk.devkmsg=on
40BOARD_KERNEL_CMDLINE += msm_rtb.filter=0x237
41BOARD_KERNEL_CMDLINE += ehci-hcd.park=3
42BOARD_KERNEL_CMDLINE += service_locator.enable=1
43BOARD_KERNEL_CMDLINE += androidboot.memcg=1 cgroup.memory=nokmem
44BOARD_KERNEL_CMDLINE += usbcore.autosuspend=7
45BOARD_KERNEL_CMDLINE += androidboot.usbcontroller=a600000.dwc3 swiotlb=2048
46BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc/1d84000.ufshc
47
48BOARD_KERNEL_BASE        := 0x00000000
49BOARD_KERNEL_PAGESIZE    := 4096
50
51BOARD_INCLUDE_DTB_IN_BOOTIMG := true
52BOARD_BOOT_HEADER_VERSION := 2
53BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)
54
55# DTBO partition definitions
56BOARD_PREBUILT_DTBOIMAGE := device/google/coral-kernel/dtbo.img
57BOARD_DTBOIMG_PARTITION_SIZE := 8388608
58
59TARGET_NO_KERNEL := false
60BOARD_USES_RECOVERY_AS_BOOT := true
61BOARD_USES_METADATA_PARTITION := true
62
63AB_OTA_UPDATER := true
64
65AB_OTA_PARTITIONS += \
66    boot \
67    system \
68    vbmeta \
69    dtbo \
70    product \
71    system_ext \
72    vbmeta_system
73
74# Partitions (listed in the file) to be wiped under recovery.
75TARGET_RECOVERY_WIPE := device/google/coral/recovery.wipe
76TARGET_RECOVERY_FSTAB := device/google/coral/fstab.hardware
77TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888
78TARGET_RECOVERY_UI_LIB := \
79    librecovery_ui_pixel \
80    libfstab
81
82# Enable chain partition for system.
83BOARD_AVB_VBMETA_SYSTEM := system system_ext
84BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
85BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048
86BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
87BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 1
88
89# product.img
90BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
91
92# system_ext.img
93BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
94
95# userdata.img
96TARGET_USERIMAGES_USE_F2FS := true
97BOARD_USERDATAIMAGE_PARTITION_SIZE := 10737418240
98BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
99
100# persist.img
101BOARD_PERSISTIMAGE_PARTITION_SIZE := 33554432
102BOARD_PERSISTIMAGE_FILE_SYSTEM_TYPE := ext4
103
104# boot.img
105BOARD_BOOTIMAGE_PARTITION_SIZE := 0x04000000
106
107BOARD_FLASH_BLOCK_SIZE := 131072
108
109BOARD_ROOT_EXTRA_SYMLINKS := /vendor/lib/dsp:/dsp
110BOARD_ROOT_EXTRA_SYMLINKS += /mnt/vendor/persist:/persist
111
112include device/google/coral-sepolicy/coral-sepolicy.mk
113
114TARGET_FS_CONFIG_GEN := device/google/coral/config.fs
115
116QCOM_BOARD_PLATFORMS += msmnile
117QC_PROP_ROOT := vendor/qcom/sm8150/proprietary
118QC_PROP_PATH := $(QC_PROP_ROOT)
119BOARD_HAVE_BLUETOOTH_QCOM := true
120BOARD_HAVE_QCOM_FM := false
121BOARD_USES_COMMON_BLUETOOTH_HAL := true
122
123# Camera
124TARGET_USES_AOSP := true
125BOARD_QTI_CAMERA_32BIT_ONLY := false
126CAMERA_DAEMON_NOT_PRESENT := true
127TARGET_USES_ION := true
128
129# GPS
130TARGET_NO_RPC := true
131TARGET_USES_HARDWARE_QCOM_GPS := false
132BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default
133BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET := true
134
135# RenderScript
136OVERRIDE_RS_DRIVER := libRSDriver_adreno.so
137
138# Sensors
139USE_SENSOR_MULTI_HAL := true
140TARGET_SUPPORT_DIRECT_REPORT := true
141# Enable sensor Version V_2
142USE_SENSOR_HAL_VER := 2.0
143
144# wlan
145BOARD_WLAN_DEVICE := qcwcn
146BOARD_WPA_SUPPLICANT_DRIVER := NL80211
147BOARD_HOSTAPD_DRIVER := NL80211
148WIFI_DRIVER_DEFAULT := qca_cld3
149WPA_SUPPLICANT_VERSION := VER_0_8_X
150BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
151BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
152WIFI_HIDL_FEATURE_AWARE := true
153WIFI_HIDL_FEATURE_DUAL_INTERFACE:= true
154
155# Audio
156BOARD_USES_ALSA_AUDIO := true
157AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
158AUDIO_FEATURE_ENABLED_SND_MONITOR := true
159AUDIO_FEATURE_ENABLED_USB_TUNNEL := true
160AUDIO_FEATURE_ENABLED_CIRRUS_SPKR_PROTECTION := true
161AUDIO_FEATURE_CONFIG_CIRRUS_RX_CHANNELS := 4
162BOARD_SUPPORTS_SOUND_TRIGGER := true
163AUDIO_FEATURE_FLICKER_SENSOR_INPUT := true
164SOUND_TRIGGER_FEATURE_LPMA_ENABLED := true
165AUDIO_FEATURE_ENABLED_MAXX_AUDIO := true
166AUDIO_FEATURE_ENABLED_24BITS_CAMCORDER := true
167AUDIO_FEATURE_ENABLED_AUDIO_ZOOM := true
168AUDIO_FEATURE_ENABLED_INSTANCE_ID := true
169
170# Audio hal flag
171TARGET_USES_HARDWARE_QCOM_AUDIO := true
172TARGET_USES_HARDWARE_QCOM_AUDIO_PLATFORM_8974 := true
173TARGET_USES_HARDWARE_QCOM_AUDIO_POSTPROC := true
174TARGET_USES_HARDWARE_QCOM_AUDIO_VOLUME_LISTENER := true
175TARGET_USES_HARDWARE_QCOM_AUDIO_GET_MMAP_DATA_FD := true
176TARGET_USES_HARDWARE_QCOM_AUDIO_APP_TYPE_CFG := true
177TARGET_USES_HARDWARE_QCOM_AUDIO_ACDB_INIT_V2_CVD := true
178TARGET_USES_HARDWARE_QCOM_AUDIO_MAX_TARGET_SPECIFIC_CHANNEL_CNT := "4"
179TARGET_USES_HARDWARE_QCOM_AUDIO_INCALL_MUSIC_ENABLED := true
180TARGET_USES_HARDWARE_QCOM_AUDIO_MULTIPLE_HW_VARIANTS_ENABLED := true
181TARGET_USES_HARDWARE_QCOM_AUDIO_INCALL_STEREO_CAPTURE_ENABLED := true
182
183# SoundTrigger hal flag of new codec
184USE_SOUND_TRIGGER_HAL := iaxxx
185
186# Graphics
187TARGET_USES_GRALLOC1 := true
188TARGET_USES_HWC2 := true
189
190VSYNC_EVENT_PHASE_OFFSET_NS := 2000000
191SF_VSYNC_EVENT_PHASE_OFFSET_NS := 6000000
192
193# Display
194TARGET_USES_DISPLAY_RENDER_INTENTS := true
195TARGET_USES_COLOR_METADATA := true
196TARGET_USES_DRM_PP := true
197TARGET_HAS_WIDE_COLOR_DISPLAY := true
198TARGET_HAS_HDR_DISPLAY := true
199
200# Vendor Interface Manifest
201DEVICE_MANIFEST_FILE := device/google/coral/manifest.xml
202DEVICE_MATRIX_FILE := device/google/coral/compatibility_matrix.xml
203DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := device/google/coral/device_framework_matrix.xml
204
205# Use mke2fs to create ext4 images
206TARGET_USES_MKE2FS := true
207
208# Kernel modules
209ifeq (,$(filter-out flame_kasan coral_kasan, $(TARGET_PRODUCT)))
210BOARD_VENDOR_KERNEL_MODULES += \
211    $(wildcard device/google/coral-kernel/kasan/*.ko)
212else ifeq (,$(filter-out flame_kernel_debug_memory coral_kernel_debug_memory, $(TARGET_PRODUCT)))
213BOARD_VENDOR_KERNEL_MODULES += \
214    $(wildcard device/google/coral-kernel/debug_memory/*.ko)
215else ifeq (,$(filter-out flame_kernel_debug_locking coral_kernel_debug_locking, $(TARGET_PRODUCT)))
216BOARD_VENDOR_KERNEL_MODULES += \
217    $(wildcard device/google/coral-kernel/debug_locking/*.ko)
218else ifeq (,$(filter-out flame_kernel_debug_hang coral_kernel_debug_hang, $(TARGET_PRODUCT)))
219BOARD_VENDOR_KERNEL_MODULES += \
220    $(wildcard device/google/coral-kernel/debug_hang/*.ko)
221else ifeq (,$(filter-out flame_kernel_debug_api coral_kernel_debug_api, $(TARGET_PRODUCT)))
222BOARD_VENDOR_KERNEL_MODULES += \
223    $(wildcard device/google/coral-kernel/debug_api/*.ko)
224else
225BOARD_VENDOR_KERNEL_MODULES += \
226    $(wildcard device/google/coral-kernel/*.ko)
227endif
228
229BOARD_SUPER_PARTITION_SIZE := 9755951104
230BOARD_SUPER_PARTITION_GROUPS := google_dynamic_partitions
231BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST := \
232    system \
233    vendor \
234    product \
235    system_ext
236
237#BOARD_GOOGLE_DYNAMIC_PARTITIONS_SIZE is set to BOARD_SUPER_PARTITION_SIZE / 2 - 4MB
238BOARD_GOOGLE_DYNAMIC_PARTITIONS_SIZE := 4873781248
239
240# Set error limit to BOARD_SUPER_PARTITON_SIZE - 500MB
241BOARD_SUPER_PARTITION_ERROR_LIMIT := 9231663104
242
243# DTB
244ifeq (,$(filter-out coral_kasan flame_kasan, $(TARGET_PRODUCT)))
245BOARD_PREBUILT_DTBIMAGE_DIR := device/google/coral-kernel/kasan
246else ifeq (,$(filter-out flame_kernel_debug_memory coral_kernel_debug_memory, $(TARGET_PRODUCT)))
247BOARD_PREBUILT_DTBIMAGE_DIR := device/google/coral-kernel/debug_memory
248else ifeq (,$(filter-out flame_kernel_debug_locking coral_kernel_debug_locking, $(TARGET_PRODUCT)))
249BOARD_PREBUILT_DTBIMAGE_DIR := device/google/coral-kernel/debug_locking
250else ifeq (,$(filter-out flame_kernel_debug_hang coral_kernel_debug_hang, $(TARGET_PRODUCT)))
251BOARD_PREBUILT_DTBIMAGE_DIR := device/google/coral-kernel/debug_hang
252else ifeq (,$(filter-out flame_kernel_debug_api coral_kernel_debug_api, $(TARGET_PRODUCT)))
253BOARD_PREBUILT_DTBIMAGE_DIR := device/google/coral-kernel/debug_api
254else
255BOARD_PREBUILT_DTBIMAGE_DIR := device/google/coral-kernel
256endif
257
258# Testing related defines
259BOARD_PERFSETUP_SCRIPT := platform_testing/scripts/perf-setup/c2f2-setup.sh
260
261-include vendor/google_devices/coral/proprietary/BoardConfigVendor.mk
262