Add Mihawk mac address sync

Change-Id: I0df46c024552a80c35131af315fd1576e44839c3
Signed-off-by: Alvin Wang <alvinwang@msn.com>
diff --git a/meta-witherspoon/conf/machine/mihawk.conf b/meta-witherspoon/conf/machine/mihawk.conf
index 53a9f5b..7a6fd87 100644
--- a/meta-witherspoon/conf/machine/mihawk.conf
+++ b/meta-witherspoon/conf/machine/mihawk.conf
@@ -7,6 +7,7 @@
 OBMC_POWER_SUPPLY_INSTANCES = "0 1"
 
 PREFERRED_PROVIDER_virtual/p9-vcs-workaround = ''
+PREFERRED_PROVIDER_virtual/openpower-fru-vpd-layout = "mihawk-openpower-fru-vpd-layout-native"
 
 require conf/machine/include/ast2500.inc
 require conf/machine/include/obmc-bsp-common.inc
@@ -36,4 +37,6 @@
 PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native_df-mrw = \
     "mihawk-led-manager-config-native"
 
-PREFERRED_PROVIDER_virtual/phosphor-logging-callouts_df-mrw = "mihawk-phosphor-logging-callouts-native"
\ No newline at end of file
+PREFERRED_PROVIDER_virtual/phosphor-logging-callouts_df-mrw = "mihawk-phosphor-logging-callouts-native"
+
+PREFERRED_PROVIDER_virtual/openpower-fru-inventory_df-mrw = "mihawk-openpower-fru-inventory-native"
diff --git a/meta-witherspoon/recipes-phosphor/images/obmc-phosphor-image.bbappend b/meta-witherspoon/recipes-phosphor/images/obmc-phosphor-image.bbappend
index 199d2c4..c66cc4e 100644
--- a/meta-witherspoon/recipes-phosphor/images/obmc-phosphor-image.bbappend
+++ b/meta-witherspoon/recipes-phosphor/images/obmc-phosphor-image.bbappend
@@ -1,2 +1,2 @@
 OBMC_IMAGE_EXTRA_INSTALL_append_ibm-ac-server = " mboxd max31785-msl phosphor-msl-verify liberation-fonts uart-render-controller first-boot-set-mac first-boot-set-hostname"
-OBMC_IMAGE_EXTRA_INSTALL_append_mihawk = " mboxd liberation-fonts uart-render-controller"
+OBMC_IMAGE_EXTRA_INSTALL_append_mihawk = " mboxd liberation-fonts uart-render-controller first-boot-set-mac"
diff --git a/meta-witherspoon/recipes-phosphor/network/first-boot-set-mac_%.bbappend b/meta-witherspoon/recipes-phosphor/network/first-boot-set-mac_%.bbappend
index cb167ee..fc8f6b8 100644
--- a/meta-witherspoon/recipes-phosphor/network/first-boot-set-mac_%.bbappend
+++ b/meta-witherspoon/recipes-phosphor/network/first-boot-set-mac_%.bbappend
@@ -1 +1,2 @@
 SYSTEMD_SERVICE_${PN}_append_ibm-ac-server = " first-boot-set-mac@eth0.service"
+SYSTEMD_SERVICE_${PN}_append_mihawk = " first-boot-set-mac@eth0.service first-boot-set-mac@eth1.service"
\ No newline at end of file
diff --git a/meta-witherspoon/recipes-phosphor/vpd/mihawk-openpower-fru-inventory-native.bb b/meta-witherspoon/recipes-phosphor/vpd/mihawk-openpower-fru-inventory-native.bb
new file mode 100644
index 0000000..e868fe9
--- /dev/null
+++ b/meta-witherspoon/recipes-phosphor/vpd/mihawk-openpower-fru-inventory-native.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Mihawk Inventory config for openpower-vpd-parser"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${IBMBASE}/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-witherspoon/recipes-phosphor/vpd/mihawk-openpower-fru-inventory/inventory b/meta-witherspoon/recipes-phosphor/vpd/mihawk-openpower-fru-inventory/inventory
new file mode 100644
index 0000000..5ae35ff
--- /dev/null
+++ b/meta-witherspoon/recipes-phosphor/vpd/mihawk-openpower-fru-inventory/inventory
@@ -0,0 +1,3 @@
+FRUS=ETHERNET,ETHERNET1
+PATHS=/system/chassis/motherboard/bmc/eth0,/system/chassis/motherboard/bmc/eth1
+EEPROM=/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a340.i2c-bus/i2c-8/8-0050/eeprom
diff --git a/meta-witherspoon/recipes-phosphor/vpd/mihawk-openpower-fru-vpd-layout-native.bb b/meta-witherspoon/recipes-phosphor/vpd/mihawk-openpower-fru-vpd-layout-native.bb
new file mode 100644
index 0000000..0b9d6a7
--- /dev/null
+++ b/meta-witherspoon/recipes-phosphor/vpd/mihawk-openpower-fru-vpd-layout-native.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Mihawk VPD layout for openpower-fru-vpd"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${IBMBASE}/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-witherspoon/recipes-phosphor/vpd/mihawk-openpower-fru-vpd-layout/layout.yaml b/meta-witherspoon/recipes-phosphor/vpd/mihawk-openpower-fru-vpd-layout/layout.yaml
new file mode 100644
index 0000000..5bceb2f
--- /dev/null
+++ b/meta-witherspoon/recipes-phosphor/vpd/mihawk-openpower-fru-vpd-layout/layout.yaml
@@ -0,0 +1,17 @@
+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:
+        VINI,B1: MACAddress
+    xyz.openbmc_project.Inventory.Item.Ethernet:
+ETHERNET1:
+    xyz.openbmc_project.Inventory.Item.NetworkInterface:
+        OPFR,B1: MACAddress
+    xyz.openbmc_project.Inventory.Item.Ethernet:
+