From 9ae17e66a392429899d8b371eca2361ced303150 Mon Sep 17 00:00:00 2001 From: vmittal-msft <46945843+vmittal-msft@users.noreply.github.com> Date: Thu, 5 May 2022 20:27:29 -0700 Subject: [PATCH] [sonic-sairedis update] Support for SAI header v1.10.2 with BRCM SAI v7.1.0.0 and MLNX SAI v1.21.1.0 (#10583) --- platform/broadcom/sai-modules.mk | 4 +- platform/broadcom/sai.mk | 4 +- platform/broadcom/saibcm-modules-dnx | 2 +- .../broadcom/saibcm-modules/debian/changelog | 6 + .../saibcm-modules/include/soc/cmic.h | 37 - .../make/Makefile.linux-bmw-2_6 | 122 - .../saibcm-modules/make/Makefile.linux-gto | 127 -- .../make/Makefile.linux-gto-2_6 | 270 --- .../make/Makefile.linux-jag-2_6 | 166 -- .../make/Makefile.linux-nsx-2_6 | 56 - .../saibcm-modules/make/Makefile.linux-nsx64 | 54 - .../make/Makefile.linux-nsx_wrl-2_6 | 127 -- .../saibcm-modules/make/Makefile.linux-raptor | 53 - .../make/Makefile.linux-raptor-2_6 | 172 -- .../kernel/modules/bcm-ptp-clock/Makefile | 65 - .../modules/bcm-ptp-clock/bcm-ptp-clock.c | 1999 ----------------- .../linux/kernel/modules/knet-cb/psample-cb.c | 2 +- .../linux/kernel/modules/psample/psample.c | 2 + .../linux/kernel/modules/shared/ksal.c | 6 + .../systems/linux/user/bmw-2_6/Makefile | 63 - .../systems/linux/user/gto-2_6/Makefile | 84 - .../systems/linux/user/gto/Makefile | 60 - .../systems/linux/user/jag-2_6/Makefile | 79 - .../systems/linux/user/nsx-2_6/Makefile | 58 - .../systems/linux/user/nsx64/Makefile | 57 - .../systems/linux/user/nsx_wrl-2_6/Makefile | 65 - .../systems/linux/user/raptor-2_6/Makefile | 79 - .../systems/linux/user/raptor/Makefile | 58 - platform/mellanox/mlnx-sai.mk | 2 +- platform/mellanox/mlnx-sai/SAI-Implementation | 2 +- slave.mk | 2 +- src/sonic-sairedis | 2 +- 32 files changed, 24 insertions(+), 3861 deletions(-) delete mode 100644 platform/broadcom/saibcm-modules/include/soc/cmic.h delete mode 100644 platform/broadcom/saibcm-modules/make/Makefile.linux-bmw-2_6 delete mode 100644 platform/broadcom/saibcm-modules/make/Makefile.linux-gto delete mode 100644 platform/broadcom/saibcm-modules/make/Makefile.linux-gto-2_6 delete mode 100644 platform/broadcom/saibcm-modules/make/Makefile.linux-jag-2_6 delete mode 100644 platform/broadcom/saibcm-modules/make/Makefile.linux-nsx-2_6 delete mode 100644 platform/broadcom/saibcm-modules/make/Makefile.linux-nsx64 delete mode 100644 platform/broadcom/saibcm-modules/make/Makefile.linux-nsx_wrl-2_6 delete mode 100644 platform/broadcom/saibcm-modules/make/Makefile.linux-raptor delete mode 100644 platform/broadcom/saibcm-modules/make/Makefile.linux-raptor-2_6 delete mode 100644 platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/Makefile delete mode 100644 platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/bcm-ptp-clock.c delete mode 100644 platform/broadcom/saibcm-modules/systems/linux/user/bmw-2_6/Makefile delete mode 100644 platform/broadcom/saibcm-modules/systems/linux/user/gto-2_6/Makefile delete mode 100644 platform/broadcom/saibcm-modules/systems/linux/user/gto/Makefile delete mode 100644 platform/broadcom/saibcm-modules/systems/linux/user/jag-2_6/Makefile delete mode 100644 platform/broadcom/saibcm-modules/systems/linux/user/nsx-2_6/Makefile delete mode 100644 platform/broadcom/saibcm-modules/systems/linux/user/nsx64/Makefile delete mode 100644 platform/broadcom/saibcm-modules/systems/linux/user/nsx_wrl-2_6/Makefile delete mode 100644 platform/broadcom/saibcm-modules/systems/linux/user/raptor-2_6/Makefile delete mode 100644 platform/broadcom/saibcm-modules/systems/linux/user/raptor/Makefile diff --git a/platform/broadcom/sai-modules.mk b/platform/broadcom/sai-modules.mk index 1236e06d62..5aa7792064 100644 --- a/platform/broadcom/sai-modules.mk +++ b/platform/broadcom/sai-modules.mk @@ -1,6 +1,6 @@ # Broadcom SAI modules -BRCM_OPENNSL_KERNEL_VERSION = 6.1.0.3 +BRCM_OPENNSL_KERNEL_VERSION = 7.1.0.0 BRCM_OPENNSL_KERNEL = opennsl-modules_$(BRCM_OPENNSL_KERNEL_VERSION)_amd64.deb $(BRCM_OPENNSL_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/saibcm-modules @@ -10,7 +10,7 @@ $(BRCM_OPENNSL_KERNEL)_MACHINE = broadcom SONIC_DPKG_DEBS += $(BRCM_OPENNSL_KERNEL) # SAI bcm modules for DNX family ASIC -BRCM_DNX_OPENNSL_KERNEL_VERSION = 6.1.0.3 +BRCM_DNX_OPENNSL_KERNEL_VERSION = 7.1.0.0 BRCM_DNX_OPENNSL_KERNEL = opennsl-modules-dnx_$(BRCM_DNX_OPENNSL_KERNEL_VERSION)_amd64.deb $(BRCM_DNX_OPENNSL_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/saibcm-modules-dnx diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index 1ec8d915e5..872c51276f 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,5 +1,5 @@ -LIBSAIBCM_VERSION = 6.1.0.3 -LIBSAIBCM_BRANCH_NAME = REL_6.1 +LIBSAIBCM_VERSION = 7.1.0.0 +LIBSAIBCM_BRANCH_NAME = REL_7.0 LIBSAIBCM_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/$(LIBSAIBCM_BRANCH_NAME)/$(LIBSAIBCM_VERSION)" BRCM_SAI = libsaibcm_$(LIBSAIBCM_VERSION)_amd64.deb diff --git a/platform/broadcom/saibcm-modules-dnx b/platform/broadcom/saibcm-modules-dnx index 6bf58f8310..fb4cf12529 160000 --- a/platform/broadcom/saibcm-modules-dnx +++ b/platform/broadcom/saibcm-modules-dnx @@ -1 +1 @@ -Subproject commit 6bf58f8310bcb29168ae5b2dabed84fc942429fc +Subproject commit fb4cf12529bc27fffc1c988029f4db100138f133 diff --git a/platform/broadcom/saibcm-modules/debian/changelog b/platform/broadcom/saibcm-modules/debian/changelog index 0ff357c572..daa78471c6 100644 --- a/platform/broadcom/saibcm-modules/debian/changelog +++ b/platform/broadcom/saibcm-modules/debian/changelog @@ -1,3 +1,9 @@ +opennsl (7.1.0.0) unstable; urgency=medium + + * Update to Broadcom SAI 7.1.0.0. + + -- Vineet Mittal Tue, 19 APR 2022 12:30:00 +0000 + opennsl (6.1.0.3) unstable; urgency=medium * Update to Broadcom SAI 6.1.0.3 diff --git a/platform/broadcom/saibcm-modules/include/soc/cmic.h b/platform/broadcom/saibcm-modules/include/soc/cmic.h deleted file mode 100644 index 5bf6130237..0000000000 --- a/platform/broadcom/saibcm-modules/include/soc/cmic.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2017 Broadcom - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation (the "GPL"). - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 (GPLv2) for more details. - * - * You should have received a copy of the GNU General Public License - * version 2 (GPLv2) along with this source code. - */ -/* - * $Id: cmic.h,v 1.1 Broadcom SDK $ - * $Copyright: (c) 2005 Broadcom Corp. - * All Rights Reserved.$ - * - * File: cmic.h - * Purpose: Maps out structures used for CMIC operations and - * exports routines and constants. - */ - -#ifndef _SOC_CMIC_H -#define _SOC_CMIC_H - -/* IRQ Register (RO) */ -#define CMIC_IRQ_STAT 0x00000144 - -/* IRQ Mask Registers (R/W) */ -#define CMIC_IRQ_MASK 0x00000148 -#define CMIC_IRQ_MASK_1 0x0000006C -#define CMIC_IRQ_MASK_2 0x00000070 - -#endif /* !_SOC_CMIC_H */ diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-bmw-2_6 b/platform/broadcom/saibcm-modules/make/Makefile.linux-bmw-2_6 deleted file mode 100644 index 6fa170fb75..0000000000 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-bmw-2_6 +++ /dev/null @@ -1,122 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# $Id: Makefile.linux-bmw-2_6,v 1.20 Broadcom SDK $ -# $Copyright: (c) 2005 Broadcom Corp. -# All Rights Reserved.$ - -# Look for custom tools -ifneq (,$(PPC_TOOLS_DIR)) -ifneq (,$(PPC_CROSS_COMPILE)) -override PATH := $(PPC_TOOLS_DIR):$(PATH) -override CROSS_COMPILE := $(PPC_CROSS_COMPILE) -endif -endif - -# Default tools -ifeq (,$(WRS_LINUX_VERSION)) -WRS_LINUX_VERSION=2.0 -endif - -# Default Linux Kernel directory -ifeq (,$(KERNDIR)) - -ifeq (1.4,$(WRS_LINUX_VERSION)) - -KERNDIR := /projects/ntsw-tools/linux/wrslinux_1.4/bcm98245cpci/build/linux-2.6.14-cgl - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE = powerpc-wrs-linux-gnu-603e-glibc_std- -endif - -WRLINUX_BASE=/tools/windriver/linux_ed/1.4/Linux -export WIND_LIC_PROXY = $(WRLINUX_BASE)/setup/x86-linux2/bin -override PATH := $(WRLINUX_BASE)/gnu/3.4.4-wrlinux-1.4/x86-linux2/bin:$(PATH) - -WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/powerpc-wrs-linux-gnu/3.4.4/include -else - -ifeq (2.0,$(WRS_LINUX_VERSION)) - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE = powerpc-wrs-linux-gnu-ppc_603e-glibc_std- -endif - -KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/bmw/glibc_std/build/linux-2.6.21-standard - -WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux - -TOOLCHAIN_EXEC_PREFIX=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2 -TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_EXEC_PREFIX) -WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin - -WRLINUX_GNU_PATH = $(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin - -override PATH := $(TOOLCHAIN_EXEC_PREFIX):$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/powerpc-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH) - -export TOOLCHAIN_EXEC_PREFIX TOOLCHAIN_BIN_DIR WIND_LIC_PROXY - -WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/powerpc-wrs-linux-gnu/4.1.2/include - -comma = , -basetarget = $(basename $(notdir $@)) -modname = $(basetarget) - -# Extra variables. -EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) - -name-fix = $(subst $(comma),_,$(subst -,_,$1)) -basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" -modname_flags = $(if $(filter 1,$(words $(modname))),\ - -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") -endif -endif -endif - -# Default Linux include directory -ifeq (,$(LINUX_INCLUDE)) -LINUX_INCLUDE := $(KERNDIR)/include -endif - -CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1 -ENDIAN = BE_HOST=1 -CFGFLAGS += -D$(ENDIAN) -CFGFLAGS += -DBCM_PLATFORM_STRING=\"BMW_MPC8245/PPC603e\" - -ARCH = ppc -KBUILD_VERBOSE = 1 - -export ARCH KBUILD_VERBOSE - -ifeq (1.4,$(WRS_LINUX_VERSION)) -# From linux/arch/ppc/Makefile - -ifeq (,$(KFLAGS)) -KFLAGS := -D__KERNEL__ -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring -endif - -else -ifeq (2.0,$(WRS_LINUX_VERSION)) - -ifeq (,$(KFLAGS)) -KFLAGS := -D__KERNEL__ -m32 -nostdinc -isystem $(WRS_SYSROOT_PATH) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/ppc -I$(KERNDIR)/arch/ppc/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -msoft-float -pipe -ffixed-r2 -mmultiple -mno-altivec -mstring -fomit-frame-pointer -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -endif - -endif -endif - -ifneq ($(targetplat),user) -include ${SDK}/make/Makefile.linux-kernel-2_6 -endif diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-gto b/platform/broadcom/saibcm-modules/make/Makefile.linux-gto deleted file mode 100644 index 4a20a99dac..0000000000 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-gto +++ /dev/null @@ -1,127 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# $Id: Makefile.linux-gto-4_4,v 1.42 Broadcom SDK $ -# $Copyright: (c) 2015 Broadcom Corp. -# All Rights Reserved.$ - -# User must select one platform from below. -ifeq (,$(BUILD_PLATFORM)) -BUILD_PLATFORM=POWERPC_LINUX -endif - -# TOOLCHAIN_BASE_DIR Toolchain base directory for GTO devices -# TARGET_ARCHITECTURE Compiler for target architecture -# KERNDIR Kernel directory for iPROC-CMICd devices -TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/linux/gto -TARGET_ARCHITECTURE := powerpc-broadcom-linux-gnuspe -KERNDIR ?= $(TOOLCHAIN_BASE_DIR)/kernel/current - - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := $(TARGET_ARCHITECTURE)- -endif - - -# GTO toolchain -TOOLCHAIN_BIN_DIR := $(TOOLCHAIN_BASE_DIR)/toolchain/host/usr/bin -override PATH := $(TOOLCHAIN_BIN_DIR)/../$(TARGET_ARCHITECTURE)/bin:$(TOOLCHAIN_BIN_DIR):$(PATH) -export TOOLCHAIN_BIN_DIR - - -# Default Linux include directory -ifeq (,$(LINUX_INCLUDE)) -LINUX_INCLUDE := $(KERNDIR)/include -endif - -CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1 -ENDIAN = BE_HOST=1 -CFGFLAGS += -D$(ENDIAN) -CFGFLAGS += -DBCM_PLATFORM_STRING=\"GTO_MPC8548\" -CFGFLAGS += -DSAL_BDE_DMA_MEM_DEFAULT=32 - -# Extra variables. -EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) - -ARCH = powerpc -KBUILD_VERBOSE = 1 - -export ARCH KBUILD_VERBOSE - - -# From linux/arch/ppc/Makefile -comma = , -basetarget = $(basename $(notdir $@)) -modname = $(basetarget) - -name-fix = $(subst $(comma),_,$(subst -,_,$1)) -basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" -modname_flags = $(if $(filter 1,$(words $(modname))),\ - -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") - -KFLAG_INCLD = $(TOOLCHAIN_BIN_DIR)/../lib/gcc/$(TARGET_ARCHITECTURE)/4.6.4/include - -ifdef BROADCOM_SVK -ifeq ($PLX_PCI2LBUS, 1) -CFLAGS += -DBCM_PLX9656_LOCAL_BUS -DBDE_LINUX_NON_INTERRUPTIBLE -endif -endif - -ifdef DPP_CHIPS -CFLAGS += -DDUNE_BCM -D__DUNE_LINUX_BCM_CPU_PCP_DMA__ -CFGFLAGS += -DSOC_CM_FUNCTION -endif - -ifdef DFE_CHIPS -CFLAGS += -DDUNE_BCM -CFGFLAGS += -DSOC_CM_FUNCTION -endif - -ifdef SAND_CHIPS -CFLAGS += -D__DUNE_GTO_BCM_CPU__ -D__DUNE_LINUX_BCM_CPU_PCIE__ -endif - -ifdef SHADOW_PLX -CFLAGS += -DBCM_PLX9656_LOCAL_BUS -DBDE_LINUX_NON_INTERRUPTIBLE -DSHADOW_SVK -endif - -ifdef LTSW_CHIPS -# Default open source target build -OPENSRC_BUILD ?= uclibc_201402_ppc - -# Hardware interface (see $SDKLT/bcma/sys/probe directory) -SYSTEM_INTERFACE ?= ngbde - -# Turn on direct register access if running on real hardware. -ifeq (ngbde,$(SYSTEM_INTERFACE)) -LTSW_ADD_CPPFLAGS += -DBCMDRD_CONFIG_MEMMAP_DIRECT=1 -endif - -export SYSTEM_INTERFACE -endif - -ifeq (,$(KFLAGS)) -KFLAGS := -D__KERNEL__ -m32 -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/generated/uapi/linux/version.h -include $(LINUX_INCLUDE)/generated/autoconf.h -I$(KERNDIR)/arch/powerpc -I$(KERNDIR)/arch/powerpc/include -I$(KERNDIR)/include/asm-powerpc -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -msoft-float -pipe -ffixed-r2 -mmultiple -mno-altivec -funit-at-a-time -Wa,-me500 -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -endif - -ifneq (,$(findstring TCL,$(FEATURE_LIST))) -#LINK_STATIC = 0 -#export LINK_STATIC -endif - -ifneq ($(targetplat),user) -include ${SDK}/make/Makefile.linux-kernel-4_4 -endif - diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-gto-2_6 b/platform/broadcom/saibcm-modules/make/Makefile.linux-gto-2_6 deleted file mode 100644 index 56085c7a3c..0000000000 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-gto-2_6 +++ /dev/null @@ -1,270 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# $Id: Makefile.linux-gto-2_6,v 1.42 Broadcom SDK $ -# $Copyright: (c) 2005 Broadcom Corp. -# All Rights Reserved.$ - -# User must select one platform from below.By default WR_LINUX is selected. . -ifeq (,$(BUILD_PLATFORM)) -#BUILD_PLATFORM=ELDK -BUILD_PLATFORM=WR_LINUX -endif - -# Specify the ELDK version you want to use for building SDK. -ifeq (,$(ELDK_VERSION)) -ifeq (ELDK,$(BUILD_PLATFORM)) -ELDK_VERSION=4.0 -endif -endif - -# Specify the KERNEL VERSION you want to use for building SDK. -ifeq (,$(KERN_VER)) -ifeq (ELDK,$(BUILD_PLATFORM)) -KERN_VER=2.6.21.7 -endif -endif - - -# Specify the Windriver Linux version here.For example '2.0' as shown below. -ifeq (WR_LINUX,$(BUILD_PLATFORM)) -ifeq (,$(WRS_LINUX_VERSION)) -WRS_LINUX_VERSION=2.0 -endif -endif - - -#glibc_small and glibc_std have their own cross-compilation tools and and path for these tools are different as implemented below. To enable glibc_small build, line given below should be uncommented. - -#WRL_GLIBC_SMALL=TRUE - -ifeq (2.0,$(WRS_LINUX_VERSION)) -ifeq ($(WRL_GLIBC_SMALL),TRUE) - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := powerpc-wrs-linux-gnu-ppc_e500v2-glibc_small- -endif - -KERNDIR ?=/projects/ntsw-tools/linux/wrslinux_2.0/gto/glibc_small/build/linux-2.6.21-standard - -else - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := powerpc-wrs-linux-gnu-ppc_e500v2-glibc_std- -endif - -KERNDIR ?= /projects/ntsw-tools/linux/wrslinux_2.0/gto/glibc_std/build/linux-2.6.21-standard - -endif - -export WRL_GLIBC_SMALL - -# After this point glibc_std and glibc_small share these flags - -WRLINUX_BASE ?=/tools/windriver/linux_ed/2.0_GA/Linux -TOOLCHAIN_EXEC_PREFIX=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2 -TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_EXEC_PREFIX) -WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin -WRLINUX_GNU_PATH = $(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin -override PATH := $(TOOLCHAIN_EXEC_PREFIX):$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/powerpc-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH) -export TOOLCHAIN_EXEC_PREFIX TOOLCHAIN_BIN_DIR WIND_LIC_PROXY -endif - - -ifeq (3.0,$(WRS_LINUX_VERSION)) -ifeq ($(WRL_GLIBC_SMALL),TRUE) - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := powerpc-wrs-linux-gnu-ppc_e500v2-glibc_small- -endif - -KERNDIR ?=/projects/ntsw-tools/linux/wrslinux_3.0/gto/bcm98548xmc_30_glibc_small/build/linux-broadcom_bcm98548xmc-standard-build -KERNDIR_STD ?=/projects/ntsw-tools/linux/wrslinux_3.0/gto/bcm98548xmc_30_glibc_small/build/linux - -else - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := powerpc-wrs-linux-gnu-ppc_e500v2-glibc_std- -endif - -KERNDIR ?=/projects/ntsw-tools/linux/wrslinux_3.0/gto/bcm98548xmc_30_glibc_std_debug/build/linux-broadcom_bcm98548xmc-standard-build -KERNDIR_STD ?=/projects/ntsw-tools/linux/wrslinux_3.0/gto/bcm98548xmc_30_glibc_std_debug/build/linux - -endif - -export WRL_GLIBC_SMALL - -# After this point glibc_std and glibc_small share these flags - -WRLINUX_BASE ?=/tools/windriver/linux_ed/3.0/Linux -TOOLCHAIN_EXEC_PREFIX=$(WRLINUX_BASE)/wrlinux-3.0/layers/wrll-toolchain-4.3-85/powerpc/toolchain/x86-linux2 -TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_EXEC_PREFIX) -WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin -WRLINUX_GNU_PATH = $(WRLINUX_BASE)/wrlinux-3.0/layers/wrll-toolchain-4.3-85/powerpc/toolchain/x86-linux2/bin -override PATH := $(TOOLCHAIN_EXEC_PREFIX):$(KERNDIR_STD)/../../host-cross/bin:$(KERNDIR_STD)/../../host-cross/powerpc-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH) -export TOOLCHAIN_EXEC_PREFIX TOOLCHAIN_BIN_DIR WIND_LIC_PROXY - -LINUX_INCLUDE_STD := $(KERNDIR_STD)/include - -endif - -ifeq (ELDK,$(BUILD_PLATFORM)) -ifeq (2.6.21.7, $(KERN_VER)) - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := ppc_85xx- -endif - -ifeq (4.0, $(ELDK_VERSION)) -override PATH := /tools/eldk/4.0/usr/bin:$(PATH) -else -override PATH := /tools/eldk/4.1/usr/bin:$(PATH) -endif -KERNDIR ?= /projects/ntsw-tools/linux/eldk/gto_eldk/linux-2.6.21.7 -endif -endif - -ifeq (ELDK,$(BUILD_PLATFORM)) -ifeq (2.6.24.4, $(KERN_VER)) - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := ppc_85xx- -endif - -ifeq (4.0, $(ELDK_VERSION)) -override PATH := /tools/eldk/4.0/usr/bin:$(PATH) -else -override PATH := /tools/eldk/4.1/usr/bin:$(PATH) -endif -KERNDIR ?= /projects/ntsw-tools/linux/eldk/gto_eldk/linux-2.6.24.4 -endif -endif - - -ifeq (ELDK,$(BUILD_PLATFORM)) -ifeq (2.6.25, $(KERN_VER)) - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := ppc_85xx- -endif - -ifeq (4.0, $(ELDK_VERSION)) -override PATH := /tools/eldk/4.0/usr/bin:$(PATH) -else -override PATH := /tools/eldk/4.1/usr/bin:$(PATH) -endif -KERNDIR ?= /projects/ntsw-tools/linux/eldk/gto_eldk/linux-2.6.25 -endif -endif - - -# Default Linux include directory -ifeq (,$(LINUX_INCLUDE)) -LINUX_INCLUDE := $(KERNDIR)/include -endif - -CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1 -ENDIAN = BE_HOST=1 -CFGFLAGS += -D$(ENDIAN) -CFGFLAGS += -DBCM_PLATFORM_STRING=\"GTO_MPC8548\" -CFGFLAGS += -DSAL_BDE_DMA_MEM_DEFAULT=32 - -# Extra variables. -EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) - -ARCH = powerpc -KBUILD_VERBOSE = 1 - -export ARCH KBUILD_VERBOSE - - -# From linux/arch/ppc/Makefile -comma = , -basetarget = $(basename $(notdir $@)) -modname = $(basetarget) - -name-fix = $(subst $(comma),_,$(subst -,_,$1)) -basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" -modname_flags = $(if $(filter 1,$(words $(modname))),\ - -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") - - -ifeq (,$(KFLAG_INCLD)) -ifeq (4.0,$(ELDK_VERSION)) -ifeq (ELDK,$(BUILD_PLATFORM)) -KFLAG_INCLD = /tools/eldk/4.0/usr/lib/gcc/powerpc-linux/4.0.0/include -endif -endif - -ifeq (4.1,$(ELDK_VERSION)) -ifeq (ELDK,$(BUILD_PLATFORM)) -KFLAG_INCLD = /tools/eldk/4.1/usr/lib/gcc/powerpc-linux/4.0.0/include -endif -endif - -ifeq (2.0,$(WRS_LINUX_VERSION)) -KFLAG_INCLD = $(WRLINUX_GNU_PATH)/../lib/gcc/powerpc-wrs-linux-gnu/4.1.2/include -endif - -ifeq (3.0,$(WRS_LINUX_VERSION)) -KFLAG_INCLD = $(WRLINUX_GNU_PATH)/../lib/gcc/powerpc-wrs-linux-gnu/4.3.2/include -endif -endif - -ifdef BROADCOM_SVK -ifeq ($PLX_PCI2LBUS, 1) -CFLAGS += -DBCM_PLX9656_LOCAL_BUS -DBDE_LINUX_NON_INTERRUPTIBLE -endif -endif - -ifdef DPP_CHIPS -CFLAGS += -DDUNE_BCM -D__DUNE_LINUX_BCM_CPU_PCP_DMA__ -CFGFLAGS += -DSOC_CM_FUNCTION -endif - -ifdef DFE_CHIPS -CFLAGS += -DDUNE_BCM -CFGFLAGS += -DSOC_CM_FUNCTION -endif - -ifdef SAND_CHIPS -CFLAGS += -D__DUNE_GTO_BCM_CPU__ -D__DUNE_LINUX_BCM_CPU_PCIE__ -endif - -ifdef SHADOW_PLX -CFLAGS += -DBCM_PLX9656_LOCAL_BUS -DBDE_LINUX_NON_INTERRUPTIBLE -DSHADOW_SVK -endif - -ifeq (,$(KFLAGS)) -#autoconf.h was moved in later kernels -LINUX_AUTOCONF = $(LINUX_INCLUDE)/generated/autoconf.h -ifeq (,$(shell ls $(LINUX_AUTOCONF) 2>/dev/null)) -LINUX_AUTOCONF = $(LINUX_INCLUDE)/linux/autoconf.h -endif - -KFLAGS := -D__KERNEL__ -m32 -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/version.h -include $(LINUX_AUTOCONF) -I$(KERNDIR)/arch/powerpc -I$(KERNDIR)/arch/powerpc -I$(KERNDIR)/arch/powerpc/include -I$(KERNDIR)/include/asm-powerpc -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -msoft-float -pipe -ffixed-r2 -mmultiple -mno-altivec -funit-at-a-time -Wa,-me500 -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -endif - -#Wind river Linux 3.0 needs addtional flags -ifeq (3.0,$(WRS_LINUX_VERSION)) - -# Use MSI interrupts if kernel is compiled with MSI support. -#CFLAGS += -DBDE_LINUX_USE_MSI_INTERRUPT -KFLAGS += -I$(LINUX_INCLUDE_STD) -I$(KERNDIR_STD)/arch/powerpc -I$(KERNDIR_STD)/arch/powerpc/include -I$(KERNDIR_STD)/include.asm-powerpc -mno-spe -endif - -ifneq ($(targetplat),user) -include ${SDK}/make/Makefile.linux-kernel-2_6 -endif diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-jag-2_6 b/platform/broadcom/saibcm-modules/make/Makefile.linux-jag-2_6 deleted file mode 100644 index 1e89cdab24..0000000000 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-jag-2_6 +++ /dev/null @@ -1,166 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# $Id: Makefile.linux-jag-2_6,v 1.20 Broadcom SDK $ -# $Copyright: (c) 2007 Broadcom Corp. -# All Rights Reserved.$ - - -# User must select one platform from below.By default WR_LINUX is selected. . -ifeq (,$(BUILD_PLATFORM)) -#BUILD_PLATFORM=ELDK -BUILD_PLATFORM=WR_LINUX -endif - - -# Specify the KERNEL VERSION you want to use for building SDK. -ifeq (ELDK,$(BUILD_PLATFORM)) -ifeq (,$(KERN_VER)) -KERN_VER=2.6.21.7 -endif -endif - -# Specify the Windriver Linux version here.For example '2.0' as shown below. -ifeq (WR_LINUX,$(BUILD_PLATFORM)) -ifeq (,$(WRS_LINUX_VERSION)) -WRS_LINUX_VERSION=2.0 -endif -endif - -ifeq (WR_LINUX,$(BUILD_PLATFORM)) -ifeq (1.4,$(WRS_LINUX_VERSION)) - -KERNDIR := /projects/ntsw-tools/linux/wrslinux_1.4/broadcom_bcm95836cpci_be/build/linux-2.6.14-small - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := mips-wrs-linux-gnu- -endif - -export WIND_LIC_PROXY = /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/setup/x86-linux2/bin - -override PATH := /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/gnu/3.4.4-wrlinux-1.4/x86-linux2/bin:$(PATH) -endif - -ifeq (2.0,$(WRS_LINUX_VERSION)) - -#CROSS_COMPILE = mips-wrs-linux-gnu- - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := mips-wrs-linux-gnu-mips_softfp-glibc_std- -endif - -KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/jag/glibc_std/build/linux-2.6.21-standard - -endif - -WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux - -TOOLCHAIN_BIN_DIR=$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin -WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin - -WRLINUX_GNU_PATH=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin - -override PATH:=$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH) - -WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/mips-wrs-linux-gnu/4.1.2/include - -export TOOLCHAIN_BIN_DIR WIND_LIC_PROXY -endif - -ifeq (ELDK,$(BUILD_PLATFORM)) -ifeq (2.6.21.7, $(KERN_VER)) - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := mips_4KC- -endif - -override PATH := /tools/eldk/4.1/usr/bin:$(PATH) -KERNDIR ?= /projects/ntsw-tools/linux/eldk/jag-ntswics-eldk/linux-2.6.21.7 -endif -endif - - - -comma = , -basetarget = $(basename $(notdir $@)) -modname = $(basetarget) - -# Extra variables. -EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) - -name-fix = $(subst $(comma),_,$(subst -,_,$1)) -basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" -modname_flags = $(if $(filter 1,$(words $(modname))),\ - -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") - - -# Default Linux include directory -ifeq (,$(LINUX_INCLUDE)) -LINUX_INCLUDE := $(KERNDIR)/include -endif - -CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=1 -DSYS_BE_OTHER=0 -ENDIAN = BE_HOST=1 -CFGFLAGS += -D$(ENDIAN) -CFGFLAGS += -DBCM_PLATFORM_STRING=\"JAG_BCM4704\" - -ARCH = mips -KBUILD_VERBOSE = 1 - -export ARCH KBUILD_VERBOSE - -ifeq (ELDK,$(BUILD_PLATFORM)) -KFLAG_INCLD = /tools/eldk/4.1/usr/lib/gcc/mips-linux/4.0.0/include/ -endif - -ifeq (1.4,$(WRS_LINUX_VERSION)) -# From linux/arch/mips/Makefile - -ifeq (,$(KFLAGS)) -KFLAGS := -D__KERNEL__ -Wall -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2 -fomit-frame-pointer -g -G 0 -mno-abicalls -fno-pic -pipe -march=mips32 -Wa,-mips32 -Wa,--trap -funit-at-a-time -mlong-calls -Wundef -finline-limit=100000 -mabi=32 -endif - -#-Wdeclaration-after-statement -Wstrict-prototypes -else - -ifeq (2.0,$(WRS_LINUX_VERSION)) - -ifeq (,$(KFLAGS)) -KFLAGS := -D__KERNEL__ -nostdinc -isystem $(WRS_SYSROOT_PATH) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32 -Wa,-mips32 -Wa,--trap -Iinclude/asm-mips/mach-bcm947xx -Iinclude/asm-mips/mach-generic -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -mlong-calls -endif - -endif -endif - -ifeq (ELDK,$(BUILD_PLATFORM)) - -ifeq (,$(KFLAGS)) -KFLAGS := -D__KERNEL__ -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32 -Wa,-mips32 -Wa,--trap -Iinclude/asm-mips/mach-bcm947xx -Iinclude/asm-mips/mach-generic -fomit-frame-pointer -g -Wdeclaration-after-statement -mlong-calls -endif - -endif - -ifneq ($(targetplat),user) -include ${SDK}/make/Makefile.linux-kernel-2_6 -endif - -ifneq (,$(findstring TCL,$(FEATURE_LIST))) -LINK_STATIC=0 -export LINK_STATIC -endif - - - - diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-nsx-2_6 b/platform/broadcom/saibcm-modules/make/Makefile.linux-nsx-2_6 deleted file mode 100644 index 785619f31f..0000000000 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-nsx-2_6 +++ /dev/null @@ -1,56 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# $Id: Makefile.linux-nsx-2_6,v 1.9 Broadcom SDK $ -# $Copyright: (c) 2005 Broadcom Corp. -# All Rights Reserved.$ - -# Look for custom tools -ifneq (,$(MIPS_TOOLS_DIR)) -override PATH := $(MIPS_TOOLS_DIR):$(PATH) -endif -ifneq (,$(MIPS_CROSS_COMPILE)) -override CROSS_COMPILE := $(MIPS_CROSS_COMPILE) -endif - -# Default tools -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := mips2_fp_be- -override PATH := $(PATH):/projects/ntsw-tools/linux/mvista/mvista-4.0/pro/devkit/mips/mips2_fp_be/bin -endif - -# Default Linux Kernel directory -ifeq (,$(KERNDIR)) -KERNDIR := /projects/ntsw-tools/linux/mvista/mvista-4.0-nsx/linux-2.6.10_dev -endif -# Default Linux include directory -ifeq (,$(LINUX_INCLUDE)) -LINUX_INCLUDE := $(KERNDIR)/include -endif - -CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1 -ENDIAN = BE_HOST=1 -CFGFLAGS += -D$(ENDIAN) -CFGFLAGS += -DBCM_PLATFORM_STRING=\"NSX_BCM1125\" - -# From linux/arch/mips/Makefile - -ifeq (,$(KFLAGS)) -KFLAGS := -D__KERNEL__ -O2 -fomit-frame-pointer -fno-strict-aliasing -G 0 -mno-abicalls -fno-pic -mips64 -mtune=sb1 -Wa,--trap -pipe -mlong-calls -endif - -ifneq ($(targetplat),user) -include ${SDK}/make/Makefile.linux-kernel-2_6 -endif diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-nsx64 b/platform/broadcom/saibcm-modules/make/Makefile.linux-nsx64 deleted file mode 100644 index c4f71995be..0000000000 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-nsx64 +++ /dev/null @@ -1,54 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# $Id: Makefile.linux-nsx64,v 1.9 Broadcom SDK $ -# $Copyright: (c) 2005 Broadcom Corp. -# All Rights Reserved.$ - -# Look for custom tools -ifneq (,$(MIPS_TOOLS_DIR)) -override PATH := $(MIPS_TOOLS_DIR):$(PATH) -endif -ifneq (,$(MIPS_CROSS_COMPILE)) -override CROSS_COMPILE := $(MIPS_CROSS_COMPILE) -endif - -# Default tools -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := mips64_fp_be- -override PATH := $(PATH):/projects/ntsw-tools/linux/mvista/mips64_be_tools-3.1/bin -endif - -# Default Linux include directory -ifeq (,$(LINUX_INCLUDE)) -LINUX_INCLUDE = /projects/ntsw-tools/linux/headers/mvl-3.1-nsx64/include -endif - -CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1 -ENDIAN = BE_HOST=1 -CFGFLAGS += -D$(ENDIAN) -Wa,-xgot -mips64 -mabi=64 -fno-strict-aliasing -DPTRS_ARE_64BITS -DLONGS_ARE_64BITS -CFGFLAGS += -DBCM_PLATFORM_STRING=\"NSX_BCM1125\" - -# From linux/arch/mips/Makefile - -ifeq (,$(KFLAGS)) -KFLAGS := -D__KERNEL__ -O2 -fomit-frame-pointer -fno-strict-aliasing -G 0 -mno-abicalls -fno-pic -mips64 -mabi=64 -mtune=sb1 -Wa,--trap -pipe -mlong-calls -endif - -ifneq ($(targetplat),user) -include ${SDK}/make/Makefile.linux-kernel -endif - -MODULE_LDFLAGS += -m elf64btsmip diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-nsx_wrl-2_6 b/platform/broadcom/saibcm-modules/make/Makefile.linux-nsx_wrl-2_6 deleted file mode 100644 index 7b549038fd..0000000000 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-nsx_wrl-2_6 +++ /dev/null @@ -1,127 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# $Id: Makefile.linux-nsx_wrl-2_6,v 1.15 Broadcom SDK $ -# $Copyright: (c) 2007 Broadcom Corp. -# All Rights Reserved.$ - -ifeq (,$(WRS_LINUX_VERSION)) -WRS_LINUX_VERSION=2.0 -endif - -# Look for custom tools -ifneq (,$(MIPS_TOOLS_DIR)) -ifneq (,$(MIPS_CROSS_COMPILE)) -override PATH := $(MIPS_TOOLS_DIR):$(PATH) -override CROSS_COMPILE := $(MIPS_CROSS_COMPILE) -endif -endif - -# Default Linux Kernel directory -ifeq (,$(KERNDIR)) - -ifeq (1.4,$(WRS_LINUX_VERSION)) - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := mips-wrs-linux-gnu- -endif - -KERNDIR := /projects/ntsw-tools/linux/wrslinux_1.4/broadcom_bcm91125cpci_32_be_glibc_std/build/linux-2.6.14-cgl - -export WIND_LIC_PROXY = /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/setup/x86-linux2/bin -override PATH := /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/gnu/3.4.4-wrlinux-1.4/x86-linux2/bin:$(PATH) -else - -ifeq (2.0,$(WRS_LINUX_VERSION)) - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := mips-wrs-linux-gnu-mips-glibc_std- -endif - -KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/nsx/glibc_std/build/linux-2.6.21-standard - -WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux - -TOOLCHAIN_BIN_DIR=$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin -WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin - -WRLINUX_GNU_PATH=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin -override PATH:=$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH) - -WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/mips-wrs-linux-gnu/4.1.2/include - -export TOOLCHAIN_BIN_DIR WIND_LIC_PROXY - -comma = , -basetarget = $(basename $(notdir $@)) -modname = $(basetarget) - -# Extra variables. -EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) - -name-fix = $(subst $(comma),_,$(subst -,_,$1)) -basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" -modname_flags = $(if $(filter 1,$(words $(modname))),\ - -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") - -endif -endif -endif - -# Default Linux include directory -ifeq (,$(LINUX_INCLUDE)) -LINUX_INCLUDE := $(KERNDIR)/include -endif - -CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1 -ENDIAN = BE_HOST=1 -CFGFLAGS += -D$(ENDIAN) -CFGFLAGS += -DBCM_PLATFORM_STRING=\"NSX_BCM1125\" - -ARCH = mips -KBUILD_VERBOSE = 1 - -export ARCH KBUILD_VERBOSE - -ifeq (1.4,$(WRS_LINUX_VERSION)) -# From Linux Kbuild output - -ifeq (,$(KFLAGS)) -KFLAGS := -D__KERNEL__ -Iinclude -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2 -fomit-frame-pointer -g -G 0 -mno-abicalls -fno-pic -pipe -finline-limit=100000 -mabi=32 -march=sb1 -Wa,-32 -Wa,-march=sb1 -Wa,-mips64 -Wa,--trap -DSIBYTE_HDR_FEATURES=SIBYTE_HDR_FMASK_1250_112x_ALL -mlong-calls -#-Wdeclaration-after-statement -endif - -else - -ifeq (2.0,$(WRS_LINUX_VERSION)) - -ifeq (,$(KFLAGS)) -KFLAGS := -D__KERNEL__ -nostdinc -isystem $(WRS_SYSROOT_PATH) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=sb1 -Wa,--trap -Iinclude/asm-mips/mach-sibyte -Iinclude/asm-mips/mach-generic -DSIBYTE_HDR_FEATURES=SIBYTE_HDR_FMASK_1250_112x_ALL -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -mlong-calls -endif - -endif -endif - -ifneq ($(targetplat),user) -include ${SDK}/make/Makefile.linux-kernel-2_6 -endif - - -ifneq (,$(findstring TCL,$(FEATURE_LIST))) -LINK_STATIC=0 -export LINK_STATIC -endif - - diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-raptor b/platform/broadcom/saibcm-modules/make/Makefile.linux-raptor deleted file mode 100644 index 80c51e782b..0000000000 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-raptor +++ /dev/null @@ -1,53 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# $Id: Makefile.linux-raptor,v 1.6 Broadcom SDK $ -# $Copyright: (c) 2005 Broadcom Corp. -# All Rights Reserved.$ - -# Look for custom tools -ifneq (,$(MIPS_TOOLS_DIR)) -override PATH := $(MIPS_TOOLS_DIR):$(PATH) -endif -ifneq (,$(MIPS_CROSS_COMPILE)) -override CROSS_COMPILE := $(MIPS_CROSS_COMPILE) -endif - -# Default tools -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := mips_fp_be- -override PATH := $(PATH):/projects/ntsw-tools/linux/mvista/mvista-3.1/pro/devkit/mips/fp_be/bin -endif - -# Default Linux include directory -ifeq (,$(LINUX_INCLUDE)) -LINUX_INCLUDE = /projects/ntsw-tools/linux/headers/mvl-3.1-raptor/include -endif - -CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=1 -DSYS_BE_OTHER=0 -DBCM_ICS -ENDIAN = BE_HOST=1 -CFGFLAGS += -D$(ENDIAN) -CFGFLAGS += -DBCM_PLATFORM_STRING=\"Raptor_BCM56218\" - - -ifneq ($(targetplat),user) -include ${SDK}/make/Makefile.linux-kernel -endif - -# From linux/arch/mips/Makefile - -ifeq (,$(KFLAGS)) -KFLAGS := -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -G 0 -mno-abicalls -fno-pic -pipe -m$(gcc-tune-flag)=r4600 -mips2 -Wa,--trap -mlong-calls -endif diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-raptor-2_6 b/platform/broadcom/saibcm-modules/make/Makefile.linux-raptor-2_6 deleted file mode 100644 index 0bebdf9564..0000000000 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-raptor-2_6 +++ /dev/null @@ -1,172 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# $Id: Makefile.linux-raptor-2_6,v 1.21 Broadcom SDK $ -# $Copyright: (c) 2007 Broadcom Corp. -# All Rights Reserved.$ - - -# User must select one platform from below.By default WR_LINUX is selected. . -ifeq (,$(BUILD_PLATFORM)) -#BUILD_PLATFORM=ELDK -BUILD_PLATFORM=WR_LINUX -endif - - -# Specify the KERNEL VERSION you want to use for building SDK. -ifeq (ELDK,$(BUILD_PLATFORM)) -ifeq (,$(KERN_VER)) -KERN_VER=2.6.21.7 -endif -endif - -# Specify the Windriver Linux version here.For example '2.0' as shown below. -ifeq (WR_LINUX,$(BUILD_PLATFORM)) -ifeq (,$(WRS_LINUX_VERSION)) -WRS_LINUX_VERSION=2.0 -endif -endif - - -# Default Linux Kernel directory -ifeq (WR_LINUX,$(BUILD_PLATFORM)) -ifeq (1.4,$(WRS_LINUX_VERSION)) - -KERNDIR ?= /projects/ntsw-tools/linux/wrslinux_1.4/broadcom_bcm95621x_be/build/linux-2.6.14-small - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := mips-wrs-linux-gnu- -endif - -export WIND_LIC_PROXY = /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/setup/x86-linux2/bin - -override PATH := /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/gnu/3.4.4-wrlinux-1.4/x86-linux2/bin:$(PATH) -endif - -ifeq (2.0,$(WRS_LINUX_VERSION)) - -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := mips-wrs-linux-gnu-mips_softfp-glibc_std- -endif - -KERNDIR ?= /projects/ntsw-tools/linux/wrslinux_2.0/ntswics/glibc_std/build/linux-2.6.21-standard -override PATH:=$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH) - -endif - -WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux - -TOOLCHAIN_BIN_DIR=$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin -WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin - -WRLINUX_GNU_PATH=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin - -override PATH:=$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH) - -WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/mips-wrs-linux-gnu/4.1.2/include - -export TOOLCHAIN_BIN_DIR WIND_LIC_PROXY - -endif - -ifeq (ELDK,$(BUILD_PLATFORM)) -ifeq (2.6.21.7, $(KERN_VER)) -ifeq (,$(CROSS_COMPILE)) -CROSS_COMPILE := mips_4KC- -endif -override PATH := /tools/eldk/4.1/usr/bin:$(PATH) -KERNDIR ?= /projects/ntsw-tools/linux/eldk/raptor_eldk/linux-2.6.21.7 -endif -endif - - - -comma = , -basetarget = $(basename $(notdir $@)) -modname = $(basetarget) - -# Extra variables. -EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) - -name-fix = $(subst $(comma),_,$(subst -,_,$1)) -basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" -modname_flags = $(if $(filter 1,$(words $(modname))),\ - -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") - -# Default Linux include directory -ifeq (,$(LINUX_INCLUDE)) -LINUX_INCLUDE := $(KERNDIR)/include -endif - -CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=1 -DSYS_BE_OTHER=0 -DBCM_ICS -ENDIAN = BE_HOST=1 -CFGFLAGS += -D$(ENDIAN) -DRAPTOR -CFGFLAGS += -DBCM_PLATFORM_STRING=\"Raptor_BCM56218\" - - -ARCH = mips -KBUILD_VERBOSE = 1 - -export ARCH KBUILD_VERBOSE - - -ifeq (ELDK,$(BUILD_PLATFORM)) -KFLAG_INCLD = /tools/eldk/4.1/usr/lib/gcc/mips-linux/4.0.0/include -endif - - -# From linux/arch/mips/Makefile -ifeq (WR_LINUX,$(BUILD_PLATFORM)) -ifeq (1.4,$(WRS_LINUX_VERSION)) - -ifeq (,$(KFLAGS)) -KFLAGS := -D__KERNEL__ -Wall -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2 -fomit-frame-pointer -g -G 0 -mno-abicalls -fno-pic -pipe -march=mips32 -Wa,-mips32 -Wa,--trap -funit-at-a-time -mlong-calls -Wundef -finline-limit=100000 -mabi=32 -endif - -endif - -ifeq (2.0,$(WRS_LINUX_VERSION)) - -ifeq (,$(KFLAGS)) -KFLAGS := -D__KERNEL__ -nostdinc -isystem $(WRS_SYSROOT_PATH) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/mips/mach-bcm56218 -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32 -Wa,-mips32 -Wa,--trap -Iinclude/asm-mips/mach-bcm56218 -Iinclude/asm-mips/mach-generic -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -mlong-calls -endif - -endif -endif - -ifeq (ELDK,$(BUILD_PLATFORM)) - -ifeq (,$(KFLAGS)) -KFLAGS := -D__KERNEL__ -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/mips/mach-bcm56218 -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32 -Wa,-mips32 -Wa,--trap -Iinclude/asm-mips/mach-bcm56218 -Iinclude/asm-mips/mach-generic -fomit-frame-pointer -g -Wdeclaration-after-statement -mlong-calls -endif - - -endif - - - -ifneq ($(targetplat),user) -include ${SDK}/make/Makefile.linux-kernel-2_6 -endif - -ifneq (,$(findstring TCL,$(FEATURE_LIST))) -LINK_STATIC=0 -export LINK_STATIC -endif - - - - - diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/Makefile b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/Makefile deleted file mode 100644 index 743eb74173..0000000000 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/Makefile +++ /dev/null @@ -1,65 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# -*- Makefile -*- -# $Id: Makefile,v 1.3 2012/07/17 07:39:51 mlarsen Exp $ -# $Copyright: (c) 2005 Broadcom Corp. -# All Rights Reserved.$ -# -LOCALDIR = systems/linux/kernel/modules/bcm-ptp-clock - -include ${SDK}/make/Make.config - -LIBS = $(LIBDIR)/libkern.a - -ifeq ($(kernel_version),2_4) -MODULE = $(LIBDIR)/linux-bcm-ptp-clock.o -else -KERNEL_MODULE_DIR = kernel_module - -THIS_MOD_NAME := linux-bcm-ptp-clock -MODULE = $(LIBDIR)/$(THIS_MOD_NAME).o -KMODULE = $(LIBDIR)/$(THIS_MOD_NAME).ko - -build: $(MODULE) $(KMODULE) -endif - -KBUILD_EXTRA_SYMBOLS := ${BLDDIR}/../../../../bde/linux/kernel/kernel_module/Module.symvers -KBUILD_EXTRA_SYMBOLS += ${BLDDIR}/../bcm-knet/kernel_module/Module.symvers - -# BCM PTP Clock Device - -$(MODULE): $(BLDDIR)/.tree $(BOBJS) $(LIBS) - $(LD) $(MODULE_LDFLAGS) -r -d $(BOBJS) $(LIBS) -o $@ -ifneq ($(kernel_version),2_4) -$(KMODULE): $(MODULE) - rm -fr $(BLDDIR)/$(KERNEL_MODULE_DIR) - mkdir $(BLDDIR)/$(KERNEL_MODULE_DIR) - cp ${SDK}/make/Makefile.linux-kmodule $(BLDDIR)/$(KERNEL_MODULE_DIR)/Makefile - cat ${KBUILD_EXTRA_SYMBOLS} > $(BLDDIR)/$(KERNEL_MODULE_DIR)/Module.symvers - MOD_NAME=$(THIS_MOD_NAME) KBUILD_EXTRA_SYMBOLS="${KBUILD_EXTRA_SYMBOLS}" $(MAKE) -C $(BLDDIR)/$(KERNEL_MODULE_DIR) $(THIS_MOD_NAME).ko -endif - -# Make.depend is before clean:: so that Make.depend's clean:: runs first. - -include ${SDK}/make/Make.depend - -clean:: - $(RM) $(BLDDIR)/version.c $(BLDDIR)/version.o - $(RM) $(BOBJS) $(MODULE) - -ifneq ($(kernel_version),2_4) -.PHONY: build -endif diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/bcm-ptp-clock.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/bcm-ptp-clock.c deleted file mode 100644 index 7c88fae97d..0000000000 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/bcm-ptp-clock.c +++ /dev/null @@ -1,1999 +0,0 @@ -/* - * Copyright 2017 Broadcom - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation (the "GPL"). - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 (GPLv2) for more details. - * - * You should have received a copy of the GNU General Public License - * version 2 (GPLv2) along with this source code. - */ - -/* - * This module implements a Linux PTP Clock driver for Broadcom - * XGS switch devices. - * - * For a list of supported module parameters, please see below. - * debug: Debug level (default 0) - * network_transport : Transport Type (default 0 - Raw) - * base_dev_name: Base device name (default ptp0, ptp1, etc.) - * - * - All the data structures and functions work on the physical port. - * For array indexing purposes, we use (phy_port - 1). - */ - -#include /* Must be included first */ -/* Module Information */ -#define MODULE_MAJOR 125 -#define MODULE_NAME "linux-bcm-ptp-clock" - -MODULE_AUTHOR("Broadcom Corporation"); -MODULE_DESCRIPTION("PTP Clock Driver for Broadcom XGS Switch"); -MODULE_LICENSE("GPL"); - -#if LINUX_VERSION_CODE > KERNEL_VERSION(3,17,0) -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -/* Configuration Parameters */ -static int debug; -LKM_MOD_PARAM(debug, "i", int, 0); -MODULE_PARM_DESC(debug, - "Debug level (default 0)"); - -static int pci_cos; - -static int network_transport; -LKM_MOD_PARAM(network_transport, "i", int, 0); -MODULE_PARM_DESC(network_transport, - "Transport Type (default - Detect from packet)"); - -static char *base_dev_name = "ptp0"; -LKM_MOD_PARAM(base_dev_name, "s", charp, 0); -MODULE_PARM_DESC(base_dev_name, - "Base device name (default ptp0, ptp1, etc.)"); - -static int fw_core; -LKM_MOD_PARAM(fw_core, "i", int, 0); -MODULE_PARM_DESC(fw_core, - "Firmware core (default 0)"); - -/* Debug levels */ -#define DBG_LVL_VERB 0x1 -#define DBG_LVL_WARN 0x2 -#define DBG_LVL_TXTS 0x4 -#define DBG_LVL_CMDS 0x8 - -#define DBG_VERB(_s) do { if (debug & DBG_LVL_VERB) gprintk _s; } while (0) -#define DBG_WARN(_s) do { if (debug & DBG_LVL_WARN) gprintk _s; } while (0) -#define DBG_TXTS(_s) do { if (debug & DBG_LVL_TXTS) gprintk _s; } while (0) -#define DBG_CMDS(_s) do { if (debug & DBG_LVL_CMDS) gprintk _s; } while (0) -#define DBG_ERR(_s) do { if (1) gprintk _s; } while (0) - - -#ifdef LINUX_BDE_DMA_DEVICE_SUPPORT -#define DMA_DEV device -#define DMA_ALLOC_COHERENT(d,s,h) dma_alloc_coherent(d,s,h,GFP_ATOMIC|GFP_DMA32) -#define DMA_FREE_COHERENT(d,s,a,h) dma_free_coherent(d,s,a,h) -#else -#define DMA_DEV pci_dev -#define DMA_ALLOC_COHERENT(d,s,h) pci_alloc_consistent(d,s,h) -#define DMA_FREE_COHERENT(d,s,a,h) pci_free_consistent(d,s,a,h) -#endif - -/* Type length in bytes */ -#define BKSYNC_PACKLEN_U8 1 -#define BKSYNC_PACKLEN_U16 2 -#define BKSYNC_PACKLEN_U24 3 -#define BKSYNC_PACKLEN_U32 4 - -#define BKSYNC_UNPACK_U8(_buf, _var) \ - _var = *_buf++ - -#define BKSYNC_UNPACK_U16(_buf, _var) \ - do { \ - (_var) = (((_buf)[0] << 8) | \ - (_buf)[1]); \ - (_buf) += BKSYNC_PACKLEN_U16; \ - } while (0) - -#define BKSYNC_UNPACK_U24(_buf, _var) \ - do { \ - (_var) = (((_buf)[0] << 16) | \ - ((_buf)[1] << 8) | \ - (_buf)[2]); \ - (_buf) += BKSYNC_PACKLEN_U24; \ - } while (0) - -#define BKSYNC_UNPACK_U32(_buf, _var) \ - do { \ - (_var) = (((_buf)[0] << 24) | \ - ((_buf)[1] << 16) | \ - ((_buf)[2] << 8) | \ - (_buf)[3]); \ - (_buf) += BKSYNC_PACKLEN_U32; \ - } while (0) - - -#define CMICX_DEV_TYPE ((ptp_priv->dcb_type == 38) || \ - (ptp_priv->dcb_type == 36)) - -/* CMIC MCS-0 SCHAN Messaging registers */ -/* Core0:CMC1 Core1:CMC2 */ -#define CMIC_CMC_BASE \ - (CMICX_DEV_TYPE ? (fw_core ? 0x10400 : 0x10300) : \ - (fw_core ? 0x33000 : 0x32000)) - -#define CMIC_CMC_SCHAN_MESSAGE_10r(BASE) (BASE + 0x00000034) -#define CMIC_CMC_SCHAN_MESSAGE_11r(BASE) (BASE + 0x00000038) -#define CMIC_CMC_SCHAN_MESSAGE_12r(BASE) (BASE + 0x0000003c) -#define CMIC_CMC_SCHAN_MESSAGE_13r(BASE) (BASE + 0x00000040) -#define CMIC_CMC_SCHAN_MESSAGE_14r(BASE) (BASE + 0x00000044) -#define CMIC_CMC_SCHAN_MESSAGE_15r(BASE) (BASE + 0x00000048) -#define CMIC_CMC_SCHAN_MESSAGE_16r(BASE) (BASE + 0x0000004c) -#define CMIC_CMC_SCHAN_MESSAGE_17r(BASE) (BASE + 0x00000050) -#define CMIC_CMC_SCHAN_MESSAGE_18r(BASE) (BASE + 0x00000054) -#define CMIC_CMC_SCHAN_MESSAGE_19r(BASE) (BASE + 0x00000058) -#define CMIC_CMC_SCHAN_MESSAGE_20r(BASE) (BASE + 0x0000005c) -#define CMIC_CMC_SCHAN_MESSAGE_21r(BASE) (BASE + 0x00000060) - -u32 hostcmd_regs[5] = { 0 }; - -#define BCMKSYNC_NUM_PORTS 128 /* NUM_PORTS where 2-step is supported. */ -#define BCMKSYNC_MAX_NUM_PORTS 256 /* Max ever NUM_PORTS in the system */ -#define BCMKSYNC_MAX_MTP_IDX 8 /* Max number of mtps in the system */ - -/* Service request commands to Firmware. */ -enum { - BKSYNC_DONE = (0x0), - BKSYNC_INIT = (0x1), - BKSYNC_DEINIT = (0x2), - BKSYNC_GETTIME = (0x3), - BKSYNC_SETTIME = (0x4), - BKSYNC_FREQCOR = (0x5), - BKSYNC_PBM_UPDATE = (0x6), - BKSYNC_ADJTIME = (0x7), - BKSYNC_GET_TSTIME = (0x8), - BKSYNC_MTP_TS_UPDATE_ENABLE = (0x9), - BKSYNC_MTP_TS_UPDATE_DISABLE = (0xa), - BKSYNC_ACK_TSTIME = (0xb), -}; - - -/* 1588 message types. */ -enum -{ - IEEE1588_MSGTYPE_SYNC = (0x0), - IEEE1588_MSGTYPE_DELREQ = (0x1), - IEEE1588_MSGTYPE_PDELREQ = (0x2), - IEEE1588_MSGTYPE_PDELRESP = (0x3), - /* reserved (0x4) */ - /* reserved (0x5) */ - /* reserved (0x6) */ - /* reserved (0x7) */ - IEEE1588_MSGTYPE_GENERALMASK = (0x8), /* all non-event messages have this bit set */ - IEEE1588_MSGTYPE_FLWUP = (0x8), - IEEE1588_MSGTYPE_DELRESP = (0x9), - IEEE1588_MSGTYPE_PDELRES_FLWUP = (0xA), - IEEE1588_MSGTYPE_ANNOUNCE = (0xB), - IEEE1588_MSGTYPE_SGNLNG = (0xC), - IEEE1588_MSGTYPE_MNGMNT = (0xD) - /* reserved (0xE) */ - /* reserved (0xF) */ -}; - -/* Usage macros */ -#define ONE_BILLION (1000000000) - -#define SKB_U16_GET(_skb, _pkt_offset) \ - ((_skb->data[_pkt_offset] << 8) | _skb->data[_pkt_offset + 1]) - -#define BKSYNC_PTP_EVENT_MSG(_ptp_msg_type) \ - ((_ptp_msg_type == IEEE1588_MSGTYPE_DELREQ) || \ - (_ptp_msg_type == IEEE1588_MSGTYPE_SYNC)) - - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) -#define HWTSTAMP_TX_ONESTEP_SYNC 2 -#else -#include -#endif - - -/* - * Hardware specific information. - * 4 words of information used from this data set. - * 0 - 3: 2-step untagged. - * 4 - 7: 2-step tagged. - * 8 - 11: 1-step untagged. - * 12 - 15: 1-step tagged. - * 16 - 19: 1-step untagged with ITS-set. - * 20 - 23: 1-step tagged with ITS-set. - */ -uint32_t sobmhrawpkts_dcb26[24] = {0x00000000, 0x00020E00, 0x00000000, 0x00000000, 0x00000000, 0x00021200, 0x00000000, 0x00000000, - 0x00000000, 0x00100E00, 0x00000000, 0x00000000, 0x00000000, 0x00101200, 0x00000000, 0x00000000, - 0x00000000, 0x00140E00, 0x00000000, 0x00000000, 0x00000000, 0x00141200, 0x00000000, 0x00000000}; - -uint32_t sobmhudpipv4_dcb26[24] = {0x00000000, 0x00022A00, 0x00000000, 0x00000000, 0x00000000, 0x00022E00, 0x00000000, 0x00000000, - 0x00000000, 0x00102A00, 0x00000000, 0x00000000, 0x00000000, 0x00102E00, 0x00000000, 0x00000000, - 0x00000000, 0x00142A00, 0x00000000, 0x00000000, 0x00000000, 0x00142E00, 0x00000000, 0x00000000}; - -uint32_t sobmhudpipv6_dcb26[24] = {0x00000000, 0x00023E00, 0x00000000, 0x00000000, 0x00000000, 0x00024200, 0x00000000, 0x00000000, - 0x00000000, 0x00103E00, 0x00000000, 0x00000000, 0x00000000, 0x00104200, 0x00000000, 0x00000000, - 0x00000000, 0x00143E00, 0x00000000, 0x00000000, 0x00000000, 0x00144200, 0x00000000, 0x00000000}; - -uint32_t sobmhrawpkts_dcb32[24] = {0x00000000, 0x00010E00, 0x00000000, 0x00000000, 0x00000000, 0x00011200, 0x00000000, 0x00000000, - 0x00000000, 0x00080E00, 0x00000000, 0x00000000, 0x00000000, 0x00081200, 0x00000000, 0x00000000, - 0x00000000, 0x00080E00, 0x00000000, 0x00000000, 0x00000000, 0x00081200, 0x00000000, 0x00000000}; - -uint32_t sobmhudpipv4_dcb32[24] = {0x00000000, 0x00012A00, 0x00000000, 0x00000000, 0x00000000, 0x00012E00, 0x00000000, 0x00000000, - 0x00000000, 0x000C2A00, 0x00000000, 0x00000000, 0x00000000, 0x000C2E00, 0x00000000, 0x00000000, - 0x00000000, 0x000C2A00, 0x00000000, 0x00000000, 0x00000000, 0x000C2E00, 0x00000000, 0x00000000}; - -uint32_t sobmhudpipv6_dcb32[24] = {0x00000000, 0x00013E00, 0x00000000, 0x00000000, 0x00000000, 0x00014200, 0x00000000, 0x00000000, - 0x00000000, 0x000C3E00, 0x00000000, 0x00000000, 0x00000000, 0x000C4200, 0x00000000, 0x00000000, - 0x00000000, 0x000C3E00, 0x00000000, 0x00000000, 0x00000000, 0x000C4200, 0x00000000, 0x00000000}; - -uint32_t sobmhrawpkts_dcb35[24] = {0x00000000, 0x0020E000, 0x00000000, 0x00000000, 0x00000000, 0x00212000, 0x00000000, 0x00000000, - 0x00000000, 0x0100E000, 0x00000000, 0x00000000, 0x00000000, 0x01012000, 0x00000000, 0x00000000, - 0x00000000, 0x0140E000, 0x00000000, 0x00000000, 0x00000000, 0x01412000, 0x00000000, 0x00000000}; - -uint32_t sobmhudpipv4_dcb35[24] = {0x00000000, 0x0022A000, 0x00000000, 0x00000000, 0x00000000, 0x0022E000, 0x00000000, 0x00000000, - 0x00000000, 0x0102A000, 0x00000000, 0x00000000, 0x00000000, 0x0102E000, 0x00000000, 0x00000000, - 0x00000000, 0x0142A000, 0x00000000, 0x00000000, 0x00000000, 0x0142E000, 0x00000000, 0x00000000}; - -uint32_t sobmhudpipv6_dcb35[24] = {0x00000000, 0x0023E000, 0x00000000, 0x00000000, 0x00000000, 0x00242000, 0x00000000, 0x00000000, - 0x00000000, 0x0103E000, 0x00000000, 0x00000000, 0x00000000, 0x01042000, 0x00000000, 0x00000000, - 0x00000000, 0x0143E000, 0x00000000, 0x00000000, 0x00000000, 0x01442000, 0x00000000, 0x00000000}; - - -uint32_t sobmhrawpkts_dcb36[24] = {0x00000000, 0x00010E00, 0x00000000, 0x00000000, 0x00000000, 0x00011200, 0x00000000, 0x00000000, - 0x00000000, 0x00080E00, 0x00000000, 0x00000000, 0x00000000, 0x00081200, 0x00000000, 0x00000000, - 0x00000000, 0x00080E00, 0x00000000, 0x00000000, 0x00000000, 0x00081200, 0x00000000, 0x00000000}; - -uint32_t sobmhudpipv4_dcb36[24] = {0x00000000, 0x00012A00, 0x00000000, 0x00000000, 0x00000000, 0x00012E00, 0x00000000, 0x00000000, - 0x00000000, 0x000C2A00, 0x00000000, 0x00000000, 0x00000000, 0x000C2E00, 0x00000000, 0x00000000, - 0x00000000, 0x000C2A00, 0x00000000, 0x00000000, 0x00000000, 0x000C2E00, 0x00000000, 0x00000000}; - -uint32_t sobmhudpipv6_dcb36[24] = {0x00000000, 0x00013E00, 0x00000000, 0x00000000, 0x00000000, 0x00014200, 0x00000000, 0x00000000, - 0x00000000, 0x000C3E00, 0x00000000, 0x00000000, 0x00000000, 0x000C4200, 0x00000000, 0x00000000, - 0x00000000, 0x000C3E00, 0x00000000, 0x00000000, 0x00000000, 0x000C4200, 0x00000000, 0x00000000}; -/* th3: onestep only */ -uint32_t sobmhrawpkts_dcb38[24] = {0x00000000, 0x00080E00, 0x00000000, 0x00000000, 0x00000000, 0x00081200, 0x00000000, 0x00000000, - 0x00000000, 0x00080E00, 0x00000000, 0x00000000, 0x00000000, 0x00081200, 0x00000000, 0x00000000, - 0x00000000, 0x00080E00, 0x00000000, 0x00000000, 0x00000000, 0x00081200, 0x00000000, 0x00000000}; - -uint32_t sobmhudpipv4_dcb38[24] = {0x00000000, 0x00082A00, 0x00000000, 0x00000000, 0x00000000, 0x00082E00, 0x00000000, 0x00000000, - 0x00000000, 0x000C2A00, 0x00000000, 0x00000000, 0x00000000, 0x000C2E00, 0x00000000, 0x00000000, - 0x00000000, 0x000C2A00, 0x00000000, 0x00000000, 0x00000000, 0x000C2E00, 0x00000000, 0x00000000}; - -uint32_t sobmhudpipv6_dcb38[24] = {0x00000000, 0x00083E00, 0x00000000, 0x00000000, 0x00000000, 0x00084200, 0x00000000, 0x00000000, - 0x00000000, 0x000C3E00, 0x00000000, 0x00000000, 0x00000000, 0x000C4200, 0x00000000, 0x00000000, - 0x00000000, 0x000C3E00, 0x00000000, 0x00000000, 0x00000000, 0x000C4200, 0x00000000, 0x00000000}; - -/* Driver Proc Entry root */ -static struct proc_dir_entry *bksync_proc_root = NULL; - -/* Shared data structures with R5 */ -typedef struct _bksync_tx_ts_data_s -{ - u32 ts_valid; /* Timestamp valid indication */ - u32 port_id; /* Port number */ - u32 ts_seq_id; /* Sequency Id */ - u32 ts_cnt; - u64 timestamp; /* Timestamp */ -} bksync_tx_ts_data_t; - -typedef struct _bksync_uc_linux_ipc_s -{ - u32 ksyncinit; - u32 dev_id; - s64 freqcorr; - u64 portmap[BCMKSYNC_NUM_PORTS/64]; /* Two-step enabled ports */ - u64 ptptime; - u64 reftime; - s64 phase_offset; - bksync_tx_ts_data_t port_ts_data[BCMKSYNC_NUM_PORTS]; -} bksync_uc_linux_ipc_t; - -typedef struct bksync_port_stats_s { - u32 pkt_rxctr; /* All ingress packets */ - u32 pkt_txctr; /* All egress packets */ - u32 pkt_txonestep; /* 1-step Tx packet counter */ - u32 tsts_match; /* 2-Step tstamp req match */ - u32 tsts_timeout; /* 2-Step tstamp req timeouts */ - u32 tsts_discard; /* 2-Step tstamp req discards */ - u32 osts_event_pkts; /* 1-step event packet counter */ - u32 osts_tstamp_reqs; /* 1-step events with tstamp request */ - u32 fifo_rxctr; /* 2-Step tstamp req match */ - u64 tsts_best_fetch_time; /* 1-step events with tstamp request */ - u64 tsts_worst_fetch_time; /* 1-step events with tstamp request */ - u32 tsts_avg_fetch_time; /* 1-step events with tstamp request */ -} bksync_port_stats_t; - -/* Clock Private Data */ -struct bksync_ptp_priv { - struct device dev; - int dcb_type; - struct ptp_clock *ptp_clock; - struct ptp_clock_info ptp_caps; - struct mutex ptp_lock; - struct mutex ptp_pair_lock; - volatile void *base_addr; /* address for PCI register access */ - volatile bksync_uc_linux_ipc_t *shared_addr; /* address for shared memory access */ - uint64_t dma_mem; - int dma_mem_size; - struct DMA_DEV *dma_dev; /* Required for DMA memory control */ - int num_pports; - int timekeep_status; - u32 mirror_encap_bmp; - struct delayed_work time_keep; - bksync_port_stats_t *port_stats; -}; - -static struct bksync_ptp_priv *ptp_priv; -volatile bksync_uc_linux_ipc_t *linuxPTPMemory = (bksync_uc_linux_ipc_t*)(0); -static volatile int module_initialized; -static int num_retries = 10; /* Retry count */ - -static void bksync_ptp_time_keep_init(void); -static void bksync_ptp_time_keep_deinit(void); - -#if defined(CMIC_SOFT_BYTE_SWAP) - -#define CMIC_SWAP32(_x) ((((_x) & 0xff000000) >> 24) \ - | (((_x) & 0x00ff0000) >> 8) \ - | (((_x) & 0x0000ff00) << 8) \ - | (((_x) & 0x000000ff) << 24)) - -#define DEV_READ32(_d, _a, _p) \ - do { \ - uint32_t _data; \ - _data = (((volatile uint32_t *)(_d)->base_addr)[(_a)/4]); \ - *(_p) = CMIC_SWAP32(_data); \ - } while(0) - -#define DEV_WRITE32(_d, _a, _v) \ - do { \ - uint32_t _data = CMIC_SWAP32(_v); \ - ((volatile uint32_t *)(_d)->base_addr)[(_a)/4] = (_data); \ - } while(0) - -#else - -#define DEV_READ32(_d, _a, _p) \ - do { \ - *(_p) = (((volatile uint32_t *)(_d)->base_addr)[(_a)/4]); \ - } while(0) - -#define DEV_WRITE32(_d, _a, _v) \ - do { \ - ((volatile uint32_t *)(_d)->base_addr)[(_a)/4] = (_v); \ - } while(0) -#endif /* defined(CMIC_SOFT_BYTE_SWAP) */ - -static void -ptp_usleep(int usec) -{ - usleep_range(usec,usec+1); -} - -static void -ptp_sleep(int jiffies) -{ - wait_queue_head_t wq; - init_waitqueue_head(&wq); - - wait_event_timeout(wq, 0, jiffies); - -} - - -static void bksync_hostcmd_data_op(int setget, u64 *d1, u64 *d2) -{ - u32 w0, w1; - u64 data; - - if (!d1) { - return; - } - - if (setget) { - data = *d1; - w0 = (data & 0xFFFFFFFF); - w1 = (data >> 32); - DEV_WRITE32(ptp_priv, hostcmd_regs[1], w0); - DEV_WRITE32(ptp_priv, hostcmd_regs[2], w1); - } else { - DEV_READ32(ptp_priv, hostcmd_regs[1], &w0); - DEV_READ32(ptp_priv, hostcmd_regs[2], &w1); - data = (((u64)w1 << 32) | (w0)); - *d1 = data; - - if (d2) { - DEV_READ32(ptp_priv, hostcmd_regs[3], &w0); - DEV_READ32(ptp_priv, hostcmd_regs[4], &w1); - data = (((u64)w1 << 32) | (w0)); - *d2 = data; - } - } -} - - -static int bksync_cmd_go(u32 cmd, void *data0, void *data1) -{ - int ret = -1; - int retry_cnt = (1000); /* 1ms default timeout for hostcmd response */ - u32 cmd_status; - char cmd_str[20]; - int port; - uint32_t seq_id; - ktime_t start, now; - - if (ptp_priv == NULL || ptp_priv->shared_addr == NULL) { - return ret; - } - - mutex_lock(&ptp_priv->ptp_lock); - - if (cmd == BKSYNC_GET_TSTIME || cmd == BKSYNC_ACK_TSTIME) { - port = *((uint64_t *)data0) & 0xFFF; - seq_id = *((uint64_t*)data0) >> 16; - } - start = ktime_get(); - - ptp_priv->shared_addr->ksyncinit = cmd; - - /* init data */ - DEV_WRITE32(ptp_priv, hostcmd_regs[1], 0x0); - DEV_WRITE32(ptp_priv, hostcmd_regs[2], 0x0); - DEV_WRITE32(ptp_priv, hostcmd_regs[3], 0x0); - DEV_WRITE32(ptp_priv, hostcmd_regs[4], 0x0); - - switch (cmd) { - case BKSYNC_INIT: - sprintf(cmd_str, "KSYNC_INIT"); - ptp_priv->shared_addr->phase_offset = 0; - bksync_hostcmd_data_op(1, (u64 *)&(ptp_priv->shared_addr->phase_offset), 0); - break; - case BKSYNC_FREQCOR: - sprintf(cmd_str, "KSYNC_FREQCORR"); - ptp_priv->shared_addr->freqcorr = *((s32 *)data0); - bksync_hostcmd_data_op(1, (u64 *)&(ptp_priv->shared_addr->freqcorr), 0); - break; - case BKSYNC_ADJTIME: - sprintf(cmd_str, "KSYNC_ADJTIME"); - ptp_priv->shared_addr->phase_offset = *((s64 *)data0); - bksync_hostcmd_data_op(1, (u64 *)&(ptp_priv->shared_addr->phase_offset), 0); - break; - case BKSYNC_GETTIME: - retry_cnt = (retry_cnt * 2); - sprintf(cmd_str, "KSYNC_GETTIME"); - break; - case BKSYNC_GET_TSTIME: - retry_cnt = (retry_cnt * 2); - sprintf(cmd_str, "KSYNC_GET_TSTIME"); - bksync_hostcmd_data_op(1, data0, data1); - break; - case BKSYNC_ACK_TSTIME: - retry_cnt = (retry_cnt * 2); - sprintf(cmd_str, "KSYNC_ACK_TSTIME"); - bksync_hostcmd_data_op(1, data0, data1); - break; - case BKSYNC_SETTIME: - sprintf(cmd_str, "KSYNC_SETTIME"); - ptp_priv->shared_addr->ptptime = *((s64 *)data0); - ptp_priv->shared_addr->phase_offset = 0; - bksync_hostcmd_data_op(1, (u64 *)&(ptp_priv->shared_addr->ptptime), (u64 *)&(ptp_priv->shared_addr->phase_offset)); - break; - case BKSYNC_MTP_TS_UPDATE_ENABLE: - retry_cnt = (retry_cnt * 6); - sprintf(cmd_str, "KSYNC_MTP_TS_UPDATE_ENABLE"); - bksync_hostcmd_data_op(1, (u64 *)data0, 0); - break; - case BKSYNC_MTP_TS_UPDATE_DISABLE: - retry_cnt = (retry_cnt * 6); - sprintf(cmd_str, "KSYNC_MTP_TS_UPDATE_DISABLE"); - bksync_hostcmd_data_op(1, (u64 *)data0, 0); - break; - case BKSYNC_DEINIT: - retry_cnt = (retry_cnt * 4); - sprintf(cmd_str, "KSYNC_DEINIT"); - break; - default: - sprintf(cmd_str, "KSYNC_XXX"); - break; - } - DEV_WRITE32(ptp_priv, hostcmd_regs[0], ptp_priv->shared_addr->ksyncinit); - - do { - DEV_READ32(ptp_priv, hostcmd_regs[0], &cmd_status); - ptp_priv->shared_addr->ksyncinit = cmd_status; - - if (cmd_status == BKSYNC_DONE) { - ret = 0; - switch (cmd) { - case BKSYNC_GET_TSTIME: - case BKSYNC_GETTIME: - bksync_hostcmd_data_op(0, (u64 *)data0, (u64 *)data1); - break; - default: - break; - } - break; - } - ptp_usleep(100); - retry_cnt--; - } while (retry_cnt); - - now = ktime_get(); - mutex_unlock(&ptp_priv->ptp_lock); - - if (retry_cnt == 0) { - DBG_ERR(("Timeout on response from R5 to cmd %s time taken %lld us\n", cmd_str, ktime_us_delta(now, start))); - if (cmd == BKSYNC_GET_TSTIME) { - DBG_TXTS(("Timeout Port %d SeqId %d\n", port, seq_id)); - } - } - if (debug & DBG_LVL_CMDS) { - if (ktime_us_delta(now, start) > 5000) - DBG_CMDS(("R5 Command %s exceeded time expected (%lld us)\n", cmd_str, ktime_us_delta(now, start))); - } - - - return ret; -} - - -/** - * bksync_ptp_adjfreq - * - * @ptp: pointer to ptp_clock_info structure - * @ppb: frequency correction value - * - * Description: this function will set the frequency correction - */ -static int bksync_ptp_adjfreq(struct ptp_clock_info *ptp, s32 ppb) -{ - int ret = -1; - u32 cmd_status = BKSYNC_FREQCOR; - - ret = bksync_cmd_go(cmd_status, &ppb, NULL); - DBG_VERB(("applying freq correction: %x\n", ppb)); - - return ret; -} - -/** - * bksync_ptp_adjtime - * - * @ptp: pointer to ptp_clock_info structure - * @delta: desired change in nanoseconds - * - * Description: this function will shift/adjust the hardware clock time. - */ -static int bksync_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) -{ - u32 cmd_status = BKSYNC_ADJTIME; - int ret = -1; - - ret = bksync_cmd_go(cmd_status, (void *)&delta, NULL); - DBG_VERB(("ptp adjtime: 0x%llx \n", delta)); - - return ret; -} - -/** - * bksync_ptp_gettime - * - * @ptp: pointer to ptp_clock_info structure - * @ts: pointer to hold time/result - * - * Description: this function will read the current time from the - * hardware clock and store it in @ts. - */ -static int bksync_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) -{ - int ret = -1; - u32 cmd_status = BKSYNC_GETTIME; - s64 reftime = 0; - s64 refctr = 0; - - ret = bksync_cmd_go(cmd_status, (void *)&reftime, (void *)&refctr); - if (ret == 0) { - DBG_VERB(("ptp gettime: 0x%llx refctr:0x%llx\n", reftime, refctr)); - mutex_lock(&ptp_priv->ptp_pair_lock); - ptp_priv->shared_addr->ptptime = reftime; - ptp_priv->shared_addr->reftime = refctr; - mutex_unlock(&ptp_priv->ptp_pair_lock); - - *ts = ns_to_timespec64(reftime); - } - return ret; -} - - -/** - * bksync_ptp_settime - * - * @ptp: pointer to ptp_clock_info structure - * @ts: time value to set - * - * Description: this function will set the current time on the - * hardware clock. - */ -static int bksync_ptp_settime(struct ptp_clock_info *ptp, - const struct timespec64 *ts) -{ - s64 reftime, phaseadj; - int ret = -1; - u32 cmd_status = BKSYNC_SETTIME; - - phaseadj = 0; - reftime = timespec64_to_ns(ts); - - ret = bksync_cmd_go(cmd_status, (void *)&reftime, (void *)&phaseadj); - DBG_VERB(("ptp settime: 0x%llx \n", reftime)); - - return ret; -} - -static int bksync_ptp_enable(struct ptp_clock_info *ptp, - struct ptp_clock_request *rq, int on) -{ - return 0; -} - - -static int bksync_ptp_mirror_encap_update(struct ptp_clock_info *ptp, - int mtp_idx, int start) -{ - int ret = -1; - u64 mirror_encap_idx; - u32 cmd_status; - - if (mtp_idx > BCMKSYNC_MAX_MTP_IDX) { - return ret; - } - - mirror_encap_idx = mtp_idx; - if (start) { - cmd_status = BKSYNC_MTP_TS_UPDATE_ENABLE; - ptp_priv->mirror_encap_bmp |= (1 << mtp_idx); - } else { - if (!(ptp_priv->mirror_encap_bmp & mtp_idx)) { - /* Not running */ - return ret; - } - cmd_status = BKSYNC_MTP_TS_UPDATE_DISABLE; - ptp_priv->mirror_encap_bmp &= ~mtp_idx; - } - - ret = bksync_cmd_go(cmd_status, &mirror_encap_idx, NULL); - DBG_VERB(("ptp mmirror_encap_update: %d, mpt_index: %d, ret:%d \n", start, mtp_idx, ret)); - - return ret; - -} - -/* structure describing a PTP hardware clock */ -static struct ptp_clock_info bksync_ptp_caps = { - .owner = THIS_MODULE, - .name = "bksync_ptp_clock", - .max_adj = 200000, - .n_alarm = 0, - .n_ext_ts = 0, - .n_per_out = 0, /* will be overwritten in bksync_ptp_register */ - .n_pins = 0, - .pps = 0, - .adjfreq = bksync_ptp_adjfreq, - .adjtime = bksync_ptp_adjtime, - .gettime64 = bksync_ptp_gettime, - .settime64 = bksync_ptp_settime, - .enable = bksync_ptp_enable, -}; - -/** - * bksync_ptp_hw_tstamp_enable - * - * @dev_no: device number - * @port: port number - * - * Description: this is a callback function to enable the timestamping on - * a given port - */ -int bksync_ptp_hw_tstamp_enable(int dev_no, int port, int tx_type) -{ - uint64_t portmap = 0; - int map = 0; - int ret = 0; - - if (!module_initialized) { - ret = -1; - goto exit; - } - - if (tx_type == HWTSTAMP_TX_ONESTEP_SYNC) { - bksync_ptp_time_keep_init(); - goto exit; - } - - DBG_VERB(("Enable timestamp on a given port:%d\n", port)); - if (port <= 0) { - DBG_ERR(("Error enabling timestamp on port:%d\n", port)); - ret = -1; - goto exit; - } - - port -= 1; - map = port/64; port = port%64; - - /* Update the shared structure member */ - if (ptp_priv->shared_addr) { - portmap = ptp_priv->shared_addr->portmap[map]; - portmap |= (uint64_t)0x1 << port; - ptp_priv->shared_addr->portmap[map] = portmap; - /* Command to R5 for the update */ - ptp_priv->shared_addr->ksyncinit=BKSYNC_PBM_UPDATE; - } - -exit: - return ret; -} - -/** - * bksync_ptp_hw_tstamp_disable - * - * @dev_no: device number - * @port: port number - * - * Description: this is a callback function to disable the timestamping on - * a given port - */ -int bksync_ptp_hw_tstamp_disable(int dev_no, int port, int tx_type) -{ - uint64_t portmap = 0; - int map = 0; - int ret = 0; - - if (!module_initialized) { - ret = -1; - goto exit; - } - - if (tx_type == HWTSTAMP_TX_ONESTEP_SYNC) { - goto exit; - } - - DBG_VERB(("Disable timestamp on a given port:%d\n", port)); - if (port <= 0) { - DBG_ERR(("Error disabling timestamp on port:%d\n", port)); - ret = -1; - goto exit; - } - - port -= 1; - map = port/64; port = port%64; - - /* Update the shared structure member */ - if (ptp_priv->shared_addr) { - portmap = ptp_priv->shared_addr->portmap[map]; - portmap &= ~((uint64_t)0x1 << port); - ptp_priv->shared_addr->portmap[map]= portmap; - - /* Command to R5 for the update */ - ptp_priv->shared_addr->ksyncinit = BKSYNC_PBM_UPDATE; - } -exit: - return ret; -} - -int bksync_ptp_transport_get(uint8_t *pkt) -{ - int transport = 0; - uint16_t ethertype; - uint16_t tpid; - int tpid_offset, ethype_offset; - - /* Need to check VLAN tag if packet is tagged */ - tpid_offset = 12; - tpid = pkt[tpid_offset] << 8 | pkt[tpid_offset + 1]; - if (tpid == 0x8100) { - ethype_offset = tpid_offset + 4; - } else { - ethype_offset = tpid_offset; - } - - ethertype = pkt[ethype_offset] << 8 | pkt[ethype_offset+1]; - - switch (ethertype) { - case 0x88f7: /* ETHERTYPE_PTPV2 */ - transport = 2; - break; - - case 0x0800: /* ETHERTYPE_IPV4 */ - transport = 4; - break; - - case 0x86DD: /* ETHERTYPE_IPV6 */ - transport = 6; - break; - - default: - transport = 0; - } - - return transport; -} - -static int -bksync_txpkt_tsts_tsamp_get(int port, uint32_t pkt_seq_id, uint32_t *ts_valid, uint32_t *seq_id, uint64_t *timestamp) -{ - int ret = 0; - uint64_t tmp; - u32 fifo_rxctr = 0; - - tmp = (port & 0xFFFF) | (pkt_seq_id << 16); - - ret = bksync_cmd_go(BKSYNC_GET_TSTIME, &tmp, timestamp); - - if (ret >= 0) { - fifo_rxctr = (tmp >> 32) & 0xFFFF; - *seq_id = ((tmp >> 16) & 0xFFFF); - *ts_valid = (tmp & 0x1); - if (*ts_valid) { - tmp = (port & 0xFFFF) | (pkt_seq_id << 16); - bksync_cmd_go(BKSYNC_ACK_TSTIME, &tmp, 0); - if (fifo_rxctr != 0) { - if (fifo_rxctr != ptp_priv->port_stats[port].fifo_rxctr + 1) { - DBG_ERR(("FW Reset or Lost Timestamp RxSeq:(Prev %d : Current %d)\n", ptp_priv->port_stats[port].fifo_rxctr, fifo_rxctr)); - } - ptp_priv->port_stats[port].fifo_rxctr = fifo_rxctr; - } - } - } - - - return ret; -} - - -/** - * bksync_ptp_hw_tstamp_tx_time_get - * - * @dev_no: device number - * @port: port number - * @pkt: packet address - * @ts: timestamp to be retrieved - * - * Description: this is a callback function to retrieve the timestamp on - * a given port - */ -int bksync_ptp_hw_tstamp_tx_time_get(int dev_no, int port, uint8_t *pkt, uint64_t *ts) -{ - /* Get Timestamp from R5 or CLMAC */ - uint32_t ts_valid = 0; - uint32_t seq_id = 0; - uint32_t pktseq_id = 0; - uint64_t timestamp = 0; - uint16_t tpid = 0; - ktime_t start; - u64 delta; - int retry_cnt = num_retries; - int seq_id_offset, tpid_offset; - int transport = network_transport; - start = ktime_get(); - - if (!ptp_priv || !pkt || !ts || port < 1 || port > 255 || ptp_priv->shared_addr == NULL) { - return -1; - } - - *ts = 0; - - tpid_offset = 12; - - /* Parse for nw transport */ - if (transport == 0) { - transport = bksync_ptp_transport_get(pkt); - } - - switch(transport) - { - case 2: - seq_id_offset = 0x2c; - break; - case 4: - seq_id_offset = 0x48; - break; - case 6: - seq_id_offset = 0x5c; - break; - default: - seq_id_offset = 0x2c; - break; - } - - /* Need to check VLAN tag if packet is tagged */ - tpid = pkt[tpid_offset] << 8 | pkt[tpid_offset + 1]; - if (tpid == 0x8100) { - seq_id_offset += 4; - } - - - pktseq_id = pkt[seq_id_offset] << 8 | pkt[seq_id_offset + 1]; - - port -= 1; - - /* Fetch the TX timestamp from shadow memory */ - do { - bksync_txpkt_tsts_tsamp_get(port, pktseq_id, &ts_valid, &seq_id, ×tamp); - if (ts_valid) { - - /* Clear the shadow memory to get next entry */ - ptp_priv->shared_addr->port_ts_data[port].timestamp = 0; - ptp_priv->shared_addr->port_ts_data[port].port_id = 0; - ptp_priv->shared_addr->port_ts_data[port].ts_seq_id = 0; - ptp_priv->shared_addr->port_ts_data[port].ts_valid = 0; - - if (seq_id == pktseq_id) { - *ts = timestamp; - ptp_priv->port_stats[port].tsts_match += 1; - - delta = ktime_us_delta(ktime_get(), start); - DBG_VERB(("Port: %d Skb_SeqID %d FW_SeqId %d and TS:%llx FetchTime %lld\n", - port, pktseq_id, seq_id, timestamp, delta)); - - if (delta < ptp_priv->port_stats[port].tsts_best_fetch_time || ptp_priv->port_stats[port].tsts_best_fetch_time == 0) { - ptp_priv->port_stats[port].tsts_best_fetch_time = delta; - } - if (delta > ptp_priv->port_stats[port].tsts_worst_fetch_time || ptp_priv->port_stats[port].tsts_worst_fetch_time == 0) { - ptp_priv->port_stats[port].tsts_worst_fetch_time = delta; - } - /* Calculate Moving Average*/ - ptp_priv->port_stats[port].tsts_avg_fetch_time = ((u32)delta + ((ptp_priv->port_stats[port].tsts_match - 1) * ptp_priv->port_stats[port].tsts_avg_fetch_time)) / ptp_priv->port_stats[port].tsts_match; - break; - } else { - DBG_TXTS(("Discard timestamp on port %d Skb_SeqID %d FW_SeqId %d RetryCnt %d TimeLapsed (%lld us)\n", - port, pktseq_id, seq_id, (num_retries - retry_cnt), ktime_us_delta(ktime_get(),start))); - - ptp_priv->port_stats[port].tsts_discard += 1; - continue; - } - } - ptp_sleep(1); - retry_cnt--; - } while(retry_cnt); - - - ptp_priv->port_stats[port].pkt_txctr += 1; - - if (retry_cnt == 0) { - ptp_priv->port_stats[port].tsts_timeout += 1; - DBG_ERR(("FW Response timeout: Tx TS on phy port:%d Skb_SeqID: %d TimeLapsed (%lld us)\n", - port, pktseq_id, ktime_us_delta(ktime_get(), start))); - } - - - return 0; -} - - -enum { - bxconCustomEncapVersionInvalid = 0, - bxconCustomEncapVersionOne = 1, - - bxconCustomEncapVersionCurrent = bxconCustomEncapVersionOne, - bxconCustomEncapVersionReserved = 255 /* last */ -} bxconCustomEncapVersion; - -enum { - bxconCustomEncapOpcodeInvalid = 0, - bxconCustomEncapOpcodePtpRx = 1, - bxconCustomEncapOpcodeReserved = 255 /* last */ -} bxconCustomEncapOpcode; - -enum { - bxconCustomEncapPtpRxTlvInvalid = 0, - bxconCustomEncapPtpRxTlvPtpRxTime = 1, - bxconCustomEncapPtpRxTlvReserved = 255 /* last */ -} bxconCustomEncapPtpRxTlvType; - -void -bksync_dump_pkt(uint8_t *data, int size) -{ - int idx; - char str[128]; - - for (idx = 0; idx < size; idx++) { - if ((idx & 0xf) == 0) { - sprintf(str, "%04x: ", idx); - } - sprintf(&str[strlen(str)], "%02x ", data[idx]); - if ((idx & 0xf) == 0xf) { - sprintf(&str[strlen(str)], "\n"); - gprintk(str); - } - } - if ((idx & 0xf) != 0) { - sprintf(&str[strlen(str)], "\n"); - gprintk(str); - } -} - - -static inline int -bksync_pkt_custom_encap_ptprx_get(uint8_t *pkt, uint64_t *ing_ptptime) -{ - uint8_t *custom_hdr; - uint8_t id[4]; - uint8_t ver, opc; - uint8_t nh_type, nh_rsvd; - uint16_t len, tot_len; - uint16_t nh_len; - uint32_t seq_id = 0; - uint32_t ptp_rx_time[2]; - uint64_t u64_ptp_rx_time = 0; - - custom_hdr = pkt; - - BKSYNC_UNPACK_U8(custom_hdr, id[0]); - BKSYNC_UNPACK_U8(custom_hdr, id[1]); - BKSYNC_UNPACK_U8(custom_hdr, id[2]); - BKSYNC_UNPACK_U8(custom_hdr, id[3]); - if (!((id[0] == 'B') && (id[1] == 'C') && (id[2] == 'M') && (id[3] == 'C'))) { - /* invalid signature */ - return -1; - } - - BKSYNC_UNPACK_U8(custom_hdr, ver); - switch (ver) { - case bxconCustomEncapVersionCurrent: - break; - default: - gprintk("invalid ver\n"); - return -1; - } - - BKSYNC_UNPACK_U8(custom_hdr, opc); - switch (opc) { - case bxconCustomEncapOpcodePtpRx: - break; - default: - gprintk("invalid opcode\n"); - return -1; - } - - - BKSYNC_UNPACK_U16(custom_hdr, len); - BKSYNC_UNPACK_U32(custom_hdr, seq_id); - tot_len = len; - - /* remaining length of custom encap */ - len = len - (custom_hdr - pkt); - - - /* process tlv */ - while (len > 0) { - BKSYNC_UNPACK_U8(custom_hdr, nh_type); - BKSYNC_UNPACK_U8(custom_hdr, nh_rsvd); - BKSYNC_UNPACK_U16(custom_hdr, nh_len); - len = len - (nh_len); - if (nh_rsvd != 0x0) { - continue; /* invalid tlv */ - } - - switch (nh_type) { - case bxconCustomEncapPtpRxTlvPtpRxTime: - BKSYNC_UNPACK_U32(custom_hdr, ptp_rx_time[0]); - BKSYNC_UNPACK_U32(custom_hdr, ptp_rx_time[1]); - u64_ptp_rx_time = ((uint64_t)ptp_rx_time[1] << 32) | (uint64_t)ptp_rx_time[0]; - *ing_ptptime = u64_ptp_rx_time; - break; - default: - custom_hdr += nh_len; - break; - } - } - -#if 0 -if (!(seq_id % 100)) { - gprintk("****** seq_id = %d ptp time = 0x%llx\n", seq_id, u64_ptp_rx_time); - bksync_dump_pkt(pkt, tot_len); -} -#endif - - DBG_VERB(("Custom encap header: ver=%d opcode=%d seq_id=0x%x\n", ver, opc, seq_id)); - - return (tot_len); -} - - - -/** - * bksync_ptp_hw_tstamp_rx_time_upscale - * - * @dev_no: device number - * @ts: timestamp to be retrieved - * - * Description: this is a callback function to retrieve 64b equivalent of - * rx timestamp - */ -int bksync_ptp_hw_tstamp_rx_time_upscale(int dev_no, int port, struct sk_buff *skb, uint32_t *meta, uint64_t *ts) -{ - int ret = 0; - int custom_encap_len = 0; - - switch (KNET_SKB_CB(skb)->dcb_type) { - case 26: - case 32: - case 35: - if (pci_cos != (meta[4] & 0x3F)) { - return -1; - } - break; - case 38: - if (pci_cos != ((meta[12] >> 22) & 0x2F)) { - return -1; - } - break; - case 36: - if (pci_cos != ((meta[6] >> 22) & 0x2F)) { - return -1; - } - break; - default: - return -1; - } - - /* parse custom encap header in pkt for ptp rxtime */ - custom_encap_len = bksync_pkt_custom_encap_ptprx_get((skb->data), ts); - - /* Remove the custom encap header from pkt */ - if (custom_encap_len > 0) { - skb_pull(skb, custom_encap_len); - - DBG_VERB(("###### ptp message type: %d\n", skb->data[42])); - } - - if (port > 0){ - port -= 1; - ptp_priv->port_stats[port].pkt_rxctr += 1; - } - - return ret; -} - - -void bksync_hton64(u8 *buf, const uint64_t *data) -{ -#ifdef __LITTLE_ENDIAN - /* LITTLE ENDIAN */ - buf[0] = (*(((uint8_t*)(data)) + 7u)); - buf[1] = (*(((uint8_t*)(data)) + 6u)); - buf[2] = (*(((uint8_t*)(data)) + 5u)); - buf[3] = (*(((uint8_t*)(data)) + 4u)); - buf[4] = (*(((uint8_t*)(data)) + 3u)); - buf[5] = (*(((uint8_t*)(data)) + 2u)); - buf[6] = (*(((uint8_t*)(data)) + 1u)); - buf[7] = (*(((uint8_t*)(data)) + 0u)); -#else - memcpy(buf, data, 8); -#endif -} - - - -int bksync_ptp_hw_tstamp_tx_meta_get(int dev_no, - int hwts, int hdrlen, - struct sk_buff *skb, - uint64_t *tstamp, - u32 **md) -{ - uint16_t tpid = 0; - int md_offset = 0; - int pkt_offset = 0; - int ptp_hdr_offset = 0; - int transport = network_transport; - s64 ptptime = 0; - s64 ptpcounter = 0; - int64_t corrField; - int32_t negCurTS32; - int64_t negCurTS64; - - if(!ptp_priv || ptp_priv->shared_addr == NULL) { - return 0; - } - - mutex_lock(&ptp_priv->ptp_pair_lock); - ptptime = ptp_priv->shared_addr->ptptime; - ptpcounter = ptp_priv->shared_addr->reftime; - mutex_unlock(&ptp_priv->ptp_pair_lock); - - negCurTS32 = - (int32_t) ptpcounter; - negCurTS64 = - (int64_t)(ptpcounter); - - if (CMICX_DEV_TYPE) { - pkt_offset = ptp_hdr_offset = hdrlen; - } - - /* Need to check VLAN tag if packet is tagged */ - tpid = SKB_U16_GET(skb, (pkt_offset + 12)); - if (tpid == 0x8100) { - md_offset = 4; - ptp_hdr_offset += 4; - } - - /* One Step Meta Data */ - if (hwts == HWTSTAMP_TX_ONESTEP_SYNC) { - md_offset += 8; - if (KNET_SKB_CB(skb)->dcb_type == 26) { - corrField = (((int64_t)negCurTS32) << 16); - if (negCurTS32 >= 0) { - md_offset += 8; - } - } else { - corrField = (((int64_t)negCurTS64) << 16); - } - } - - - /* Parse for nw transport */ - if (transport == 0) { - transport = bksync_ptp_transport_get(skb->data + pkt_offset); - } - - switch(transport) - { - case 2: /* IEEE 802.3 */ - ptp_hdr_offset += 14; - if (KNET_SKB_CB(skb)->dcb_type == 32) { - if (md) *md = &sobmhrawpkts_dcb32[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 26) { - if (md) *md = &sobmhrawpkts_dcb26[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 35) { - if (md) *md = &sobmhrawpkts_dcb35[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 36) { - if (md) *md = &sobmhrawpkts_dcb36[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 38) { - if (md) *md = &sobmhrawpkts_dcb38[md_offset]; - } - break; - case 4: /* UDP IPv4 */ - ptp_hdr_offset += 42; - if (KNET_SKB_CB(skb)->dcb_type == 32) { - if (md) *md = &sobmhudpipv4_dcb32[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 26) { - if (md) *md = &sobmhudpipv4_dcb26[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 35) { - if (md) *md = &sobmhudpipv4_dcb35[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 36) { - if (md) *md = &sobmhudpipv4_dcb36[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 38) { - if (md) *md = &sobmhudpipv4_dcb38[md_offset]; - } - break; - case 6: /* UDP IPv6 */ - ptp_hdr_offset += 62; - if (KNET_SKB_CB(skb)->dcb_type == 32) { - if (md) *md = &sobmhudpipv6_dcb32[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 26) { - if (md) *md = &sobmhudpipv6_dcb26[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 35) { - if (md) *md = &sobmhudpipv6_dcb35[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 36) { - if (md) *md = &sobmhudpipv6_dcb36[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 38) { - if (md) *md = &sobmhudpipv6_dcb38[md_offset]; - } - break; - default: - ptp_hdr_offset += 42; - if (KNET_SKB_CB(skb)->dcb_type == 32) { - if (md) *md = &sobmhudpipv4_dcb32[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 26) { - if (md) *md = &sobmhudpipv4_dcb26[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 35) { - if (md) *md = &sobmhudpipv4_dcb35[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 36) { - if (md) *md = &sobmhudpipv4_dcb36[md_offset]; - } else if(KNET_SKB_CB(skb)->dcb_type == 38) { - if (md) *md = &sobmhudpipv4_dcb38[md_offset]; - } - break; - } - - - if ((hwts == HWTSTAMP_TX_ONESTEP_SYNC) && - BKSYNC_PTP_EVENT_MSG(skb->data[ptp_hdr_offset])) { - /* One Step Timestamp Field updation */ - int corr_offset = ptp_hdr_offset + 8; - int origin_ts_offset = ptp_hdr_offset + 34; - u32 tmp; - struct timespec64 ts; - int udp_csum_regen; - u32 udp_csum20; - u16 udp_csum; - int port; - - udp_csum = SKB_U16_GET(skb, (ptp_hdr_offset - 2)); - - switch (transport) { - case 2: - udp_csum_regen = 0; - break; - case 6: - udp_csum_regen = 1; - break; - default: - udp_csum_regen = (udp_csum != 0x0); - break; - } - - /* Fill the correction field */ - bksync_hton64(&(skb->data[corr_offset]), (const u64 *)&corrField); - - /* Fill the Origin Timestamp Field */ - ts = ns_to_timespec64(ptptime); - - tmp = (ts.tv_sec >> 32); - skb->data[origin_ts_offset + 0] = ((tmp >> 8) & 0xFF); - skb->data[origin_ts_offset + 1] = ((tmp ) & 0xFF); - - tmp = (ts.tv_sec & 0xFFFFFFFFLL); - skb->data[origin_ts_offset + 2] = ((tmp >> 24) & 0xFF); - skb->data[origin_ts_offset + 3] = ((tmp >> 16) & 0xFF); - skb->data[origin_ts_offset + 4] = ((tmp >> 8) & 0xFF); - skb->data[origin_ts_offset + 5] = ((tmp ) & 0xFF); - - tmp = (ts.tv_nsec & 0xFFFFFFFFLL); - skb->data[origin_ts_offset + 6] = ((tmp >> 24) & 0xFF); - skb->data[origin_ts_offset + 7] = ((tmp >> 16) & 0xFF); - skb->data[origin_ts_offset + 8] = ((tmp >> 8) & 0xFF); - skb->data[origin_ts_offset + 9] = ((tmp ) & 0xFF); - - if (udp_csum_regen) { - udp_csum20 = (~udp_csum) & 0xFFFF; - - udp_csum20 += SKB_U16_GET(skb, (corr_offset + 0)); - udp_csum20 += SKB_U16_GET(skb, (corr_offset + 2)); - udp_csum20 += SKB_U16_GET(skb, (corr_offset + 4)); - udp_csum20 += SKB_U16_GET(skb, (corr_offset + 6)); - - udp_csum20 += SKB_U16_GET(skb, (origin_ts_offset + 0)); - udp_csum20 += SKB_U16_GET(skb, (origin_ts_offset + 2)); - udp_csum20 += SKB_U16_GET(skb, (origin_ts_offset + 4)); - udp_csum20 += SKB_U16_GET(skb, (origin_ts_offset + 6)); - udp_csum20 += SKB_U16_GET(skb, (origin_ts_offset + 8)); - - /* Fold 20bit checksum into 16bit udp checksum */ - udp_csum20 = ((udp_csum20 & 0xFFFF) + (udp_csum20 >> 16)); - udp_csum = ((udp_csum20 & 0xFFFF) + (udp_csum20 >> 16)); - - /* invert again to get final checksum. */ - udp_csum = ~udp_csum; - if (udp_csum == 0) { - udp_csum = 0xFFFF; - } - - skb->data[ptp_hdr_offset - 2] = ((udp_csum >> 8) & 0xFF); - skb->data[ptp_hdr_offset - 1] = ((udp_csum ) & 0xFF); - } - - if (skb->data[ptp_hdr_offset] == IEEE1588_MSGTYPE_DELREQ) { - *tstamp = ptptime; - - DBG_VERB(("ptp delay req packet tstamp : 0x%llx corrField: 0x%llx\n", ptptime, corrField)); - } - - port = KNET_SKB_CB(skb)->port; - port -= 1; - ptp_priv->port_stats[port].pkt_txonestep += 1; - } - - return 0; -} - - -int bksync_ptp_hw_tstamp_ptp_clock_index_get(int dev_no) -{ - int phc_index = -1; - if (ptp_priv && ptp_priv->ptp_clock) - phc_index = ptp_clock_index(ptp_priv->ptp_clock); - return phc_index; -} - - -/** -* bcm_ptp_time_keep - call timecounter_read every second to avoid timer overrun -* because a 32bit counter, will timeout in 4s -*/ -static void bksync_ptp_time_keep(struct work_struct *work) -{ - struct delayed_work *dwork = to_delayed_work(work); - struct bksync_ptp_priv *priv = - container_of(dwork, struct bksync_ptp_priv, time_keep); - struct timespec64 ts; - - /* Call bcm_ptp_gettime function to keep the ref_time_64 and ref_counter_48 in sync */ - bksync_ptp_gettime(&(priv->ptp_caps), &ts); - schedule_delayed_work(&priv->time_keep, HZ); -} - -static void bksync_ptp_time_keep_init(void) -{ - if (!ptp_priv->timekeep_status) { - INIT_DELAYED_WORK(&(ptp_priv->time_keep), bksync_ptp_time_keep); - schedule_delayed_work(&ptp_priv->time_keep, HZ); - - ptp_priv->timekeep_status = 1; - } - - return; -} - -static void bksync_ptp_time_keep_deinit(void) -{ - if (ptp_priv->timekeep_status) { - /* Cancel delayed work */ - cancel_delayed_work_sync(&(ptp_priv->time_keep)); - - ptp_priv->timekeep_status = 0; - } - - return; -} - - - -static int bksync_ptp_init(struct ptp_clock_info *ptp) -{ - return bksync_cmd_go(BKSYNC_INIT, NULL, NULL); -} - -static int bksync_ptp_deinit(struct ptp_clock_info *ptp) -{ - bksync_ptp_time_keep_deinit(); - - return bksync_cmd_go(BKSYNC_DEINIT, NULL, NULL); -} - -/* - * Device Debug Statistics Proc Entry - */ -/** -* This function is called at the beginning of a sequence. -* ie, when: -* - the /proc/bcm/ksync/stats file is read (first time) -* - after the function stop (end of sequence) -* -*/ -static void *bksync_proc_seq_start(struct seq_file *s, loff_t *pos) -{ - /* beginning a new sequence ? */ - if ( (int)*pos == 0 && ptp_priv->shared_addr != NULL) - { - seq_printf(s, "TwoStep Port Bitmap : %08llx%08llx\n", - (uint64_t)(ptp_priv->shared_addr->portmap[1]), - (uint64_t)(ptp_priv->shared_addr->portmap[0])); - seq_printf(s,"%4s| %9s| %9s| %9s| %9s| %9s| %9s| %9s| %9s| %9s| %9s| %9s\n", - "Port", "RxCounter", "TxCounter", "TxOneStep", "TSTimeout", "TSRead", "TSMatch", "TSDiscard", - "TimeHi" , "TimeLo", "TimeAvg", "FIFORx"); - } - - if ((int)*pos < (ptp_priv->num_pports)) - return (void *)(unsigned long)(*pos + 1); - /* End of the sequence, return NULL */ - return NULL; -} - -/** -* This function is called after the beginning of a sequence. -* It's called untill the return is NULL (this ends the sequence). -* -*/ -static void *bksync_proc_seq_next(struct seq_file *s, void *v, loff_t *pos) -{ - (*pos)++; - return bksync_proc_seq_start(s, pos); -} -/** -* This function is called at the end of a sequence -* -*/ -static void bksync_proc_seq_stop(struct seq_file *s, void *v) -{ - /* nothing to do, we use a static value in bksync_proc_seq_start() */ -} - -/** -* This function is called for each "step" of a sequence -* -*/ -static int bksync_proc_seq_show(struct seq_file *s, void *v) -{ - unsigned long port = (unsigned long)v; - port = port - 1; - if (ptp_priv->port_stats[port].pkt_rxctr || ptp_priv->port_stats[port].pkt_txctr || - ptp_priv->port_stats[port].pkt_txonestep|| - ptp_priv->port_stats[port].tsts_discard || ptp_priv->port_stats[port].tsts_timeout || - ptp_priv->shared_addr->port_ts_data[port].ts_cnt || ptp_priv->port_stats[port].tsts_match) { - seq_printf(s, "%4lu | %9d| %9d| %9d| %9d| %9d| %9d| %9d| %9lld| %9lld | %9d|%9d | %s\n", (port + 1), - ptp_priv->port_stats[port].pkt_rxctr, - ptp_priv->port_stats[port].pkt_txctr, - ptp_priv->port_stats[port].pkt_txonestep, - ptp_priv->port_stats[port].tsts_timeout, - ptp_priv->shared_addr->port_ts_data[port].ts_cnt, - ptp_priv->port_stats[port].tsts_match, - ptp_priv->port_stats[port].tsts_discard, - ptp_priv->port_stats[port].tsts_worst_fetch_time, - ptp_priv->port_stats[port].tsts_best_fetch_time, - ptp_priv->port_stats[port].tsts_avg_fetch_time, - ptp_priv->port_stats[port].fifo_rxctr, - ptp_priv->port_stats[port].pkt_txctr != ptp_priv->port_stats[port].tsts_match ? "***":""); - } - return 0; -} - -/** -* seq_operations for bsync_proc_*** entries -* -*/ -static struct seq_operations bksync_proc_seq_ops = { - .start = bksync_proc_seq_start, - .next = bksync_proc_seq_next, - .stop = bksync_proc_seq_stop, - .show = bksync_proc_seq_show -}; -static int bksync_proc_txts_open(struct inode * inode, struct file * file) -{ - return seq_open(file, &bksync_proc_seq_ops); -} - -static ssize_t -bksync_proc_txts_write(struct file *file, const char *buf, - size_t count, loff_t *loff) -{ - char debug_str[40]; - char *ptr; - int port; - - if (copy_from_user(debug_str, buf, count)) { - return -EFAULT; - } - - if ((ptr = strstr(debug_str, "clear")) != NULL) { - for (port = 0; port < ptp_priv->num_pports; port++) { - ptp_priv->port_stats[port].pkt_rxctr = 0; - ptp_priv->port_stats[port].pkt_txctr = 0; - ptp_priv->port_stats[port].pkt_txonestep = 0; - ptp_priv->port_stats[port].tsts_timeout = 0; - ptp_priv->port_stats[port].tsts_match = 0; - ptp_priv->port_stats[port].tsts_discard = 0; - if (ptp_priv->shared_addr) - ptp_priv->shared_addr->port_ts_data[port].ts_cnt = 0; - } - } else { - gprintk("Warning: unknown input\n"); - } - - return count; -} - -struct proc_ops bksync_proc_txts_file_ops = { - proc_open: bksync_proc_txts_open, - proc_read: seq_read, - proc_lseek: seq_lseek, - proc_write: bksync_proc_txts_write, - proc_release: seq_release, -}; - -/* - * Driver Debug Proc Entry - */ -static int -bksync_proc_debug_show(struct seq_file *m, void *v) -{ - seq_printf(m, "Configuration:\n"); - seq_printf(m, " debug: 0x%x\n", debug); - return 0; -} - -static ssize_t -bksync_proc_debug_write(struct file *file, const char *buf, - size_t count, loff_t *loff) -{ - char debug_str[40]; - char *ptr; - - if (copy_from_user(debug_str, buf, count)) { - return -EFAULT; - } - - if ((ptr = strstr(debug_str, "debug=")) != NULL) { - ptr += 6; - debug = simple_strtol(ptr, NULL, 0); - } else { - gprintk("Warning: unknown configuration\n"); - } - - return count; -} - -static int bksync_proc_debug_open(struct inode * inode, struct file * file) -{ - return single_open(file, bksync_proc_debug_show, NULL); -} - - -struct proc_ops bksync_proc_debug_file_ops = { - proc_open: bksync_proc_debug_open, - proc_read: seq_read, - proc_lseek: seq_lseek, - proc_write: bksync_proc_debug_write, - proc_release: single_release, -}; - - -static int -bksync_proc_init(void) -{ - struct proc_dir_entry *entry; - - PROC_CREATE(entry, "stats", 0666, bksync_proc_root, &bksync_proc_txts_file_ops); - if (entry == NULL) { - return -1; - } - PROC_CREATE(entry, "debug", 0666, bksync_proc_root, &bksync_proc_debug_file_ops); - if (entry == NULL) { - return -1; - } - return 0; -} - -static int -bksync_proc_cleanup(void) -{ - remove_proc_entry("stats", bksync_proc_root); - remove_proc_entry("debug", bksync_proc_root); - return 0; -} - -static void bksync_ptp_dma_init(int dcb_type) -{ - int endianess; - int num_pports = 256; - - - ptp_priv->num_pports = num_pports; - ptp_priv->dcb_type = dcb_type; - ptp_priv->dma_mem_size = 16384;/*sizeof(bksync_uc_linux_ipc_t);*/ - - if (ptp_priv->shared_addr == NULL) { - ptp_priv->shared_addr = kzalloc(16384, GFP_KERNEL); - ptp_priv->port_stats = kzalloc((sizeof(bksync_port_stats_t) * num_pports), GFP_KERNEL); - } - - if (ptp_priv->shared_addr != NULL) { - /* Reset memory. */ - memset((void *)ptp_priv->shared_addr, 0, ptp_priv->dma_mem_size); - -#ifdef __LITTLE_ENDIAN - endianess = 0; -#else - endianess = 1; -#endif - DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_14r(CMIC_CMC_BASE), ((pci_cos << 16) | endianess)); - - DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_15r(CMIC_CMC_BASE), 1); - DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_16r(CMIC_CMC_BASE), 1); - - } - - if (debug & DBG_LVL_VERB) { - printk(KERN_EMERG"%s %p:%p\n",__FUNCTION__, - ptp_priv->base_addr,(void *)ptp_priv->shared_addr); - } - - ptp_priv->mirror_encap_bmp = 0x0; - - hostcmd_regs[0] = CMIC_CMC_SCHAN_MESSAGE_21r(CMIC_CMC_BASE); - hostcmd_regs[1] = CMIC_CMC_SCHAN_MESSAGE_20r(CMIC_CMC_BASE); - hostcmd_regs[2] = CMIC_CMC_SCHAN_MESSAGE_19r(CMIC_CMC_BASE); - hostcmd_regs[3] = CMIC_CMC_SCHAN_MESSAGE_18r(CMIC_CMC_BASE); - hostcmd_regs[4] = CMIC_CMC_SCHAN_MESSAGE_17r(CMIC_CMC_BASE); - - return; -} - - -/** - * bksync_ioctl_cmd_handler - * @kmsg: kcom message - ptp clock ioctl command. - * Description: This function will handle ioctl commands - * from user mode. - */ -static int -bksync_ioctl_cmd_handler(kcom_msg_clock_cmd_t *kmsg, int len, int dcb_type) -{ - u32 fw_status; - kmsg->hdr.type = KCOM_MSG_TYPE_RSP; - - if (!module_initialized && kmsg->clock_info.cmd != KSYNC_M_HW_INIT) { - kmsg->hdr.status = KCOM_E_NOT_FOUND; - return sizeof(kcom_msg_hdr_t); - } - - switch(kmsg->clock_info.cmd) { - case KSYNC_M_HW_INIT: - pci_cos = kmsg->clock_info.data[0]; - if (kmsg->clock_info.data[1] == 0 || kmsg->clock_info.data[1] == 1) { - fw_core = kmsg->clock_info.data[1]; - DEV_READ32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_21r(CMIC_CMC_BASE), &fw_status); - - /* Return success if the app is already initialized. */ - if (module_initialized) { - kmsg->hdr.status = KCOM_E_NONE; - return sizeof(kcom_msg_hdr_t); - } - - /* Return error if the app is not ready yet. */ - if (fw_status != 0xBADC0DE1) { - kmsg->hdr.status = KCOM_E_RESOURCE; - return sizeof(kcom_msg_hdr_t); - } - - bksync_ptp_dma_init(dcb_type); - if (bksync_ptp_init(&(ptp_priv->ptp_caps)) >= 0) { - module_initialized = 1; - } - } - break; - case KSYNC_M_HW_DEINIT: - bksync_ptp_deinit(&(ptp_priv->ptp_caps)); - module_initialized = 0; - break; - case KSYNC_M_HW_TS_DISABLE: - bksync_ptp_hw_tstamp_disable(0, kmsg->clock_info.data[0], 0); - break; - case KSYNC_M_MTP_TS_UPDATE_ENABLE: - bksync_ptp_mirror_encap_update(0, kmsg->clock_info.data[0], TRUE); - break; - case KSYNC_M_MTP_TS_UPDATE_DISABLE: - bksync_ptp_mirror_encap_update(0, kmsg->clock_info.data[0], FALSE); - break; - case KSYNC_M_VERSION: - break; - default: - kmsg->hdr.status = KCOM_E_NOT_FOUND; - return sizeof(kcom_msg_hdr_t); - } - - return sizeof(*kmsg); -} - - - -/** - * bksync_ptp_register - * @priv: driver private structure - * Description: this function will register the ptp clock driver - * to kernel. It also does some house keeping work. - */ -static int bksync_ptp_register(void) -{ - int err = -ENODEV; - - /* Support on core-0 or core-1 */ - if (fw_core < 0 || fw_core > 1) { - goto exit; - } - - /* default transport is raw, ieee 802.3 */ - switch (network_transport) { - case 2: /* IEEE 802.3 */ - case 4: /* UDP IPv4 */ - case 6: /* UDP IPv6 */ - break; - default: - network_transport = 0; - } - - ptp_priv = kzalloc(sizeof(*ptp_priv), GFP_KERNEL); - if (!ptp_priv) { - err = -ENOMEM; - goto exit; - } - - /* Reset memory */ - memset(ptp_priv, 0, sizeof(*ptp_priv)); - - err = -ENODEV; - - ptp_priv->ptp_caps = bksync_ptp_caps; - - mutex_init(&(ptp_priv->ptp_lock)); - mutex_init(&(ptp_priv->ptp_pair_lock)); - - /* Register ptp clock driver with bksync_ptp_caps */ - ptp_priv->ptp_clock = ptp_clock_register(&ptp_priv->ptp_caps, NULL); - - /* Initialize the Base address for CMIC and shared Memory access */ - ptp_priv->base_addr = lkbde_get_dev_virt(0); - ptp_priv->dma_dev = lkbde_get_dma_dev(0); - - if (IS_ERR(ptp_priv->ptp_clock)) { - ptp_priv->ptp_clock = NULL; - } else if (ptp_priv->ptp_clock) { - err = 0; - - /* Register BCM-KNET HW Timestamp Callback Functions */ - bkn_hw_tstamp_enable_cb_register(bksync_ptp_hw_tstamp_enable); - bkn_hw_tstamp_disable_cb_register(bksync_ptp_hw_tstamp_disable); - bkn_hw_tstamp_tx_time_get_cb_register(bksync_ptp_hw_tstamp_tx_time_get); - bkn_hw_tstamp_tx_meta_get_cb_register(bksync_ptp_hw_tstamp_tx_meta_get); - bkn_hw_tstamp_rx_time_upscale_cb_register(bksync_ptp_hw_tstamp_rx_time_upscale); - bkn_hw_tstamp_ptp_clock_index_cb_register(bksync_ptp_hw_tstamp_ptp_clock_index_get); - bkn_hw_tstamp_ioctl_cmd_cb_register(bksync_ioctl_cmd_handler); - - } - - /* Initialize proc files */ - bksync_proc_root = proc_mkdir("bcm/ksync", NULL); - bksync_proc_init(); - ptp_priv->shared_addr = NULL; - ptp_priv->port_stats = NULL; -exit: - return err; -} - -static int bksync_ptp_remove(void) -{ - if (!ptp_priv) - return 0; - - bksync_ptp_time_keep_deinit(); - - bksync_proc_cleanup(); - remove_proc_entry("bcm/ksync", NULL); - - /* UnRegister BCM-KNET HW Timestamp Callback Functions */ - bkn_hw_tstamp_enable_cb_unregister(bksync_ptp_hw_tstamp_enable); - bkn_hw_tstamp_disable_cb_unregister(bksync_ptp_hw_tstamp_disable); - bkn_hw_tstamp_tx_time_get_cb_unregister(bksync_ptp_hw_tstamp_tx_time_get); - bkn_hw_tstamp_tx_meta_get_cb_unregister(bksync_ptp_hw_tstamp_tx_meta_get); - bkn_hw_tstamp_rx_time_upscale_cb_unregister(bksync_ptp_hw_tstamp_rx_time_upscale); - bkn_hw_tstamp_ptp_clock_index_cb_unregister(bksync_ptp_hw_tstamp_ptp_clock_index_get); - bkn_hw_tstamp_ioctl_cmd_cb_unregister(bksync_ioctl_cmd_handler); - - if (module_initialized) { - DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_15r(CMIC_CMC_BASE), 0); - DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_16r(CMIC_CMC_BASE), 0); - } - /* Deinitialize the PTP */ - bksync_ptp_deinit(&(ptp_priv->ptp_caps)); - module_initialized = 0; - - if (ptp_priv->port_stats != NULL) { - kfree((void *)ptp_priv->port_stats); - ptp_priv->port_stats = NULL; - } - if (ptp_priv->shared_addr != NULL) { - kfree((void *)ptp_priv->shared_addr); - ptp_priv->shared_addr = NULL; - DBG_ERR(("Free R5 memory\n")); - } - - /* Unregister the bcm ptp clock driver */ - ptp_clock_unregister(ptp_priv->ptp_clock); - - /* Free Memory */ - kfree(ptp_priv); - - return 0; -} -#endif - - -/* - * Generic module functions - */ - -/* - * Function: _pprint - * - * Purpose: - * Print proc filesystem information. - * Parameters: - * None - * Returns: - * Always 0 - */ - static int -_pprint(struct seq_file *m) -{ -#if LINUX_VERSION_CODE > KERNEL_VERSION(3,17,0) - /* put some goodies here */ - pprintf(m, "Broadcom BCM PTP Hardware Clock Module\n"); -#else - pprintf(m, "Broadcom BCM PTP Hardware Clock Module not supported\n"); -#endif - return 0; -} - -/* - * Function: _init - * - * Purpose: - * Module initialization. - * Attached SOC all devices and optionally initializes these. - * Parameters: - * None - * Returns: - * 0 on success, otherwise -1 - */ - static int -_init(void) -{ -#if LINUX_VERSION_CODE > KERNEL_VERSION(3,17,0) - bksync_ptp_register(); - return 0; -#else - return -1; -#endif -} - -/* - * Function: _cleanup - * - * Purpose: - * Module cleanup function - * Parameters: - * None - * Returns: - * Always 0 - */ - static int -_cleanup(void) -{ -#if LINUX_VERSION_CODE > KERNEL_VERSION(3,17,0) - mutex_destroy(&(ptp_priv->ptp_lock)); - mutex_destroy(&(ptp_priv->ptp_pair_lock)); - bksync_ptp_remove(); - return 0; -#else - return -1; -#endif -} - -static gmodule_t _gmodule = { -name: MODULE_NAME, - major: MODULE_MAJOR, - init: _init, - cleanup: _cleanup, - pprint: _pprint, - ioctl: NULL, - open: NULL, - close: NULL, -}; - - gmodule_t* -gmodule_get(void) -{ - EXPORT_NO_SYMBOLS; - return &_gmodule; -} diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.c index e67f9191d4..628ee1780c 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.c @@ -509,7 +509,7 @@ psample_filter_cb(uint8_t * pkt, int size, int dev_no, void *pkt_meta, /* setup skb to point to pkt */ memcpy(skb->data, pkt, meta.trunc_size); skb_put(skb, meta.trunc_size); - skb->len = meta.trunc_size; + skb->len = size; /* SONIC-55684 */ psample_pkt->skb = skb; spin_lock_irqsave(&g_psample_work.lock, flags); diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/psample/psample.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/psample/psample.c index 99317cbf30..46a84c7f7c 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/psample/psample.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/psample/psample.c @@ -202,6 +202,7 @@ void psample_group_put(struct psample_group *group) } EXPORT_SYMBOL_GPL(psample_group_put); +#if IS_ENABLED(CONFIG_PSAMPLE) /* FIXUP:- Remove after GTS kernel is recompiled with change in CONFIG_PSAMPLE flag */ void psample_sample_packet(struct psample_group *group, struct sk_buff *skb, u32 trunc_size, int in_ifindex, int out_ifindex, u32 sample_rate) @@ -283,6 +284,7 @@ error: nlmsg_free(nl_skb); } EXPORT_SYMBOL_GPL(psample_sample_packet); +#endif static int __init psample_module_init(void) { diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/ksal.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/ksal.c index 2161b287f6..9c093e0eac 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/ksal.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/ksal.c @@ -196,9 +196,15 @@ sal_time_usecs(void) do_gettimeofday(<v); return (ltv.tv_sec * SECOND_USEC + ltv.tv_usec); #else +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) /* ktime_to_us and ktime_get_real_ns return 64-bit integets, but this */ /* function is returning a 32-bit integer. This should be fine until 2038. */ return ktime_to_us(ktime_get_real_ns()); +#else + struct timeval ltv; + do_gettimeofday(<v); + return (ltv.tv_sec * SECOND_USEC + ltv.tv_usec); +#endif #endif } diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/bmw-2_6/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/bmw-2_6/Makefile deleted file mode 100644 index 899c7b4053..0000000000 --- a/platform/broadcom/saibcm-modules/systems/linux/user/bmw-2_6/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# -*- Makefile -*- -# $Id: Makefile,v 1.4 Broadcom SDK $ -# $Copyright: (c) 2005 Broadcom Corp. -# All Rights Reserved.$ - -# -# This make job requires the following environment variables to be set: -# -# SDK - path to StrataXGS SDK root directory -# -# Optionally the following environment variables can be set to -# override the default build server configuration: -# -# PPC_TOOLS_DIR - path to build tools (if not in PATH already) -# PPC_CROSS_COMPILE - cross compile tools prefix -# LINUX_INCLUDE - path to Linux kernel include directory -# - -SDK :=$(shell if [ -n "$$SDK" ] ; then\ - echo $$SDK;\ - else\ - cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \ - dir=`cd ../;pwd`; \ - if [ "$$dir" = "/" ] ; then \ - echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \ - exit 1; \ - fi ; \ - cd $$dir; \ - done ; \ - pwd; \ - fi) - -ifeq ($(SDK),) -$(error Please run this in a tree) -endif - -export SDK - -override kernel_version=2_6 -platform=bmw-$(kernel_version) - -# Windriver linux version -#WRS_LINUX_VERSION=1.4 -#WRS_LINUX_VERSION=2.0 - -LINUX_MAKE_USER=1 -include ${SDK}/make/Make.linux - diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/gto-2_6/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/gto-2_6/Makefile deleted file mode 100644 index c157f9ff35..0000000000 --- a/platform/broadcom/saibcm-modules/systems/linux/user/gto-2_6/Makefile +++ /dev/null @@ -1,84 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# -*- Makefile -*- -# $Id: Makefile,v 1.9 Broadcom SDK $ -# $Copyright: (c) 2007 Broadcom Corp. -# All Rights Reserved.$ - -# -# This make job requires the following environment variables to be set: -# -# SDK - path to StrataXGS SDK root directory -# -# Optionally the following environment variables can be set to -# override the default build server configuration: -# -# PPC_TOOLS_DIR - path to build tools (if not in PATH already) -# PPC_CROSS_COMPILE - cross compile tools prefix -# LINUX_INCLUDE - path to Linux kernel include directory -# - -SDK :=$(shell if [ -n "$$SDK" ] ; then\ - echo $$SDK;\ - else\ - cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \ - dir=`cd ../;pwd`; \ - if [ "$$dir" = "/" ] ; then \ - echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \ - exit 1; \ - fi ; \ - cd $$dir; \ - done ; \ - pwd; \ - fi) - -ifeq ($(SDK),) -$(error Please run this in a tree) -endif - -export SDK - -override kernel_version=2_6 -platform=gto-$(kernel_version) -LINUX_MAKE_USER=1 -export LINKER_RELAX=1 - -# Select the build environment -#BUILD_PLATFORM=ELDK -#BUILD_PLATFORM=WR_LINUX - -#Select the LINUX KERNEL VERSION -#KERN_VER = 2.6.21.7 -#KERN_VER = 2.6.24.4 -#KERN_VER = 2.6.25 - - -# Select the ELDK version -#ELDK_VERSION=4.1 -#ELDK_VERSION=4.0 - -#Select WRS Linux version -#WRS_LINUX_VERSION=2.0 -#WRS_LINUX_VERSION=3.0 - - -export KERN_VER -export ELDK_VERSION -export BUILD_PLATFORM -export WRS_LINUX_VERSION - -include ${SDK}/make/Make.linux - diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/gto/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/gto/Makefile deleted file mode 100644 index fd98f6d2f9..0000000000 --- a/platform/broadcom/saibcm-modules/systems/linux/user/gto/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# -*- Makefile -*- -# $Id: Makefile,v 1.9 Broadcom SDK $ -# $Copyright: (c) 2015 Broadcom Corp. -# All Rights Reserved.$ - -# -# This make job requires the following environment variables to be set: -# -# SDK - path to StrataXGS SDK root directory -# -# Optionally the following environment variables can be set to -# override the default build server configuration: -# -# PPC_TOOLS_DIR - path to build tools (if not in PATH already) -# PPC_CROSS_COMPILE - cross compile tools prefix -# LINUX_INCLUDE - path to Linux kernel include directory -# - -SDK :=$(shell if [ -n "$$SDK" ] ; then\ - echo $$SDK;\ - else\ - cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \ - dir=`cd ../;pwd`; \ - if [ "$$dir" = "/" ] ; then \ - echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \ - exit 1; \ - fi ; \ - cd $$dir; \ - done ; \ - pwd; \ - fi) - -ifeq ($(SDK),) -$(error Please run this in a tree) -endif - -export SDK - -override kernel_version=4_4 -platform=gto -LINUX_MAKE_USER=1 -export LINKER_RELAX=1 - -include ${SDK}/make/Make.linux - diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/jag-2_6/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/jag-2_6/Makefile deleted file mode 100644 index 26a7f520f2..0000000000 --- a/platform/broadcom/saibcm-modules/systems/linux/user/jag-2_6/Makefile +++ /dev/null @@ -1,79 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# -*- Makefile -*- -# $Id: Makefile,v 1.4 Broadcom SDK $ -# $Copyright: (c) 2005 Broadcom Corp. -# All Rights Reserved.$ - -# -# This make job requires the following environment variables to be set: -# -# SDK - path to StrataXGS SDK root directory -# -# Optionally the following environment variables can be set to -# override the default build server configuration: -# -# MIPS_TOOLS_DIR - path to build tools (if not in PATH already) -# MIPS_CROSS_COMPILE - cross compile tools prefix -# LINUX_INCLUDE - path to Linux kernel include directory -# - -SDK :=$(shell if [ -n "$$SDK" ] ; then\ - echo $$SDK;\ - else\ - cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \ - dir=`cd ../;pwd`; \ - if [ "$$dir" = "/" ] ; then \ - echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \ - exit 1; \ - fi ; \ - cd $$dir; \ - done ; \ - pwd; \ - fi) - -ifeq ($(SDK),) -$(error Please run this in a tree) -endif - -export SDK - -override kernel_version=2_6 -platform=jag-$(kernel_version) - -# Select the build environment -#BUILD_PLATFORM=ELDK -#BUILD_PLATFORM=WR_LINUX - -#Select the LINUX KERNEL VERSION -#KERN_VER = 2.6.21.7 - - -# Select the ELDK version -#ELDK_VERSION=4.1 - -# Windriver linux version -#WRS_LINUX_VERSION=1.4 -#WRS_LINUX_VERSION=2.0 - -export KERN_VER -export ELDK_VERSION -export BUILD_PLATFORM -export WRS_LINUX_VERSION - -LINUX_MAKE_USER=1 -include ${SDK}/make/Make.linux - diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/nsx-2_6/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/nsx-2_6/Makefile deleted file mode 100644 index 881ec34c2d..0000000000 --- a/platform/broadcom/saibcm-modules/systems/linux/user/nsx-2_6/Makefile +++ /dev/null @@ -1,58 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# -*- Makefile -*- -# $Id: Makefile,v 1.4 Broadcom SDK $ -# $Copyright: (c) 2005 Broadcom Corp. -# All Rights Reserved.$ - -# -# This make job requires the following environment variables to be set: -# -# SDK - path to StrataXGS SDK root directory -# -# Optionally the following environment variables can be set to -# override the default build server configuration: -# -# MIPS_TOOLS_DIR - path to build tools (if not in PATH already) -# MIPS_CROSS_COMPILE - cross compile tools prefix -# LINUX_INCLUDE - path to Linux kernel include directory -# - -SDK :=$(shell if [ -n "$$SDK" ] ; then\ - echo $$SDK;\ - else\ - cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \ - dir=`cd ../;pwd`; \ - if [ "$$dir" = "/" ] ; then \ - echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \ - exit 1; \ - fi ; \ - cd $$dir; \ - done ; \ - pwd; \ - fi) - -ifeq ($(SDK),) -$(error Please run this in a tree) -endif - -export SDK - -override kernel_version=2_6 -platform=nsx-$(kernel_version) -LINUX_MAKE_USER=1 -include ${SDK}/make/Make.linux - diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/nsx64/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/nsx64/Makefile deleted file mode 100644 index 9e79d90fa9..0000000000 --- a/platform/broadcom/saibcm-modules/systems/linux/user/nsx64/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# -*- Makefile -*- -# $Id: Makefile,v 1.3 Broadcom SDK $ -# $Copyright: (c) 2005 Broadcom Corp. -# All Rights Reserved.$ - -# -# This make job requires the following environment variables to be set: -# -# SDK - path to StrataXGS SDK root directory -# -# Optionally the following environment variables can be set to -# override the default build server configuration: -# -# MIPS_TOOLS_DIR - path to build tools (if not in PATH already) -# MIPS_CROSS_COMPILE - cross compile tools prefix -# LINUX_INCLUDE - path to Linux kernel include directory -# - -SDK :=$(shell if [ -n "$$SDK" ] ; then\ - echo $$SDK;\ - else\ - cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \ - dir=`cd ../;pwd`; \ - if [ "$$dir" = "/" ] ; then \ - echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \ - exit 1; \ - fi ; \ - cd $$dir; \ - done ; \ - pwd; \ - fi) - -ifeq ($(SDK),) -$(error Please run this in a tree) -endif - -export SDK - -platform=nsx64 -LINUX_MAKE_USER=1 -include ${SDK}/make/Make.linux - diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/nsx_wrl-2_6/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/nsx_wrl-2_6/Makefile deleted file mode 100644 index 4e86843cdc..0000000000 --- a/platform/broadcom/saibcm-modules/systems/linux/user/nsx_wrl-2_6/Makefile +++ /dev/null @@ -1,65 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# -*- Makefile -*- -# $Id: Makefile,v 1.3 Broadcom SDK $ -# $Copyright: (c) 2005 Broadcom Corp. -# All Rights Reserved.$ - -# -# This make job requires the following environment variables to be set: -# -# SDK - path to StrataXGS SDK root directory -# -# Optionally the following environment variables can be set to -# override the default build server configuration: -# -# MIPS_TOOLS_DIR - path to build tools (if not in PATH already) -# MIPS_CROSS_COMPILE - cross compile tools prefix -# LINUX_INCLUDE - path to Linux kernel include directory -# - -SDK :=$(shell if [ -n "$$SDK" ] ; then\ - echo $$SDK;\ - else\ - cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \ - dir=`cd ../;pwd`; \ - if [ "$$dir" = "/" ] ; then \ - echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \ - exit 1; \ - fi ; \ - cd $$dir; \ - done ; \ - pwd; \ - fi) - -ifeq ($(SDK),) -$(error Please run this in a tree) -endif - -export SDK - -override kernel_version=2_6 -platform=nsx_wrl-$(kernel_version) - -# Windriver linux version -#WRS_LINUX_VERSION=1.4 -#WRS_LINUX_VERSION=2.0 - -export WRS_LINUX_VERSION - -LINUX_MAKE_USER=1 -include ${SDK}/make/Make.linux - diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/raptor-2_6/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/raptor-2_6/Makefile deleted file mode 100644 index 10ab1a1cc2..0000000000 --- a/platform/broadcom/saibcm-modules/systems/linux/user/raptor-2_6/Makefile +++ /dev/null @@ -1,79 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# -*- Makefile -*- -# $Id: Makefile,v 1.5 Broadcom SDK $ -# $Copyright: (c) 2007 Broadcom Corp. -# All Rights Reserved.$ - -# -# This make job requires the following environment variables to be set: -# -# SDK - path to StrataXGS SDK root directory -# -# Optionally the following environment variables can be set to -# override the default build server configuration: -# -# MIPS_TOOLS_DIR - path to build tools (if not in PATH already) -# MIPS_CROSS_COMPILE - cross compile tools prefix -# LINUX_INCLUDE - path to Linux kernel include directory -# - -SDK :=$(shell if [ -n "$$SDK" ] ; then\ - echo $$SDK;\ - else\ - cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \ - dir=`cd ../;pwd`; \ - if [ "$$dir" = "/" ] ; then \ - echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \ - exit 1; \ - fi ; \ - cd $$dir; \ - done ; \ - pwd; \ - fi) - -ifeq ($(SDK),) -$(error Please run this in a tree) -endif - -export SDK - -override kernel_version=2_6 -platform=raptor-$(kernel_version) - -# Select the build environment -#BUILD_PLATFORM=ELDK -#BUILD_PLATFORM=WR_LINUX - -#Select the LINUX KERNEL VERSION -#KERN_VER = 2.6.21.7 - - -# Select the ELDK version -#ELDK_VERSION=4.1 - -# Windriver linux version -#WRS_LINUX_VERSION=1.4 -#WRS_LINUX_VERSION=2.0 - -export KERN_VER -export ELDK_VERSION -export BUILD_PLATFORM -export WRS_LINUX_VERSION - -LINUX_MAKE_USER=1 -include ${SDK}/make/Make.linux - diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/raptor/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/raptor/Makefile deleted file mode 100644 index df8800a1a7..0000000000 --- a/platform/broadcom/saibcm-modules/systems/linux/user/raptor/Makefile +++ /dev/null @@ -1,58 +0,0 @@ -# -# Copyright 2017 Broadcom -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2, as -# published by the Free Software Foundation (the "GPL"). -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License version 2 (GPLv2) for more details. -# -# You should have received a copy of the GNU General Public License -# version 2 (GPLv2) along with this source code. -# -# -*- Makefile -*- -# $Id: Makefile,v 1.1 Broadcom SDK $ -# $Copyright: (c) 2005 Broadcom Corp. -# All Rights Reserved.$ - -# -# This make job requires the following environment variables to be set: -# -# SDK - path to StrataXGS SDK root directory -# -# Optionally the following environment variables can be set to -# override the default build server configuration: -# -# MIPS_TOOLS_DIR - path to build tools (if not in PATH already) -# MIPS_CROSS_COMPILE - cross compile tools prefix -# LINUX_INCLUDE - path to Linux kernel include directory -# - -SDK :=$(shell if [ -n "$$SDK" ] ; then\ - echo $$SDK;\ - else\ - cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \ - dir=`cd ../;pwd`; \ - if [ "$$dir" = "/" ] ; then \ - echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \ - exit 1; \ - fi ; \ - cd $$dir; \ - done ; \ - pwd; \ - fi) - -ifeq ($(SDK),) -$(error Please run this in a tree) -endif - -export SDK - -platform=raptor -LINUX_MAKE_USER=1 -CFGFLAGS += -DBCM_ICS -include ${SDK}/make/Make.linux - diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index d49a832aff..69279d0844 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -1,6 +1,6 @@ # Mellanox SAI -MLNX_SAI_VERSION = SAIRel1.21.1.1 +MLNX_SAI_VERSION = SAIRel1.21.1.0 export MLNX_SAI_VERSION diff --git a/platform/mellanox/mlnx-sai/SAI-Implementation b/platform/mellanox/mlnx-sai/SAI-Implementation index a01442acd9..d6eb22a12c 160000 --- a/platform/mellanox/mlnx-sai/SAI-Implementation +++ b/platform/mellanox/mlnx-sai/SAI-Implementation @@ -1 +1 @@ -Subproject commit a01442acd95e3a4f78a8e4b04b227fcbe905771e +Subproject commit d6eb22a12cc0f01e84a71d367f7c4ebe19f58a40 diff --git a/slave.mk b/slave.mk index 1a008640b4..72049cebf0 100644 --- a/slave.mk +++ b/slave.mk @@ -1370,7 +1370,7 @@ jessie : $$(addprefix $(TARGET_PATH)/,$$(JESSIE_DOCKER_IMAGES)) \ $$(addprefix $(TARGET_PATH)/,$$(JESSIE_DBG_DOCKER_IMAGES)) ############################################################################### -## Standard targets +## Standard targets ############################################################################### .PHONY : $(SONIC_CLEAN_DEBS) $(SONIC_CLEAN_FILES) $(SONIC_CLEAN_TARGETS) $(SONIC_CLEAN_STDEB_DEBS) $(SONIC_CLEAN_WHEELS) $(SONIC_PHONY_TARGETS) clean distclean configure diff --git a/src/sonic-sairedis b/src/sonic-sairedis index c7cbfe80df..f67bcddf15 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit c7cbfe80dfcb61deef483f6c99b1c21763134ab1 +Subproject commit f67bcddf15d315a01ac4f3fafe14e9db2231c195