meta-facebook: santabarbara: update SWB EID removal for AEB SWB mctp_remove only cleared the EID on i2c-114 (BRCM SWB). The AEB SWB has four boards on i2c-114..117, so stale EIDs remained after DC off. Loop over i2c-114..117; buses with no SWB are skipped, so BRCM SWB is unchanged. Tested-on santabarbara: ``` root@bmc:~# mctp route eid min 53 max 53 net 1 dev mctpi2c117 mtu 0 eid min 52 max 52 net 1 dev mctpi2c116 mtu 0 eid min 51 max 51 net 1 dev mctpi2c115 mtu 0 eid min 50 max 50 net 1 dev mctpi2c114 mtu 0 eid min 40 max 40 net 1 dev mctpi2c105 mtu 0 eid min 30 max 30 net 1 dev mctpi2c104 mtu 0 eid min 20 max 20 net 1 dev mctpi2c103 mtu 0 eid min 10 max 10 net 1 dev mctpi2c102 mtu 0 eid min 49 max 49 net 1 dev mctpi2c11 mtu 0 eid min 8 max 8 net 1 dev mctpi2c102 mtu 0 root@bmc:~# mfg-tool power-control -p 0 --action off <6> Attempting runtime:off on 0. "success" root@bmc:~# mctp route eid min 40 max 40 net 1 dev mctpi2c105 mtu 0 eid min 30 max 30 net 1 dev mctpi2c104 mtu 0 eid min 20 max 20 net 1 dev mctpi2c103 mtu 0 eid min 10 max 10 net 1 dev mctpi2c102 mtu 0 eid min 49 max 49 net 1 dev mctpi2c11 mtu 0 eid min 8 max 8 net 1 dev mctpi2c102 mtu 0 root@bmc:~# journalctl -u mctp_remove.service Starting Remove MCTP Endpoint ID (EID)... mctp_remove.service: Deactivated successfully. Finished Remove MCTP Endpoint ID (EID). ``` Change-Id: I0c457db935a5344aa0db6c64ddf63bbc77a41a63 Signed-off-by: Freddie Jheng <Freddie.Jheng@quantatw.com>
diff --git a/meta-facebook/meta-santabarbara/recipes-phosphor/gpio/phosphor-gpio-monitor/mctp_remove b/meta-facebook/meta-santabarbara/recipes-phosphor/gpio/phosphor-gpio-monitor/mctp_remove index f4a8ba5..d84228b 100644 --- a/meta-facebook/meta-santabarbara/recipes-phosphor/gpio/phosphor-gpio-monitor/mctp_remove +++ b/meta-facebook/meta-santabarbara/recipes-phosphor/gpio/phosphor-gpio-monitor/mctp_remove
@@ -1,13 +1,15 @@ #!/bin/bash -# Remove EID for SWB -if i2cdetect -l | grep -q "^i2c-114[[:space:]]"; then - eid=$(mctp route | grep "mctpi2c114" | grep -oE "eid min [0-9]+" | awk '{print $3}' | head -n1) - if [[ -n "$eid" ]]; then - busctl call au.com.codeconstruct.MCTP1 \ - /au/com/codeconstruct/mctp1/networks/1/endpoints/"$eid" \ - au.com.codeconstruct.MCTP.Endpoint1 Remove 2>/dev/null || true +# Remove EID for SWB (BRCM SWB uses i2c-114 only; AEB SWB uses i2c-114..117) +for bus in 114 115 116 117; do + if i2cdetect -l | grep -q "^i2c-${bus}[[:space:]]"; then + eid=$(mctp route | grep "mctpi2c$bus" | grep -oE "eid min [0-9]+" | awk '{print $3}' | head -n1) + if [[ -n "$eid" ]]; then + busctl call au.com.codeconstruct.MCTP1 \ + /au/com/codeconstruct/mctp1/networks/1/endpoints/"$eid" \ + au.com.codeconstruct.MCTP.Endpoint1 Remove 2>/dev/null || true + fi fi -fi +done exit 0