summaryrefslogtreecommitdiff
path: root/meta-ampere/meta-common
diff options
context:
space:
mode:
Diffstat (limited to 'meta-ampere/meta-common')
-rw-r--r--meta-ampere/meta-common/recipes-ac01/mac/ampere-mac-update.bb26
-rw-r--r--meta-ampere/meta-common/recipes-ac01/mac/ampere-mac-update/ampere_update_mac.service12
-rw-r--r--meta-ampere/meta-common/recipes-ac01/mac/ampere-mac-update/ampere_update_mac.sh43
-rw-r--r--meta-ampere/meta-common/recipes-ac01/packagegroups/packagegroup-ampere-apps.bb2
-rwxr-xr-xmeta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/firmware_update.sh101
-rw-r--r--meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-host-bios@.service2
-rw-r--r--meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend15
-rw-r--r--meta-ampere/meta-common/recipes-phosphor/ipmi/ampere-ipmi-oem.bb32
-rw-r--r--meta-ampere/meta-common/recipes-phosphor/smbios/smbios-mdr_git.bbappend3
-rw-r--r--meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager/ampere-reset-host-check@.service18
-rw-r--r--meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend9
11 files changed, 152 insertions, 111 deletions
diff --git a/meta-ampere/meta-common/recipes-ac01/mac/ampere-mac-update.bb b/meta-ampere/meta-common/recipes-ac01/mac/ampere-mac-update.bb
deleted file mode 100644
index b6ddfad80..000000000
--- a/meta-ampere/meta-common/recipes-ac01/mac/ampere-mac-update.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-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}:"
-
-SRC_URI += " \
- file://ampere_update_mac.sh \
- "
-
-SYSTEMD_SERVICE:${PN} = "ampere_update_mac.service"
-
-do_install:append() {
- install -d ${D}/${sbindir}
- install -m 755 ${WORKDIR}/ampere_update_mac.sh ${D}/${sbindir}
-}
diff --git a/meta-ampere/meta-common/recipes-ac01/mac/ampere-mac-update/ampere_update_mac.service b/meta-ampere/meta-common/recipes-ac01/mac/ampere-mac-update/ampere_update_mac.service
deleted file mode 100644
index 86f7a0346..000000000
--- a/meta-ampere/meta-common/recipes-ac01/mac/ampere-mac-update/ampere_update_mac.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=Updating MAC Address Service From FRU inventory
-After=xyz.openbmc_project.Inventory.Manager.service
-
-[Service]
-ExecStart=/usr/sbin/ampere_update_mac.sh
-SyslogIdentifier=ampere_update_mac.sh
-Type=oneshot
-RemainAfterExit=yes
-
-[Install]
-WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/meta-ampere/meta-common/recipes-ac01/mac/ampere-mac-update/ampere_update_mac.sh b/meta-ampere/meta-common/recipes-ac01/mac/ampere-mac-update/ampere_update_mac.sh
deleted file mode 100644
index 5dbdde771..000000000
--- a/meta-ampere/meta-common/recipes-ac01/mac/ampere-mac-update/ampere_update_mac.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-#
-# This script is used to get the MAC Address from FRU Inventory information
-
-ETHERNET_INTERFACE="eth0"
-ENV_ETH="eth1addr"
-ENV_MAC_ADDR=`fw_printenv`
-
-# Check if BMC MAC address is exported
-if [[ $ENV_MAC_ADDR =~ $ENV_ETH ]]; then
- echo "WARNING: BMC MAC address already exist!"
- exit 0
-fi
-
-# Read FRU Board Custom Field 1 to get the MAC address
-CUSTOM_FIELD_1=`busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard xyz.openbmc_project.Inventory.Item.NetworkInterface MACAddress`
-MAC_ADDR=`echo $CUSTOM_FIELD_1 | cut -d "\"" -f 2`
-
-# Check if BMC MAC address is exported
-if [ -z "${MAC_ADDR}" ]; then
- echo "ERROR: No BMC MAC address is detected from FRU Inventory information!"
- # Return 1 so that systemd knows the service failed to start
- exit 1
-fi
-
-# Request to update the MAC address
-fw_setenv ${ENV_ETH} ${MAC_ADDR}
-
-if [[ $? -ne 0 ]]; then
- echo "ERROR: Fail to set MAC address to ${ENV_ETH}"
- exit 1
-fi
-
-# Request to restart the service
-ifconfig ${ETHERNET_INTERFACE} down
-ifconfig ${ETHERNET_INTERFACE} hw ether ${MAC_ADDR}
-if [[ $? -ne 0 ]]; then
- echo "ERROR: Can not update MAC ADDR to ${ETHERNET_INTERFACE}"
- exit 1
-fi
-ifconfig ${ETHERNET_INTERFACE} up
-
-echo "Successfully update the MAC address ${MAC_ADDR} to ${ENV_ETH} and ${ETHERNET_INTERFACE}"
diff --git a/meta-ampere/meta-common/recipes-ac01/packagegroups/packagegroup-ampere-apps.bb b/meta-ampere/meta-common/recipes-ac01/packagegroups/packagegroup-ampere-apps.bb
index 856d3dc0a..ede8d9db5 100644
--- a/meta-ampere/meta-common/recipes-ac01/packagegroups/packagegroup-ampere-apps.bb
+++ b/meta-ampere/meta-common/recipes-ac01/packagegroups/packagegroup-ampere-apps.bb
@@ -31,9 +31,11 @@ RDEPENDS:${PN}-chassis = " \
SUMMARY:${PN}-system = "Ampere System"
RDEPENDS:${PN}-system = " \
+ smbios-mdr \
"
SUMMARY:${PN}-flash = "Ampere Flash"
RDEPENDS:${PN}-flash = " \
ampere-flash-utils \
+ phosphor-software-manager \
"
diff --git a/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/firmware_update.sh b/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/firmware_update.sh
new file mode 100755
index 000000000..af3e2bead
--- /dev/null
+++ b/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/firmware_update.sh
@@ -0,0 +1,101 @@
+#!/bin/bash
+#
+# Copyright (c) 2021 Ampere Computing LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This script updates the EDKII / SCP firmware.
+# Author : Chanh Nguyen (chnguyen@amperecomputing.com)
+# Date : Sep 7, 2021
+# Modified:
+
+usage () {
+ echo "Usage:"
+ echo " $(basename $0) <image path> "
+ echo "Where:"
+ echo " <image path>: the path link to folder, which include image file and MANIFEST"
+ echo "Example:"
+ echo " $(basename $0) /tmp/images/ghdh1393"
+}
+
+
+IMG_PATH="$1"
+if [ ! -d $IMG_PATH ]; then
+ echo $IMG_PATH
+ echo "The folder $IMG_PATH does not exist"
+ usage
+ exit 1
+fi
+
+MANIFEST_PATH="${IMG_PATH}/MANIFEST"
+if [ ! -f $MANIFEST_PATH ]; then
+ echo $MANIFEST_PATH
+ echo "The MANIFEST file $MANIFEST_PATH does not exist"
+ usage
+ exit 1
+fi
+
+EXTENDED_VERSION=$(awk '/ExtendedVersion/ {print}' ${MANIFEST_PATH} | cut -d "=" -f 2)
+
+# If the ExtendedVersion is empty, set default to update UEFI/EDKII on primary device
+if [ -z "$EXTENDED_VERSION" ]
+then
+ EXTENDED_VERSION="primary"
+fi
+
+# Assign the command based on the ExtendedVersion
+case ${EXTENDED_VERSION} in
+ "primary")
+ export IMAGE=$(find ${IMG_PATH} -type f \( -name "*.img" -o -name "*.bin" -o -name "*.rom" \))
+ export CMD='/usr/sbin/ampere_flash_bios.sh $IMAGE 1'
+ ;;
+
+ "secondary")
+ export IMAGE=$(find ${IMG_PATH} -type f \( -name "*.img" -o -name "*.bin" -o -name "*.rom" \))
+ export CMD='/usr/sbin/ampere_flash_bios.sh $IMAGE 2'
+ ;;
+
+ "scp-primary")
+ export IMAGE=$(find ${IMG_PATH} -type f \( -name "*.img" -o -name "*.slim" -o -name "*.rom" \))
+ export CMD='/usr/sbin/ampere_firmware_upgrade.sh smpmpro $IMAGE 1'
+ ;;
+
+ "scp-secondary")
+ export IMAGE=$(find ${IMG_PATH} -type f \( -name "*.img" -o -name "*.slim" -o -name "*.rom" \))
+ export CMD='/usr/sbin/ampere_firmware_upgrade.sh smpmpro $IMAGE 2'
+ ;;
+
+ "fru")
+ export IMAGE=$(find ${IMG_PATH} -type f \( -name "*.bin" \))
+ export CMD='/usr/sbin/ampere_firmware_upgrade.sh fru $IMAGE'
+ ;;
+
+ *)
+ echo "Invalid ExtendedVersion: ${EXTENDED_VERSION}. Please check MANIFEST file!"
+ exit 1
+ ;;
+esac
+
+
+if [ -z "$IMAGE" ]
+then
+ echo "ERROR: The image file: No such file or directory"
+ exit 1
+else
+ eval $CMD
+fi
+
+if [[ $? -ne 0 ]]; then
+ echo "ERROR: The firmware update not successfull"
+ exit 1
+fi
diff --git a/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-host-bios@.service b/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-host-bios@.service
index c344600b2..036b78928 100644
--- a/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-host-bios@.service
+++ b/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-host-bios@.service
@@ -4,4 +4,4 @@ Description=Ampere service for flashing the Host firmware image
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart=/usr/sbin/ampere_flash_bios.sh /tmp/images/%I/*.img
+ExecStart=/usr/sbin/firmware_update.sh /tmp/images/%I
diff --git a/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend b/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend
index f5a250d60..853e5464a 100644
--- a/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend
+++ b/meta-ampere/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend
@@ -1,7 +1,18 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+SRC_URI += " \
+ file://firmware_update.sh \
+ "
+
PACKAGECONFIG[flash_bios] = "-Dhost-bios-upgrade=enabled, -Dhost-bios-upgrade=disabled"
-PACKAGECONFIG:append_ = " flash_bios"
+PACKAGECONFIG:append = " flash_bios"
+
+SYSTEMD_SERVICE:${PN}:updater += "${@bb.utils.contains('PACKAGECONFIG', 'flash_bios', 'obmc-flash-host-bios@.service', '', d)}"
+
+RDEPENDS:${PN} += "bash"
-SYSTEMD_SERVICE:${PN}-updater += "${@bb.utils.contains('PACKAGECONFIG', 'flash_bios', 'obmc-flash-host-bios@.service', '', d)}"
+do_install:append() {
+ install -d ${D}/usr/sbin
+ install -m 0755 ${WORKDIR}/firmware_update.sh ${D}/usr/sbin/firmware_update.sh
+}
diff --git a/meta-ampere/meta-common/recipes-phosphor/ipmi/ampere-ipmi-oem.bb b/meta-ampere/meta-common/recipes-phosphor/ipmi/ampere-ipmi-oem.bb
new file mode 100644
index 000000000..e0a6819b6
--- /dev/null
+++ b/meta-ampere/meta-common/recipes-phosphor/ipmi/ampere-ipmi-oem.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Ampere OEM IPMI commands"
+DESCRIPTION = "Ampere OEM IPMI commands"
+
+LICENSE = "Apache-2.0"
+S = "${WORKDIR}"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
+
+DEPENDS = "boost phosphor-ipmi-host phosphor-logging systemd libgpiod"
+
+inherit cmake obmc-phosphor-ipmiprovider-symlink
+
+EXTRA_OECMAKE="-DENABLE_TEST=0 -DYOCTO=1"
+
+LIBRARY_NAMES = "libzampoemcmds.so"
+
+S = "${WORKDIR}/git"
+SRC_URI = "git://github.com/openbmc/ampere-ipmi-oem.git"
+SRCREV = "1463f7013a17699081c1fbf506ee8d57827d1088"
+
+HOSTIPMI_PROVIDER_LIBRARY += "${LIBRARY_NAMES}"
+NETIPMI_PROVIDER_LIBRARY += "${LIBRARY_NAMES}"
+
+FILES:${PN}:append = " ${libdir}/ipmid-providers/lib*${SOLIBS}"
+FILES:${PN}:append = " ${libdir}/host-ipmid/lib*${SOLIBS}"
+FILES:${PN}:append = " ${libdir}/net-ipmid/lib*${SOLIBS}"
+FILES:${PN}-dev:append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV}"
+
+do_install:append(){
+ install -d ${D}${includedir}/ampere-ipmi-oem
+ install -m 0644 -D ${S}/include/*.hpp ${D}${includedir}/ampere-ipmi-oem
+}
diff --git a/meta-ampere/meta-common/recipes-phosphor/smbios/smbios-mdr_git.bbappend b/meta-ampere/meta-common/recipes-phosphor/smbios/smbios-mdr_git.bbappend
new file mode 100644
index 000000000..cbc9b80f8
--- /dev/null
+++ b/meta-ampere/meta-common/recipes-phosphor/smbios/smbios-mdr_git.bbappend
@@ -0,0 +1,3 @@
+PACKAGECONFIG:append = " smbios-ipmi-blob"
+
+PACKAGECONFIG:remove = " cpuinfo" \ No newline at end of file
diff --git a/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager/ampere-reset-host-check@.service b/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager/ampere-reset-host-check@.service
deleted file mode 100644
index 83f6581be..000000000
--- a/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager/ampere-reset-host-check@.service
+++ /dev/null
@@ -1,18 +0,0 @@
-[Unit]
-Description=Check Host%i status on BMC reset
-Wants=phosphor-ipmi-host.service
-After=phosphor-ipmi-host.service
-Wants=obmc-host-reset-running@%i.target
-Before=obmc-host-reset-running@%i.target
-Wants=op-reset-chassis-on@%i.service
-After=op-reset-chassis-on@%i.service
-Conflicts=obmc-host-stop@%i.target
-ConditionPathExists=/run/openbmc/chassis@%i-on
-
-[Service]
-RemainAfterExit=yes
-Type=oneshot
-ExecStart=/usr/sbin/ampere_host_check.sh 1 0
-
-[Install]
-WantedBy=obmc-host-reset@%i.target \ No newline at end of file
diff --git a/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend b/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend
index b25ba5d94..03df6a30e 100644
--- a/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend
+++ b/meta-ampere/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend
@@ -4,12 +4,3 @@ DEPS_CFG = "resetreason.conf"
DEPS_TGT = "phosphor-discover-system-state@.service"
SYSTEMD_OVERRIDE:${PN}-discover:append = "${DEPS_CFG}:${DEPS_TGT}.d/${DEPS_CFG}"
-FILES:${PN} += "${systemd_system_unitdir}/*"
-
-SRC_URI += " \
- file://ampere-reset-host-check@.service \
- "
-
-do_install:append() {
- install -m 0644 ${WORKDIR}/ampere-reset-host-check@.service ${D}${systemd_unitdir}/system/phosphor-reset-host-check@.service
-}