OpenBIC
OpenSource Bridge-IC
plat_mctp.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _PLAT_MCTP_h
18#define _PLAT_MCTP_h
19#include <kernel.h>
20#include "storage_handler.h"
21#include "pldm.h"
22
23/* i2c 8 bit address */
24#define I2C_ADDR_BIC 0x40
25#define I2C_ADDR_BMC 0x20
26/* i2c dev bus*/
27#define I2C_BUS_BMC 0x02
28
29/* i3c dev bus */
30#define I3C_BUS_BMC 0
31#define I3C_BUS_CONTROLLER 1
32#define I3C_BUS_HUB 1
33#define I3C_ADDR_HUB 0x70
34
35#define I3C_STATIC_ADDR_BIC 0x40
36#define I3C_STATIC_ADDR_BMC 0x20
37#define I3C_STATIC_ADDR_FF_BIC 0x9
38#define I3C_STATIC_ADDR_WF_BIC 0xA
39
40/* mctp endpoint */
41#define MCTP_EID_BMC 0x08
42
44 uint8_t iana[IANA_LEN];
45 uint8_t netfn_lun;
46 uint8_t ipmi_cmd;
47} __attribute__((__packed__));
48;
49
51 uint8_t completion_code;
52 uint8_t netfn_lun;
53 uint8_t ipmi_cmd;
54 uint8_t ipmi_comp_code;
55} __attribute__((__packed__));
56;
57
61} __attribute__((__packed__));
62
66} __attribute__((__packed__));
67
68/* init the mctp moduel for platform */
69void plat_mctp_init(void);
70void send_cmd_to_dev(struct k_timer *timer);
71void send_cmd_to_dev_handler(struct k_work *work);
74mctp_port *plat_get_mctp_port(uint8_t index);
75uint8_t plat_get_eid();
76
77mctp *find_mctp_by_bus(uint8_t bus);
78
79#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:582
bool mctp_add_sel_to_ipmi(common_addsel_msg_t *sel_msg)
Definition: plat_mctp.c:271
void send_cmd_to_dev_handler(struct k_work *work)
Definition: plat_mctp.c:563
mctp * find_mctp_by_bus(uint8_t bus)
Definition: plat_mctp.c:68
#define IANA_LEN
Definition: pldm_oem.h:27
uint8_t plat_get_eid()
Definition: mctp.c:427
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:688
mctp_port * plat_get_mctp_port(uint8_t index)
Definition: mctp.c:693
enum @186 __attribute__