diff options
author | Christophe Lombard <clombard@linux.ibm.com> | 2023-08-29 11:23:20 +0200 |
---|---|---|
committer | Reza Arbab <arbab@linux.ibm.com> | 2023-09-12 14:22:11 -0500 |
commit | 1a3ba1ec80071a031e793fc51954c88bbdfca645 (patch) | |
tree | b1c46010a7b6d580a9c65fa5b00f814f35e62980 /hw/ast-bmc | |
parent | 4fc06a6cb136a0acaef03e603bb906a6e6c48788 (diff) | |
download | skiboot-1a3ba1ec80071a031e793fc51954c88bbdfca645.zip skiboot-1a3ba1ec80071a031e793fc51954c88bbdfca645.tar.gz skiboot-1a3ba1ec80071a031e793fc51954c88bbdfca645.tar.bz2 |
core/pldm: PLDM over MCTP Binding
Enable the mctp binding over LPC bus interface and new wrappers to send
and receive PLDM messages over the mctp library.
PLDM is supported as a message type over MCTP. PLDM over MCTP binding
defines the format of PLDM over MCTP messages.
An MCTP Endpoint is the terminus for MCTP communication. A physical device
that supports MCTP may provide one or more MCTP Endpoints. Endpoints are
addressed using a logical address called the Endpoint ID, or EID. EIDs in
MCTP are analogous to IP Addresses in Internet Protocol networking.
The BMC EID default is 8.
First byte of the PLDM over MCTP Message Fields identifies the MCTP
message as carrying a PLDM message:
Message Type (7 bits) PLDM = 0x01 (000_0001b).
Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com>
Signed-off-by: Christophe Lombard <clombard@linux.ibm.com>
Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
Diffstat (limited to 'hw/ast-bmc')
-rw-r--r-- | hw/ast-bmc/ast-mctp.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/hw/ast-bmc/ast-mctp.c b/hw/ast-bmc/ast-mctp.c index c2efb7b..00f66ab 100644 --- a/hw/ast-bmc/ast-mctp.c +++ b/hw/ast-bmc/ast-mctp.c @@ -12,6 +12,7 @@ #include <device.h> #include <ast.h> #include <console.h> +#include <pldm.h> #include <libmctp.h> #include <libmctp-cmds.h> #include <libmctp-log.h> @@ -286,6 +287,23 @@ static void message_rx(uint8_t eid, bool tag_owner, prlog(PR_TRACE, "message received: msg type: %x, len %zd" " (eid: %d), rx tag %d owner %d\n", *msg, len, eid, tag_owner, msg_tag); + + /* The first byte defines the type of MCTP packet payload + * contained in the message data portion of the MCTP message. + * (See DSP0236 for more details about MCTP packet fields). + * For now we only support PLDM over MCTP. + */ + switch (*msg) { + case MCTP_MSG_TYPE_PLDM: + /* handle the PLDM message */ + pldm_mctp_message_rx(eid, tag_owner, msg_tag, + msg + sizeof(uint8_t), + len - sizeof(uint8_t)); + break; + default: + prlog(PR_ERR, "%s - not a pldm message type (type: %x)\n", + __func__, *msg); + } } /* |