OpenBIC
OpenSource Bridge-IC
plat_mctp.c File Reference
#include "plat_mctp.h"
#include <zephyr.h>
#include <sys/printk.h>
#include <logging/log.h>
#include <logging/log_ctrl.h>
#include <stdlib.h>
#include <stdio.h>
#include "mctp.h"
#include "mctp_ctrl.h"
#include "pldm.h"
#include "ipmi.h"
#include "sensor.h"
#include "plat_ipmb.h"
#include "plat_class.h"
#include "util_sys.h"
#include "hal_i2c.h"
#include "hal_i3c.h"
Include dependency graph for plat_mctp.c:

Macros

#define MCTP_MSG_TYPE_SHIFT   0
 
#define MCTP_MSG_TYPE_MASK   0x7F
 
#define MCTP_IC_SHIFT   7
 
#define MCTP_IC_MASK   0x80
 
#define MCTP_EID_FF_BIC   0
 
#define MCTP_EID_WF_BIC   0
 
#define MCTP_EID_FF_CXL   0
 
#define MCTP_EID_WF_CXL1   0
 
#define MCTP_EID_WF_CXL2   0
 

Functions

 LOG_MODULE_REGISTER (plat_mctp)
 
 K_TIMER_DEFINE (send_cmd_timer, send_cmd_to_dev, NULL)
 
 K_WORK_DEFINE (send_cmd_work, send_cmd_to_dev_handler)
 
mctpfind_mctp_by_bus (uint8_t bus)
 
mctpfind_mctp_by_addr (uint8_t addr)
 
void send_cmd_to_dev_handler (struct k_work *work)
 
void send_cmd_to_dev (struct k_timer *timer)
 
bool mctp_add_sel_to_ipmi (common_addsel_msg_t *sel_msg)
 
int pal_get_medium_type (uint8_t interface)
 
int pal_get_target (uint8_t interface)
 
mctppal_get_mctp (uint8_t medium_type, uint8_t bus)
 
void plat_set_eid_by_slot ()
 
void set_routing_table_eid ()
 
uint8_t plat_get_eid ()
 
void plat_mctp_init (void)
 
uint8_t plat_get_mctp_port_count ()
 
mctp_portplat_get_mctp_port (uint8_t index)
 

Variables

mctp_route_entry plat_mctp_route_tbl []
 
uint8_t plat_eid = MCTP_DEFAULT_ENDPOINT
 

Macro Definition Documentation

◆ MCTP_EID_FF_BIC

#define MCTP_EID_FF_BIC   0

◆ MCTP_EID_FF_CXL

#define MCTP_EID_FF_CXL   0

◆ MCTP_EID_WF_BIC

#define MCTP_EID_WF_BIC   0

◆ MCTP_EID_WF_CXL1

#define MCTP_EID_WF_CXL1   0

◆ MCTP_EID_WF_CXL2

#define MCTP_EID_WF_CXL2   0

◆ 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

Function Documentation

◆ find_mctp_by_addr()

mctp * find_mctp_by_addr ( uint8_t  addr)

◆ find_mctp_by_bus()

mctp * find_mctp_by_bus ( uint8_t  bus)

◆ K_TIMER_DEFINE()

K_TIMER_DEFINE ( send_cmd_timer  ,
send_cmd_to_dev  ,
NULL   
)

◆ K_WORK_DEFINE()

K_WORK_DEFINE ( send_cmd_work  ,
send_cmd_to_dev_handler   
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_mctp  )

◆ mctp_add_sel_to_ipmi()

bool mctp_add_sel_to_ipmi ( common_addsel_msg_t sel_msg)
Here is the call graph for this function:

◆ pal_get_mctp()

mctp * pal_get_mctp ( uint8_t  medium_type,
uint8_t  bus 
)
Here is the call graph for this function:

◆ pal_get_medium_type()

int pal_get_medium_type ( uint8_t  interface)

◆ pal_get_target()

int pal_get_target ( uint8_t  interface)

◆ plat_get_eid()

uint8_t plat_get_eid ( )

◆ plat_get_mctp_port()

mctp_port * plat_get_mctp_port ( uint8_t  index)

◆ plat_get_mctp_port_count()

uint8_t plat_get_mctp_port_count ( )

◆ plat_mctp_init()

void plat_mctp_init ( void  )

BIC will not initialize mctp instance if CXL is not present

init mctp for bmc bus

Here is the call graph for this function:

◆ plat_set_eid_by_slot()

void plat_set_eid_by_slot ( )
Here is the call graph for this function:

◆ 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)

◆ set_routing_table_eid()

void set_routing_table_eid ( )

Variable Documentation

◆ plat_eid

uint8_t plat_eid = MCTP_DEFAULT_ENDPOINT

◆ plat_mctp_route_tbl

mctp_route_entry plat_mctp_route_tbl[]
Initial value:
= {
{ MCTP_EID_BMC, I2C_BUS_BMC, I2C_ADDR_BMC, .set_endpoint = false },
{ MCTP_EID_BMC, I3C_BUS_BMC, I3C_STATIC_ADDR_BMC, .set_endpoint = false },
{ MCTP_EID_FF_BIC, I3C_BUS_HUB, I3C_STATIC_ADDR_FF_BIC, .set_endpoint = true },
{ MCTP_EID_WF_BIC, I3C_BUS_HUB, I3C_STATIC_ADDR_WF_BIC, .set_endpoint = true },
{ MCTP_EID_FF_CXL, I3C_BUS_HUB, I3C_STATIC_ADDR_FF_BIC, .set_endpoint = false },
{ MCTP_EID_WF_CXL1, I3C_BUS_HUB, I3C_STATIC_ADDR_WF_BIC, .set_endpoint = false },
{ MCTP_EID_WF_CXL2, I3C_BUS_HUB, I3C_STATIC_ADDR_WF_BIC, .set_endpoint = false },
}
#define I3C_BUS_BMC
Definition: plat_mctp.h:31
#define I2C_BUS_BMC
Definition: plat_mctp.c:48
#define I2C_ADDR_BMC
Definition: plat_mctp.c:44
#define MCTP_EID_BMC
Definition: plat_mctp.c:58
#define I3C_STATIC_ADDR_BMC
Definition: plat_i3c.h:25
#define MCTP_EID_FF_CXL
Definition: plat_mctp.c:37
#define MCTP_EID_WF_CXL1
Definition: plat_mctp.c:38
#define MCTP_EID_WF_BIC
Definition: plat_mctp.c:36
#define MCTP_EID_FF_BIC
Definition: plat_mctp.c:35
#define MCTP_EID_WF_CXL2
Definition: plat_mctp.c:39
#define I3C_BUS_HUB
Definition: plat_mctp.h:16
#define I3C_STATIC_ADDR_WF_BIC
Definition: plat_mctp.h:22
#define I3C_STATIC_ADDR_FF_BIC
Definition: plat_mctp.h:21