summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThang Tran <thuutran@amperecomputing.com>2022-04-30 11:56:31 +0300
committerThang Q. Nguyen <thang@os.amperecomputing.com>2022-10-19 06:38:30 +0300
commit95ca309f3bb31d218161a7860049f6740cd43222 (patch)
treeb6afa00277451178cea05b4d23888192fdd74e54
parent5e313e95441e1e094aa0e31128d41336ddcdb5f5 (diff)
downloadopenbmc-95ca309f3bb31d218161a7860049f6740cd43222.tar.xz
meta-ampere: mtmitchell: set BMC MAC address from FRU
Update the MAC address via BMC FRU data, the MAC address is based on "Board extra information 1". BMC FRU device is detected based on i2c bus index and address. Tested: 1. Clear environment and then reboot BMC. 2. Wait for BMC to boot complete, check for eth0 to have MAC Address the same value defined in FRU at Board Extra. Signed-off-by: Thang Tran <thuutran@amperecomputing.com> Change-Id: I5d644109143e4d600b92e23e3f1627986e827768
-rw-r--r--meta-ampere/meta-mitchell/conf/machine/mtmitchell.conf1
-rw-r--r--meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-mac-update.bb18
-rw-r--r--meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-mac-update/ampere_update_mac.service16
3 files changed, 35 insertions, 0 deletions
diff --git a/meta-ampere/meta-mitchell/conf/machine/mtmitchell.conf b/meta-ampere/meta-mitchell/conf/machine/mtmitchell.conf
index c821cb1ca6..a2d43c981b 100644
--- a/meta-ampere/meta-mitchell/conf/machine/mtmitchell.conf
+++ b/meta-ampere/meta-mitchell/conf/machine/mtmitchell.conf
@@ -30,6 +30,7 @@ OBMC_IMAGE_EXTRA_INSTALL:append = " \
ampere-ipmi-oem \
ampere-hostctrl \
ampere-driver-binder \
+ ampere-mac-update \
phosphor-ipmi-blobs \
phosphor-ipmi-blobs-binarystore \
util-linux \
diff --git a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-mac-update.bb b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-mac-update.bb
new file mode 100644
index 0000000000..7deb05a219
--- /dev/null
+++ b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-mac-update.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Ampere Computing LLC Update MAC Address from FRU Inventory Information"
+DESCRIPTION = "Update MAC Address from FRU Inventory Information for Ampere systems"
+PR = "r1"
+
+LICENSE = "Apache-2.0"
+
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit systemd
+inherit obmc-phosphor-systemd
+
+DEPENDS = "systemd"
+RDEPENDS:${PN} = "bash"
+
+FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
+
+SYSTEMD_SERVICE:${PN} = "ampere_update_mac.service"
+
diff --git a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-mac-update/ampere_update_mac.service b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-mac-update/ampere_update_mac.service
new file mode 100644
index 0000000000..f68f029aed
--- /dev/null
+++ b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-mac-update/ampere_update_mac.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Updating MAC Address Service From FRU inventory
+Requires=xyz.openbmc_project.EntityManager.service
+After=xyz.openbmc_project.EntityManager.service
+StartLimitInterval=25
+StartLimitBurst=5
+
+[Service]
+ExecStart=/usr/bin/env ampere_update_mac.sh eth0 14 80
+SyslogIdentifier=ampere_update_mac.sh
+RemainAfterExit=yes
+Restart=on-failure
+RestartSec=5
+
+[Install]
+WantedBy={SYSTEMD_DEFAULT_TARGET}