diff --git a/.gitmodules b/.gitmodules index 2cb687ff88..e5f0d2364d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -122,3 +122,6 @@ [submodule "src/dhcpmon"] path = src/dhcpmon url = https://github.com/sonic-net/sonic-dhcpmon.git +[submodule "platform/marvell-arm64/mrvl-prestera"] + path = platform/marvell-arm64/mrvl-prestera + url = https://github.com/Marvell-switching/mrvl-prestera.git diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/installer.conf b/device/nokia/arm64-nokia_ixs7215_52xb-r0/installer.conf index b138f294e1..3d02aab20d 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/installer.conf +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/installer.conf @@ -1 +1,2 @@ VAR_LOG_SIZE=4096 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="default_hugepagesz=32M hugepages=4 loglevel=4" diff --git a/platform/marvell-arm64/mrvl-prestera b/platform/marvell-arm64/mrvl-prestera new file mode 160000 index 0000000000..a5e93cbd8d --- /dev/null +++ b/platform/marvell-arm64/mrvl-prestera @@ -0,0 +1 @@ +Subproject commit a5e93cbd8d90c767891e9ad56447b1047cfa558a diff --git a/platform/marvell-arm64/prestera.mk b/platform/marvell-arm64/mrvl-prestera.mk similarity index 54% rename from platform/marvell-arm64/prestera.mk rename to platform/marvell-arm64/mrvl-prestera.mk index fc7debaf5d..6a3f4df2a5 100644 --- a/platform/marvell-arm64/prestera.mk +++ b/platform/marvell-arm64/mrvl-prestera.mk @@ -1,11 +1,8 @@ -# Marvell Prestera - +# Marvell Prestera platform package export MRVL_PRESTERA_VER = 1.0 export MRVL_PRESTERA = mrvlprestera_$(MRVL_PRESTERA_VER)_$(PLATFORM_ARCH) export MRVL_PRESTERA_DEB = $(MRVL_PRESTERA).deb -export MRVL_PRESTERA_SRC_URL = https://github.com/Marvell-switching/mrvl-prestera.git -export MRVL_PRESTERA_SRC_TAG = MRVL_PRESTERA_DRIVER_1.3 -$(MRVL_PRESTERA_DEB)_SRC_PATH = $(PLATFORM_PATH)/prestera +$(MRVL_PRESTERA_DEB)_SRC_PATH = $(PLATFORM_PATH)/mrvl-prestera $(MRVL_PRESTERA_DEB)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) SONIC_DPKG_DEBS += $(MRVL_PRESTERA_DEB) diff --git a/platform/marvell-arm64/platform.conf b/platform/marvell-arm64/platform.conf index a40e16a390..9e2a0cd8ee 100644 --- a/platform/marvell-arm64/platform.conf +++ b/platform/marvell-arm64/platform.conf @@ -48,7 +48,7 @@ else fit_addr=0x8000000 initrd_addr=0x2000000 - fdt_fname="/boot/armada-7020-comexpress.dtb" + fdt_fname="/usr/lib/linux-image-$kernel_version/marvell/armada-7020-comexpress.dtb" FW_ENV_DEFAULT='/dev/mtd1 0x0 0x10000 0x100000' demo_part=1 @@ -194,8 +194,8 @@ prepare_boot_menu() { BORDER='echo "---------------------------------------------------";echo;' fw_setenv ${FW_ARG} print_menu $BORDER $BOOT1 $BOOT2 $BOOT3 $BORDER > /dev/null - fw_setenv ${FW_ARG} linuxargs "net.ifnames=0 loopfstype=squashfs loop=$image_dir/$FILESYSTEM_SQUASHFS systemd.unified_cgroup_hierarchy=0 varlog_size=$VAR_LOG ${extra_cmdline_linux} loglevel=4" > /dev/null - fw_setenv ${FW_ARG} linuxargs_old "net.ifnames=0 loopfstype=squashfs loop=$image_dir_old/$FILESYSTEM_SQUASHFS systemd.unified_cgroup_hierarchy=0 varlog_size=$VAR_LOG loglevel=4" > /dev/null + fw_setenv ${FW_ARG} linuxargs "net.ifnames=0 loopfstype=squashfs loop=$image_dir/$FILESYSTEM_SQUASHFS systemd.unified_cgroup_hierarchy=0 varlog_size=$VAR_LOG ${ONIE_PLATFORM_EXTRA_CMDLINE_LINUX}" > /dev/null + fw_setenv ${FW_ARG} linuxargs_old "net.ifnames=0 loopfstype=squashfs loop=$image_dir_old/$FILESYSTEM_SQUASHFS systemd.unified_cgroup_hierarchy=0 varlog_size=$VAR_LOG ${ONIE_PLATFORM_EXTRA_CMDLINE_LINUX}" > /dev/null sonic_bootargs_old='setenv bootargs root='$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,${baudrate} ${othbootargs} ${mtdparts} ${linuxargs_old}' fw_setenv ${FW_ARG} sonic_bootargs_old $sonic_bootargs_old > /dev/null || true sonic_boot_load_old=$(fw_printenv -n sonic_boot_load || true) diff --git a/platform/marvell-arm64/prestera/debian/changelog b/platform/marvell-arm64/prestera/debian/changelog deleted file mode 100644 index 3e1e97802c..0000000000 --- a/platform/marvell-arm64/prestera/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -mrvlprestera (1.0) unstable; urgency=low - - * Prestera switch driver - - -- Marvell Fri, 19 Feb 2021 10:39:18 +0800 diff --git a/platform/marvell-arm64/prestera/debian/compat b/platform/marvell-arm64/prestera/debian/compat deleted file mode 100644 index ec635144f6..0000000000 --- a/platform/marvell-arm64/prestera/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/platform/marvell-arm64/prestera/debian/control b/platform/marvell-arm64/prestera/debian/control deleted file mode 100644 index 33a96b991d..0000000000 --- a/platform/marvell-arm64/prestera/debian/control +++ /dev/null @@ -1,15 +0,0 @@ -Source: mrvlprestera -Section: unknown -Priority: optional -Maintainer: Marvell -Build-Depends: debhelper (>=9) -Standards-Version: 3.9.6 -Homepage: -#Vcs-Git: git://anonscm.debian.org/collab-maint/mrvlprestera.git -#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/mrvlprestera.git - -Package: mrvlprestera -Architecture: arm64 -Homepage: -Description: - kernel modules for prestera switch driver diff --git a/platform/marvell-arm64/prestera/debian/mrvlprestera.install.template b/platform/marvell-arm64/prestera/debian/mrvlprestera.install.template deleted file mode 100644 index 5747270e57..0000000000 --- a/platform/marvell-arm64/prestera/debian/mrvlprestera.install.template +++ /dev/null @@ -1,3 +0,0 @@ -mrvl-prestera/drivers/generic/cpssEnabler/linuxNoKernelModule/drivers/mvMbusDrv.ko /lib/modules/KVERSION/kernel/extra -mrvl-prestera/drivers/generic/cpssEnabler/linuxNoKernelModule/drivers/mvIntDrv.ko /lib/modules/KVERSION/kernel/extra -mrvl-prestera/platform/arm64/* / diff --git a/platform/marvell-arm64/prestera/debian/rules b/platform/marvell-arm64/prestera/debian/rules deleted file mode 100755 index bf223af19b..0000000000 --- a/platform/marvell-arm64/prestera/debian/rules +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/make -f - -include /usr/share/dpkg/pkg-info.mk - -PACKAGE_PRE_NAME := mrvlprestera -ifneq ($(CROSS_BUILD_ENVIRON), y) -KVERSION ?= $(shell uname -r) -endif -KERNEL_SRC := /lib/modules/$(KVERSION) -MOD_SRC_DIR:= $(shell pwd) -MODULE_DIR := mrvl-prestera/drivers/generic/cpssEnabler/linuxNoKernelModule/drivers - -%: - dh $@ --with systemd,python2,python3 --buildsystem=pybuild - -clean: - dh_testdir - dh_testroot - dh_clean - -build: - # get sources - rm -rf mrvl-prestera || true - git clone ${MRVL_PRESTERA_SRC_URL} - cd mrvl-prestera && git checkout ${MRVL_PRESTERA_SRC_TAG} && cd .. - sed "s/KVERSION/${KVERSION}/g" /sonic/platform/marvell-arm64/prestera/debian/mrvlprestera.install.template > /sonic/platform/marvell-arm64/prestera/debian/mrvlprestera.install - - make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$(MODULE_DIR)/ - -binary: binary-arch binary-indep - # Nothing to do - -binary-arch: - # Nothing to do - -binary-indep: - dh_testdir - dh_installdirs - - # Resuming debhelper scripts - dh_testroot - dh_install - dh_installchangelogs - dh_installdocs - dh_systemd_enable - dh_installinit - dh_systemd_start - dh_link - dh_fixperms - dh_compress - dh_strip - dh_installdeb - dh_gencontrol - dh_md5sums - dh_builddeb -.PHONY: build binary binary-arch binary-indep clean diff --git a/platform/marvell-arm64/rules.mk b/platform/marvell-arm64/rules.mk index 0e8e18d14c..15d5071e1f 100644 --- a/platform/marvell-arm64/rules.mk +++ b/platform/marvell-arm64/rules.mk @@ -5,7 +5,7 @@ include $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.mk include $(PLATFORM_PATH)/docker-saiserver-mrvl.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk include $(PLATFORM_PATH)/one-image.mk -include $(PLATFORM_PATH)/prestera.mk +include $(PLATFORM_PATH)/mrvl-prestera.mk include $(PLATFORM_PATH)/platform-nokia.mk SONIC_ALL += $(SONIC_ONE_IMAGE) \ diff --git a/platform/marvell-arm64/sai.mk b/platform/marvell-arm64/sai.mk index f6372ca683..097264832c 100644 --- a/platform/marvell-arm64/sai.mk +++ b/platform/marvell-arm64/sai.mk @@ -1,6 +1,6 @@ # Marvell SAI -export MRVL_SAI_VERSION = 1.11.0-1 +export MRVL_SAI_VERSION = 1.12.0-3 export MRVL_SAI = mrvllibsai_$(MRVL_SAI_VERSION)_$(PLATFORM_ARCH).deb $(MRVL_SAI)_SRC_PATH = $(PLATFORM_PATH)/sai diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215-init.sh b/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215-init.sh index aaaa47eb92..deecbe0682 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215-init.sh +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215-init.sh @@ -4,9 +4,9 @@ # Load required kernel-mode drivers load_kernel_drivers() { - echo "Loading Kernel Drivers" - sudo insmod /lib/modules/5.10.0-23-2-arm64/nokia_7215_ixs_a1_cpld.ko - sudo insmod /lib/modules/5.10.0-23-2-arm64/ac5_thermal_sensor.ko + echo "Loading Kernel Drivers" + sudo insmod /lib/modules/5.10.0-23-2-arm64/kernel/extra/nokia_7215_ixs_a1_cpld.ko + sudo insmod /lib/modules/5.10.0-23-2-arm64/kernel/extra/ac5_thermal_sensor.ko } nokia_7215_profile() diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215_plt_setup.sh b/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215_plt_setup.sh deleted file mode 100644 index b7a6022e60..0000000000 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215_plt_setup.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -fw_uboot_env_cfg() -{ - echo "Setting up U-Boot environment..." - MACH_FILE="/host/machine.conf" - PLATFORM=`sed -n 's/onie_platform=\(.*\)/\1/p' $MACH_FILE` - - FW_ENV_DEFAULT='/dev/mtd0 0x400000 0x10000 0x10000' - - echo $FW_ENV_DEFAULT > /etc/fw_env.config -} - -update_modulelist() -{ - MODULE_FILE="/etc/modules-load.d/marvell.conf" - if grep -Fxq "mvMbusDrv" $MODULE_FILE - then - echo "Module list up to date" - else - echo "mvMbusDrv" >> $MODULE_FILE - modprobe mvMbusDrv - fi - -} - -main() -{ - fw_uboot_env_cfg - update_modulelist -} - -main $@ diff --git a/platform/marvell-arm64/sonic-platform-nokia/debian/rules b/platform/marvell-arm64/sonic-platform-nokia/debian/rules index aa8ba79551..27015185a1 100755 --- a/platform/marvell-arm64/sonic-platform-nokia/debian/rules +++ b/platform/marvell-arm64/sonic-platform-nokia/debian/rules @@ -11,10 +11,13 @@ ifneq ($(CROSS_BUILD_ENVIRON), y) KVERSION ?= $(shell uname -r) endif KERNEL_SRC := /lib/modules/$(KVERSION) +INSTALL_MOD_DIR := kernel/extra/ MOD_SRC_DIR:= $(shell pwd) MODULE_DIRS:= 7215 UTILS_DIR := utils MODULE_DIR:= modules +MRVL_MODULE_DIR:= mrvl-modules +PRESTERA_MODULE_SRC := mrvl-prestera/drivers/generic/cpssEnabler/linuxNoKernelModule/drivers SERVICE_DIR := service PLATFORM_DIR := sonic_platform @@ -28,6 +31,12 @@ clean: build: (for mod in $(MODULE_DIRS); do \ + cd $(MOD_SRC_DIR)/../$(PRESTERA_MODULE_SRC)/; \ + make clean; \ + make modules -C $(KERNEL_SRC)/build M=`pwd` CONFIG_KM_MVMBUS=y CONFIG_KM_MVINT=y || exit 1; \ + mkdir $(MOD_SRC_DIR)/$${mod}/$(MRVL_MODULE_DIR); \ + cp *.ko $(MOD_SRC_DIR)/$${mod}/$(MRVL_MODULE_DIR)/; \ + cd $(MOD_SRC_DIR); \ make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules || exit 1; \ python3 $${mod}/setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}; \ done) @@ -50,6 +59,7 @@ binary-indep: dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} /lib/systemd/system; \ cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system/; \ cp $(MOD_SRC_DIR)/$${mod}/$(UTILS_DIR)/* debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/local/bin/; \ + cp $(MOD_SRC_DIR)/$${mod}/$(MRVL_MODULE_DIR)/mvcpss.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ python3 $${mod}/setup.py install --root=$(MOD_SRC_DIR)/debian/$(PACKAGE_PRE_NAME)-$${mod} --install-layout=deb; \ done) diff --git a/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install b/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install index 8bfbd8efd9..ec9e8d9f60 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install +++ b/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install @@ -1,4 +1,4 @@ -7215/scripts/nokia-7215_plt_setup.sh usr/local/bin 7215/scripts/nokia-7215-init.sh usr/local/bin 7215/service/nokia-7215init.service etc/systemd/system 7215/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/arm64-nokia_ixs7215_52xb-r0 +../mrvl-prestera/platform/arm64/ac5x/* / diff --git a/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst b/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst index 4cd13f5b0d..e48b6feee7 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst +++ b/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst @@ -20,8 +20,9 @@ set -e case "$1" in configure) - sh /usr/local/bin/nokia-7215_plt_setup.sh chmod a+x /usr/local/bin/nokia-7215-init.sh + depmod -a + systemctl restart kmod systemctl enable nokia-7215init.service systemctl start nokia-7215init.service diff --git a/platform/marvell-arm64/sonic_fit.its b/platform/marvell-arm64/sonic_fit.its index 63590ffd7f..c4be07c76f 100644 --- a/platform/marvell-arm64/sonic_fit.its +++ b/platform/marvell-arm64/sonic_fit.its @@ -20,7 +20,7 @@ }; fdt_ac5x { description = "Flattened Device Tree blob for AC5x"; - data = /incbin/("/boot/ac5x.dtb"); + data = /incbin/("/usr/lib/linux-image-5.10.0-23-2-arm64/marvell/ac5-98dx35xx-rd.dtb"); type = "flat_dt"; arch = "arm64"; compression = "none";