Skip to content
Closed
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
13 changes: 12 additions & 1 deletion platform/mellanox/mlnx-fw-upgrade.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ declare -rA FW_FILE_MAP=( \
[$SPC3_ASIC]="/etc/mlnx/fw-SPC3.mfa" \
)

declare -rA MST_DEVICE_MAP=( \
[$SPC1_ASIC]="/dev/mst/mt52100_pci_cr0" \
[$SPC2_ASIC]="/dev/mst/mt53100_pci_cr0" \
[$SPC3_ASIC]="/dev/mst/mt53104_pci_cr0" \
)

IMAGE_UPGRADE="${NO_PARAM}"
VERBOSE_LEVEL="${VERBOSE_MIN}"

Expand Down Expand Up @@ -175,6 +181,11 @@ function UpgradeFW() {
ExitFailure "failed to detect ASIC type"
fi

local -r _MST_DEVICE="${MST_DEVICE_MAP[$_ASIC_TYPE]}"
if [[ ! -c "${_MST_DEVICE}" ]]; then
ExitFailure "no such device: ${_MST_DEVICE}"
fi

if [ ! -z "${_FS_MOUNTPOINT}" ]; then
local -r _FW_FILE="${_FS_MOUNTPOINT}/${FW_FILE_MAP[$_ASIC_TYPE]}"
else
Expand Down Expand Up @@ -207,7 +218,7 @@ function UpgradeFW() {
ExitSuccess "firmware is up to date"
else
LogNotice "firmware upgrade is required. Installing compatible version..."
RunCmd "${BURN_CMD} -i ${_FW_FILE}"
RunCmd "${BURN_CMD} -d ${_MST_DEVICE} -i ${_FW_FILE}"
fi
}

Expand Down