From 0d5594111ea1712f731cff174f21b3e2c4246c15 Mon Sep 17 00:00:00 2001
From: Samuli Piippo <samuli.piippo@theqtcompany.com>
Date: Tue, 23 Feb 2016 13:23:56 +0200
Subject: [PATCH] kontron: update to Yocto BSP for SMARC-sAMX6i R02.00

Change-Id: If0f8dc2c786bc63fba69531fa009efd8ae8111b7
Reviewed-by: Teemu Holappa <teemu.holappa@theqtcompany.com>
---
 b2qt-init-build-env                           |  5 +-
 conf/bblayers.conf.smx6.sample                | 50 +++++++++++++++++++
 conf/distro/include/smarc-samx6i.conf         |  3 ++
 meta-smx6-extras/conf/layer.conf              | 37 ++++++++++++++
 .../recipes/linux/linux-smx6_3.14.28.bbappend | 26 ++++++++++
 scripts/manifest.xml                          | 10 +++-
 scripts/manifest_fido.xml                     |  7 ++-
 scripts/setup-environment.sh                  |  5 +-
 8 files changed, 138 insertions(+), 5 deletions(-)
 create mode 100644 conf/bblayers.conf.smx6.sample
 create mode 100644 meta-smx6-extras/conf/layer.conf
 create mode 100644 meta-smx6-extras/recipes/linux/linux-smx6_3.14.28.bbappend

diff --git a/b2qt-init-build-env b/b2qt-init-build-env
index e3c619b6..90fa2b06 100755
--- a/b2qt-init-build-env
+++ b/b2qt-init-build-env
@@ -95,9 +95,12 @@ get_groups() {
     apalis-imx6|colibri-imx6|colibri-vf)
       PROJECT_GROUPS="toradex"
     ;;
-    imx53qsb|imx6qsabresd|imx6dlsabresd|nitrogen6x|smarc-samx6i)
+    imx53qsb|imx6qsabresd|imx6dlsabresd|nitrogen6x)
       PROJECT_GROUPS="fsl"
     ;;
+    smarc-samx6i)
+      PROJECT_GROUPS="smx6"
+    ;;
     tibidabo)
       PROJECT_GROUPS="architech"
     ;;
diff --git a/conf/bblayers.conf.smx6.sample b/conf/bblayers.conf.smx6.sample
new file mode 100644
index 00000000..f6043946
--- /dev/null
+++ b/conf/bblayers.conf.smx6.sample
@@ -0,0 +1,50 @@
+##############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Boot to Qt meta layer.
+##
+## $QT_BEGIN_LICENSE:COMM$
+##
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see http://www.qt.io/terms-conditions. For further
+## information use the contact form at http://www.qt.io/contact-us.
+##
+## $QT_END_LICENSE$
+##
+##############################################################################
+
+# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
+# changes incompatibly
+LCONF_VERSION = "6"
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"
+
+BBLAYERS ?= " \
+  ${BSPDIR}/sources/poky/meta \
+  ${BSPDIR}/sources/poky/meta-yocto \
+  ${BSPDIR}/sources/meta-fsl-arm \
+  ${BSPDIR}/sources/meta-fsl-arm-extra \
+  ${BSPDIR}/sources/meta-smx6 \
+  ${BSPDIR}/sources/meta-openembedded/meta-oe \
+  ${BSPDIR}/sources/meta-openembedded/meta-python \
+  ${BSPDIR}/sources/meta-openembedded/meta-networking \
+  ${BSPDIR}/sources/meta-openembedded/meta-initramfs \
+  ${BSPDIR}/sources/meta-openembedded/meta-ruby \
+  ${BSPDIR}/sources/meta-b2qt \
+  ${BSPDIR}/sources/meta-b2qt/meta-fsl-extras \
+  ${BSPDIR}/sources/meta-b2qt/meta-smx6-extras \
+  ${BSPDIR}/sources/meta-mingw \
+  ${BSPDIR}/sources/meta-qt5 \
+  "
+BBLAYERS_NON_REMOVABLE ?= " \
+  ${BSPDIR}/sources/poky/meta \
+  ${BSPDIR}/sources/poky/meta-yocto \
+  "
diff --git a/conf/distro/include/smarc-samx6i.conf b/conf/distro/include/smarc-samx6i.conf
index 23bc85f1..d3ce2c98 100644
--- a/conf/distro/include/smarc-samx6i.conf
+++ b/conf/distro/include/smarc-samx6i.conf
@@ -45,3 +45,6 @@ MACHINE_EXTRA_INSTALL_SDK += " \
         "
 
 KERNEL_MODULE_AUTOLOAD += "mxc_v4l2_capture"
+
+BBMASK ?= " "
+BBMASK .= "|meta-smx6/recipes-qt"
diff --git a/meta-smx6-extras/conf/layer.conf b/meta-smx6-extras/conf/layer.conf
new file mode 100644
index 00000000..097fefea
--- /dev/null
+++ b/meta-smx6-extras/conf/layer.conf
@@ -0,0 +1,37 @@
+##############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Boot to Qt meta layer.
+##
+## $QT_BEGIN_LICENSE:COMM$
+##
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see http://www.qt.io/terms-conditions. For further
+## information use the contact form at http://www.qt.io/contact-us.
+##
+## $QT_END_LICENSE$
+##
+##############################################################################
+
+# We have a conf and classes directory, append to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have a recipes directory, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes*/*/*.bb \
+            ${LAYERDIR}/recipes*/*/*.bbappend \
+            "
+
+BBFILE_COLLECTIONS += "b2qt_smx6"
+BBFILE_PATTERN_b2qt_smx6 := "^${LAYERDIR}/"
+BBFILE_PRIORITY_b2qt_smx6 = "20"
+
+# meta-smx6 depends on fsl-demos, but that's not needed
+LAYERDEPENDS_smx6 = ""
+# meta-smx6 layer.conf modifies qtbase PACKAGECONFIG
+PACKAGECONFIG_remove_pn-qtbase = "examples"
diff --git a/meta-smx6-extras/recipes/linux/linux-smx6_3.14.28.bbappend b/meta-smx6-extras/recipes/linux/linux-smx6_3.14.28.bbappend
new file mode 100644
index 00000000..00f3c115
--- /dev/null
+++ b/meta-smx6-extras/recipes/linux/linux-smx6_3.14.28.bbappend
@@ -0,0 +1,26 @@
+##############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Boot to Qt meta layer.
+##
+## $QT_BEGIN_LICENSE:COMM$
+##
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see http://www.qt.io/terms-conditions. For further
+## information use the contact form at http://www.qt.io/contact-us.
+##
+## $QT_END_LICENSE$
+##
+##############################################################################
+
+do_configure_prepend() {
+    echo "CONFIG_NAMESPACES=y"              >> ${WORKDIR}/defconfig
+    echo "CONFIG_FHANDLE=y"                 >> ${WORKDIR}/defconfig
+    echo "CONFIG_CGROUPS=y"                 >> ${WORKDIR}/defconfig
+}
diff --git a/scripts/manifest.xml b/scripts/manifest.xml
index 703aedc6..71686c11 100644
--- a/scripts/manifest.xml
+++ b/scripts/manifest.xml
@@ -37,7 +37,7 @@
            remote="yocto"
            revision="c9f259a4bf8472dfa3ff75f1c3fcbe5e0ded7aaf"
            path="sources/meta-fsl-arm"
-           groups="notdefault,fsl,toradex,architech,ti,bbb"/>
+           groups="notdefault,fsl,toradex,architech,ti,bbb,smx6"/>
   <project name="meta-ti"
            remote="yocto"
            revision="0a222c70845d19a2213ac36803361e8531768cca"
@@ -52,7 +52,7 @@
            remote="freescale"
            revision="ad90ca98459f5de9483bb3ba5a81be0a67b078c3"
            path="sources/meta-fsl-arm-extra"
-           groups="notdefault,fsl,toradex,architech"/>
+           groups="notdefault,fsl,toradex,architech,smx6"/>
   <project name="meta-beagleboard"
            remote="beagleboard"
            revision="b5c709b2b6bd3bf236df923fa8f245a00fbb1b60"
@@ -73,6 +73,7 @@
            revision="ead0a5c115e632015d8358f4f304ec8908732f5f"
            path="sources/meta-intel"
            groups="notdefault,nuc"/>
+
   <project name="meta-tegra"
            remote="playground"
            revision="3125d29a5c58a471b67104d1bff965df38eb3115"
@@ -83,6 +84,11 @@
            revision="a376c795d5361fda4ea5f19feecc23ab7e753646"
            path="sources/jetson-tk1-pro"
            groups="notdefault,nvidia-logan"/>
+  <project name="meta-smx6"
+           remote="playground"
+           revision="c2f639ef4b2fd5809ab95fb330d28c2716aa290d"
+           path="sources/meta-smx6"
+           groups="notdefault,smx6"/>
 
 </manifest>
 
diff --git a/scripts/manifest_fido.xml b/scripts/manifest_fido.xml
index 2945e883..3a13f404 100644
--- a/scripts/manifest_fido.xml
+++ b/scripts/manifest_fido.xml
@@ -73,6 +73,7 @@
            revision="fido"
            path="sources/meta-intel"
            groups="notdefault,nuc"/>
+
   <project name="meta-tegra"
            remote="playground"
            revision="master"
@@ -83,6 +84,10 @@
            revision="master"
            path="sources/jetson-tk1-pro"
            groups="notdefault,nvidia-logan"/>
-
+  <project name="meta-smx6"
+           remote="playground"
+           revision="fido"
+           path="sources/meta-smx6"
+           groups="notdefault,smx6"/>
 </manifest>
 
diff --git a/scripts/setup-environment.sh b/scripts/setup-environment.sh
index f681d14e..28adeec9 100755
--- a/scripts/setup-environment.sh
+++ b/scripts/setup-environment.sh
@@ -51,9 +51,12 @@ if [ ! -f ${PWD}/${BUILDDIRECTORY}/conf/bblayers.conf ]; then
     apalis-imx6|colibri-imx6|colibri-vf)
       LAYERSCONF="bblayers.conf.toradex.sample"
     ;;
-    imx53qsb|imx6qsabresd|imx6dlsabresd|nitrogen6x|smarc-samx6i)
+    imx53qsb|imx6qsabresd|imx6dlsabresd|nitrogen6x)
       LAYERSCONF="bblayers.conf.fsl.sample"
     ;;
+    smarc-samx6i)
+      LAYERSCONF="bblayers.conf.smx6.sample"
+    ;;
     tibidabo)
       LAYERSCONF="bblayers.conf.tibidabo.sample"
     ;;
-- 
GitLab