blob: 6cacf32521d4ad6153479c0d487d86ea809c78f0 [file] [log] [blame]
#!/bin/sh
# Setup Endpoint for NICs, using devmem to read GPIO value since
# the gpio pin is occupied by gpio-monitor, read the value from
# gpioget is not possible.
# shellcheck source=meta-facebook/meta-yosemite4/recipes-networking/mctp/files/nic-gpio-addrs.sh
. /usr/share/mctp/nic-gpio-addrs.sh
# Setup slot1 NIC
gpio_val=$(devmem "$PRSNT_NIC0" "$WIDTH")
if [ $((gpio_val & "$BITMASK_NIC0")) -eq 0 ]; then
systemctl start setup-nic-endpoint-slot@0.service
fi
# Setup slot2 NIC
gpio_val=$(devmem "$PRSNT_NIC1" "$WIDTH")
if [ $((gpio_val & "$BITMASK_NIC1")) -eq 0 ]; then
systemctl start setup-nic-endpoint-slot@1.service
fi
# Setup slot3 NIC
gpio_val=$(devmem "$PRSNT_NIC2" "$WIDTH")
if [ $((gpio_val & "$BITMASK_NIC2")) -eq 0 ]; then
systemctl start setup-nic-endpoint-slot@2.service
fi
# Setup slot4 NIC
gpio_val=$(devmem "$PRSNT_NIC3" "$WIDTH")
if [ $((gpio_val & "$BITMASK_NIC3")) -eq 0 ]; then
systemctl start setup-nic-endpoint-slot@3.service
fi