Skip to content

Commit

Permalink
wedge400: setup-board.sh (#103)
Browse files Browse the repository at this point in the history
Summary:
Initialize the system board setting on booting.
Pull Request resolved: facebookexternal/openbmc.celestica#103

Reviewed By: joancaneus

fbshipit-source-id: c968f2f672
  • Loading branch information
joancaneus authored and facebook-github-bot committed Aug 17, 2019
1 parent 4034621 commit ef12e82
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions meta-facebook/meta-wedge400/recipes-utils/openbmc-utils/files/setup_board.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2018-present Facebook. All Rights Reserved.
# Copyright 2019-present Facebook. All Rights Reserved.
#
# This program file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
Expand Down Expand Up @@ -35,6 +35,34 @@ board_rev=$(wedge_board_rev)
# Enable the isolation buffer between BMC and COMe i2c bus
echo 0 > ${SCMCPLD_SYSFS_DIR}/com_exp_pwr_enable

# Make the backup BIOS flash connect to COMe instead of BMC
#echo 0 > ${SCMCPLD_SYSFS_DIR}/com_spi_oe_n
#echo 0 > ${SCMCPLD_SYSFS_DIR}/com_spi_sel

# Setup management port LED
/usr/local/bin/setup_mgmt.sh led &
#/usr/local/bin/setup_mgmt.sh led &

# Setup USB Serial to RS485
echo 0 > ${SMBCPLD_SYSFS_DIR}/cpld_usb_mux_sel_0
echo 0 > ${SMBCPLD_SYSFS_DIR}/cpld_usb_mux_sel_1

# Init server_por_cfg
#if [ ! -f "/mnt/data/kv_store/server_por_cfg" ]; then
# /usr/bin/kv set server_por_cfg on persistent
#fi

# Force COMe's UART connect to BMC UART-5 and FB USB debug
# UART connect to BMC UART-2
echo 0x3 > $SMBCPLD_SYSFS_DIR/uart_selection

# Read board type from SMB CPLD and keep in cache store
brd_type=$(head -n 1 $SMBCPLD_SYSFS_DIR/board_type)
mkdir /tmp/cache_store
echo $brd_type > /tmp/cache_store/board_type

# Check board type to select lmsensor configuration
if [ $((brd_type)) -eq $((0x00)) ]; then
cp /etc/sensors.d/custom/wedge400.conf /etc/sensors.d/wedge400.conf
elif [ $((brd_type)) -eq $((0x01)) ]; then
cp /etc/sensors.d/custom/wedge400-2.conf /etc/sensors.d/wedge400-2.conf
fi

0 comments on commit ef12e82

Please sign in to comment.