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#define MCTP_MSG_TYPE_SHIFT 0
24#define MCTP_MSG_TYPE_MASK 0x7F
25#define MCTP_IC_SHIFT 7
26#define MCTP_IC_MASK 0x80
27
28/* i2c dev bus*/
29#define I2C_BUS_BMC 0
30#define I2C_BUS_CXL1 0x01
31#define I2C_BUS_CXL2 0x03
32
33// i2c dev address
34#define I2C_ADDR_BIC 0x40
35#define I2C_ADDR_BMC 0x20
36#define I2C_ADDR_CXL1 0x64
37#define I2C_ADDR_CXL2 0x64
38
39// i3c dev bus
40#define I3C_BUS_SD_BIC 0
41#define I3C_BUS_BMC I3C_BUS_SD_BIC
42
43// i3c dev address
44#define I3C_ADDR_SD_BIC 0x8
45#define I3C_STATIC_ADDR_BMC I3C_ADDR_SD_BIC
46
47// mctp endpoint
48#define MCTP_EID_BMC 0x08
49
50// dynamic allocate eid
51#define MCTP_EID_SD_BIC 0
52#define MCTP_EID_CXL1 0
53#define MCTP_EID_CXL2 0
54
55#define UNKNOWN_CXL_EID 0xFF
56
57#define SET_DEV_ENDPOINT_STACK_SIZE 1024
58
59/* init the mctp moduel for platform */
60void plat_mctp_init(void);
62mctp_port *plat_get_mctp_port(uint8_t index);
64uint8_t plat_get_eid();
65mctp *find_mctp_by_bus(uint8_t bus);
66bool check_cxl_eid(uint8_t cxl_id);
67bool set_cxl_eid(uint8_t cxl_id);
68uint8_t plat_get_cxl_eid(uint8_t cxl_id);
69
70#endif /* _PLAT_MCTP_h */
void plat_mctp_init(void)
Definition: plat_mctp.c:218
mctp * find_mctp_by_bus(uint8_t bus)
Definition: plat_mctp.c:68
uint8_t plat_get_eid()
Definition: mctp.c:427
Definition: mctp.h:204
Definition: mctp.h:153
uint8_t plat_get_mctp_port_count()
Definition: mctp.c:688
mctp_port * plat_get_mctp_port(uint8_t index)
Definition: mctp.c:693
void create_set_dev_endpoint_thread()
Definition: plat_mctp.c:345
bool check_cxl_eid(uint8_t cxl_id)
Definition: plat_mctp.c:113
bool set_cxl_eid(uint8_t cxl_id)
Definition: plat_mctp.c:137
uint8_t plat_get_cxl_eid(uint8_t cxl_id)
Definition: plat_mctp.c:439