Skip to content

Commit

Permalink
Bluefield drivers/packages/debs updated to Debian 11 (#7)
Browse files Browse the repository at this point in the history
* BF drivers/pkgs/debs updated to Debian 11
* Packages added for mlx-openipmi
* Unnecessary drivers for BF2/3 removed
* Added the Derived Deb for OpenIPMI
* MFT compilation made generic
* Made the platform module deb installation at build time
* Added a udev rule for oob port
* Removed Trailing Whitespace
* Add the derived package hook in openIPMI
* Mistake resolved in mft.mk
* Update 92-oob_net.rules

Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>

Co-authored-by: Vivek Reddy Karri <vkarri@nvidia.com>
  • Loading branch information
vivekrnv and vivekrnv authored Dec 9, 2021
1 parent 6eb5b6c commit f9c71c9
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 230 deletions.
3 changes: 0 additions & 3 deletions platform/nvidia-bluefield/gpio-mlxbf/.gitignore

This file was deleted.

42 changes: 0 additions & 42 deletions platform/nvidia-bluefield/gpio-mlxbf/Makefile

This file was deleted.

3 changes: 2 additions & 1 deletion platform/nvidia-bluefield/mft/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ SHELL = /bin/bash
MFT_NAME = mft-$(MFT_VERSION)-$(MFT_REVISION)-arm64-deb
MFT_TGZ = $(MFT_NAME).tgz

BUILD_ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
SRC_DEB = kernel-mft-dkms_$(MFT_VERSION)-$(MFT_REVISION)_all.deb
MOD_DEB = kernel-mft-dkms-modules-$(KVERSION)_$(MFT_VERSION)_arm64.deb
MOD_DEB = kernel-mft-dkms-modules-$(KVERSION)_$(MFT_VERSION)_$(BUILD_ARCH).deb

MAIN_TARGET = mft_$(MFT_VERSION)-$(MFT_REVISION)_arm64.deb
DERIVED_TARGETS = $(MOD_DEB) mft-oem_$(MFT_VERSION)-$(MFT_REVISION)_arm64.deb
Expand Down
4 changes: 0 additions & 4 deletions platform/nvidia-bluefield/mlx-cpld/.gitignore

This file was deleted.

40 changes: 0 additions & 40 deletions platform/nvidia-bluefield/mlx-cpld/Makefile

This file was deleted.

11 changes: 8 additions & 3 deletions platform/nvidia-bluefield/mlx-openipmi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ SHELL = /bin/bash
MLX_OPENIPMI = mlx-OpenIPMI-${MLX_OPENIPMI_DRIVER_VERSION}
MLX_OPENIPMI_TAR = ${MLX_OPENIPMI}.tar.gz

$(addprefix $(DEST)/, $(MLX_OPENIPMI_DEB)): $(DEST)/% :
MAIN_TARGET = $(MLX_OPENIPMI_DEB)
DERIVED_TARGETS = $(MLX_OPENIPMI_SERVER_DEB)

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf ${MLX_OPENIPMI} ${MLX_OPENIPMI_TAR} *.buildinfo *.changes *.deb
wget -N "https://linux.mellanox.com/public/repo/bluefield/${BSD_VER}/extras/SOURCES/$(MLX_OPENIPMI_TAR)"
tar -z -f $(MLX_OPENIPMI_TAR) -x
Expand All @@ -31,10 +34,12 @@ $(addprefix $(DEST)/, $(MLX_OPENIPMI_DEB)): $(DEST)/% :

# Build the package
ifeq ($(CROSS_BUILD_ENVIRON), y)
CONFIG_SITE=/etc/dpkg-cross/cross-config.$(CONFIGURED_ARCH) LD_LIBRARY_PATH=$(CROSS_LIB_PATH) dpkg-buildpackage -rfakeroot -us -uc -b -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
dpkg-buildpackage -rfakeroot -us -uc -b -d -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
else
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -rfakeroot -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -rfakeroot -us -uc -b -d -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
endif
popd

mv $* $(DEST)/

$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)
9 changes: 0 additions & 9 deletions platform/nvidia-bluefield/recipes/gpio-mlxbf.dep

This file was deleted.

25 changes: 0 additions & 25 deletions platform/nvidia-bluefield/recipes/gpio-mlxbf.mk

This file was deleted.

15 changes: 9 additions & 6 deletions platform/nvidia-bluefield/recipes/installer-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@ SONIC_BF2_IMAGE_BASE = sonic-nvidia-bluefield
$(SONIC_BF2_IMAGE_BASE)_MACHINE = nvidia-bluefield

# Install the packages during the build_debian phase
$(SONIC_BF2_IMAGE_BASE)_INSTALLS += $(ETHTOOL) $(LIBPKA_DEB) $(SYSTEMD_SONIC_GENERATOR) $(KERNEL_MFT) $(MFT_OEM) $(MFT)
$(SONIC_BF2_IMAGE_BASE)_INSTALLS += $(ETHTOOL) \
$(LIBPKA_DEB) \
$(KERNEL_MFT) \
$(MFT_OEM) \
$(MFT) \
$(MLX_OPENIPMI_DEB) \
$(MLX_OPENIPMI_SERVER_DEB) \
$(BF2_PLATFORM_MODULE)

# Required Dockers
# TODO: Add swss, syncd and pmon later
$(SONIC_BF2_IMAGE_BASE)_DOCKERS = $(filter-out $(DOCKER_ORCHAGENT) $(DOCKER_PLATFORM_MONITOR),$(SONIC_INSTALL_DOCKER_IMAGES))

# Platform Specific Packages
$(SONIC_BF2_IMAGE_BASE)_LAZY_INSTALLS += $(BF2_PLATFORM_MODULE)

# TODO:
# INSTALLS: $(MLNX_BLUEFIELD_BUILD_SCRIPTS) $(MLXBF_BOOTCTL_DEB)
Expand Down Expand Up @@ -62,6 +67,4 @@ $(SONIC_BF2_IMAGE_BFB)_DEPENDS += $($(SONIC_BF2_IMAGE_BASE)_DEPENDS)
$(SONIC_BF2_IMAGE_BFB)_DOCKERS += $($(SONIC_BF2_IMAGE_BASE)_DOCKERS)
$(SONIC_BF2_IMAGE_BFB)_LAZY_INSTALLS += $($(SONIC_BF2_IMAGE_BASE)_LAZY_INSTALLS)

SONIC_INSTALLERS += $(SONIC_BF2_IMAGE_PXE)
SONIC_INSTALLERS += $(SONIC_BF2_IMAGE_BIN)
SONIC_INSTALLERS += $(SONIC_BF2_IMAGE_BFB)
SONIC_INSTALLERS += $(SONIC_BF2_IMAGE_PXE) $(SONIC_BF2_IMAGE_BIN) $(SONIC_BF2_IMAGE_BFB)
3 changes: 2 additions & 1 deletion platform/nvidia-bluefield/recipes/mft.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ SONIC_MAKE_DEBS += $(MFT)
ifeq ($(BLDENV), bullseye)
$(MFT)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)

KERNEL_MFT = kernel-mft-dkms-modules-$(KVERSION)_$(MFT_VERSION)_arm64.deb
BUILD_ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
KERNEL_MFT = kernel-mft-dkms-modules-$(KVERSION)_$(MFT_VERSION)_$(BUILD_ARCH).deb
$(eval $(call add_derived_package,$(MFT),$(KERNEL_MFT)))
endif

Expand Down
2 changes: 1 addition & 1 deletion platform/nvidia-bluefield/recipes/mlx-bootctl.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
#

MLX_BOOTCTL_DRIVER_VERSION = 1.3
MLX_BOOTCTL_DRIVER_VERSION = 1.5
MLX_BOOTCTL_DRIVER = mlx-bootctl.ko

$(MLX_BOOTCTL_DRIVER)_SRC_PATH = $(PLATFORM_PATH)/mlx-bootctl
Expand Down
9 changes: 0 additions & 9 deletions platform/nvidia-bluefield/recipes/mlx-cpld.dep

This file was deleted.

26 changes: 0 additions & 26 deletions platform/nvidia-bluefield/recipes/mlx-cpld.mk

This file was deleted.

6 changes: 5 additions & 1 deletion platform/nvidia-bluefield/recipes/mlx-openipmi.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@
#

MLX_OPENIPMI_DRIVER_VERSION = 2.0.25
MLX_OPENIPMI_DEB = mlx-openipmi_${MLX_OPENIPMI_DRIVER_VERSION}-1_arm64.deb
MLX_OPENIPMI_DEB = mlx-libopenipmi0_${MLX_OPENIPMI_DRIVER_VERSION}-3_arm64.deb
MLX_OPENIPMI_SERVER_DEB = mlx-openipmi_${MLX_OPENIPMI_DRIVER_VERSION}-3_arm64.deb


$(MLX_OPENIPMI_DEB)_SRC_PATH = $(PLATFORM_PATH)/mlx-openipmi
$(MLX_OPENIPMI_DEB)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) libsnmp-dev_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
SONIC_MAKE_DEBS += $(MLX_OPENIPMI_DEB)
$(eval $(call add_derived_package,$(MLX_OPENIPMI_DEB),$(MLX_OPENIPMI_SERVER_DEB)))

export MLX_OPENIPMI_DRIVER_VERSION
export MLX_OPENIPMI_DEB
export MLX_OPENIPMI_SERVER_DEB
10 changes: 4 additions & 6 deletions platform/nvidia-bluefield/recipes/platform-modules-bf2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ BF2_PLATFORM_MODULE = platform-modules-bf2_$(BF2_PLATFORM_MODULE_VERSION)_arm64.
$(BF2_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-bf2

# Bluefield Drivers
BF2_PLATFORM_DRIVERS = $(MLXBF_GIGE_DRIVER) $(MLXBF2_GPIO_DRIVER) $(BLUEFIELD_EDAC_DRIVER)
BF2_PLATFORM_DRIVERS += $(MLX_TRIO_DRIVER) $(MLXBF_LIVEFISH_DRIVER) $(IPMB_HOST_DRIVER)
BF2_PLATFORM_DRIVERS += $(MLXBF_PKA_DRIVER) $(MLXBF_PMC_DRIVER) $(TMFIFO_DRIVER)
BF2_PLATFORM_DRIVERS += $(MLX_BOOTCTL_DRIVER) $(MLXBF_I2C_DRIVER) $(IPMB_DEV_INT_DRIVER)

# $(MLX_CPLD_DRIVER)
BF2_PLATFORM_DRIVERS = $(MLXBF_GIGE_DRIVER) $(IPMB_HOST_DRIVER) $(MLXBF_I2C_DRIVER)
BF2_PLATFORM_DRIVERS += $(MLX_TRIO_DRIVER) $(MLXBF_LIVEFISH_DRIVER) $(MLXBF_PMC_DRIVER)
BF2_PLATFORM_DRIVERS += $(TMFIFO_DRIVER) $(MLXBF2_GPIO_DRIVER) $(BLUEFIELD_EDAC_DRIVER)
BF2_PLATFORM_DRIVERS += $(MLX_BOOTCTL_DRIVER) $(IPMB_DEV_INT_DRIVER) $(MLXBF_PKA_DRIVER)

$(BF2_PLATFORM_MODULE)_FILES = $(BF2_PLATFORM_DRIVERS)
$(BF2_PLATFORM_MODULE)_PLATFORM = arm64-nvda_bf-mbf2m516a arm64-nvda_bf-mbf2h536c
Expand Down
3 changes: 0 additions & 3 deletions platform/nvidia-bluefield/rshim/.gitignore

This file was deleted.

40 changes: 0 additions & 40 deletions platform/nvidia-bluefield/rshim/Makefile

This file was deleted.

11 changes: 4 additions & 7 deletions platform/nvidia-bluefield/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,18 @@
RECIPE_DIR = recipes

# Bluefied Software Distribution Version
BSD_VER = "3.7.1"
BSD_VER=3.8.0
export BSD_VER


include $(PLATFORM_PATH)/$(RECIPE_DIR)/tmfifo.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/mlxbf-gige.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/gpio-mlxbf.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/gpio-mlxbf2.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/i2c-mlxbf.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/bluefield-edac.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/ipmb-dev-int.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/ipmb-host.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/libpka.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/mlx-bootctl.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/mlx-cpld.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/mlx-trio.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/mlxbf-bootctl.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/mlxbf-livefish.mk
Expand All @@ -42,8 +40,7 @@ include $(PLATFORM_PATH)/$(RECIPE_DIR)/bootimages.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/bfscripts.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/platform-modules-bf2.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/mft.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/mlx-openipmi.mk
# include $(PLATFORM_PATH)/$(RECIPE_DIR)/libpka.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/installer-image.mk

# TODO: This deb has dependency issues, skipped for now
# include $(PLATFORM_PATH)/$(RECIPE_DIR)/mlx-openipmi.mk

Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ modprobe {{ k_module.split(".")[0] }}

sync

systemctl restart ssh
systemctl restart systemd-logind
systemctl enable serial-getty@hvc0.service
systemctl enable serial-getty@ttyAMA0.service
systemctl enable serial-getty@ttyAMA1.service

#DEBHELPER#
#DEBHELPER#
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBSYSTEM=="net", ACTION=="add", DEVPATH=="/devices/platform/MLNXBF17:00/net/e*", NAME="eth0"
3 changes: 3 additions & 0 deletions sonic-slave-bullseye/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ RUN apt-get update && apt-get install -y \
googletest \
libgtest-dev \
libgcc-10-dev \
# For mlx-openIPMI
libopt0 \
libopt-dev \
# For sonic-host-services build
libcairo2-dev \
libdbus-1-dev \
Expand Down

0 comments on commit f9c71c9

Please sign in to comment.