meta-amd: prep for amd meta layer refactoring

Code refactoring to support CRB's bring-up.

Configuration files "nohost" and "withhost" variants
introduced to support various stages of  bring-up in
AMD CRBs.

Change-Id: Id52ac68edf365e6623bd71992fdd6d9fc8a3adf5
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/meta-amd/conf/machine/include/amd-nohost.inc b/meta-amd/conf/machine/include/amd-nohost.inc
new file mode 100644
index 0000000..a37b5b7
--- /dev/null
+++ b/meta-amd/conf/machine/include/amd-nohost.inc
@@ -0,0 +1,3 @@
+MACHINEOVERRIDES =. "amd-nohost:"
+
+require conf/machine/include/amd.inc
diff --git a/meta-amd/conf/machine/include/amd-withhost.inc b/meta-amd/conf/machine/include/amd-withhost.inc
new file mode 100644
index 0000000..366e24a
--- /dev/null
+++ b/meta-amd/conf/machine/include/amd-withhost.inc
@@ -0,0 +1,16 @@
+MACHINEOVERRIDES =. "amd-withhost:"
+
+require conf/machine/include/amd.inc
+
+MACHINE_FEATURES:append = "\
+        obmc-chassis-state-mgmt \
+        obmc-host-state-mgmt \
+        obmc-phosphor-chassis-mgmt \
+        obmc-host-ipmi \
+        "
+
+VIRTUAL-RUNTIME_obmc-host-state-manager ?= "x86-power-control"
+VIRTUAL-RUNTIME_obmc-chassis-state-manager ?= "x86-power-control"
+
+PREFERRED_PROVIDER_virtual/obmc-chassis-mgmt = "packagegroup-amd-apps"
+PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw ?= "phosphor-ipmi-kcs"
diff --git a/meta-amd/conf/machine/include/amd.inc b/meta-amd/conf/machine/include/amd.inc
index c29336c..4a025cb 100644
--- a/meta-amd/conf/machine/include/amd.inc
+++ b/meta-amd/conf/machine/include/amd.inc
@@ -1,23 +1,15 @@
 MACHINE_FEATURES += "\
         obmc-bmc-state-mgmt \
-        obmc-chassis-state-mgmt \
-        obmc-host-state-mgmt \
-        obmc-phosphor-chassis-mgmt \
-        obmc-host-ipmi \
         obmc-phosphor-fan-mgmt \
         obmc-phosphor-flash-mgmt \
         "
 
-VIRTUAL-RUNTIME_obmc-host-state-manager ?= "x86-power-control"
-VIRTUAL-RUNTIME_obmc-chassis-state-manager ?= "x86-power-control"
 VIRTUAL-RUNTIME_obmc-sensors-hwmon ?= "dbus-sensors"
 VIRTUAL-RUNTIME_obmc-inventory-manager = "entity-manager"
 
 PREFERRED_PROVIDER_virtual/obmc-inventory-data = "entity-manager"
-PREFERRED_PROVIDER_virtual/obmc-chassis-mgmt = "packagegroup-amd-apps"
 PREFERRED_PROVIDER_virtual/obmc-fan-mgmt = "packagegroup-amd-apps"
 PREFERRED_PROVIDER_virtual/obmc-flash-mgmt = "packagegroup-amd-apps"
-PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw ?= "phosphor-ipmi-kcs"
 PREFERRED_PROVIDER_virtual/obmc-system-mgmt = "packagegroup-amd-apps"
 
 OVERRIDES .= ":amd"
diff --git a/meta-amd/meta-daytonax/conf/machine/daytonax.conf b/meta-amd/meta-daytonax/conf/machine/daytonax.conf
index 59ec62b..3de37df 100644
--- a/meta-amd/meta-daytonax/conf/machine/daytonax.conf
+++ b/meta-amd/meta-daytonax/conf/machine/daytonax.conf
@@ -6,7 +6,7 @@
 
 require conf/machine/include/ast2500.inc
 require conf/machine/include/obmc-bsp-common.inc
-require conf/machine/include/amd.inc
+require conf/machine/include/amd-withhost.inc
 
 SERIAL_CONSOLES = "115200;ttyS4"
 
diff --git a/meta-amd/meta-ethanolx/conf/machine/ethanolx.conf b/meta-amd/meta-ethanolx/conf/machine/ethanolx.conf
index c252478..64a566f 100644
--- a/meta-amd/meta-ethanolx/conf/machine/ethanolx.conf
+++ b/meta-amd/meta-ethanolx/conf/machine/ethanolx.conf
@@ -6,7 +6,7 @@
 
 require conf/machine/include/ast2500.inc
 require conf/machine/include/obmc-bsp-common.inc
-require conf/machine/include/amd.inc
+require conf/machine/include/amd-withhost.inc
 
 SERIAL_CONSOLES = "115200;ttyS4"
 
diff --git a/meta-amd/recipes-amd/packagegroups/packagegroup-amd-apps.bb b/meta-amd/recipes-amd/packagegroups/packagegroup-amd-apps.bb
index a3a74b7..43a0be0 100644
--- a/meta-amd/recipes-amd/packagegroups/packagegroup-amd-apps.bb
+++ b/meta-amd/recipes-amd/packagegroups/packagegroup-amd-apps.bb
@@ -5,11 +5,14 @@
 
 PROVIDES = "${PACKAGES}"
 PACKAGES = " \
-        ${PN}-chassis \
         ${PN}-fans \
         ${PN}-flash \
         ${PN}-system \
         "
+PACKAGES:append:amd-withhost = " \
+        ${PN}-chassis \
+        ${PN}-hostmgmt \
+        "
 
 PROVIDES += "virtual/obmc-chassis-mgmt"
 PROVIDES += "virtual/obmc-fan-mgmt"
@@ -39,10 +42,14 @@
 
 SUMMARY:${PN}-system = "AMD System"
 RDEPENDS:${PN}-system = " \
-        amd-fpga \
         dbus-sensors \
         entity-manager \
         ipmitool \
-        phosphor-hostlogger \
         srvcfg-manager \
+        ${RDEPENDS_PN_SYSTEM_EXTRAS} \
+        "
+RDEPENDS_PN_SYSTEM_EXTRAS = ""
+RDEPENDS_PN_SYSTEM_EXTRAS:amd-withhost = " \
+        amd-fpga \
+        phosphor-hostlogger \
         "