nicole: Add VPD support

VPD contains general description of the BMC card and MAC address for
the Ethernet controller.
Physically, VPD is stored in the EEPROM AT24C256C, which is connected
to the Aspeed SoC via I2C and can be read or written through
the special device file /sys/bus/i2c/devices/0-0050/eeprom.

(From meta-yadro rev: 95f98dc7d5ccf2b221d2a5aea51bf411201f351c)

Signed-off-by: Artem Senichev <a.senichev@yadro.com>
Change-Id: I21624f154cfa1e92eddbc1739a4e053d00889b5a
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-yadro/meta-nicole/recipes-phosphor/images/obmc-phosphor-image.bbappend b/meta-yadro/meta-nicole/recipes-phosphor/images/obmc-phosphor-image.bbappend
index aa57bbf..b2b27da 100644
--- a/meta-yadro/meta-nicole/recipes-phosphor/images/obmc-phosphor-image.bbappend
+++ b/meta-yadro/meta-nicole/recipes-phosphor/images/obmc-phosphor-image.bbappend
@@ -1 +1,4 @@
-OBMC_IMAGE_EXTRA_INSTALL_append = " mboxd"
+OBMC_IMAGE_EXTRA_INSTALL_append = " mboxd \
+                                    openpower-fru-vpd \
+                                    first-boot-set-mac \
+                                    first-boot-set-hostname"
diff --git a/meta-yadro/meta-nicole/recipes-phosphor/network/first-boot-set-mac_%.bbappend b/meta-yadro/meta-nicole/recipes-phosphor/network/first-boot-set-mac_%.bbappend
new file mode 100644
index 0000000..29d23c8
--- /dev/null
+++ b/meta-yadro/meta-nicole/recipes-phosphor/network/first-boot-set-mac_%.bbappend
@@ -0,0 +1 @@
+SYSTEMD_SERVICE_${PN} += "first-boot-set-mac@eth0.service"
diff --git a/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-inventory-native.bb b/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-inventory-native.bb
new file mode 100644
index 0000000..0a5d73c
--- /dev/null
+++ b/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-inventory-native.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Nicole Inventory config for openpower-vpd-parser"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+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-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-inventory/inventory b/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-inventory/inventory
new file mode 100644
index 0000000..62ab2da
--- /dev/null
+++ b/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-inventory/inventory
@@ -0,0 +1,3 @@
+FRUS=BMC,ETHERNET
+PATHS=/system/chassis/bmc,/system/chassis/ethernet
+EEPROM=/sys/bus/i2c/devices/0-0050/eeprom
diff --git a/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-properties-native.bb b/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-properties-native.bb
new file mode 100644
index 0000000..05be1df
--- /dev/null
+++ b/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-properties-native.bb
@@ -0,0 +1,19 @@
+SUMMARY = "FRU properties config for openpower-vpd-parser"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit native
+inherit openpower-fru-vpd
+
+SRC_URI += "file://properties.yaml"
+
+PROVIDES += "virtual/openpower-fru-properties"
+
+S = "${WORKDIR}"
+
+do_install() {
+        DEST=${D}${properties_datadir}
+        install -d ${DEST}
+        install properties.yaml ${DEST}/out.yaml
+}
diff --git a/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-properties/properties.yaml b/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-properties/properties.yaml
new file mode 100644
index 0000000..96e567c
--- /dev/null
+++ b/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-properties/properties.yaml
@@ -0,0 +1,7 @@
+/system/chassis/bmc:
+    xyz.openbmc_project.Inventory.Item:
+        Present: 'true'
+
+/system/chassis/ethernet:
+    xyz.openbmc_project.Inventory.Item:
+        Present: 'true'
diff --git a/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-vpd-layout-native.bb b/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-vpd-layout-native.bb
new file mode 100644
index 0000000..35c4de4
--- /dev/null
+++ b/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-vpd-layout-native.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Nicole VPD layout for openpower-fru-vpd"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+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-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-vpd-layout/layout.yaml b/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-vpd-layout/layout.yaml
new file mode 100644
index 0000000..e71776b
--- /dev/null
+++ b/meta-yadro/meta-nicole/recipes-phosphor/vpd/nicole-openpower-fru-vpd-layout/layout.yaml
@@ -0,0 +1,14 @@
+BMC:
+    xyz.openbmc_project.Inventory.Decorator.Asset:
+        OPFR,VP: PartNumber
+        OPFR,VS: SerialNumber
+        OPFR,VN: Manufacturer
+        OPFR,MB: BuildDate
+        OPFR,DR: Model
+    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: