From 8173a173448db7b811ed2675e82e2ac742d2245f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Olguy=20Can=C3=A9us?= Date: Fri, 16 Aug 2019 22:41:10 -0700 Subject: [PATCH] wedge400: board-util.sh code revised (#97) Summary: 1. Copyright change 2. wedge_power_on judgement follow CPLD spec 3. support wedge400-c/wedge400-2 4. remove code not used Pull Request resolved: https://github.com/facebookexternal/openbmc.celestica/pull/97 Reviewed By: joancaneus fbshipit-source-id: 2cac97e09e --- .../openbmc-utils/files/board-utils.sh | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/meta-facebook/meta-wedge400/recipes-utils/openbmc-utils/files/board-utils.sh b/meta-facebook/meta-wedge400/recipes-utils/openbmc-utils/files/board-utils.sh index 19b8774c59a5..82d8d6573d2e 100755 --- a/meta-facebook/meta-wedge400/recipes-utils/openbmc-utils/files/board-utils.sh +++ b/meta-facebook/meta-wedge400/recipes-utils/openbmc-utils/files/board-utils.sh @@ -18,7 +18,8 @@ # Boston, MA 02110-1301 USA # -. /usr/local/bin/openbmc-utils.sh +# Do not change this line to openbmc-utils.sh, or it will generate a source loop. +. /usr/local/bin/i2c-utils.sh SCMCPLD_SYSFS_DIR=$(i2c_device_sysfs_abspath 2-003e) SMBCPLD_SYSFS_DIR=$(i2c_device_sysfs_abspath 12-003e) @@ -33,16 +34,6 @@ PWR_USRV_SYSFS="${SCMCPLD_SYSFS_DIR}/com_exp_pwr_enable" PWR_USRV_FORCE_OFF="${SCMCPLD_SYSFS_DIR}/com_exp_pwr_force_off" PWR_TH_RST_SYSFS="${SMBCPLD_SYSFS_DIR}/mac_reset_n" -wedge_iso_buf_enable() { - # TODO, no isolation buffer - return 0 -} - -wedge_iso_buf_disable() { - # TODO, no isolation buffer - return 0 -} - wedge_is_us_on() { local val0 val1 @@ -59,7 +50,12 @@ wedge_is_us_on() { } wedge_board_type() { - echo 'WEDGE400' + rev=$(wedge_board_rev) + if [ $((rev&0x04)) -eq 4 ]; then + echo 'WEDGE400' + else + echo 'WEDGE400-2' + fi } wedge_slot_id() { @@ -74,12 +70,6 @@ wedge_board_rev() { echo $((val0 | (val1 << 1) | (val2 << 2))) } -# Should we enable OOB interface or not -wedge_should_enable_oob() { - # wedge400 uses BMC MAC since beginning - return -1 -} - wedge_power_on_board() { # wedge400 SCM power is controlled by SCMCPLD return 0