TT-System-Firmware APIs 19.15.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
pldm_mctp_responder.c File Reference
#include <zephyr/device.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/pmci/mctp/mctp_i3c_target.h>
#include <libmctp.h>
#include <libpldm/base.h>
#include <errno.h>
#include <string.h>
#include "pldm_base.h"
#include "pldm_mctp_responder.h"
#include "pldm_pdr.h"
#include "pldm_platform.h"
#include <zephyr/drivers/pmci/pldm/pldm_oem_handler.h>
Include dependency graph for pldm_mctp_responder.c:

Data Structures

struct  tt_pldm_rx_work_item
struct  tt_pldm_mctp_responder_config
struct  tt_pldm_mctp_responder_data

Macros

#define DT_DRV_COMPAT   tenstorrent_pldm_mctp_responder
#define TT_PLDM_MSG_TYPE_PLDM   0x01U
#define TT_PLDM_MAX_MESSAGE_LEN   64U
#define TT_PLDM_RX_QUEUE_DEPTH   8U
#define TT_PLDM_RX_WORKQ_STACK_SIZE   1024U
#define TT_PLDM_MCTP_BINDING(inst)
#define TT_PLDM_MCTP_RESPONDER_DEFINE(inst)

Functions

 LOG_MODULE_REGISTER (tt_pldm_mctp_rsp, CONFIG_TT_APP_LOG_LEVEL)
static int tt_pldm_build_response (const struct device *dev, const struct pldm_msg *req_msg, size_t req_pldm_len, struct pldm_msg *resp_msg, size_t *resp_pldm_len)
static void tt_pldm_mctp_process_rx_message (const struct device *dev, uint8_t eid, uint8_t msg_tag, const uint8_t *rx_buf, size_t len)
static void tt_pldm_mctp_rx_work_handler (struct k_work *work)
bool dmc_mctp_transport_ready (void)
const struct devicett_pldm_mctp_responder_oem_handler_get (const struct device *dev)
 Return the OEM handler device associated with a PLDM MCTP responder.
static void tt_pldm_mctp_rx_message (uint8_t eid, bool tag_owner, uint8_t msg_tag, void *cb_data, void *msg, size_t len)
static int tt_pldm_mctp_responder_init (const struct device *dev)

Variables

static bool g_dmc_mctp_transport_ready

Macro Definition Documentation

◆ DT_DRV_COMPAT

#define DT_DRV_COMPAT   tenstorrent_pldm_mctp_responder

◆ TT_PLDM_MAX_MESSAGE_LEN

#define TT_PLDM_MAX_MESSAGE_LEN   64U

◆ TT_PLDM_MCTP_BINDING

#define TT_PLDM_MCTP_BINDING ( inst)
Value:
MCTP_I3C_TARGET_DT_DEFINE(tt_pldm_mctp_i3c_##inst, \
DT_PHANDLE(DT_DRV_INST(inst), mctp_target))
#define DT_PHANDLE(node_id, prop)
#define DT_DRV_INST(inst)
#define MCTP_I3C_TARGET_DT_DEFINE(_name, _node_id)

◆ TT_PLDM_MCTP_RESPONDER_DEFINE

#define TT_PLDM_MCTP_RESPONDER_DEFINE ( inst)
Value:
static const struct tt_pldm_mctp_responder_config tt_pldm_mctp_cfg_##inst = { \
.endpoint_id = DT_PROP(DT_PHANDLE(DT_DRV_INST(inst), mctp_target), endpoint_id), \
.tid = DT_PROP(DT_DRV_INST(inst), pldm_tid), \
.binding = &tt_pldm_mctp_i3c_##inst, \
.oem_handler_dev = COND_CODE_1(DT_NODE_HAS_PROP \
(DT_DRV_INST(inst), oem_handler), \
oem_handler))), (NULL)), \
}; \
static struct tt_pldm_mctp_responder_data tt_pldm_mctp_data_##inst; \
DEVICE_DT_INST_DEFINE(inst, tt_pldm_mctp_responder_init, NULL, &tt_pldm_mctp_data_##inst, \
&tt_pldm_mctp_cfg_##inst, POST_KERNEL, \
CONFIG_APPLICATION_INIT_PRIORITY, NULL)
#define NULL
Definition avs.c:45
#define DEVICE_DT_GET(node_id)
#define DT_NODE_HAS_PROP(node_id, prop)
#define DT_PROP(node_id, prop)
#define COND_CODE_1(_flag, _if_1_code, _else_code)
static int tt_pldm_mctp_responder_init(const struct device *dev)
Definition pldm_mctp_responder.c:202
#define TT_PLDM_MCTP_BINDING(inst)
Definition pldm_mctp_responder.c:252
Definition pldm_mctp_responder.c:39
const struct device * pdr_dev
Definition pldm_mctp_responder.c:43
Definition pldm_mctp_responder.c:47

◆ TT_PLDM_MSG_TYPE_PLDM

#define TT_PLDM_MSG_TYPE_PLDM   0x01U

◆ TT_PLDM_RX_QUEUE_DEPTH

#define TT_PLDM_RX_QUEUE_DEPTH   8U

◆ TT_PLDM_RX_WORKQ_STACK_SIZE

#define TT_PLDM_RX_WORKQ_STACK_SIZE   1024U

Function Documentation

◆ dmc_mctp_transport_ready()

bool dmc_mctp_transport_ready ( void )

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( tt_pldm_mctp_rsp ,
CONFIG_TT_APP_LOG_LEVEL  )

◆ tt_pldm_build_response()

int tt_pldm_build_response ( const struct device * dev,
const struct pldm_msg * req_msg,
size_t req_pldm_len,
struct pldm_msg * resp_msg,
size_t * resp_pldm_len )
static

◆ tt_pldm_mctp_process_rx_message()

void tt_pldm_mctp_process_rx_message ( const struct device * dev,
uint8_t eid,
uint8_t msg_tag,
const uint8_t * rx_buf,
size_t len )
static

◆ tt_pldm_mctp_responder_init()

int tt_pldm_mctp_responder_init ( const struct device * dev)
static

◆ tt_pldm_mctp_responder_oem_handler_get()

const struct device * tt_pldm_mctp_responder_oem_handler_get ( const struct device * dev)

Return the OEM handler device associated with a PLDM MCTP responder.

Parameters
devA tenstorrent,pldm-mctp-responder device instance.
Returns
The linked tenstorrent,pldm-oem-handler device, or NULL if none.

◆ tt_pldm_mctp_rx_message()

void tt_pldm_mctp_rx_message ( uint8_t eid,
bool tag_owner,
uint8_t msg_tag,
void * cb_data,
void * msg,
size_t len )
static

◆ tt_pldm_mctp_rx_work_handler()

void tt_pldm_mctp_rx_work_handler ( struct k_work * work)
static

Variable Documentation

◆ g_dmc_mctp_transport_ready

bool g_dmc_mctp_transport_ready
static