blob: ded51ae7d8718c46bcded5bb7fc7b5ebeb66bde9 [file] [log] [blame]
Delphine CC Chiu99be5bc32023-12-11 13:56:32 +08001#!/bin/sh
2
Delphine CC Chiu5c7dabe2023-12-15 17:58:13 +08003# Set mctpi2c/mctpi3c link up and assign local address.
Delphine CC Chiu99be5bc32023-12-11 13:56:32 +08004localEid=8
5
Delphine CC Chiu5c7dabe2023-12-15 17:58:13 +08006# shellcheck source=meta-facebook/meta-yosemite4/recipes-yosemite4/plat-tool/files/yosemite4-common-functions
7. /usr/libexec/yosemite4-common-functions
8
9is_nuvoton_board="$(check_nuvoton_board)"
10
Delphine CC Chiu99be5bc32023-12-11 13:56:32 +080011busnum=0
Delphine CC Chiu5c7dabe2023-12-15 17:58:13 +080012if [ -n "$is_nuvoton_board" ]; then
13 # Enable MCTP-I3C for Nuvoton BMC
14 # The Sentinel Dome BICs are after the I3C hub on I3C bus0 and bus1.
15 while [ $busnum -le 1 ]
16 do
17 mctp link set mctpi3c${busnum} up
18 mctp addr add ${localEid} dev mctpi3c${busnum}
19 busnum=$((busnum+1))
20 done
21else
22 # Enable MCTP-I2C for ASPEED BMC
23 # The Sentinel Dome BICs are on the i2c bus0 to bus7.
24 while [ $busnum -le 7 ]
25 do
26 mctp link set mctpi2c${busnum} up
27 mctp addr add ${localEid} dev mctpi2c${busnum}
28 busnum=$((busnum+1))
29 done
30fi
Delphine CC Chiu99be5bc32023-12-11 13:56:32 +080031
32# The NICs are on the i2c bus24 to bus27.
33busnum=24
34while [ $busnum -le 27 ]
35do
36 mctp link set mctpi2c${busnum} up
37 mctp addr add ${localEid} dev mctpi2c${busnum}
38 busnum=$((busnum+1))
39done