#@TYPE: Machine
#@NAME: APQ8009 MTP
#@DESCRIPTION: Machine configuration for QTI MTP with APQ8009

require conf/machine/include/apq8009.inc

KERNEL_IMAGETYPE = "zImage-dtb"

KERNEL_DTS_NAME = "msm8909"
KERNEL_BASE = "0x81C00000"
KERNEL_TAGS_OFFSET = "0x81900000"

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


# setting mem=511M as the last MB is reserved for panic reporting
KERNEL_CMD_PARAMS = "noinitrd ro console=ttyHSL0,115200,n8 androidboot.hardware=qcom ehci-hcd.park=3 msm_rtb.filter=0x37 lpm_levels.sleep_disabled=1 rootwait androidboot.bootdevice=7824900.sdhci mem=511M"

# Use systemd init manager.
DISTRO_FEATURES +=  " systemd"
DISTRO_FEATURES +=  " ro-rootfs"
DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
VIRTUAL-RUNTIME_dev_manager = "udev"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES:remove = "sysvinit"

DISTRO_FEATURES += " usrmerge"

# Use avahi-daemon
DISTRO_FEATURES += " avahi"

#Enable the factory reset of data partition
DISTRO_FEATURES += " userfs-factory-reset "

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

# Change Image features for systemd.
IMAGE_DEV_MANAGER = "udev"
IMAGE_INIT_MANAGER = "systemd"
IMAGE_INITSCRIPTS = ""
LICENSE_FLAGS_ACCEPTED = "commercial_gstreamer1.0-omx commercial_libomxil commercial_gstreamer1.0-libav"

#UBINIZE Args
UBINIZE_ARGS ?= "-m 2048 -p 128KiB"
#MKUBIFS Args
MKUBIFS_ARGS ?= "-m 2048 -e 126976 -c 4096 -F -v"
#Volume sizes
#PERSIST UBI Args
MKUBIFS_PERSIST_ARGS ?= "-m 2048 -e 126976 -c 4096 -j 2MiB -F -v"

SYSTEM_VOLUME_SIZE ?= "800MiB"
CACHE_VOLUME_SIZE ?= "37MiB"
PERSIST_VOLUME_SIZE ?= "4MiB"
PAGE_SIZE = '2048'

# Enable conventional Yocto Wi-Fi tools
DISTRO_FEATURES += " wifi"

INITRAMFS_IMAGE = "core-image-anki-initramfs"
INITRAMFS_IMAGE_BUNDLE = "0"
