summaryrefslogtreecommitdiff
path: root/meta-ampere
diff options
context:
space:
mode:
authorThang Q. Nguyen <thang@os.amperecomputing.com>2023-10-19 06:19:11 +0300
committerThang Q. Nguyen <thang@os.amperecomputing.com>2023-10-23 04:52:01 +0300
commit7b3a9f5a9abeced85dd3c90e03c0259d52c16f26 (patch)
treed26f3d909f4b9ce6dfefd36239e5a04092db05e9 /meta-ampere
parentd85233532c89612b0006a39c26ea94375bbcd2bc (diff)
downloadopenbmc-7b3a9f5a9abeced85dd3c90e03c0259d52c16f26.tar.xz
meta-ampere: mtmitchell: enable MCTP/PLDM
Enable MCTP in kernel support with Mt.Mitchell MCTP configuration. Tested: 1. Check for mctpi2c3 in ifconfig command. 2. Check for mctpd.service service started and is in running state. 3. Check for pldmd.service service started and is in running state. Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com> Change-Id: I699e9bc93ae5815b8454a8cc42ec22d4cfd735e1
Diffstat (limited to 'meta-ampere')
-rw-r--r--meta-ampere/meta-common/recipes-phosphor/mctp/files/mctp-local.service14
-rw-r--r--meta-ampere/meta-common/recipes-phosphor/mctp/mctp_%.bbappend12
-rw-r--r--meta-ampere/meta-common/recipes-phosphor/pldm/files/host_eid1
-rw-r--r--meta-ampere/meta-common/recipes-phosphor/pldm/pldm_%.bbappend23
-rw-r--r--meta-ampere/meta-mitchell/conf/machine/mtmitchell.conf1
5 files changed, 51 insertions, 0 deletions
diff --git a/meta-ampere/meta-common/recipes-phosphor/mctp/files/mctp-local.service b/meta-ampere/meta-common/recipes-phosphor/mctp/files/mctp-local.service
new file mode 100644
index 0000000000..6dfc00e15f
--- /dev/null
+++ b/meta-ampere/meta-common/recipes-phosphor/mctp/files/mctp-local.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=MCTP configuration for i2c bus 3
+After=mctpd.service
+BindTo=mctpd.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/mctp link set mctpi2c3 up
+ExecStart=/usr/bin/mctp addr add 8 dev mctpi2c3
+ExecStart=/usr/bin/mctp neigh add 8 dev mctpi2c3 lladdr 0x10
+RemainAfterExit=true
+
+[Install]
+WantedBy=mctpd.service
diff --git a/meta-ampere/meta-common/recipes-phosphor/mctp/mctp_%.bbappend b/meta-ampere/meta-common/recipes-phosphor/mctp/mctp_%.bbappend
new file mode 100644
index 0000000000..711913b7a1
--- /dev/null
+++ b/meta-ampere/meta-common/recipes-phosphor/mctp/mctp_%.bbappend
@@ -0,0 +1,12 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI:append = " \
+ file://mctp-local.service \
+ "
+
+SYSTEMD_SERVICE:${PN} += "mctp-local.service"
+
+do_install:append() {
+ install -m 0644 ${WORKDIR}/mctp-local.service ${D}${systemd_system_unitdir}/
+}
+
diff --git a/meta-ampere/meta-common/recipes-phosphor/pldm/files/host_eid b/meta-ampere/meta-common/recipes-phosphor/pldm/files/host_eid
new file mode 100644
index 0000000000..573541ac97
--- /dev/null
+++ b/meta-ampere/meta-common/recipes-phosphor/pldm/files/host_eid
@@ -0,0 +1 @@
+0
diff --git a/meta-ampere/meta-common/recipes-phosphor/pldm/pldm_%.bbappend b/meta-ampere/meta-common/recipes-phosphor/pldm/pldm_%.bbappend
new file mode 100644
index 0000000000..6381917bb7
--- /dev/null
+++ b/meta-ampere/meta-common/recipes-phosphor/pldm/pldm_%.bbappend
@@ -0,0 +1,23 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI:append = " file://host_eid"
+
+SYSTEMD_SERVICE:${PN}:remove = " \
+ pldmSoftPowerOff.service \
+ "
+SRC_URI:remove = "file://pldm-softpoweroff"
+
+EXTRA_OEMESON:append = " \
+ -Dtransport-implementation=af-mctp \
+ "
+
+do_install:append() {
+ install -d ${D}/${datadir}/pldm
+ install ${WORKDIR}/host_eid ${D}/${datadir}/pldm/
+ LINK="${D}${systemd_unitdir}/obmc-host-shutdown@0.target.wants/pldmSoftPowerOff.service"
+ rm -f $LINK
+ LINK="${D}${systemd_unitdir}/obmc-host-warm-reboot@0.target.wants/pldmSoftPowerOff.service"
+ rm -f $LINK
+ rm -f ${D}${systemd_unitdir}/system/pldmSoftPowerOff.service
+ rm -rf ${D}/${bindir}/pldm-softpoweroff
+}
diff --git a/meta-ampere/meta-mitchell/conf/machine/mtmitchell.conf b/meta-ampere/meta-mitchell/conf/machine/mtmitchell.conf
index 13598dcfa3..0c3f218682 100644
--- a/meta-ampere/meta-mitchell/conf/machine/mtmitchell.conf
+++ b/meta-ampere/meta-mitchell/conf/machine/mtmitchell.conf
@@ -9,6 +9,7 @@ SERIAL_CONSOLES = "115200;ttyS4"
require conf/machine/include/ast2600.inc
require conf/machine/include/obmc-bsp-common.inc
+require conf/distro/include/pldm.inc
FLASH_SIZE = "65536"
VOLATILE_LOG_DIR = "no"