diff --git a/platform/marvell-armhf/linux-kernel-armhf.mk b/platform/marvell-armhf/linux-kernel-armhf.mk deleted file mode 100644 index ac7aa3faf19a..000000000000 --- a/platform/marvell-armhf/linux-kernel-armhf.mk +++ /dev/null @@ -1,6 +0,0 @@ -# linux kernel package for marvell armhf - -# Add platform specific DTB -LINUX_KERNEL_DTB = linux-image-4.9.189-armhf.deb -$(LINUX_KERNEL_DTB)_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/kernel/$(LINUX_KERNEL_DTB) -SONIC_ONLINE_DEBS += $(LINUX_KERNEL_DTB) diff --git a/platform/marvell-armhf/linux/Makefile b/platform/marvell-armhf/linux/Makefile deleted file mode 100644 index dba660649abf..000000000000 --- a/platform/marvell-armhf/linux/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -.ONESHELL: -SHELL = /bin/bash -.SHELLFLAGS += -e - -LINUX_KERNEL_MRVL_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/kernel/$(LINUX_KERNEL_DTB) - -$(addprefix $(DEST)/, $(LINUX_KERNEL_DTB)): $(DEST)/% : - # get deb package - wget -O $(DEST)/$(LINUX_KERNEL_DTB) $(LINUX_KERNEL_MRVL_URL) - diff --git a/platform/marvell-armhf/one-image.mk b/platform/marvell-armhf/one-image.mk index 44bcd9595281..b72b553487f2 100644 --- a/platform/marvell-armhf/one-image.mk +++ b/platform/marvell-armhf/one-image.mk @@ -4,7 +4,7 @@ SONIC_ONE_IMAGE = sonic-marvell-armhf.bin $(SONIC_ONE_IMAGE)_MACHINE = marvell-armhf $(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie $(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR) -$(SONIC_ONE_IMAGE)_INSTALLS += $(LINUX_KERNEL_DTB) +$(SONIC_ONE_IMAGE)_INSTALLS += $(MRVL_PRESTERA_DEB) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(ET6448M_PLATFORM) \ $(NOKIA_7215_PLATFORM) ifeq ($(INSTALL_DEBUG_TOOLS),y) diff --git a/platform/marvell-armhf/prestera.mk b/platform/marvell-armhf/prestera.mk new file mode 100644 index 000000000000..2365319b9d00 --- /dev/null +++ b/platform/marvell-armhf/prestera.mk @@ -0,0 +1,11 @@ +# Marvell Prestera + +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.0 + +$(MRVL_PRESTERA_DEB)_SRC_PATH = $(PLATFORM_PATH)/prestera +$(MRVL_PRESTERA_DEB)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +SONIC_DPKG_DEBS += $(MRVL_PRESTERA_DEB) diff --git a/platform/marvell-armhf/prestera/debian/changelog b/platform/marvell-armhf/prestera/debian/changelog new file mode 100644 index 000000000000..ab8de1dfa386 --- /dev/null +++ b/platform/marvell-armhf/prestera/debian/changelog @@ -0,0 +1,5 @@ +mrvlprestera (1.0) unstable; urgency=low + + * Prestera switch driver + + -- Marvell Fri, 19 Feb 2021 10:39:18 +0800 diff --git a/platform/marvell-armhf/prestera/debian/compat b/platform/marvell-armhf/prestera/debian/compat new file mode 100644 index 000000000000..ec635144f600 --- /dev/null +++ b/platform/marvell-armhf/prestera/debian/compat @@ -0,0 +1 @@ +9 diff --git a/platform/marvell-armhf/prestera/debian/control b/platform/marvell-armhf/prestera/debian/control new file mode 100755 index 000000000000..51cb0579a263 --- /dev/null +++ b/platform/marvell-armhf/prestera/debian/control @@ -0,0 +1,15 @@ +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: armhf +Homepage: +Description: + kernel modules for prestera switch driver diff --git a/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template b/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template new file mode 100644 index 000000000000..d0e96ab1e7d6 --- /dev/null +++ b/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template @@ -0,0 +1,3 @@ +mrvl-prestera/cpssEnabler/linuxNoKernelModule/drivers/mvDmaDrv.ko /lib/modules/KVERSION/kernel/extra +mrvl-prestera/cpssEnabler/linuxNoKernelModule/drivers/mvIntDrv.ko /lib/modules/KVERSION/kernel/extra +mrvl-prestera/platform/armhf/* / diff --git a/platform/marvell-armhf/prestera/debian/rules b/platform/marvell-armhf/prestera/debian/rules new file mode 100755 index 000000000000..67692a42725c --- /dev/null +++ b/platform/marvell-armhf/prestera/debian/rules @@ -0,0 +1,53 @@ +#!/usr/bin/make -f + +include /usr/share/dpkg/pkg-info.mk + +PACKAGE_PRE_NAME := mrvlprestera +KVERSION ?= $(shell uname -r) +KERNEL_SRC := /lib/modules/$(KVERSION) +MOD_SRC_DIR:= $(shell pwd) +MODULE_DIR := mrvl-prestera/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 -b ${MRVL_PRESTERA_SRC_TAG} ${MRVL_PRESTERA_SRC_URL} + sed "s/KVERSION/${KVERSION}/g" /sonic/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template > /sonic/platform/marvell-armhf/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-armhf/rules.mk b/platform/marvell-armhf/rules.mk index 58b9654956f3..fd320e8caa41 100644 --- a/platform/marvell-armhf/rules.mk +++ b/platform/marvell-armhf/rules.mk @@ -5,9 +5,9 @@ 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)/linux-kernel-armhf.mk include $(PLATFORM_PATH)/platform-et6448m.mk include $(PLATFORM_PATH)/platform-nokia.mk +include $(PLATFORM_PATH)/prestera.mk ENABLE_SYNCD_RPC = "" INCLUDE_MGMT_FRAMEWORK = ""