DEFAULTTUNE ?= "cortexa5thf-neon"

require conf/machine/include/arm/arch-armv7a.inc

TUNEVALID[cortexa5] = "Enable Cortex-A5 specific processor optimizations"
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexa5', ' -mcpu=cortex-a5', '', d)}"
MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'cortexa5', 'armv7a:', '', d)}"

# Little Endian base configs
AVAILTUNES += "cortexa5 cortexa5t cortexa5-neon cortexa5t-neon cortexa5-neon-vfpv4 cortexa5t-neon-vfpv4"
ARMPKGARCH:tune-cortexa5             = "cortexa5"
ARMPKGARCH:tune-cortexa5t            = "cortexa5"
ARMPKGARCH:tune-cortexa5-neon        = "cortexa5"
ARMPKGARCH:tune-cortexa5t-neon       = "cortexa5"
ARMPKGARCH:tune-cortexa5-neon-vfpv4  = "cortexa5"
ARMPKGARCH:tune-cortexa5t-neon-vfpv4 = "cortexa5"
# mcpu is used so don't use armv7a as we don't want march
TUNE_FEATURES:tune-cortexa5             = "arm vfp cortexa5"
TUNE_FEATURES:tune-cortexa5t            = "${TUNE_FEATURES:tune-cortexa5} thumb"
TUNE_FEATURES:tune-cortexa5-neon        = "${TUNE_FEATURES:tune-cortexa5} neon"
TUNE_FEATURES:tune-cortexa5t-neon       = "${TUNE_FEATURES:tune-cortexa5-neon} thumb"
TUNE_FEATURES:tune-cortexa5-neon-vfpv4  = "${TUNE_FEATURES:tune-cortexa5-neon} vfpv4"
TUNE_FEATURES:tune-cortexa5t-neon-vfpv4 = "${TUNE_FEATURES:tune-cortexa5-neon-vfpv4} thumb"
PACKAGE_EXTRA_ARCHS:tune-cortexa5             = "${PACKAGE_EXTRA_ARCHS:tune-armv7a} cortexa5-vfp"
PACKAGE_EXTRA_ARCHS:tune-cortexa5t            = "${PACKAGE_EXTRA_ARCHS:tune-armv7at} cortexa5-vfp cortexa5t2-vfp"
PACKAGE_EXTRA_ARCHS:tune-cortexa5-neon        = "${PACKAGE_EXTRA_ARCHS:tune-armv7a-neon} cortexa5-vfp cortexa5-neon"
PACKAGE_EXTRA_ARCHS:tune-cortexa5t-neon       = "${PACKAGE_EXTRA_ARCHS:tune-armv7at-neon} cortexa5-vfp cortexa5-neon cortexa5t2-vfp cortexa5t2-neon"
PACKAGE_EXTRA_ARCHS:tune-cortexa5-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS:tune-armv7a-neon-vfpv4} cortexa5-vfp cortexa5-neon cortexa5-neon-vfpv4"
PACKAGE_EXTRA_ARCHS:tune-cortexa5t-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS:tune-armv7at-neon-vfpv4} cortexa5-vfp cortexa5-neon cortexa5-neon-vfpv4 cortexa5t2-vfp cortexa5t2-neon cortexa5t2-neon-vfpv4"

# HF Tunes
AVAILTUNES += "cortexa5hf cortexa5thf cortexa5hf-neon cortexa5thf-neon cortexa5hf-neon-vfpv4 cortexa5thf-neon-vfpv4"
ARMPKGARCH:tune-cortexa5hf             = "cortexa5"
ARMPKGARCH:tune-cortexa5thf            = "cortexa5"
ARMPKGARCH:tune-cortexa5hf-neon        = "cortexa5"
ARMPKGARCH:tune-cortexa5thf-neon       = "cortexa5"
ARMPKGARCH:tune-cortexa5hf-neon-vfpv4  = "cortexa5"
ARMPKGARCH:tune-cortexa5thf-neon-vfpv4 = "cortexa5"
# mcpu is used so don't use armv7a as we don't want march
TUNE_FEATURES:tune-cortexa5hf             = "${TUNE_FEATURES:tune-cortexa5} callconvention-hard"
TUNE_FEATURES:tune-cortexa5thf            = "${TUNE_FEATURES:tune-cortexa5t} callconvention-hard"
TUNE_FEATURES:tune-cortexa5hf-neon        = "${TUNE_FEATURES:tune-cortexa5-neon} callconvention-hard"
TUNE_FEATURES:tune-cortexa5thf-neon       = "${TUNE_FEATURES:tune-cortexa5t-neon} callconvention-hard"
TUNE_FEATURES:tune-cortexa5hf-neon-vfpv4  = "${TUNE_FEATURES:tune-cortexa5-neon-vfpv4} callconvention-hard"
TUNE_FEATURES:tune-cortexa5thf-neon-vfpv4 = "${TUNE_FEATURES:tune-cortexa5t-neon-vfpv4} callconvention-hard"
PACKAGE_EXTRA_ARCHS:tune-cortexa5hf             = "${PACKAGE_EXTRA_ARCHS:tune-armv7ahf} cortexa5hf-vfp"
PACKAGE_EXTRA_ARCHS:tune-cortexa5thf            = "${PACKAGE_EXTRA_ARCHS:tune-armv7athf} cortexa5hf-vfp cortexa5t2hf-vfp"
PACKAGE_EXTRA_ARCHS:tune-cortexa5hf-neon        = "${PACKAGE_EXTRA_ARCHS:tune-armv7ahf-neon} cortexa5hf-vfp cortexa5hf-neon"
PACKAGE_EXTRA_ARCHS:tune-cortexa5thf-neon       = "${PACKAGE_EXTRA_ARCHS:tune-armv7athf-neon} cortexa5hf-vfp cortexa5hf-neon cortexa5t2hf-vfp cortexa5t2hf-neon"
PACKAGE_EXTRA_ARCHS:tune-cortexa5hf-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS:tune-armv7ahf-neon-vfpv4} cortexa5hf-vfp cortexa5hf-neon cortexa5hf-neon-vfpv4"
PACKAGE_EXTRA_ARCHS:tune-cortexa5thf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS:tune-armv7athf-neon-vfpv4} cortexa5hf-vfp cortexa5hf-neon cortexa5hf-neon-vfpv4 cortexa5t2hf-vfp cortexa5t2hf-neon cortexa5t2hf-neon-vfpv4"
