blob: 59031b5400f9da252b71d3e60d0575153d4a28f8 [file] [log] [blame]
Chris Wang0598b572024-03-12 17:29:15 +08001#!/bin/sh
2
3# This script is a backup solution for setting up/removing MCTP endpoint for NICs
4action=$1
5slot=$2
6# NIC bus are 24~27.
Potin Lai178a2a22024-04-23 16:59:31 +08007bus=$((24 + slot))
Chris Wang0598b572024-03-12 17:29:15 +08008# Static EID for NIC are 90~93.
Potin Lai178a2a22024-04-23 16:59:31 +08009eid=$((90 + slot))
Chris Wang0598b572024-03-12 17:29:15 +080010
11sleep 2
12
13if [ "$action" = "add" ]; then
14 echo "Adding MCTP endpoint for slot $slot"
15 busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp au.com.CodeConstruct.MCTP AssignEndpointStatic sayy "mctpi2c${bus}" 1 0x32 "$eid"
16elif [ "$action" = "remove" ]; then
17 echo "Removing MCTP endpoint for slot $slot"
18 busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp/1/${eid} au.com.CodeConstruct.MCTP.Endpoint Remove
19fi
20