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
18include build/make/target/board/BoardConfigPixelCommon.mk
19
20TARGET_BOARD_PLATFORM := sm6150
21TARGET_BOARD_INFO_FILE := device/google/sunfish/board-info.txt
22USES_DEVICE_GOOGLE_SUNFISH := true
23
24TARGET_ARCH := arm64
25TARGET_ARCH_VARIANT := armv8-a
26TARGET_CPU_ABI := arm64-v8a
27TARGET_CPU_ABI2 :=
28TARGET_CPU_VARIANT := generic
29TARGET_CPU_VARIANT_RUNTIME := cortex-a76
30
31TARGET_2ND_ARCH := arm
32TARGET_2ND_ARCH_VARIANT := armv8-a
33TARGET_2ND_CPU_ABI := armeabi-v7a
34TARGET_2ND_CPU_ABI2 := armeabi
35TARGET_2ND_CPU_VARIANT := generic
36TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a76
37
38BUILD_BROKEN_DUP_RULES := true
39BUILD_BROKEN_USES_BUILD_COPY_HEADERS := true
40# GOOGLE: workaround for https://android-review.googlesource.com/c/platform/system/sepolicy/+/1532995
41BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE := true
42
43TARGET_BOARD_COMMON_PATH := device/google/sunfish/sm7150
44
45BOARD_KERNEL_CMDLINE += console=ttyMSM0,115200n8 androidboot.console=ttyMSM0 printk.devkmsg=on
46BOARD_KERNEL_CMDLINE += msm_rtb.filter=0x237
47BOARD_KERNEL_CMDLINE += ehci-hcd.park=3
48BOARD_KERNEL_CMDLINE += service_locator.enable=1
49BOARD_KERNEL_CMDLINE += androidboot.memcg=1 cgroup.memory=nokmem
50BOARD_KERNEL_CMDLINE += lpm_levels.sleep_disabled=1 #STOPSHIP
51BOARD_KERNEL_CMDLINE += usbcore.autosuspend=7
52BOARD_KERNEL_CMDLINE += loop.max_part=7
53BOARD_KERNEL_CMDLINE += loop.hw_queue_depth=31
54BOARD_KERNEL_CMDLINE += androidboot.usbcontroller=a600000.dwc3 swiotlb=1
55BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc/1d84000.ufshc
56BOARD_KERNEL_CMDLINE += cgroup_disable=pressure
57
58#BOARD_KERNEL_CMDLINE += video=vfb:640x400,bpp=32,memsize=3072000 service_locator.enable=1 earlycon=msm_geni_serial,0x880000
59
60BOARD_KERNEL_BASE        := 0x00000000
61BOARD_KERNEL_PAGESIZE    := 4096
62BOARD_KERNEL_TAGS_OFFSET := 0x01E00000
63BOARD_RAMDISK_OFFSET     := 0x02000000
64
65BOARD_INCLUDE_DTB_IN_BOOTIMG := true
66BOARD_BOOT_HEADER_VERSION := 2
67BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)
68
69# DTBO partition definitions
70BOARD_PREBUILT_DTBOIMAGE := device/google/sunfish-kernel/dtbo.img
71BOARD_DTBOIMG_PARTITION_SIZE := 8388608
72
73TARGET_NO_KERNEL := false
74BOARD_USES_RECOVERY_AS_BOOT := true
75BOARD_USES_METADATA_PARTITION := true
76
77AB_OTA_UPDATER := true
78
79AB_OTA_PARTITIONS += \
80     boot \
81     system \
82     vbmeta \
83     dtbo \
84     product \
85     system_ext \
86     vbmeta_system
87
88# Partitions (listed in the file) to be wiped under recovery.
89TARGET_RECOVERY_WIPE := device/google/sunfish/recovery.wipe
90TARGET_RECOVERY_FSTAB := device/google/sunfish/fstab.hardware
91TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888
92TARGET_RECOVERY_UI_LIB := \
93    librecovery_ui_pixel \
94    libfstab
95
96# Enable chain partition for system.
97BOARD_AVB_VBMETA_SYSTEM := system system_ext product
98BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
99BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048
100BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
101BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 1
102
103# product.img
104BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
105
106# system_ext.img
107BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
108
109# userdata.img
110TARGET_USERIMAGES_USE_F2FS := true
111BOARD_USERDATAIMAGE_PARTITION_SIZE := 10737418240
112BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
113
114# persist.img
115BOARD_PERSISTIMAGE_PARTITION_SIZE := 33554432
116BOARD_PERSISTIMAGE_FILE_SYSTEM_TYPE := ext4
117
118# boot.img
119BOARD_BOOTIMAGE_PARTITION_SIZE := 0x04000000
120
121BOARD_FLASH_BLOCK_SIZE := 131072
122
123BOARD_ROOT_EXTRA_SYMLINKS := /vendor/dsp:/dsp
124BOARD_ROOT_EXTRA_SYMLINKS += /mnt/vendor/persist:/persist
125
126include device/google/sunfish-sepolicy/sunfish-sepolicy.mk
127
128TARGET_FS_CONFIG_GEN := device/google/sunfish/config.fs
129
130QCOM_BOARD_PLATFORMS += sm6150
131MSMSTEPPE = sm6150
132QC_PROP_ROOT := vendor/qcom/sm8150/proprietary
133QC_PROP_PATH := $(QC_PROP_ROOT)
134BOARD_HAVE_BLUETOOTH_QCOM := true
135BOARD_HAVE_QCOM_FM := false
136TARGET_USE_QTI_BT_SAR := true
137TARGET_USE_QTI_BT_CHANNEL_AVOIDANCE := true
138BOARD_USES_COMMON_BLUETOOTH_HAL := true
139
140# Camera
141TARGET_USES_AOSP := true
142BOARD_QTI_CAMERA_32BIT_ONLY := false
143CAMERA_DAEMON_NOT_PRESENT := true
144TARGET_USES_ION := true
145
146# GPS
147TARGET_NO_RPC := true
148TARGET_USES_HARDWARE_QCOM_GPS := false
149BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default
150BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET := true
151
152# RenderScript
153OVERRIDE_RS_DRIVER := libRSDriver_adreno.so
154
155# Sensors
156USE_SENSOR_MULTI_HAL := true
157TARGET_SUPPORT_DIRECT_REPORT := true
158# Enable sensor Version V_2
159USE_SENSOR_HAL_VER := 2.0
160
161# CHRE
162CHRE_DAEMON_ENABLED := true
163CHRE_DAEMON_LPMA_ENABLED := true
164CHRE_DAEMON_LOAD_INTO_SENSORSPD := true
165
166# wlan
167BOARD_WLAN_DEVICE := qcwcn
168BOARD_WPA_SUPPLICANT_DRIVER := NL80211
169BOARD_HOSTAPD_DRIVER := NL80211
170WIFI_DRIVER_DEFAULT := qca_cld3
171WPA_SUPPLICANT_VERSION := VER_0_8_X
172BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
173BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
174WIFI_HIDL_FEATURE_AWARE := true
175WIFI_HIDL_FEATURE_DUAL_INTERFACE:= true
176WIFI_FEATURE_WIFI_EXT_HAL := true
177WIFI_FEATURE_IMU_DETECTION := true
178WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true
179
180# Audio
181BOARD_USES_ALSA_AUDIO := true
182AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
183AUDIO_FEATURE_ENABLED_SND_MONITOR := true
184AUDIO_FEATURE_ENABLED_USB_TUNNEL := true
185BOARD_SUPPORTS_SOUND_TRIGGER := true
186AUDIO_FEATURE_FLICKER_SENSOR_INPUT := true
187AUDIO_FEATURE_ENABLED_MAXX_AUDIO := true
188BOARD_SUPPORTS_SOUND_TRIGGER_5514 := true
189AUDIO_FEATURE_ENABLED_24BITS_CAMCORDER := true
190AUDIO_FEATURE_ENABLED_INSTANCE_ID := true
191#Cirrus cs35l41 speaker amp
192AUDIO_FEATURE_ENABLED_CS35L41 := true
193AUDIO_FEATURE_ENABLED_CS35L41_CALIBRATION_TOOL := true
194
195# Graphics
196TARGET_USES_GRALLOC1 := true
197TARGET_USES_HWC2 := true
198TARGET_USES_NV21_CAMERA_PREVIEW := true
199
200# Display
201TARGET_HAS_WIDE_COLOR_DISPLAY := true
202TARGET_HAS_HDR_DISPLAY := true
203TARGET_USES_DISPLAY_RENDER_INTENTS := true
204TARGET_USES_COLOR_METADATA := true
205TARGET_USES_DRM_PP := true
206
207# Vendor Interface Manifest
208DEVICE_MANIFEST_FILE := device/google/sunfish/manifest.xml
209DEVICE_MATRIX_FILE := device/google/sunfish/compatibility_matrix.xml
210# Install product specific framework compatibility matrix
211# (TODO: b/169535506) This includes the FCM for system_ext and product partition.
212# It must be split into the FCM of each partition.
213DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/sunfish/device_framework_matrix_product.xml
214
215# Use mke2fs to create ext4 images
216TARGET_USES_MKE2FS := true
217
218# Kernel modules
219ifeq (,$(filter-out sunfish_kasan, $(TARGET_PRODUCT)))
220BOARD_VENDOR_KERNEL_MODULES += \
221    $(wildcard device/google/sunfish-kernel/kasan/*.ko)
222else ifeq (,$(filter-out sunfish_kernel_debug_memory, $(TARGET_PRODUCT)))
223BOARD_VENDOR_KERNEL_MODULES += \
224    $(wildcard device/google/sunfish-kernel/debug_memory/*.ko)
225else ifeq (,$(filter-out sunfish_kernel_debug_memory_accounting, $(TARGET_PRODUCT)))
226BOARD_VENDOR_KERNEL_MODULES += \
227    $(wildcard device/google/sunfish-kernel/debug_memory_accounting/*.ko)
228BOARD_KERNEL_CMDLINE += page_owner=on
229else ifeq (,$(filter-out sunfish_kernel_debug_locking, $(TARGET_PRODUCT)))
230BOARD_VENDOR_KERNEL_MODULES += \
231    $(wildcard device/google/sunfish-kernel/debug_locking/*.ko)
232else ifeq (,$(filter-out sunfish_kernel_debug_hang, $(TARGET_PRODUCT)))
233BOARD_VENDOR_KERNEL_MODULES += \
234    $(wildcard device/google/sunfish-kernel/debug_hang/*.ko)
235else ifeq (,$(filter-out sunfish_kernel_debug_api, $(TARGET_PRODUCT)))
236BOARD_VENDOR_KERNEL_MODULES += \
237    $(wildcard device/google/sunfish-kernel/debug_api/*.ko)
238else
239BOARD_VENDOR_KERNEL_MODULES += \
240    $(wildcard device/google/sunfish-kernel/*.ko)
241endif
242
243# dynamic partition
244BOARD_SUPER_PARTITION_SIZE := 9755951104
245BOARD_SUPER_PARTITION_GROUPS := google_dynamic_partitions
246BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST := \
247    system \
248    vendor \
249    product \
250    system_ext
251
252#BOARD_GOOGLE_DYNAMIC_PARTITIONS_SIZE is set to BOARD_SUPER_PARTITION_SIZE / 2 - 4MB
253BOARD_GOOGLE_DYNAMIC_PARTITIONS_SIZE := 4873781248
254
255# Set error limit to BOARD_SUPER_PARTITON_SIZE - 500MB
256BOARD_SUPER_PARTITION_ERROR_LIMIT := 9231663104
257
258# DTB
259ifeq (,$(filter-out sunfish_kasan, $(TARGET_PRODUCT)))
260BOARD_PREBUILT_DTBIMAGE_DIR := device/google/sunfish-kernel/kasan
261else ifeq (,$(filter-out sunfish_kernel_debug_memory, $(TARGET_PRODUCT)))
262BOARD_PREBUILT_DTBIMAGE_DIR := device/google/sunfish-kernel/debug_memory
263else ifeq (,$(filter-out sunfish_kernel_debug_memory_accounting, $(TARGET_PRODUCT)))
264BOARD_PREBUILT_DTBIMAGE_DIR := device/google/sunfish-kernel/debug_memory_accounting
265else ifeq (,$(filter-out sunfish_kernel_debug_locking, $(TARGET_PRODUCT)))
266BOARD_PREBUILT_DTBIMAGE_DIR := device/google/sunfish-kernel/debug_locking
267else ifeq (,$(filter-out sunfish_kernel_debug_hang, $(TARGET_PRODUCT)))
268BOARD_PREBUILT_DTBIMAGE_DIR := device/google/sunfish-kernel/debug_hang
269else ifeq (,$(filter-out sunfish_kernel_debug_api, $(TARGET_PRODUCT)))
270BOARD_PREBUILT_DTBIMAGE_DIR := device/google/sunfish-kernel/debug_api
271else
272BOARD_PREBUILT_DTBIMAGE_DIR := device/google/sunfish-kernel
273endif
274
275# Testing related defines
276#BOARD_PERFSETUP_SCRIPT := platform_testing/scripts/perf-setup/s5-setup.sh
277
278-include vendor/google_devices/sunfish/proprietary/BoardConfigVendor.mk
279