meta-evb: meta-evb-arm: use kernel mctp stack
create mctp-local.service to
- configure serial parameters for /dev/ttyAMA1
- create the link with 'mctp' command
- configure local and remote EID for the link
- setup the endpoint with mctpd
Tested: pldm commands work and response is received from the MCP
Change-Id: If924376c4775229c1701924e154894e4eaefa362
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/machine/fvp.conf b/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/machine/fvp.conf
index 1a65c6f..bccea33 100644
--- a/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/machine/fvp.conf
+++ b/meta-evb/meta-evb-arm/meta-evb-fvp-base/conf/machine/fvp.conf
@@ -6,6 +6,7 @@
require conf/distro/include/phosphor-mmc.inc
require conf/machine/include/arm/arch-armv8-4a.inc
+require conf/distro/include/mctp.inc
require conf/distro/include/pldm.inc
require conf/machine/include/obmc-evb-common.inc
require conf/machine/include/obmc-bsp-common.inc
diff --git a/meta-evb/meta-evb-arm/meta-evb-fvp-base/recipes-phosphor/mctp/files/mctp-local.service b/meta-evb/meta-evb-arm/meta-evb-fvp-base/recipes-phosphor/mctp/files/mctp-local.service
new file mode 100644
index 0000000..9f96750
--- /dev/null
+++ b/meta-evb/meta-evb-arm/meta-evb-fvp-base/recipes-phosphor/mctp/files/mctp-local.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=MCTP configuration for serial ttyAMA1
+After=mctpd.service
+Before=pldmd.service
+BindTo=mctpd.service
+
+[Service]
+Type=simple
+ExecStartPre=stty -F /dev/ttyAMA1 115200 litout -crtscts -ixon -echo raw
+ExecStart=mctp link serial /dev/ttyAMA1
+ExecStartPost=sleep 3
+ExecStartPost=mctp link set mctpserial0 up
+ExecStartPost=mctp addr add 8 dev mctpserial0
+ExecStartPost=mctp route add 18 via mctpserial0
+ExecStartPost=busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp au.com.CodeConstruct.MCTP SetupEndpoint say mctpserial0 0
+
+[Install]
+WantedBy=mctpd.service
diff --git a/meta-evb/meta-evb-arm/meta-evb-fvp-base/recipes-phosphor/mctp/mctp_%.bbappend b/meta-evb/meta-evb-arm/meta-evb-fvp-base/recipes-phosphor/mctp/mctp_%.bbappend
new file mode 100644
index 0000000..1267b0a
--- /dev/null
+++ b/meta-evb/meta-evb-arm/meta-evb-fvp-base/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-evb/meta-evb-arm/meta-evb-fvp-base/recipes-phosphor/pldm/files/host_eid b/meta-evb/meta-evb-arm/meta-evb-fvp-base/recipes-phosphor/pldm/files/host_eid
index 573541a..3c03207 100644
--- a/meta-evb/meta-evb-arm/meta-evb-fvp-base/recipes-phosphor/pldm/files/host_eid
+++ b/meta-evb/meta-evb-arm/meta-evb-fvp-base/recipes-phosphor/pldm/files/host_eid
@@ -1 +1 @@
-0
+18
diff --git a/meta-evb/meta-evb-arm/meta-evb-fvp-base/recipes-phosphor/pldm/pldm_%.bbappend b/meta-evb/meta-evb-arm/meta-evb-fvp-base/recipes-phosphor/pldm/pldm_%.bbappend
index 8388b84..9883cf4 100644
--- a/meta-evb/meta-evb-arm/meta-evb-fvp-base/recipes-phosphor/pldm/pldm_%.bbappend
+++ b/meta-evb/meta-evb-arm/meta-evb-fvp-base/recipes-phosphor/pldm/pldm_%.bbappend
@@ -1,8 +1,12 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+# increase the timeouts for our use-case,
+# refer to this layer's README.md
+
EXTRA_OEMESON:append = " \
- -Doem-ibm=disabled \
- "
+ -Dresponse-time-out=4800 \
+ -Ddbus-timeout-value=10 \
+"
SRC_URI:append = " file://host_eid "