fp5280g2: Add vpd configs

Add vpd configs for fp5280g2, by adding the following specific configs
for fp5280g2 to replace the default ones.
openpower-fru-inventory
openpower-fru-vpd-layout

Tested: Manually update eeprom and verified vpd information are
corrected on fp5280g2 via dbus and ipmitool commands.

(From meta-inspur rev: 65f5494753ac5d477fb96aa163c0a8f633aaa078)

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I311082d53a1339960d17db2f501c5c619b965fb8
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-inspur/meta-fp5280g2/conf/machine/fp5280g2.conf b/meta-inspur/meta-fp5280g2/conf/machine/fp5280g2.conf
index 2e754bc..22eedaf 100644
--- a/meta-inspur/meta-fp5280g2/conf/machine/fp5280g2.conf
+++ b/meta-inspur/meta-fp5280g2/conf/machine/fp5280g2.conf
@@ -4,6 +4,8 @@
 UBOOT_MACHINE = "ast_g5_ncsi_config"
 
 PREFERRED_PROVIDER_virtual/p9-vcs-workaround = ''
+PREFERRED_PROVIDER_virtual/openpower-fru-vpd-layout = "fp5280g2-openpower-fru-vpd-layout-native"
+PREFERRED_PROVIDER_virtual/openpower-fru-inventory = "fp5280g2-openpower-fru-inventory-native"
 
 require conf/machine/include/ast2500.inc
 require conf/machine/include/obmc-bsp-common.inc
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/configuration/fp5280g2-yaml-config/fp5280g2-ipmi-fru.yaml b/meta-inspur/meta-fp5280g2/recipes-phosphor/configuration/fp5280g2-yaml-config/fp5280g2-ipmi-fru.yaml
index 901914c..19859fb 100644
--- a/meta-inspur/meta-fp5280g2/recipes-phosphor/configuration/fp5280g2-yaml-config/fp5280g2-ipmi-fru.yaml
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/configuration/fp5280g2-yaml-config/fp5280g2-ipmi-fru.yaml
@@ -55,7 +55,7 @@
                     Value: false
 3:
     /system:
-        entityID: 7
+        entityID: 6
         entityInstance: 1
         interfaces:
             xyz.openbmc_project.Inventory.Decorator.Asset:
@@ -65,7 +65,7 @@
                 SerialNumber:
                     IPMIFruProperty: Serial Number
                     IPMIFruSection: Chassis
-    /system/chassis/motherboard:
+    /system/chassis/motherboard/bmc:
         entityID: 7
         entityInstance: 1
         interfaces:
@@ -534,3 +534,13 @@
                 PrettyName:
                     IPMIFruProperty: Name
                     IPMIFruSection: Product
+20:
+    /system/chassis/motherboard/bmc/ethernet:
+        entityID: 7
+        entityInstance: 2
+        interfaces:
+            xyz.openbmc_project.Inventory.Item.NetworkInterface:
+                MACAddress:
+                    IPMIFruProperty: MACAddress
+                    IPMIFruSection: Product
+            xyz.openbmc_project.Inventory.Item.Ethernet:
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend b/meta-inspur/meta-fp5280g2/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
index 755b9ea..220f7b4 100644
--- a/meta-inspur/meta-fp5280g2/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
@@ -1,2 +1,2 @@
-RDEPENDS_${PN}-inventory_append_fp5280g2 = " openpower-occ-control phosphor-cooling-type"
+RDEPENDS_${PN}-inventory_append_fp5280g2 = " openpower-fru-vpd openpower-occ-control phosphor-cooling-type"
 RDEPENDS_${PN}-extras_append_fp5280g2 = " phosphor-webui"
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/vpd/fp5280g2-openpower-fru-inventory-native.bb b/meta-inspur/meta-fp5280g2/recipes-phosphor/vpd/fp5280g2-openpower-fru-inventory-native.bb
new file mode 100644
index 0000000..915af76
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/vpd/fp5280g2-openpower-fru-inventory-native.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Inspur FP5280G2 Inventory config for openpower-vpd-parser"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${INSPURBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
+
+inherit native
+inherit openpower-fru-vpd
+
+SRC_URI += "file://inventory"
+
+PROVIDES += "virtual/openpower-fru-inventory"
+
+S = "${WORKDIR}"
+
+do_install() {
+        DEST=${D}${inventory_datadir_native}
+        install -d ${DEST}
+        install inventory ${DEST}
+}
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/vpd/fp5280g2-openpower-fru-inventory/inventory b/meta-inspur/meta-fp5280g2/recipes-phosphor/vpd/fp5280g2-openpower-fru-inventory/inventory
new file mode 100644
index 0000000..2e6b391
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/vpd/fp5280g2-openpower-fru-inventory/inventory
@@ -0,0 +1,3 @@
+FRUS=BMC,ETHERNET
+PATHS=/system/chassis/motherboard/bmc,/system/chassis/motherboard/bmc/ethernet
+EEPROM=/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a080.i2c-bus/i2c-1/1-0050/eeprom
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/vpd/fp5280g2-openpower-fru-vpd-layout-native.bb b/meta-inspur/meta-fp5280g2/recipes-phosphor/vpd/fp5280g2-openpower-fru-vpd-layout-native.bb
new file mode 100644
index 0000000..46611fa
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/vpd/fp5280g2-openpower-fru-vpd-layout-native.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Inspur FP5280G2 VPD layout for openpower-fru-vpd"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${INSPURBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
+
+inherit native
+inherit openpower-fru-vpd
+
+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-inspur/meta-fp5280g2/recipes-phosphor/vpd/fp5280g2-openpower-fru-vpd-layout/layout.yaml b/meta-inspur/meta-fp5280g2/recipes-phosphor/vpd/fp5280g2-openpower-fru-vpd-layout/layout.yaml
new file mode 100644
index 0000000..aab99db
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/vpd/fp5280g2-openpower-fru-vpd-layout/layout.yaml
@@ -0,0 +1,12 @@
+BMC:
+    xyz.openbmc_project.Inventory.Decorator.Asset:
+        OPFR,VP: PartNumber
+        OPFR,VS: SerialNumber
+        OPFR,VN: Manufacturer
+    xyz.openbmc_project.Inventory.Item:
+        VINI,DR: PrettyName
+    xyz.openbmc_project.Inventory.Item.Bmc:
+ETHERNET:
+    xyz.openbmc_project.Inventory.Item.NetworkInterface:
+        OPFR,B1: MACAddress
+    xyz.openbmc_project.Inventory.Item.Ethernet: