#@TYPE: Machine
#@NAME: SA515M
#@DESCRIPTION: Machine configuration for QTI sa515m

require conf/machine/include/sdxprairie.inc

KERNEL_IMAGETYPE = "zImage-dtb"
KERNEL_DTS_NAME = "sdxprairie"
KERNEL_BASE = "0x80000000"
KERNEL_TAGS_OFFSET = "0x82000000"
KERNEL_LOAD_ADDR = "0x85400000"

KERNEL_CONFIG = "${@['sa515m-perf_defconfig', 'sa515m_defconfig'][d.getVar('VARIANT', True) == ('' or 'debug')]}"

KERNEL_CMD_PARAMS = "ro rootwait console=ttyMSM0,115200,n8 androidboot.hardware=qcom msm_rtb.filter=0x237 androidboot.console=ttyMSM0 lpm_levels.sleep_disabled=1 firmware_class.path=/lib/firmware/updates service_locator.enable=1 net.ifnames=0"
KERNEL_CMD_PARAMS += "${@bb.utils.contains('DISTRO_FEATURES', 'nad-avb', 'nad_avb=1', '', d)}"
KERNEL_CMD_PARAMS += "${@bb.utils.contains('DISTRO_FEATURES', 'nad-fde', 'nad_fde=1 fde.system.0', '', d)}"
KERNEL_CMD_PARAMS:remove = "${@bb.utils.contains_any('VARIANT', 'perf user', 'console=ttyMSM0,115200,n8 androidboot.console=ttyMSM0', '', d)}"

BOOTIMAGE_TARGET = "${MACHINE}-boot.img"

LLVM_VERSION = "6.0"


# Volume sizes
SYSTEM_VOLUME_SIZE = "125MiB"
CACHE_VOLUME_SIZE = "15MiB"
SYSTEMRW_VOLUME_SIZE = "6MiB"
PERSIST_VOLUME_SIZE = "6MiB"

# Enable audio kernel
DISTRO_FEATURES += "audiodlkm audio-dlkm"

# Uncomment below lines to Enable flashless feature
# Add squashfs-xz filesystem needed
#DISTRO_FEATURES += "flashless"
#IMAGE_FSTYPES += "squashfs-xz"

RAMDISK = "${IMGDEPLOYDIR}/machine-image-${MACHINE}-flashless.squashfs-xz"
RAMDISK_OFFSET = "0x02200000"

MACHINE_MNT_POINTS = "/firmware /persist /cache"

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

# Enable rootfs_flashless
IMAGE_ROOTFS_FLASHLESS = "${UNPACKDIR}/rootfs_flashless"
USERDATAIMAGE_TARGET   = "${MACHINE}-usrfs.ext4"
SYSTEMRWIMAGE_TARGET   = "${MACHINE}-systemrw.ext4"
PERSISTIMAGE_TARGET    = "${MACHINE}-persist.ext4"

# Create different label for this machine
MAKEEXT4_USRDATA_LABEL_OPT = "-L mdm_userdata"
SYSTEMRW_LABEL             = "mdm_systemrw"
PERSIST_LABEL              = "mdm_persist"

# Size of ext4 (in bytes)
USERDATA_SIZE_EXT4 = "73400320"
SYSTEMRW_SIZE_EXT4 = "8808038"
PERSIST_SIZE_EXT4  = "4404019"

# Enable early USB init
DISTRO_FEATURES:append = " early-usb-init"

# Enable support for KM Multi userspace 
#DISTRO_FEATURES:append = " enable-kmlite-multi"

# Enable SDK feature
SDK_IMAGE = "1"

PREFERRED_VERSION_tcpdump = "4.9.2"
