inspur: fp5280g2 : Add mctp/pldm packages to fp5280g2

In order to ensure that normal ran of the mctp/pldm, temporarily add
these to the fp5280g2 machine.

Tested: Built successfully on fp5280g2 and mctp/pldm ran well.

(From meta-inspur rev: 82e0a6261199c73158f2244d819c2d9dce4e491b)

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ia344ba4467b3334e138f50f8b8c902d052e76315
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
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 1fa652d..dc51a01 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-fru-vpd openpower-occ-control phosphor-cooling-type virtual/obmc-gpio-presence"
-RDEPENDS_${PN}-extras_append_fp5280g2 = " phosphor-fp5280g2-psu-update phosphor-psu-software-manager phosphor-power phosphor-power-systemd-links phosphor-webui"
+RDEPENDS_${PN}-extras_append_fp5280g2 = " pldm mctp phosphor-fp5280g2-psu-update phosphor-psu-software-manager phosphor-power phosphor-power-systemd-links phosphor-webui"
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/FRU_Master.json b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/FRU_Master.json
new file mode 100644
index 0000000..9c631fb
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/FRU_Master.json
@@ -0,0 +1,8 @@
+{
+    "service":"xyz.openbmc_project.Inventory.Manager",
+    "root_path":"/xyz/openbmc_project/inventory/system/",
+    "interfaces":[
+        "xyz.openbmc_project.Inventory.Item.Board",
+        "xyz.openbmc_project.Inventory.Item.Cpu"
+    ]
+}
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/bios/enum_attrs.json b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/bios/enum_attrs.json
new file mode 100644
index 0000000..cd35096
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/bios/enum_attrs.json
@@ -0,0 +1,34 @@
+{
+   "entries": [
+      {
+         "attribute_name": "Led",
+         "possible_values": [
+            "On",
+            "Off"
+         ],
+         "default_values": [
+            "Off"
+         ],
+         "dbus": {
+            "object_path": "/xyz/openbmc_project/led/physical/front_memory",
+            "interface": "xyz.openbmc_project.Led.Physical",
+            "property_name": "State",
+            "property_type": "string",
+            "property_values": [
+               "xyz.openbmc_project.Led.Physical.Action.On",
+               "xyz.openbmc_project.Led.Physical.Action.Off"
+            ]
+         }
+      },
+      {
+         "attribute_name": "CodeUpdatePolicy",
+         "possible_values": [
+            "Concurrent",
+            "Disruptive"
+         ],
+         "default_values": [
+            "Concurrent"
+         ]
+      }
+   ]
+}
\ No newline at end of file
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/bios/integer_attrs.json b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/bios/integer_attrs.json
new file mode 100644
index 0000000..744b788
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/bios/integer_attrs.json
@@ -0,0 +1,17 @@
+{
+    "entries": [
+        {
+            "attribute_name": "OUTLET",
+            "lower_bound": 0,
+            "upper_bound": 68002,
+            "scalar_increment": 1,
+            "default_value": 0,
+            "dbus": {
+                "object_path": "/xyz/openbmc_project/sensors/voltage/p3v_bat",
+                "interface": "xyz.openbmc_project.Sensor.Value",
+                "property_type": "int64_t",
+                "property_name": "Value"
+            }
+        }
+    ]
+}
\ No newline at end of file
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/bios/string_attrs.json b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/bios/string_attrs.json
new file mode 100644
index 0000000..440476f
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/bios/string_attrs.json
@@ -0,0 +1,26 @@
+{
+    "entries": [
+        {
+            "attribute_name": "Model",
+            "string_type": "ASCII",
+            "minimum_string_length": 1,
+            "maximum_string_length": 100,
+            "default_string_length": 8,
+            "default_string": "FP5280G2",
+            "dbus": {
+                "object_path": "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0",
+                "interface": "xyz.openbmc_project.Inventory.Item",
+                "property_name": "PrettyName",
+                "property_type": "string"
+            }
+        },
+        {
+            "attribute_name": "str_example3",
+            "string_type": "Unknown",
+            "minimum_string_length": 1,
+            "maximum_string_length": 100,
+            "default_string_length": 2,
+            "default_string": "ef"
+        }
+    ]
+}
\ No newline at end of file
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/effecter_pdr.json b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/effecter_pdr.json
new file mode 100644
index 0000000..6493623
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/effecter_pdr.json
@@ -0,0 +1,82 @@
+{
+  "effecterPDRs": [
+    {
+      "pdrType": 11,
+      "entries": [
+        {
+          "type": 33,
+          "instance": 0,
+          "container": 0,
+          "effecters": [
+            {
+              "set": {
+                "id": 196,
+                "size": 1,
+                "states": [
+                  1,
+                  2
+                ]
+              },
+              "dbus": {
+                "path": "/xyz/openbmc_project/state/host0",
+                "interface": "xyz.openbmc_project.State.OperatingSystem.Status",
+                "property_name": "OperatingSystemState",
+                "property_type": "string",
+                "property_values": [
+                  "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Standby",
+                  "xyz.openbmc_project.OperatingSystem.Status.OSStatus.BootComplete"
+                ]
+              }
+            }
+          ]
+        },
+        {
+          "type": 45,
+          "instance": 0,
+          "container": 0,
+          "effecters": [
+            {
+              "set": {
+                "id": 260,
+                "size": 2,
+                "states": [
+                  9
+                ]
+              },
+              "dbus": {
+                "path": "/xyz/openbmc_project/state/chassis0",
+                "interface": "xyz.openbmc_project.State.Chassis",
+                "property_name": "RequestedPowerTransition",
+                "property_type": "string",
+                "property_values": [
+                  "xyz.openbmc_project.State.Chassis.Transition.Off"
+                ]
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "pdrType": 9,
+      "entries": [
+        {
+	  "type": 32768,
+	  "instance": 0,
+          "base_unit": 21,
+          "rate_unit": 3,
+          "effecter_resolution_init": 1,
+          "effecter_data_size": 4,
+          "range_field_format": 4,
+          "dbus": {
+            "path": "/xyz/openbmc_project/control/host0/power_cap",
+            "interface": "xyz.openbmc_project.Control.Power.Cap",
+            "property_name": "PowerCap",
+            "property_type": "uint32_t"
+          }
+        }
+      ]
+    }
+  ]
+}
+
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/fileTable.json b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/fileTable.json
new file mode 100644
index 0000000..9d9750a
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/fileTable.json
@@ -0,0 +1,10 @@
+[
+   {
+      "path":"/var/lib/pldm/PHYP-NVRAM",
+      "file_traits":1
+   },
+   {
+      "path":"/var/lib/pldm/PHYP-NVRAM-CKSUM",
+      "file_traits":4
+   }
+]
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/host_eid b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/host_eid
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm/host_eid
@@ -0,0 +1 @@
+9
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm_%.bbappend b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm_%.bbappend
new file mode 100755
index 0000000..5509a3e
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/pldm/pldm_%.bbappend
@@ -0,0 +1,26 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+EXTRA_OEMESON_append = " \
+        -Doem-ibm=enabled \
+        "
+
+SRC_URI += "file://fileTable.json"
+SRC_URI += "file://bios/enum_attrs.json"
+SRC_URI += "file://bios/integer_attrs.json"
+SRC_URI += "file://bios/string_attrs.json"
+SRC_URI += "file://effecter_pdr.json"
+SRC_URI += "file://FRU_Master.json"
+SRC_URI += "file://host_eid"
+
+do_install_append() {
+        install -d ${D}${datadir}/pldm/bios/
+        install -d ${D}${datadir}/pldm/pdr/
+        install -d ${D}${datadir}/pldm/fru/
+        install -m 0644 ${WORKDIR}/fileTable.json ${D}${datadir}/pldm/
+        install -m 0644 ${WORKDIR}/bios/enum_attrs.json ${D}${datadir}/pldm/bios/
+        install -m 0644 ${WORKDIR}/bios/integer_attrs.json ${D}${datadir}/pldm/bios/
+        install -m 0644 ${WORKDIR}/bios/string_attrs.json ${D}${datadir}/pldm/bios/
+        install -m 0644 ${WORKDIR}/effecter_pdr.json ${D}${datadir}/pldm/pdr/
+        install -m 0644 ${WORKDIR}/FRU_Master.json ${D}${datadir}/pldm/fru/
+        install -m 0644 ${WORKDIR}/host_eid ${D}${datadir}/pldm/
+}