20#include <devicetree.h>
23#if DT_NODE_EXISTS(DT_NODELABEL(ipmb0))
27#if DT_NODE_EXISTS(DT_NODELABEL(ipmb1))
31#if DT_NODE_EXISTS(DT_NODELABEL(ipmb2))
35#if DT_NODE_EXISTS(DT_NODELABEL(ipmb3))
39#if DT_NODE_EXISTS(DT_NODELABEL(ipmb4))
43#if DT_NODE_EXISTS(DT_NODELABEL(ipmb5))
47#if DT_NODE_EXISTS(DT_NODELABEL(ipmb6))
51#if DT_NODE_EXISTS(DT_NODELABEL(ipmb7))
55#if DT_NODE_EXISTS(DT_NODELABEL(ipmb8))
59#if DT_NODE_EXISTS(DT_NODELABEL(ipmb9))
66#define MAX_SEQ_QUENE 15
67#define MEM_ALLOCATE_RETRY_TIME 2
68#define IPMI_DATA_MAX_LENGTH 520
69#define IPMB_REQ_HEADER_LENGTH 6
70#define IPMB_RESP_HEADER_LENGTH 7
71#define IPMI_MSG_MAX_LENGTH (IPMI_DATA_MAX_LENGTH + IPMB_RESP_HEADER_LENGTH)
72#define IPMB_TX_RETRY_TIME 5
73#define IPMB_TXQUEUE_LEN 1
74#define IPMB_RXQUEUE_LEN 2
75#define IPMB_TX_STACK_SIZE 3072
76#define IPMB_RX_STACK_SIZE 3072
77#define IPMI_HEADER_CHECKSUM_POSITION 2
78#define IPMB_NETFN_MASK 0xFC
79#define IPMB_DEST_LUN_MASK 0x03
80#define IPMB_SEQ_MASK 0xFC
81#define IPMB_SRC_LUN_MASK 0x03
82#define IPMB_RETRY_DELAY_MS 500
83#define IPMB_POLLING_TIME_MS 1
84#define IPMB_SEQ_TIMEOUT_MS 3000
85#define IPMB_SEQ_TIMEOUT_STACK_SIZE 512
86#define I2C_RETRY_TIME 5
88#define RESERVED_IDX 0xFF
89#define RESERVED_BUS 0xFF
90#define RESERVED_ADDRESS 0xFF
95#define IS_RESPONSE(msg) (msg.netfn & 0x01)
Channel_Target
Definition: ipmb.h:97
@ HOST_KCS_2
Definition: ipmb.h:123
@ BMC_USB
Definition: ipmb.h:115
@ SLOT1_BIC
Definition: ipmb.h:103
@ MCTP
Definition: ipmb.h:118
@ EXP4_IPMB
Definition: ipmb.h:112
@ PLDM
Definition: ipmb.h:117
@ MPRO_PLDM
Definition: ipmb.h:119
@ EXP1_IPMB
Definition: ipmb.h:102
@ ME_IPMB
Definition: ipmb.h:99
@ HD_BIC_IPMB
Definition: ipmb.h:108
@ PEER_BMC_IPMB
Definition: ipmb.h:113
@ HOST_KCS_3
Definition: ipmb.h:124
@ HOST_KCS_4
Definition: ipmb.h:125
@ EXP2_IPMB
Definition: ipmb.h:106
@ EXP3_IPMB
Definition: ipmb.h:111
@ BMC_IPMB
Definition: ipmb.h:100
@ GL_BIC_IPMB
Definition: ipmb.h:109
@ SELF
Definition: ipmb.h:98
@ SLOT3_BIC
Definition: ipmb.h:104
@ CL_BIC_IPMB
Definition: ipmb.h:107
@ SERVER_IPMB
Definition: ipmb.h:101
@ BB_IPMB
Definition: ipmb.h:105
@ HOST_SSIF_1
Definition: ipmb.h:127
@ HOST_KCS_1
Definition: ipmb.h:122
@ SATMC_PLDM
Definition: ipmb.h:120
@ RESERVED
Definition: ipmb.h:129
Interface
Definition: ipmb.h:132
@ RESERVED_IF
Definition: ipmb.h:135
@ I3C_IF
Definition: ipmb.h:134
@ I2C_IF
Definition: ipmb.h:133
ipmb_error ipmb_read(ipmi_msg *msg, uint8_t bus)
void pal_encode_response_bridge_cmd(ipmi_msg *bridge_msg, ipmi_msg_cfg *current_msg_rx, IPMB_config *ipmb_cfg, IPMB_config *IPMB_config_tables)
ipmb_error ipmb_send_response(ipmi_msg *resp, uint8_t index)
IPMB_config * IPMB_config_table
bool pal_load_ipmb_config(void)
Definition: plat_ipmb.c:38
struct IPMB_config IPMB_config
bool pal_is_interface_use_ipmb(uint8_t interface_index)
Definition: plat_ipmb.c:60
ipmb_error
Definition: ipmb.h:152
@ IPMB_ERROR_UNKNOWN
Definition: ipmb.h:154
@ IPMB_ERROR_HDR_CHECKSUM
Definition: ipmb.h:158
@ IPMB_ERROR_QUEUE_CREATION
Definition: ipmb.h:160
@ IPMB_ERROR_MSG_CHECKSUM
Definition: ipmb.h:159
@ IPMB_ERROR_INVALID_REQ
Definition: ipmb.h:157
@ IPMB_ERROR_MUTEX_LOCK
Definition: ipmb.h:162
@ IPMB_ERROR_SUCCESS
Definition: ipmb.h:153
@ IPMB_ERROR_GET_MESSAGE_QUEUE
Definition: ipmb.h:161
@ IPMB_ERROR_FAILURE
Definition: ipmb.h:155
@ IPMB_ERROR_TIMEOUT
Definition: ipmb.h:156
#define IPMI_MSG_MAX_LENGTH
Definition: ipmb.h:71
ipmb_error ipmb_send_request(ipmi_msg *req, uint8_t index)
struct ipmi_msg __attribute__((packed, aligned(4))) ipmi_msg
void ipmb_tx_suspend(uint8_t index)
void ipmb_tx_resume(uint8_t index)
uint8_t channel
Definition: ipmb.h:141
char * rx_thread_name
Definition: ipmb.h:146
uint8_t self_address
Definition: ipmb.h:145
uint8_t bus
Definition: ipmb.h:142
uint8_t interface
Definition: ipmb.h:140
char * tx_thread_name
Definition: ipmb.h:147
bool enable_status
Definition: ipmb.h:144
uint8_t channel_target_address
Definition: ipmb.h:143
uint8_t index
Definition: ipmb.h:139
uint8_t retries
Definition: ipmb.h:191
struct ipmi_msg_cfg * next
Definition: ipmb.h:192
ipmi_msg buffer
Definition: ipmb.h:190
uint8_t data[IPMI_MSG_MAX_LENGTH]
Definition: ipmb.h:181
uint8_t src_addr
Definition: ipmb.h:170
uint8_t dest_LUN
Definition: ipmb.h:168
uint8_t seq_source
Definition: ipmb.h:171
uint8_t netfn
Definition: ipmb.h:167
uint32_t timestamp
Definition: ipmb.h:185
uint8_t seq
Definition: ipmb.h:173
uint8_t pldm_inst_id
Definition: ipmb.h:174
uint8_t InF_source
Definition: ipmb.h:175
uint16_t data_len
Definition: ipmb.h:180
uint8_t seq_target
Definition: ipmb.h:172
uint8_t completion_code
Definition: ipmb.h:179
uint8_t dest_addr
Definition: ipmb.h:166
uint8_t cmd
Definition: ipmb.h:178
uint8_t hdr_chksum
Definition: ipmb.h:169
uint8_t msg_chksum
Definition: ipmb.h:186
uint8_t InF_target
Definition: ipmb.h:176
uint8_t src_LUN
Definition: ipmb.h:177