meta-amd: added meta-common folder

This is to keep all AMD layer common recipes at one place.

Change-Id: I5e407e9673437e203dc46d1bb4dea51387a91afd
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/meta-amd/conf/layer.conf b/meta-amd/conf/layer.conf
index 6603316..f5b4fde 100644
--- a/meta-amd/conf/layer.conf
+++ b/meta-amd/conf/layer.conf
@@ -2,9 +2,9 @@
 BBPATH .= ":${LAYERDIR}"
 
 # We have recipes-* directories, add to BBFILES
-BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
-            ${LAYERDIR}/recipes-*/*/*.bbappend"
+BBFILES += "${LAYERDIR}/meta-common/recipes-*/*/*.bb \
+            ${LAYERDIR}/meta-common/recipes-*/*/*.bbappend"
 
 BBFILE_COLLECTIONS += "amd-layer"
-BBFILE_PATTERN_amd-layer = "^${LAYERDIR}/"
+BBFILE_PATTERN_amd-layer = "^${LAYERDIR}/meta-common/"
 LAYERSERIES_COMPAT_amd-layer = "nanbield scarthgap"
diff --git a/meta-amd/meta-common/conf/layer.conf b/meta-amd/meta-common/conf/layer.conf
new file mode 100644
index 0000000..82f1a93
--- /dev/null
+++ b/meta-amd/meta-common/conf/layer.conf
@@ -0,0 +1,10 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have recipes-* directories, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+            ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "common-layer"
+BBFILE_PATTERN_common-layer := "^${LAYERDIR}/"
+LAYERSERIES_COMPAT_common-layer = "nanbield scarthgap"
diff --git a/meta-amd/recipes-amd/packagegroups/packagegroup-amd-apps.bb b/meta-amd/meta-common/recipes-amd/packagegroups/packagegroup-amd-apps.bb
similarity index 100%
rename from meta-amd/recipes-amd/packagegroups/packagegroup-amd-apps.bb
rename to meta-amd/meta-common/recipes-amd/packagegroups/packagegroup-amd-apps.bb
diff --git a/meta-amd/recipes-phosphor/console/obmc-console/daytonax/server.ttyVUART0.conf b/meta-amd/meta-common/recipes-phosphor/console/obmc-console/daytonax/server.ttyVUART0.conf
similarity index 100%
rename from meta-amd/recipes-phosphor/console/obmc-console/daytonax/server.ttyVUART0.conf
rename to meta-amd/meta-common/recipes-phosphor/console/obmc-console/daytonax/server.ttyVUART0.conf
diff --git a/meta-amd/recipes-phosphor/console/obmc-console/ethanolx/server.ttyS0.conf b/meta-amd/meta-common/recipes-phosphor/console/obmc-console/ethanolx/server.ttyS0.conf
similarity index 100%
rename from meta-amd/recipes-phosphor/console/obmc-console/ethanolx/server.ttyS0.conf
rename to meta-amd/meta-common/recipes-phosphor/console/obmc-console/ethanolx/server.ttyS0.conf
diff --git a/meta-amd/recipes-phosphor/console/obmc-console_%.bbappend b/meta-amd/meta-common/recipes-phosphor/console/obmc-console_%.bbappend
similarity index 100%
rename from meta-amd/recipes-phosphor/console/obmc-console_%.bbappend
rename to meta-amd/meta-common/recipes-phosphor/console/obmc-console_%.bbappend
diff --git a/meta-amd/recipes-phosphor/logging/phosphor-hostlogger/daytonax/ttyVUART0.conf b/meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger/daytonax/ttyVUART0.conf
similarity index 100%
rename from meta-amd/recipes-phosphor/logging/phosphor-hostlogger/daytonax/ttyVUART0.conf
rename to meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger/daytonax/ttyVUART0.conf
diff --git a/meta-amd/recipes-phosphor/logging/phosphor-hostlogger/ethanolx/ttyS0.conf b/meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger/ethanolx/ttyS0.conf
similarity index 100%
rename from meta-amd/recipes-phosphor/logging/phosphor-hostlogger/ethanolx/ttyS0.conf
rename to meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger/ethanolx/ttyS0.conf
diff --git a/meta-amd/recipes-phosphor/logging/phosphor-hostlogger_%.bbappend b/meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger_%.bbappend
similarity index 100%
rename from meta-amd/recipes-phosphor/logging/phosphor-hostlogger_%.bbappend
rename to meta-amd/meta-common/recipes-phosphor/logging/phosphor-hostlogger_%.bbappend
diff --git a/meta-amd/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend b/meta-amd/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend
similarity index 100%
rename from meta-amd/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend
rename to meta-amd/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend
diff --git a/meta-amd/meta-daytonax/recipes-x86/chassis/x86-power-control/power-config-host0.json b/meta-amd/meta-common/recipes-x86/chassis/x86-power-control/daytonax/power-config-host0.json
similarity index 100%
rename from meta-amd/meta-daytonax/recipes-x86/chassis/x86-power-control/power-config-host0.json
rename to meta-amd/meta-common/recipes-x86/chassis/x86-power-control/daytonax/power-config-host0.json
diff --git a/meta-amd/meta-ethanolx/recipes-x86/chassis/x86-power-control/power-config-host0.json b/meta-amd/meta-common/recipes-x86/chassis/x86-power-control/ethanolx/power-config-host0.json
similarity index 100%
rename from meta-amd/meta-ethanolx/recipes-x86/chassis/x86-power-control/power-config-host0.json
rename to meta-amd/meta-common/recipes-x86/chassis/x86-power-control/ethanolx/power-config-host0.json
diff --git a/meta-amd/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend b/meta-amd/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend
new file mode 100644
index 0000000..b2e79a8
--- /dev/null
+++ b/meta-amd/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend
@@ -0,0 +1,16 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}/${MACHINE}:"
+
+SRC_URI:append:ethanolx = " file://power-config-host0.json"
+SRC_URI:append:daytonax = " file://power-config-host0.json"
+
+do_install:append:ethanolx() {
+        install -m 0755 -d ${D}/${datadir}/${PN}
+        install -m 0644 -D ${WORKDIR}/power-config-host0.json \
+                  ${D}/${datadir}/${PN}/
+}
+
+do_install:append:daytonax() {
+        install -m 0755 -d ${D}/${datadir}/${PN}
+        install -m 0644 -D ${WORKDIR}/power-config-host0.json \
+                  ${D}/${datadir}/${PN}/
+}
diff --git a/meta-amd/recipes-amd/amd-fpga/amd-fpga.bb b/meta-amd/meta-daytonax/recipes-amd/amd-fpga/amd-fpga.bb
similarity index 87%
rename from meta-amd/recipes-amd/amd-fpga/amd-fpga.bb
rename to meta-amd/meta-daytonax/recipes-amd/amd-fpga/amd-fpga.bb
index 6e89a4c..de6eeb9 100644
--- a/meta-amd/recipes-amd/amd-fpga/amd-fpga.bb
+++ b/meta-amd/meta-daytonax/recipes-amd/amd-fpga/amd-fpga.bb
@@ -1,4 +1,4 @@
-FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}/${MACHINE}:"
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
 SUMMARY = "AMD FPGA Register Dump Utility"
 DESCRIPTION = "AMD FPGA Register Dump Utility"
 
diff --git a/meta-amd/recipes-amd/amd-fpga/files/LICENSE b/meta-amd/meta-daytonax/recipes-amd/amd-fpga/files/LICENSE
similarity index 100%
rename from meta-amd/recipes-amd/amd-fpga/files/LICENSE
rename to meta-amd/meta-daytonax/recipes-amd/amd-fpga/files/LICENSE
diff --git a/meta-amd/recipes-amd/amd-fpga/files/daytonax/fpgardu.sh b/meta-amd/meta-daytonax/recipes-amd/amd-fpga/files/fpgardu.sh
similarity index 100%
rename from meta-amd/recipes-amd/amd-fpga/files/daytonax/fpgardu.sh
rename to meta-amd/meta-daytonax/recipes-amd/amd-fpga/files/fpgardu.sh
diff --git a/meta-amd/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service b/meta-amd/meta-daytonax/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service
similarity index 100%
rename from meta-amd/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service
rename to meta-amd/meta-daytonax/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service
diff --git a/meta-amd/recipes-phosphor/fans/phosphor-pid-control_%.bbappend b/meta-amd/meta-daytonax/recipes-phosphor/fans/phosphor-pid-control_%.bbappend
similarity index 100%
rename from meta-amd/recipes-phosphor/fans/phosphor-pid-control_%.bbappend
rename to meta-amd/meta-daytonax/recipes-phosphor/fans/phosphor-pid-control_%.bbappend
diff --git a/meta-amd/meta-daytonax/recipes-x86/chassis/x86-power-control_%.bbappend b/meta-amd/meta-daytonax/recipes-x86/chassis/x86-power-control_%.bbappend
deleted file mode 100644
index 4c079c7..0000000
--- a/meta-amd/meta-daytonax/recipes-x86/chassis/x86-power-control_%.bbappend
+++ /dev/null
@@ -1,9 +0,0 @@
-FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += "file://power-config-host0.json \
-"
-
-do_install:append() {
-        install -d  ${D}/${datadir}/${PN}
-        install -m 0644 ${WORKDIR}/power-config-host0.json ${D}/${datadir}/${PN}
-}
diff --git a/meta-amd/meta-ethanolx/conf/templates/default/bblayers.conf.sample b/meta-amd/meta-ethanolx/conf/templates/default/bblayers.conf.sample
index 2703e31..31dc06d 100644
--- a/meta-amd/meta-ethanolx/conf/templates/default/bblayers.conf.sample
+++ b/meta-amd/meta-ethanolx/conf/templates/default/bblayers.conf.sample
@@ -14,4 +14,5 @@
   ##OEROOT##/meta-aspeed \
   ##OEROOT##/meta-amd \
   ##OEROOT##/meta-amd/meta-ethanolx \
+  ##OEROOT##/meta-amd/meta-common \
   "
diff --git a/meta-amd/recipes-amd/amd-fpga/amd-fpga.bb b/meta-amd/meta-ethanolx/recipes-amd/amd-fpga/amd-fpga.bb
similarity index 87%
copy from meta-amd/recipes-amd/amd-fpga/amd-fpga.bb
copy to meta-amd/meta-ethanolx/recipes-amd/amd-fpga/amd-fpga.bb
index 6e89a4c..de6eeb9 100644
--- a/meta-amd/recipes-amd/amd-fpga/amd-fpga.bb
+++ b/meta-amd/meta-ethanolx/recipes-amd/amd-fpga/amd-fpga.bb
@@ -1,4 +1,4 @@
-FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}/${MACHINE}:"
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
 SUMMARY = "AMD FPGA Register Dump Utility"
 DESCRIPTION = "AMD FPGA Register Dump Utility"
 
diff --git a/meta-amd/recipes-amd/amd-fpga/files/LICENSE b/meta-amd/meta-ethanolx/recipes-amd/amd-fpga/files/LICENSE
similarity index 100%
copy from meta-amd/recipes-amd/amd-fpga/files/LICENSE
copy to meta-amd/meta-ethanolx/recipes-amd/amd-fpga/files/LICENSE
diff --git a/meta-amd/recipes-amd/amd-fpga/files/ethanolx/fpgardu.sh b/meta-amd/meta-ethanolx/recipes-amd/amd-fpga/files/fpgardu.sh
similarity index 100%
rename from meta-amd/recipes-amd/amd-fpga/files/ethanolx/fpgardu.sh
rename to meta-amd/meta-ethanolx/recipes-amd/amd-fpga/files/fpgardu.sh
diff --git a/meta-amd/recipes-amd/amd-fpga/files/ip-to-fpga.service b/meta-amd/meta-ethanolx/recipes-amd/amd-fpga/files/ip-to-fpga.service
similarity index 100%
rename from meta-amd/recipes-amd/amd-fpga/files/ip-to-fpga.service
rename to meta-amd/meta-ethanolx/recipes-amd/amd-fpga/files/ip-to-fpga.service
diff --git a/meta-amd/recipes-amd/amd-fpga/files/ip-to-fpga.sh b/meta-amd/meta-ethanolx/recipes-amd/amd-fpga/files/ip-to-fpga.sh
similarity index 100%
rename from meta-amd/recipes-amd/amd-fpga/files/ip-to-fpga.sh
rename to meta-amd/meta-ethanolx/recipes-amd/amd-fpga/files/ip-to-fpga.sh
diff --git a/meta-amd/recipes-amd/amd-fpga/ip-to-fpga.bb b/meta-amd/meta-ethanolx/recipes-amd/amd-fpga/ip-to-fpga.bb
similarity index 100%
rename from meta-amd/recipes-amd/amd-fpga/ip-to-fpga.bb
rename to meta-amd/meta-ethanolx/recipes-amd/amd-fpga/ip-to-fpga.bb
diff --git a/meta-amd/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service b/meta-amd/meta-ethanolx/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service
similarity index 100%
copy from meta-amd/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service
copy to meta-amd/meta-ethanolx/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service
diff --git a/meta-amd/recipes-phosphor/fans/phosphor-pid-control_%.bbappend b/meta-amd/meta-ethanolx/recipes-phosphor/fans/phosphor-pid-control_%.bbappend
similarity index 100%
copy from meta-amd/recipes-phosphor/fans/phosphor-pid-control_%.bbappend
copy to meta-amd/meta-ethanolx/recipes-phosphor/fans/phosphor-pid-control_%.bbappend
diff --git a/meta-amd/meta-ethanolx/recipes-x86/chassis/x86-power-control_%.bbappend b/meta-amd/meta-ethanolx/recipes-x86/chassis/x86-power-control_%.bbappend
deleted file mode 100644
index cba1306..0000000
--- a/meta-amd/meta-ethanolx/recipes-x86/chassis/x86-power-control_%.bbappend
+++ /dev/null
@@ -1,9 +0,0 @@
-FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += "file://power-config-host0.json \
-            "
-
-do_install:append() {
-        install -d  ${D}/${datadir}/${PN}
-        install -m 0644 ${WORKDIR}/power-config-host0.json ${D}/${datadir}/${PN}
-}