aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristophe Lombard <clombard@linux.ibm.com>2023-08-29 11:23:19 +0200
committerReza Arbab <arbab@linux.ibm.com>2023-09-12 14:22:11 -0500
commit4fc06a6cb136a0acaef03e603bb906a6e6c48788 (patch)
tree4a532dbcbfd67687706350fa669fb2bbc579eae0 /include
parent66c38f45e9fc079dc47c8865ee6a27da5e7cdc0f (diff)
downloadskiboot-4fc06a6cb136a0acaef03e603bb906a6e6c48788.zip
skiboot-4fc06a6cb136a0acaef03e603bb906a6e6c48788.tar.gz
skiboot-4fc06a6cb136a0acaef03e603bb906a6e6c48788.tar.bz2
hw/ast-bmc: Initialize ast lpc mctp binding
The Management Component Transport Protocol (MCTP) defines a communication model intended to facilitate communication. This patch initialize MCTP binding over LPC Bus interface. Several steps must be performed: - Initialize the MCTP core (mctp_init()). - Initialize a hardware binding as AST LPC mode host (mctp_astlpc_init()). - Register the hardware binding with the core (mctp_register_bus()), using a predefined EID (Host default is 9). To transmit a MCTP message, mctp_message_tx() is used. To receive a MCTP message, a callback need to be provided and registered through mctp_set_rx_all(). For the transfer of MCTP messages, two basics components are used: - A window of the LPC FW address space, where reads and writes are forwarded to BMC memory. - An interrupt mechanism using the KCS interface. hw/ast-bmc/ast-mctp.c is compilated if the compiler flag CONFIG_PLDM is set. 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 'include')
-rw-r--r--include/ast.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/ast.h b/include/ast.h
index 5e93239..79efe4f 100644
--- a/include/ast.h
+++ b/include/ast.h
@@ -91,6 +91,26 @@ void ast_setup_ibt(uint16_t io_base, uint8_t irq);
/* MBOX configuration */
void ast_setup_sio_mbox(uint16_t io_base, uint8_t irq);
+/* MCTP configuration */
+
+/*
+ * EID is the MCTP endpoint ID, which aids in routing MCTP packets.
+ * For the EIDs: the valid range is 8-254.
+ * We are saying that BMC is EID 8 and Skiboot is HOST_EID 9
+ */
+#define BMC_EID 8
+#define HOST_EID 9
+
+enum mctp_msg_type {
+ MCTP_MSG_TYPE_CONTROL = 0x00,
+ MCTP_MSG_TYPE_PLDM = 0x01,
+};
+
+int ast_mctp_message_tx(bool tag_owner, uint8_t msg_tag,
+ uint8_t *msg, int msg_len);
+int ast_mctp_init(void);
+void ast_mctp_exit(void);
+
#endif /* __SKIBOOT__ */
/*