Skip to content

Commit

Permalink
[202211_SPC4] Revert "Remove support to Mellanox SPC4 ASIC (sonic-net…
Browse files Browse the repository at this point in the history
…#13932) (sonic-net#13957)"

This reverts commit 18bc044
  • Loading branch information
DavidZagury committed May 30, 2023
1 parent 2f05ccd commit 511a04e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,7 @@ declare -rA FW_FILE_MAP=( \
[$MLNX_SPC_FW_FILE]="fw-SPC.mfa" \
[$MLNX_SPC2_FW_FILE]="fw-SPC2.mfa" \
[$MLNX_SPC3_FW_FILE]="fw-SPC3.mfa" \
[$MLNX_SPC4_FW_FILE]="fw-SPC4.mfa" \
)
sudo mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/fw/asic/
sudo mkdir -p $FILESYSTEM_ROOT_ETC/mlnx/
Expand Down
4 changes: 4 additions & 0 deletions platform/mellanox/fw.dep
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ $(MLNX_SPC2_FW_FILE)_DEP_FILES := $(DEP_FILES)
$(MLNX_SPC3_FW_FILE)_CACHE_MODE := GIT_CONTENT_SHA
$(MLNX_SPC3_FW_FILE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(MLNX_SPC3_FW_FILE)_DEP_FILES := $(DEP_FILES)

$(MLNX_SPC4_FW_FILE)_CACHE_MODE := GIT_CONTENT_SHA
$(MLNX_SPC4_FW_FILE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(MLNX_SPC4_FW_FILE)_DEP_FILES := $(DEP_FILES)
8 changes: 7 additions & 1 deletion platform/mellanox/fw.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ MLNX_SPC3_FW_FILE = fw-SPC3-rel-$(subst .,_,$(MLNX_SPC3_FW_VERSION))-EVB.mfa
$(MLNX_SPC3_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
$(MLNX_SPC3_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC3_FW_FILE)

MLNX_FW_FILES = $(MLNX_SPC_FW_FILE) $(MLNX_SPC2_FW_FILE) $(MLNX_SPC3_FW_FILE)
MLNX_SPC4_FW_VERSION = 34.2010.4150
MLNX_SPC4_FW_FILE = fw-SPC4-rel-$(subst .,_,$(MLNX_SPC4_FW_VERSION))-EVB.mfa
$(MLNX_SPC4_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
$(MLNX_SPC4_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC4_FW_FILE)

MLNX_FW_FILES = $(MLNX_SPC_FW_FILE) $(MLNX_SPC2_FW_FILE) $(MLNX_SPC3_FW_FILE) $(MLNX_SPC4_FW_FILE)

ifeq ($(FW_FROM_URL),n)
SONIC_COPY_FILES += $(MLNX_FW_FILES)
Expand All @@ -60,3 +65,4 @@ MLNX_FILES += $(MLNX_FW_FILES)
export MLNX_SPC_FW_FILE
export MLNX_SPC2_FW_FILE
export MLNX_SPC3_FW_FILE
export MLNX_SPC4_FW_FILE
6 changes: 6 additions & 0 deletions platform/mellanox/mlnx-fw-upgrade.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ declare -r LIST_CONTENT_FILE="/tmp/mlxfwmanager-list-content.log"
declare -r SPC1_ASIC="spc1"
declare -r SPC2_ASIC="spc2"
declare -r SPC3_ASIC="spc3"
declare -r SPC4_ASIC="spc4"
declare -r UNKN_ASIC="unknown"
declare -r UNKN_MST="unknown"

declare -rA FW_FILE_MAP=( \
[$SPC1_ASIC]="fw-SPC.mfa" \
[$SPC2_ASIC]="fw-SPC2.mfa" \
[$SPC3_ASIC]="fw-SPC3.mfa" \
[$SPC4_ASIC]="fw-SPC4.mfa" \
)

IMAGE_UPGRADE="${NO_PARAM}"
Expand Down Expand Up @@ -160,6 +162,7 @@ function GetAsicType() {
local -r SPC1_PRODUCT_ID="cb84"
local -r SPC2_PRODUCT_ID="cf6c"
local -r SPC3_PRODUCT_ID="cf70"
local -r SPC4_PRODUCT_ID="cf80"

if lspci -n | grep "${VENDOR_ID}:${SPC1_PRODUCT_ID}" &>/dev/null; then
echo "${SPC1_ASIC}"
Expand All @@ -170,6 +173,9 @@ function GetAsicType() {
elif lspci -n | grep "${VENDOR_ID}:${SPC3_PRODUCT_ID}" &>/dev/null; then
echo "${SPC3_ASIC}"
exit "${EXIT_SUCCESS}"
elif lspci -n | grep "${VENDOR_ID}:${SPC4_PRODUCT_ID}" &>/dev/null; then
echo "${SPC4_ASIC}"
exit "${EXIT_SUCCESS}"
fi

echo "${UNKN_ASIC}"
Expand Down

0 comments on commit 511a04e

Please sign in to comment.