diff options
author | George Hung <george.hung@quantatw.com> | 2020-10-14 13:01:37 +0300 |
---|---|---|
committer | Andrew Geissler <geissonator@yahoo.com> | 2020-10-16 00:55:02 +0300 |
commit | 9058879ea9b0e839f4bea60eddf50794ce112e88 (patch) | |
tree | d360e245ee2cb0bdcc936ed1da3df05ee5263277 /meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files | |
parent | b149c656d94a08bfdfffe55094664c4b898883a0 (diff) | |
download | openbmc-9058879ea9b0e839f4bea60eddf50794ce112e88.tar.xz |
meta-quanta: gbs: fix gpio presence issue
gpio presence service startup had the following issue:
https://gerrit.openbmc-project.xyz/c/openbmc/meta-quanta/+/37359
This may cause gpio present status to be misjudged leading to
wrong actions, thus add return code check to prevent them.
Also, remove unused present messages
(From meta-quanta rev: 18307556359068d936254d14f38392243bf80821)
Signed-off-by: George Hung <george.hung@quantatw.com>
Change-Id: Ie955f2cec14ad1e8d51c6e6df9a47fd5db9e6720
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files')
-rw-r--r-- | meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh | 42 |
1 files changed, 8 insertions, 34 deletions
diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh b/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh index 71a608fff..9858404a0 100644 --- a/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh +++ b/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh @@ -27,12 +27,8 @@ INTERFACE_NAME="xyz.openbmc_project.Inventory.Item" PE_PRESENT_OBJPATH=("/xyz/openbmc_project/inventory/system/chassis/entity/pe_slot0_prsnt" "/xyz/openbmc_project/inventory/system/chassis/entity/pe_slot1_prsnt") -HSBP_PRESENT_OBJPATH="/xyz/openbmc_project/inventory/system/chassis/cable/hsbp_cab_prsnt" -FANBD_PRESENT_OBJPATH="/xyz/openbmc_project/inventory/system/chassis/cable/fanbd_cab_prsnt" -BP12V_PRESENT_OBJPATH="/xyz/openbmc_project/inventory/system/chassis/cable/bp12v_cab_prsnt" SATA0_PRESENT_OBJPATH="/xyz/openbmc_project/inventory/system/chassis/entity/sata0_prsnt" - set_gpio_persistence() { reg_val=$(devmem ${WD1RCR_ADDR} 32) # Clear bit 16-23 to perserve all GPIO states across warm resets @@ -67,12 +63,12 @@ get_board_sku_id() { | sed 's/ //g' > ~/board_sku_id.txt } -get_hsp_board_rev_id() { +get_hsbp_board_rev_id() { echo $(get_gpio_value 'HSBP_BRD_REV_ID3')\ $(get_gpio_value 'HSBP_BRD_REV_ID2')\ $(get_gpio_value 'HSBP_BRD_REV_ID1')\ $(get_gpio_value 'HSBP_BRD_REV_ID0')\ - | sed 's/ //g' > ~/hsp_board_rev_id.txt + | sed 's/ //g' > ~/hsbp_board_rev_id.txt } get_fan_board_rev_id() { @@ -121,8 +117,8 @@ set_hdd_prsnt() { # On PVT need to forward SATA0_PRSNT_N to HDD_PRSNT_N # The signal is safe to set on DVT boards so just set universally. sata_prsnt_n="$(busctl get-property $SERVICE_NAME ${SATA0_PRESENT_OBJPATH} \ - $INTERFACE_NAME Present | awk '{print $2}')" - if [[ ${sata_prsnt_n} != "true" ]]; then + $INTERFACE_NAME Present)" + if [[ "$?" == "0" && ${sata_prsnt_n} == "b false" ]]; then return 1 fi # sata_prsnt_n is active low => value "true" means low @@ -190,9 +186,9 @@ parse_pe_fru() { for i in {1..2}; do pe_prsnt_n="$(busctl get-property $SERVICE_NAME ${PE_PRESENT_OBJPATH[$(($i-1))]} \ - $INTERFACE_NAME Present | awk '{print $2}')" + $INTERFACE_NAME Present)" - if [[ ${pe_prsnt_n} != "true" ]]; then + if [[ "$?" == "0" && ${pe_prsnt_n} == "b false" ]]; then pe_fruid=$(($pe_fruid+1)) continue fi @@ -232,6 +228,8 @@ check_power_status() { main() { get_board_rev_id get_board_sku_id + get_hsbp_board_rev_id + get_fan_board_rev_id check_board_ver if [[ "${BOARD_VER}" == "PREPVT" ]]; then @@ -240,30 +238,6 @@ main() { check_board_sku - hsbp_prsnt="$(busctl get-property $SERVICE_NAME ${HSBP_PRESENT_OBJPATH} \ - $INTERFACE_NAME Present | awk '{print $2}')" - if [[ ${hsbp_prsnt} == "true" ]]; then - get_hsp_board_rev_id - hsbp_12v_prsnt="$(busctl get-property $SERVICE_NAME ${BP12V_PRESENT_OBJPATH} \ - $INTERFACE_NAME Present | awk '{print $2}')" - if [[ ${hsbp_12v_prsnt} != "true" ]]; then - echo "HSBP board power cable(12V) not present !!" - fi - else - echo "HSBP board sideband cable not present !!" - echo "Stop NVMe Power/LED control Service " - systemctl stop xyz.openbmc_project.Control.Nvme.Power - systemctl stop xyz.openbmc_project.nvme.manager - fi - - fan_prsnt="$(busctl get-property $SERVICE_NAME ${FANBD_PRESENT_OBJPATH} \ - $INTERFACE_NAME Present | awk '{print $2}')" - if [[ ${fan_prsnt} == "true" ]]; then - get_fan_board_rev_id - else - echo "Fan board sideband cable not present !!" - fi - set_hdd_prsnt reset_phy |