summaryrefslogtreecommitdiff
path: root/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/configure-nic-mctp-endpoint.sh
blob: 59031b5400f9da252b71d3e60d0575153d4a28f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# This script is a backup solution for setting up/removing MCTP endpoint for NICs
action=$1
slot=$2
# NIC bus are 24~27.
bus=$((24 + slot))
# Static EID for NIC are 90~93.
eid=$((90 + slot))

sleep 2

if [ "$action" = "add" ]; then
    echo "Adding MCTP endpoint for slot $slot"
    busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp au.com.CodeConstruct.MCTP AssignEndpointStatic sayy "mctpi2c${bus}" 1 0x32 "$eid"
elif [ "$action" = "remove" ]; then
    echo "Removing MCTP endpoint for slot $slot"
    busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp/1/${eid} au.com.CodeConstruct.MCTP.Endpoint Remove
fi