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/*
18 * Copyright (c) 2012-2014 Wind River Systems, Inc.
19 *
20 * SPDX-License-Identifier: Apache-2.0
21 */
22
23#ifndef _PLAT_MCTP_H
24#define _PLAT_MCTP_H
25
26#include "ipmi.h"
27#include "plat_i2c.h"
28
29#define I2C_BUS_BMC I2C_BUS5
30#define I2C_BUS_CXL I2C_BUS2
31/* I2C 8-bit address */
32#define I2C_ADDR_BIC 0x40
33#define I2C_ADDR_BMC 0x20
34#define I2C_ADDR_CXL 0xDE
35
36/* mctp endpoint */
37#define MCTP_EID_DEFAULT 0x00
38#define MCTP_EID_BMC 0x08
39#define MCTP_EID_CXL MCTP_EID_DEFAULT
40
41#define MCTP_RESP_DATA_INDEX 4
42/* MCTP CC, Netfn, cmd, IPMI CC */
43#define MCTP_RESP_HEADER_COUNT 4
44
45#define SET_EID_FLAG true
46#define CLEAR_EID_FLAG false
47
48void plat_mctp_init(void);
49bool get_set_cxl_endpoint(uint8_t cxl_card_id, uint8_t eid);
50bool get_cxl_eid_flag(uint8_t cxl_card_id);
51void set_cxl_eid_flag(uint8_t cxl_card_id, bool value);
52int pal_pldm_send_ipmi_request(ipmi_msg *msg, uint8_t eid);
53
54#endif
int pal_pldm_send_ipmi_request(ipmi_msg *msg, uint8_t eid)
Definition: plat_mctp.c:157
void plat_mctp_init(void)
Definition: plat_mctp.c:218
void set_cxl_eid_flag(uint8_t cxl_card_id, bool value)
Definition: plat_mctp.c:75
bool get_set_cxl_endpoint(uint8_t cxl_card_id, uint8_t eid)
Definition: plat_mctp.c:160
bool get_cxl_eid_flag(uint8_t cxl_card_id)
Definition: plat_mctp.c:62
uint8_t eid
Definition: mctp_ctrl.h:1
Definition: ipmb.h:165