Skip to content

Commit

Permalink
Add Xsight specific syncd start options (sonic-net#1112)
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Zhurakivsky <rzhurak@larch-networks.com>

Signed-off-by: Roman Zhurakivsky <rzhurak@larch-networks.com>
Co-authored-by: Roman Zhurakivskyy <rzhurak@larch-networks.com>
  • Loading branch information
deran1980 and z80x1 authored Sep 1, 2022
1 parent acacda0 commit ad148c6
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions syncd/scripts/syncd_init_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,55 @@ config_syncd_innovium()
mkdir -p $II_ROOT
}

config_syncd_xsight()
{
SYS_MODE="asic"
CFG_FILE="/etc/sonic/xlink.cfg"
LABEL_REVISION_FILE="/etc/sonic/hw_revision"
ONIE_MACHINE=`sed -n -e 's/^.*onie_machine=//p' /etc/machine.conf`

ln -sf /usr/share/sonic/hwsku/xdrv_config.json /etc/xsight/xdrv_config.json
ln -sf /usr/share/sonic/hwsku/xlink_cfg.json /etc/xsight/xlink_cfg.json
ln -sf /usr/share/sonic/hwsku/lanes_polarity.json /etc/xsight/lanes_polarity.json

if [ -f ${LABEL_REVISION_FILE} ]; then
LABEL_REVISION=`cat ${LABEL_REVISION_FILE}`
if [[ x${LABEL_REVISION} == x"R0B" ]] || [[ x${LABEL_REVISION} == x"R0B2" ]]; then
ln -sf /etc/xsight/serdes_config_A0.json /etc/xsight/serdes_config.json
else
ln -sf /etc/xsight/serdes_config_A1.json /etc/xsight/serdes_config.json
fi
fi

#export XLOG_DEBUG="XSW SAI SAI-HOST XHAL-TBL XHAL-LKP XHAL-LPM XHAL-TCAM XHAL-DTE XHAL-RNG XHAL-SP XHAL-RPC"
export XLOG_SYSLOG=ALL
export XLOG_LEVEL=ERROR
#export XLOG_FILE="/tmp/xsai.log"

#ports for XCLI Thrift client
export SAI_RPC_PORT=31000
export XSW_RPC_PORT=31001
export XHAL_RPC_PORT=31002

if [[ ${ONIE_MACHINE,,} != *"kvm"* ]]; then
# Working on HW box. Determine what to run XBM/ASIC
if [[ -f ${CFG_FILE} ]]; then
SYS_MODE=`sed -n -e 's/^.*sys_mode[[:blank:]]*=[[:blank:]]*//p' ${CFG_FILE}`
fi
else
SYS_MODE="xbm"
fi

if [[ ${SYS_MODE,,} == "xbm" ]]; then
rm -f /xbm/log/*
/xbm/run_xbm.sh &
else
export XDRV_PLUGIN_SO=libxpci_drv_plugin.so
fi

CMD_ARGS+=" -p $HWSKU_DIR/sai.profile"
}

config_syncd()
{
check_warm_boot
Expand Down Expand Up @@ -327,6 +376,8 @@ config_syncd()
config_syncd_innovium
elif [ "$SONIC_ASIC_TYPE" == "soda" ]; then
config_syncd_soda
elif [ "$SONIC_ASIC_TYPE" == "xsight" ]; then
config_syncd_xsight
else
echo "Unknown ASIC type $SONIC_ASIC_TYPE"
exit 1
Expand Down

0 comments on commit ad148c6

Please sign in to comment.