From 529e83d41fa2de67285a30bfeaa4a29ff4373310 Mon Sep 17 00:00:00 2001 From: Yakiv Huryk Date: Tue, 31 Jan 2023 13:45:19 +0000 Subject: [PATCH] [Mellanox] update sdk/fw build procedure * sdk debs are now downloaded as Spectrum-SDK-Drivers-SONiC-Bins release * sx kernel is downloaded as zip from Spectrum-SDK-Drivers Signed-off-by: Yakiv Huryk --- .gitmodules | 3 --- platform/mellanox/fw.mk | 9 ++++++--- platform/mellanox/sdk-src/sx-kernel/Makefile | 14 +++++++++++--- .../sdk-src/sx-kernel/Switch-SDK-drivers | 1 - platform/mellanox/sdk.mk | 17 ++++++++--------- 5 files changed, 25 insertions(+), 19 deletions(-) delete mode 160000 platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers diff --git a/.gitmodules b/.gitmodules index 55299d62fe75..b2fe3c4800b5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -71,9 +71,6 @@ [submodule "src/sonic-mgmt-framework"] path = src/sonic-mgmt-framework url = https://github.com/sonic-net/sonic-mgmt-framework -[submodule "Switch-SDK-drivers"] - path = platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers - url = https://github.com/Mellanox/Switch-SDK-drivers [submodule "src/sonic-ztp"] path = src/sonic-ztp url = https://github.com/sonic-net/sonic-ztp diff --git a/platform/mellanox/fw.mk b/platform/mellanox/fw.mk index 6ce3c8faabca..9d2b445df85a 100644 --- a/platform/mellanox/fw.mk +++ b/platform/mellanox/fw.mk @@ -23,10 +23,13 @@ MLNX_FW_BASE_URL = SIMX_VERSION = 5.1-1065 -ifneq ($(MLNX_FW_BASE_URL), ) FW_FROM_URL = y -else -FW_FROM_URL = n + +MLNX_FW_ASSETS_RELEASE_TAG = fw-2010.4150 +MLNX_FW_ASSETS_URL = $(MLNX_ASSETS_GITHUB_URL)/releases/download/$(MLNX_FW_ASSETS_RELEASE_TAG) + +ifeq ($(MLNX_FW_BASE_URL), ) +MLNX_FW_BASE_URL = $(MLNX_FW_ASSETS_URL) endif MLNX_SPC_FW_VERSION = 13.2010.4150 diff --git a/platform/mellanox/sdk-src/sx-kernel/Makefile b/platform/mellanox/sdk-src/sx-kernel/Makefile index 26ccbd02516a..12256fd4b725 100644 --- a/platform/mellanox/sdk-src/sx-kernel/Makefile +++ b/platform/mellanox/sdk-src/sx-kernel/Makefile @@ -5,6 +5,8 @@ MAIN_TARGET = sx-kernel_1.mlnx.$(MLNX_SDK_DEB_VERSION)_$(CONFIGURED_ARCH).deb DERIVED_TARGETS = sx-kernel-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_$(CONFIGURED_ARCH).deb PACKAGE_NAME = sx_kernel +MLNX_SX_KERNEL_GITHUB_URL_BASE = https://github.com/Mellanox/Spectrum-SDK-Drivers/archive/refs/heads + $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # get sources @@ -13,9 +15,15 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : wget -c $(MLNX_SDK_SOURCE_BASE_URL)/$(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION).tar.gz -O - | tar -xz pushd sx_kernel-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION) else - pushd Switch-SDK-drivers - git reset --hard - git clean -xfd + rm -rf Spectrum-SDK-Drivers-$(MLNX_SDK_VERSION) + wget -c $(MLNX_SX_KERNEL_GITHUB_URL_BASE)/$(MLNX_SDK_VERSION).zip + unzip $(MLNX_SDK_VERSION).zip + rm -rf $(MLNX_SDK_VERSION).zip + + pushd Spectrum-SDK-Drivers-$(MLNX_SDK_VERSION) + ln -s ./sx_scripts/Makefile ./Makefile + ln -s ./sx_scripts/makefile ./makefile + ln -s ./sx_scripts/configure ./configure fi # build diff --git a/platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers b/platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers deleted file mode 160000 index c66b48a7aa60..000000000000 --- a/platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c66b48a7aa609b4e4a927c5f3fa9039d1a9bde28 diff --git a/platform/mellanox/sdk.mk b/platform/mellanox/sdk.mk index 8d2b43171fdd..5e1df75e9f07 100644 --- a/platform/mellanox/sdk.mk +++ b/platform/mellanox/sdk.mk @@ -14,11 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -MLNX_SDK_BASE_PATH = $(PLATFORM_PATH)/sdk-src/sx-kernel/Switch-SDK-drivers/bin/ -MLNX_SDK_PKG_BASE_PATH = $(MLNX_SDK_BASE_PATH)/$(BLDENV)/$(CONFIGURED_ARCH)/ MLNX_SDK_VERSION = 4.5.4150 MLNX_SDK_ISSU_VERSION = 101 +MLNX_ASSETS_GITHUB_URL = https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins +MLNX_SDK_ASSETS_RELEASE_TAG = sdk-$(MLNX_SDK_VERSION)-$(BLDENV)-$(CONFIGURED_ARCH) +MLNX_SDK_ASSETS_URL = $(MLNX_ASSETS_GITHUB_URL)/releases/download/$(MLNX_SDK_ASSETS_RELEASE_TAG) MLNX_SDK_DEB_VERSION = $(subst -,.,$(subst _,.,$(MLNX_SDK_VERSION))) # Place here URL where SDK sources exist @@ -30,7 +31,7 @@ else SDK_FROM_SRC = n endif -export MLNX_SDK_SOURCE_BASE_URL MLNX_SDK_VERSION MLNX_SDK_ISSU_VERSION MLNX_SDK_DEB_VERSION +export MLNX_SDK_SOURCE_BASE_URL MLNX_SDK_VERSION MLNX_SDK_ISSU_VERSION MLNX_SDK_DEB_VERSION MLNX_ASSETS_GITHUB_URL MLNX_SDK_RDEBS += $(APPLIBS) $(IPROUTE2_MLNX) $(SX_COMPLIB) $(SX_EXAMPLES) \ $(SX_GEN_UTILS) $(SX_SCEW) $(SXD_LIBS) $(WJH_LIBS) $(SX_ACL_HELPER) \ @@ -163,21 +164,19 @@ $(SX_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/sdk-src/sx-kernel SX_KERNEL_DEV = sx-kernel-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_$(CONFIGURED_ARCH).deb $(eval $(call add_derived_package,$(SX_KERNEL),$(SX_KERNEL_DEV))) -define make_path - $(1)_PATH = $(MLNX_SDK_PKG_BASE_PATH) +define make_url + $(1)_URL = $(MLNX_SDK_ASSETS_URL)/$(1) endef -$(eval $(foreach deb,$(MLNX_SDK_DEBS),$(call make_path,$(deb)))) -$(eval $(foreach deb,$(MLNX_SDK_RDEBS),$(call make_path,$(deb)))) -$(eval $(foreach deb,$(PYTHON_SDK_API) $(SX_KERNEL) $(SX_KERNEL_DEV),$(call make_path,$(deb)))) +$(eval $(foreach deb,$(MLNX_SDK_DEBS) $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API),$(call make_url,$(deb)))) SONIC_MAKE_DEBS += $(SX_KERNEL) ifeq ($(SDK_FROM_SRC), y) SONIC_MAKE_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) else -SONIC_COPY_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) +SONIC_ONLINE_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) endif mlnx-sdk-packages: $(addprefix $(DEBS_PATH)/, $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) $(SX_KERNEL))