Skip to content

Commit

Permalink
fby3.5: hd: Support IPMB
Browse files Browse the repository at this point in the history
Summary:
- Support IPMB handler.

Test plan:
- Build code: Pass
- Check IPMB is workable: Pass

LOG:
```
root@bmc-oob:~# bic-util slot1 0x18 0x1
00 80 FF FF 02 BF 15 A0 00 00 00 00 00 00 00
```
  • Loading branch information
Yi-Shum committed Jul 7, 2022
1 parent 3e36392 commit 0179db3
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions meta-facebook/yv35-hd/src/platform/plat_i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define I2C_BUS13 12
#define I2C_BUS14 13

#define IPMB_I2C_BMC I2C_BUS7
#define I2C_BUS_MAX_NUM 14

#endif
22 changes: 22 additions & 0 deletions meta-facebook/yv35-hd/src/platform/plat_ipmb.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <stdio.h>
#include <string.h>
#include "plat_ipmb.h"

IPMB_config pal_IPMB_config_table[] = {
// index, interface, channel, bus, channel_target_address, enable_status, self_address,
// rx_thread_name, tx_thread_name
{ BMC_IPMB_IDX, I2C_IF, BMC_IPMB, IPMB_I2C_BMC, BMC_I2C_ADDRESS, ENABLE, SELF_I2C_ADDRESS,
"RX_BMC_IPMB_TASK", "TX_BMC_IPMB_TASK" },
{ EXP1_IPMB_IDX, I2C_IF, EXP1_IPMB, IPMB_EXP1_BUS, BIC1_I2C_ADDRESS, DISABLE,
SELF_I2C_ADDRESS, "RX_EPX1_IPMB_TASK", "TX_EXP1_IPMB_TASK" },
{ EXP2_IPMB_IDX, I2C_IF, EXP2_IPMB, IPMB_EXP2_BUS, BIC2_I2C_ADDRESS, DISABLE,
SELF_I2C_ADDRESS, "RX_EPX2_IPMB_TASK", "TX_EXP2_IPMB_TASK" },
{ RESERVED_IDX, RESERVED_IF, RESERVED, RESERVED_BUS, RESERVED_ADDRESS, DISABLE,
RESERVED_ADDRESS, "RESERVED_ATTR", "RESERVED_ATTR" },
};

bool pal_load_ipmb_config(void)
{
memcpy(IPMB_config_table, pal_IPMB_config_table, sizeof(pal_IPMB_config_table));
return true;
}
14 changes: 13 additions & 1 deletion meta-facebook/yv35-hd/src/platform/plat_ipmb.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@
#include "plat_i2c.h"
#include "ipmb.h"

#define IPMB_BMC_BUS I2C_BUS7
#define IPMB_EXP1_BUS I2C_BUS8
#define IPMB_EXP2_BUS I2C_BUS9

#define BMC_I2C_ADDRESS 0x10
#define SELF_I2C_ADDRESS 0x20
#define MAX_IPMB_IDX 2
#define BIC1_I2C_ADDRESS 0x20
#define BIC2_I2C_ADDRESS 0x20
#define MAX_IPMB_IDX 4

enum { BMC_IPMB_IDX,
EXP1_IPMB_IDX,
EXP2_IPMB_IDX,
};

extern IPMB_config pal_IPMB_config_table[];
#endif

0 comments on commit 0179db3

Please sign in to comment.