[Feature]add MT2731_MP2_MR2_SVN388 baseline version
Change-Id: Ief04314834b31e27effab435d3ca8ba33b499059
diff --git a/meta/meta-mediatek/recipes-devtools/met/met-driver-internal.bb b/meta/meta-mediatek/recipes-devtools/met/met-driver-internal.bb
new file mode 100644
index 0000000..91763bd
--- /dev/null
+++ b/meta/meta-mediatek/recipes-devtools/met/met-driver-internal.bb
@@ -0,0 +1,49 @@
+DESCRIPTION = "MET-DRIVER-INTERNAL"
+LICENSE = "MediaTekProprietary"
+DEPENDS = "linux-mtk-extension"
+DEPENDS += "met-driver"
+
+inherit workonsrc
+WORKONSRC = "${TOPDIR}/../src/devtools/met-driver-internal"
+export LINUX_VERSION = "${@[d.getVar('TUNE_PKGARCH'), d.getVar('PREFERRED_VERSION_linux-mtk-extension')][bool(d.getVar('PREFERRED_VERSION_linux-mtk-extension'))].replace('%', '')}"
+LDFLAGS = "-L ${RECIPE_SYSROOT}"
+PRJ_DISTRO = "${@bb.utils.contains("DISTRO", "poky-agl", "agl", "poky", d)}"
+
+export KERNEL_SRC = "${TOPDIR}/../src/kernel/linux/v${LINUX_VERSION}"
+export KERNEL_OUT = "${TOPDIR}/tmp/work/${MACHINE_ARCH}-${PRJ_DISTRO}-${TARGET_OS}/${PREFERRED_PROVIDER_virtual/kernel}/${LINUX_VERSION}-${PR}/${PREFERRED_PROVIDER_virtual/kernel}-${LINUX_VERSION}/"
+export MET_DRIVER_INTERNAL_DIR = "${S}/${LINUX_VERSION}"
+#export KBUILD_EXTRA_SYMBOLS= "${TOPDIR}/../src/devtools/met-driver/${LINUX_VERSION}/Module.symvers"
+export CONFIG_MTK_PLATFORM = "${TARGET_PLATFORM}"
+export CONFIG_MET = "m"
+export CONFIG_MET_PLF = "m"
+export CONFIG_BUILD_YOCTO = "y"
+TOOLCHAIN = "gcc"
+
+do_compile() {
+ if [ -d "${MET_DRIVER_INTERNAL_DIR}" ]; then
+ if test "${TARGET_PLATFORM}" != ""; then
+ echo ${TARGET_PLATFORM} met driver internal start compile
+
+ if test "${KERNEL_ARCH}" = "arm64"; then
+ oe_runmake -f ${LINUX_VERSION}/Makefile.yocto TOPDIR=${TOPDIR} ARCH=arm64 CROSS_COMPILE=aarch64-${PRJ_DISTRO}-linux-
+ else
+ oe_runmake -f ${LINUX_VERSION}/Makefile.yocto TOPDIR=${TOPDIR} ARCH=arm CROSS_COMPILE=arm-${PRJ_DISTRO}-linux-gnueabi-
+ fi
+
+ echo ${TARGET_PLATFORM} met driver internal end compile
+ fi
+ fi
+}
+
+do_install() {
+ install -d ${D}/vendor/lib/modules
+ if [ -d "${MET_DRIVER_INTERNAL_DIR}" ]; then
+ install -m 0644 ${MET_DRIVER_INTERNAL_DIR}/met_plf.ko ${D}/vendor/lib/modules
+ fi
+}
+
+# Avoid QA Issue: No GNU_HASH in the elf binary
+PN='met-driver-internal'
+INSANE_SKIP_${PN} = "ldflags"
+INSANE_SKIP_${PN} += "already-stripped"
+FILES_${PN} += "/vendor/lib/modules"
diff --git a/meta/meta-mediatek/recipes-devtools/met/met-driver.bb b/meta/meta-mediatek/recipes-devtools/met/met-driver.bb
new file mode 100644
index 0000000..30addcc
--- /dev/null
+++ b/meta/meta-mediatek/recipes-devtools/met/met-driver.bb
@@ -0,0 +1,54 @@
+DESCRIPTION = "MET-DRIVER"
+LICENSE = "GPL-2.0"
+DEPENDS = "linux-mtk-extension"
+
+inherit workonsrc
+WORKONSRC = "${TOPDIR}/../src/devtools/met-driver"
+LINUX_VERSION = "${@[d.getVar('TUNE_PKGARCH'), d.getVar('PREFERRED_VERSION_linux-mtk-extension')][bool(d.getVar('PREFERRED_VERSION_linux-mtk-extension'))].replace('%', '')}"
+LDFLAGS = "-L ${RECIPE_SYSROOT}"
+PRJ_DISTRO = "${@bb.utils.contains("DISTRO", "poky-agl", "agl", "poky", d)}"
+
+export KERNEL_SRC = "${TOPDIR}/../src/kernel/linux/v${LINUX_VERSION}"
+export KERNEL_OUT = "${TOPDIR}/tmp/work/${MACHINE_ARCH}-${PRJ_DISTRO}-${TARGET_OS}/${PREFERRED_PROVIDER_virtual/kernel}/${LINUX_VERSION}-${PR}/${PREFERRED_PROVIDER_virtual/kernel}-${LINUX_VERSION}/"
+export MET_DRIVER_DIR = "${S}/${LINUX_VERSION}"
+export CONFIG_MTK_PLATFORM = "${TARGET_PLATFORM}"
+export CONFIG_MTK_MET = "m"
+export CONFIG_BUILD_YOCTO = "y"
+TOOLCHAIN = "gcc"
+
+do_compile() {
+ if [ -d "${MET_DRIVER_DIR}" ]; then
+ if test "${TARGET_PLATFORM}" != ""; then
+ echo ${TARGET_PLATFORM} met driver start compile
+
+ # for different kerenl src path naming
+ if test "${KERNELDIR}" != ""; then
+ if test "${TARGET_PLATFORM}" = "mt8183"; then
+ export KERNEL_SRC="${TOPDIR}/../src/kernel/linux/${KERNELDIR}"
+ fi
+ fi
+
+ if test "${KERNEL_ARCH}" = "arm64"; then
+ oe_runmake -f ${LINUX_VERSION}/Makefile.yocto TOPDIR=${TOPDIR} ARCH=arm64 CROSS_COMPILE=aarch64-${PRJ_DISTRO}-linux-
+ else
+ oe_runmake -f ${LINUX_VERSION}/Makefile.yocto TOPDIR=${TOPDIR} ARCH=arm CROSS_COMPILE=arm-${PRJ_DISTRO}-linux-gnueabi-
+ fi
+
+ echo ${TARGET_PLATFORM} met driver end compile
+ fi
+ fi
+}
+
+do_install() {
+ install -d ${D}/vendor/lib/modules
+ if [ -d "${MET_DRIVER_DIR}" ]; then
+ install -m 0644 ${MET_DRIVER_DIR}/met.ko ${D}/vendor/lib/modules
+ fi
+}
+
+# Avoid QA Issue: No GNU_HASH in the elf binary
+PN='met-driver'
+INSANE_SKIP_${PN} = "ldflags"
+INSANE_SKIP_${PN} += "already-stripped"
+FILES_${PN} += "/vendor/lib/modules"
+
diff --git a/meta/meta-mediatek/recipes-devtools/met/met-utils.bb b/meta/meta-mediatek/recipes-devtools/met/met-utils.bb
new file mode 100644
index 0000000..6ceacb1
--- /dev/null
+++ b/meta/meta-mediatek/recipes-devtools/met/met-utils.bb
@@ -0,0 +1,35 @@
+DESCRIPTION = "MET-UTILS"
+LICENSE = "MediaTekProprietary"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b415b1f2e589c23040ce1f39702002e6"
+
+inherit get_toolchain_name
+inherit workonsrc
+WORKONSRC = "${TOPDIR}/../src/devtools/met-utils"
+export CONFIG_MTK_PLATFORM = "${TARGET_PLATFORM}"
+#TOOLCHAIN = "gcc"
+
+export EXTRA_CFLAGS += "-Wl,--hash-style=gnu"
+
+do_compile() {
+ if [ -d "${WORKONSRC}" ]; then
+ echo ${TARGET_PLATFORM} met-utils start compile
+
+ if test "${KERNEL_ARCH}" = "arm64"; then
+ oe_runmake -f ${WORKONSRC}/Makefile TOPDIR=${TOPDIR} ARCH=arm64 CROSS_COMPILE=aarch64-poky-linux- TOOLCHAIN_NAME=${TOOLCHAIN_NAME}
+ else
+ oe_runmake -f ${WORKONSRC}/Makefile TOPDIR=${TOPDIR} ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- TOOLCHAIN_NAME=${TOOLCHAIN_NAME}
+ fi
+
+ echo ${TARGET_PLATFORM} met-utils end compile
+ fi
+}
+
+do_install() {
+ oe_runmake \
+ PREFIX="${prefix}" DESTDIR="${D}" PACKAGE_ARCH="${PACKAGE_ARCH}" install
+}
+
+# Avoid QA Issue: No GNU_HASH in the elf binary
+PN='met-utils'
+INSANE_SKIP_${PN} += "already-stripped"
+