1# 2# Copyright 2020 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 17# 18# arm64 target for Trout 19# 20 21TARGET_BOARD_PLATFORM := vsoc_arm64 22TARGET_ARCH := arm64 23TARGET_ARCH_VARIANT := armv8-a 24TARGET_CPU_ABI := arm64-v8a 25TARGET_CPU_VARIANT := cortex-a53 26 27AUDIOSERVER_MULTILIB := first 28 29HOST_CROSS_OS := linux_musl 30HOST_CROSS_ARCH := arm64 31HOST_CROSS_2ND_ARCH := 32 33# Android Bluetooth stack configuration 34LOCAL_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR ?= device/google/trout/product_files/bluetooth 35BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(LOCAL_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR) 36 37# Enable sparse on all filesystem images 38TARGET_USERIMAGES_SPARSE_EROFS_DISABLED ?= false 39TARGET_USERIMAGES_SPARSE_EXT_DISABLED ?= false 40TARGET_USERIMAGES_SPARSE_F2FS_DISABLED ?= false 41 42# 43# arm64 target for Trout 44# 45ifndef TARGET_BOOTLOADER_BOARD_NAME 46TARGET_BOOTLOADER_BOARD_NAME := trout 47endif 48 49BOARD_BOOT_HEADER_VERSION := 4 50 51# Kernel - prefer version 6.1 by default for trout 52TARGET_KERNEL_USE ?= 6.1 53 54# Select the prebuilt trout kernel if 5.10 or 5.4 is in use 55TROUT_KERNEL_DIR ?= $(wildcard device/google/trout-kernel/$(TARGET_KERNEL_USE)-arm64) 56 57TARGET_BOARD_PLATFORM := vsoc_arm64 58TARGET_ARCH := arm64 59TARGET_ARCH_VARIANT := armv8-a 60TARGET_CPU_ABI := arm64-v8a 61TARGET_CPU_VARIANT := cortex-a53 62 63ifneq ($(TROUT_KERNEL_DIR),) 64KERNEL_MODULES_PATH ?= $(TROUT_KERNEL_DIR) 65TARGET_KERNEL_PATH ?= $(TROUT_KERNEL_DIR)/Image 66 67# For local builds of the android12-5.10 kernel, this directory doesn't exist. 68# The system_dlkm partition won't have any kernel modules in it, which matches 69# how this kernel was originally used. 70# 71# For prebuilts of the android12-5.10 kernel, the result is the same. 72# 73# For local builds of the android14-6.1 kernel and later, this directory should 74# be created by extracting the system_dlkm_staging_archive.tar.gz file in the 75# build directory of the kernel before building the android image. 76# 77# For prebuilts of the android14-6.1 kernel and later, TROUT_KERNEL_DIR should 78# not be specified, in which case it will follow whatever the upstream 79# cuttlefish device specifies. 80SYSTEM_DLKM_SRC ?= $(TROUT_KERNEL_DIR)/flatten/lib/modules 81endif 82 83# The list of modules strictly/only required either to reach second stage 84# init, OR for recovery. Do not use this list to workaround second stage 85# issues. 86# 87# virtio_blk.ko, virtio_console.ko, virtio_pci.ko, vmw_vsock_virtio_transport.ko 88# are already added by cuttlefish/shared/BoardConfig.mk. Adding them causes 89# duplicate definition errors with kernel 6.6 prebuilt drops since Nov 2024 90# See: b/379929054. 91RAMDISK_KERNEL_MODULES ?= \ 92 failover.ko \ 93 nd_virtio.ko \ 94 net_failover.ko \ 95 virtio_dma_buf.ko \ 96 virtio-gpu.ko \ 97 virtio_input.ko \ 98 virtio_net.ko \ 99 virtio_mmio.ko \ 100 virtio-rng.ko \ 101 102-include device/google/trout/shared/BoardConfig.mk 103 104AUDIOSERVER_MULTILIB := first 105 106HOST_CROSS_OS := linux_musl 107HOST_CROSS_ARCH := arm64 108HOST_CROSS_2ND_ARCH := 109 110# Turn off AVB so that trout can boot 111BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flag 2 112BOARD_KERNEL_CMDLINE += androidboot.verifiedbootstate=orange 113 114# Set SELinux to permissive mode for trout 115BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive 116BOARD_KERNEL_CMDLINE += enforcing=0 117 118# Declare trout as a Cuttlefish HW 119BOARD_KERNEL_CMDLINE += androidboot.hardware=cutf_cvm 120BOARD_KERNEL_CMDLINE += androidboot.serialno=CUTTLEFISHCVD01 121BOARD_KERNEL_CMDLINE += androidboot.cf_devcfg=1 122 123# Set GPU properties 124BOARD_KERNEL_CMDLINE += androidboot.cpuvulkan.version=0 125BOARD_KERNEL_CMDLINE += androidboot.hardware.gralloc=minigbm 126BOARD_KERNEL_CMDLINE += androidboot.hardware.hwcomposer=ranchu 127BOARD_KERNEL_CMDLINE += androidboot.hardware.egl=emulation 128BOARD_KERNEL_CMDLINE += androidboot.hardware.hwcomposer.mode=client 129BOARD_KERNEL_CMDLINE += androidboot.hardware.hwcomposer.display_finder_mode=drm 130BOARD_KERNEL_CMDLINE += androidboot.lcd_density=160 131 132# Add WiFi configuration for VirtWifi network 133BOARD_KERNEL_CMDLINE += androidboot.wifi_mac_prefix=5554 134 135# Add default fstab settings 136BOARD_KERNEL_CMDLINE += androidboot.fstab_name=fstab androidboot.fstab_suffix=trout 137 138# Prevent mac80211_hwsim from simulating any radios 139BOARD_KERNEL_CMDLINE += mac80211_hwsim.radios=0 140