OpenBIC
OpenSource Bridge-IC
plat_mctp.h
Go to the documentation of this file.
1#ifndef _PLAT_MCTP_h
2#define _PLAT_MCTP_h
3#include <kernel.h>
4#include "storage_handler.h"
5#include "pldm.h"
6
7/* i2c 8 bit address */
8#define I2C_ADDR_BIC 0x40
9#define I2C_ADDR_BMC 0x20
10/* i2c dev bus*/
11#define I2C_BUS_BMC 0x02
12
13/* i3c dev bus */
14#define I3C_BUS_BMC 0
15#define I3C_BUS_CONTROLLER 1
16#define I3C_BUS_HUB 1
17#define I3C_ADDR_HUB 0x70
18
19#define I3C_STATIC_ADDR_BIC 0x40
20#define I3C_STATIC_ADDR_BMC 0x20
21#define I3C_STATIC_ADDR_FF_BIC 0x9
22#define I3C_STATIC_ADDR_WF_BIC 0xA
23
24/* mctp endpoint */
25#define MCTP_EID_BMC 0x08
26
28 uint8_t iana[IANA_LEN];
29 uint8_t netfn_lun;
30 uint8_t ipmi_cmd;
31} __attribute__((__packed__));
32;
33
35 uint8_t completion_code;
36 uint8_t netfn_lun;
37 uint8_t ipmi_cmd;
38 uint8_t ipmi_comp_code;
39} __attribute__((__packed__));
40;
41
45} __attribute__((__packed__));
46
50} __attribute__((__packed__));
51
52/* init the mctp moduel for platform */
53void plat_mctp_init(void);
54void send_cmd_to_dev(struct k_timer *timer);
55void send_cmd_to_dev_handler(struct k_work *work);
58mctp_port *plat_get_mctp_port(uint8_t index);
59uint8_t plat_get_eid();
60
61mctp *find_mctp_by_bus(uint8_t bus);
62
63#endif /* _PLAT_MCTP_h */
void plat_mctp_init(void)
Definition: plat_mctp.c:218
void send_cmd_to_dev(struct k_timer *timer)
Definition: plat_mctp.c:548
bool mctp_add_sel_to_ipmi(common_addsel_msg_t *sel_msg)
Definition: plat_mctp.c:259
void send_cmd_to_dev_handler(struct k_work *work)
Definition: plat_mctp.c:533
#define IANA_LEN
Definition: pldm_oem.h:27
Definition: mctp.h:204
Definition: mctp.h:153
Definition: ipmi.h:53
Definition: storage_handler.h:56
Definition: storage_handler.h:63
Definition: plat_mctp.h:23
uint8_t netfn_lun
Definition: plat_mctp.h:25
uint8_t ipmi_cmd
Definition: plat_mctp.h:26
uint8_t iana[IANA_LEN]
Definition: plat_mctp.h:24
Definition: plat_mctp.h:30
uint8_t ipmi_comp_code
Definition: plat_mctp.h:35
uint8_t ipmi_cmd
Definition: plat_mctp.h:34
uint8_t netfn_lun
Definition: plat_mctp.h:33
uint8_t completion_code
Definition: plat_mctp.h:31
Definition: plat_mctp.h:39
struct ipmi_storage_add_sel_req req_data
Definition: plat_mctp.h:41
struct mctp_to_ipmi_header_req header
Definition: plat_mctp.h:40
Definition: plat_mctp.h:44
struct mctp_to_ipmi_header_resp header
Definition: plat_mctp.h:45
struct ipmi_storage_add_sel_resp resp_data
Definition: plat_mctp.h:46
uint8_t plat_get_mctp_port_count()
Definition: mctp.c:675
mctp_port * plat_get_mctp_port(uint8_t index)
Definition: mctp.c:680
enum @172 __attribute__
uint8_t plat_get_eid()
Definition: mctp.c:419
mctp * find_mctp_by_bus(uint8_t bus)
Definition: plat_mctp.c:69