Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Xsight specific syncd start options #1112

Merged
merged 1 commit into from
Sep 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions syncd/scripts/syncd_init_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,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 @@ -314,6 +363,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