OpenBIC
OpenSource Bridge-IC
plat_mctp.c File Reference
#include <zephyr.h>
#include <sys/printk.h>
#include <logging/log.h>
#include <logging/log_ctrl.h>
#include <stdlib.h>
#include "mctp.h"
#include "mctp_ctrl.h"
#include "pldm.h"
#include "ipmi.h"
#include "sensor.h"
#include "plat_power_status.h"
#include "plat_mctp.h"
#include "plat_pldm.h"
#include "plat_gpio.h"
#include "plat_i2c.h"
#include "hal_i2c_target.h"
Include dependency graph for plat_mctp.c:

Classes

struct  _mctp_smbus_port
 
struct  _mctp_route_entry
 
struct  _mctp_msg_handler
 

Macros

#define MCTP_MSG_TYPE_SHIFT   0
 
#define MCTP_MSG_TYPE_MASK   0x7F
 
#define MCTP_IC_SHIFT   7
 
#define MCTP_IC_MASK   0x80
 
#define MAX_PLDM_EVENT_RECV_BUFF_SIZE   0xC0
 

Typedefs

typedef struct _mctp_smbus_port mctp_smbus_port
 
typedef struct _mctp_route_entry mctp_route_entry
 
typedef struct _mctp_msg_handler mctp_msg_handler
 

Functions

 LOG_MODULE_REGISTER (plat_mctp)
 
 K_WORK_DEFINE (send_cmd_work, send_cmd_to_dev_handler)
 
uint8_t get_mctp_info (uint8_t dest_endpoint, mctp **mctp_inst, mctp_ext_params *ext_params)
 
void send_cmd_to_dev_handler (struct k_work *work)
 
void send_cmd_to_dev (struct k_timer *timer)
 
void plat_mctp_init (void)
 

Variables

mctp_route_entry mctp_route_tbl []
 

Macro Definition Documentation

◆ MAX_PLDM_EVENT_RECV_BUFF_SIZE

#define MAX_PLDM_EVENT_RECV_BUFF_SIZE   0xC0

◆ MCTP_IC_MASK

#define MCTP_IC_MASK   0x80

◆ MCTP_IC_SHIFT

#define MCTP_IC_SHIFT   7

◆ MCTP_MSG_TYPE_MASK

#define MCTP_MSG_TYPE_MASK   0x7F

◆ MCTP_MSG_TYPE_SHIFT

#define MCTP_MSG_TYPE_SHIFT   0

Typedef Documentation

◆ mctp_msg_handler

◆ mctp_route_entry

◆ mctp_smbus_port

Function Documentation

◆ get_mctp_info()

uint8_t get_mctp_info ( uint8_t  dest_endpoint,
mctp **  mctp_inst,
mctp_ext_params ext_params 
)
Here is the call graph for this function:

◆ K_WORK_DEFINE()

K_WORK_DEFINE ( send_cmd_work  ,
send_cmd_to_dev_handler   
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_mctp  )

◆ plat_mctp_init()

void plat_mctp_init ( void  )

BIC will not initialize mctp instance if CXL is not present

init mctp for bmc bus

◆ send_cmd_to_dev()

void send_cmd_to_dev ( struct k_timer *  timer)

◆ send_cmd_to_dev_handler()

void send_cmd_to_dev_handler ( struct k_work *  work)

Variable Documentation

◆ mctp_route_tbl

mctp_route_entry mctp_route_tbl[]
Initial value:
= {
}
#define I2C_ADDR_MPRO
Definition: plat_mctp.h:24
#define MCTP_EID_MPRO
Definition: plat_mctp.h:30
#define I2C_BUS_MPRO
Definition: plat_mctp.h:27