#@TYPE: Machine
#@NAME: sdmsteppe
#@DESCRIPTION: Machine configuration for QTI sdmsteppe 32bit

require  ${COREBASE}/meta-qti-bsp/conf/machine/sdm-generic32.conf

# Pull in security flags
require ${COREBASE}/meta-qti-bsp/conf/distro/include/security_flags.inc

SOC_FAMILY = "sdm670"

BASEMACHINE = "sdmsteppe"

DEFAULTTUNE = "armv7ahf-neon"

PREFERRED_PROVIDER_virtual/kernel = "linux-msm"
PREFERRED_VERSION_linux-msm = "4.14"
PREFERRED_VERSION_libdrm = "2.4.83"

# Kernel to build for a different arch than default tune
TARGET_KERNEL_ARCH = "aarch64"

KERNEL_DTS_NAME = "sm6150-qrd"
KERNEL_BASE = "0x80000000"
KERNEL_TAGS_OFFSET = "0x81E00000"
KERNEL_IMAGETYPE = "Image-dtb"
KERNEL_CONFIG = "${@['vendor/sdmsteppe-perf_defconfig', 'vendor/sdmsteppe_defconfig'][d.getVar('VARIANT', True) == ('' or 'debug')]}"

# Defined 64bit multilib environment to setup toolchain to compile 64bit kernel
require conf/multilib.conf
MULTILIBS = "multilib:lib64"
DEFAULTTUNE_virtclass-multilib-lib64 = "aarch64"
TARGET_VENDOR_virtclass-multilib-lib64="-oe"

# Enable selinux
DISTRO_FEATURES:append = " selinux"
DEFAULT_ENFORCING = "enforcing"

#Enable verity feature
DISTRO_FEATURES += "dm-verity"

# enable audio as a loadable kernel module
DISTRO_FEATURES:append = " audio-dlkm"

# readonly-rootfs
DISTRO_FEATURES:append = " ro-rootfs"

# Support A/B partition scheme
DISTRO_FEATURES += "ab-boot-support"

# drm driver
MACHINE_FEATURES += "drm"

#Disable journalling for RO rootfs. Set the block size to 4096.
IMAGE_EXT4_EXTRA_OPTIONS = "${@bb.utils.contains('DISTRO_FEATURES','ro-rootfs',' -J -b 4096 ','',d)}"

QPERM_FILE_pn-start-script-ab-slot-util = "${bindir}/getslotsuffix:0:1000"
QPERM_FILE_pn-system-core = "${sysconfdir}/build.prop:5002:5002"
QPERM_FILE_pn-system-prop = "/build.prop:5002:5002"

# Userspace needs below given macro to support libion after kernel 4.12.
TARGET_CFLAGS:append = " -DTARGET_ION_ABI_VERSION=2 "
TARGET_CXXFLAGS:append = " -DTARGET_ION_ABI_VERSION=2 "

PREFERRED_PROVIDER_virtual/libgles1 = "adreno"
PREFERRED_PROVIDER_virtual/libgles2 = "adreno"
PREFERRED_PROVIDER_virtual/egl      = "adreno"
PREFERRED_PROVIDER_openssl          = "openssl10"
PREFERRED_VERSION_openssl10         = "1.0.2q"
PREFERRED_PROVIDER_openssl-native   = "openssl10-native"

MACHINE_MNT_POINTS = "/firmware /persist /cache /dsp /bt_firmware"

# Enable LE Verified Boot
DISTRO_FEATURES:append = " vble"

# Enable coredump
SYSTEMD_ENABLE_COREDUMP = "1"
SYSTEMD_COREDUMP_PATH = "${userfsdatadir}/coredump"

#Uncomment to Enable SNPE wrapper compilation
#DISTRO_FEATURES += "snpe-enable"

#Enable TFlite wrapper compilation
#DISTRO_FEATURES += "tflite-enable"

DISTRO_FEATURES  += "qti-audio"
MACHINE_FEATURES += "qti-audio"
DISTRO_FEATURES  += "qti-camerax"
DISTRO_FEATURES  += "qti-fastcv"
DISTRO_FEATURES  += "qmmf-wayland"
DISTRO_FEATURES  += "qti-qmmf-legacy"
DISTRO_FEATURES  += "qti-qmmf"
DISTRO_FEATURES  += "qti-video"
