[marvell]: Marvell prestera kernel driver (#7066)

Build Marvell kernel driver for prestera sai sdk
Builds interrupt and dma kernel driver
Removed the older method pre-compiled kernel module debian package and its makefile
This commit is contained in:
arheneus@marvell.com 2021-03-30 03:57:01 +05:30 committed by Guohan Lu
parent 0269fc19c2
commit 26ee7cc5f4
10 changed files with 90 additions and 18 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -0,0 +1,5 @@
mrvlprestera (1.0) unstable; urgency=low
* Prestera switch driver
-- Marvell <arheneus@marvell.com> Fri, 19 Feb 2021 10:39:18 +0800

View File

@ -0,0 +1 @@
9

View File

@ -0,0 +1,15 @@
Source: mrvlprestera
Section: unknown
Priority: optional
Maintainer: Marvell <arheneus@marvell.com>
Build-Depends: debhelper (>=9)
Standards-Version: 3.9.6
Homepage: <insert the upstream URL, if relevant>
#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: <insert the upstream URL, if relevant>
Description:
kernel modules for prestera switch driver

View File

@ -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/* /

View File

@ -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

View File

@ -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 = ""