Add virtual/openpower-fru-vpd-layout

This virtual provides a vpd layout file that describes openpower vpd
structure to openpower-vpd-parser.

Add a native recipe that provides a default layout, set that as the
default for OpenPOWER systems. A system may override this by providing
their own virtual/openpower-fru-vpd-layout.

Change-Id: I143fb03e68ef7418c704b1d0e2e9835ffb4c5526
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/meta-openbmc-machines/meta-openpower/classes/openpower-fru-vpd.bbclass b/meta-openbmc-machines/meta-openpower/classes/openpower-fru-vpd.bbclass
new file mode 100644
index 0000000..8de966f
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/classes/openpower-fru-vpd.bbclass
@@ -0,0 +1 @@
+vpdlayout_datadir="${datadir}/openpower-fru-vpd/vpdlayout"
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout-native.bb b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout-native.bb
new file mode 100644
index 0000000..de0cc64
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout-native.bb
@@ -0,0 +1,19 @@
+SUMMARY = "VPD layout for openpower-fru-vpd"
+PR = "r1"
+
+inherit native
+inherit openpower-fru-vpd
+inherit obmc-phosphor-license
+
+SRC_URI += "file://layout.yaml"
+
+PROVIDES += "virtual/openpower-fru-vpd-layout"
+
+S = "${WORKDIR}"
+
+do_install() {
+        DEST=${D}${vpdlayout_datadir}
+
+        install -d ${DEST}
+        install layout.yaml ${DEST}
+}
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout/layout.yaml b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout/layout.yaml
new file mode 100644
index 0000000..46a4f4a
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout/layout.yaml
@@ -0,0 +1,11 @@
+BMC:
+    xyz.openbmc_project.Inventory.Decorator.Asset:
+        PartNumber: VINI,PN
+        SerialNumber: VINI,SN
+        Manufacturer: OPFR,VN
+    xyz.openbmc_project.Inventory.Item:
+        PrettyName: VINI,DR
+
+ETHERNET:
+    xyz.openbmc_project.Inventory.Item.NetworkInterface:
+        MACAddress: VINI,B1
diff --git a/meta-openbmc-machines/meta-openpower/conf/machine/include/openpower.inc b/meta-openbmc-machines/meta-openpower/conf/machine/include/openpower.inc
index e29a91f..72a0139 100644
--- a/meta-openbmc-machines/meta-openpower/conf/machine/include/openpower.inc
+++ b/meta-openbmc-machines/meta-openpower/conf/machine/include/openpower.inc
@@ -20,3 +20,4 @@
 PREFERRED_PROVIDER_virtual/obmc-host-ctl ?= "obmc-op-control-host"
 PREFERRED_PROVIDER_virtual/obmc-inventory-data ?= "${VIRTUAL-RUNTIME_skeleton_workbook}"
 PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-hostfw-config ?= "hostboot-inventory-config-native"
+PREFERRED_PROVIDER_virtual/openpower-fru-vpd-layout ?= "openpower-fru-vpd-layout-native"