sonic-buildimage/platform/broadcom/saibcm-modules/sdklt/linux/knet/Makefile
vmittal-msft 04b9ce8e32
[BCMSAI] Update BCMSAI debian to 6.0.0.10 with 6.5.23 SDK, and opennsl module to 6.5.23 (#9046)
Manual verification on switch (TH3 device)
admin@str2-xxxxx-01:~$ bcmcmd bsv
bsv
BRCM SAI ver: [6.0.0.10], OCP SAI ver: [1.9.1], SDK ver: [sdk-6.5.23]
drivshell>

admin@str2-xxxxx-01:~$ bcmcmd version
version
Broadcom Command Monitor: Copyright (c) 1998-2021 Broadcom
Release: sdk-6.5.23 built 20211020 (Wed Oct 20 06:52:58 2021)
From root@fedbbfdbee81:/__w/2/s/output/x86-xgsall-deb/hsdk
Platform: X86
OS: Unix (Posix)
Chips:
BCM56640_A0,
BCM56850_A0,
BCM56340_A0,
BCM56960_A0, BCM56860_A0,

   BCM56970_A0, BCM56870_A0,
   BCM56980_A0, BCM56980_B0,
  
   BCM56370_A0, BCM56275_A0, BCM56770_A0,
Chips:
BCM56780_A0, BCM56782_A0, BCM56784_A0, BCM56785_A0,
BCM56786_A0, BCM56787_A0, BCM56788_A0, BCM56789_A0,
BCM56880_A0, BCM56880_B0, BCM56881_A0, BCM56881_B0,
BCM56883_A0, BCM56883_B0, BCM56990_A0, BCM56990_B0,
BCM56991_B0, BCM56992_B0, BCM56996_A0, BCM56996_B0,
BCM56997_A0, BCM56997_B0

Variant drivers:
BCM56780_A0_CNA_1_2_10, BCM56780_A0_DNA_2_7_6_0, BCM56880_A0_CNA_1_2_9, BCM56880_A0_DNA_4_9_5_0
PHYs: BCM5400, BCM54182, BCM54185, BCM54180,
BCM54140, BCM54192, BCM54195, BCM54190,
BCM54194, BCM54210, BCM54220, BCM54280,
BCM54282, BCM54240, BCM54285, BCM5428X,
BCM54290, BCM54292, BCM54294, BCM54295,
BCM54296, BCM56160-GPHY, BCM53540-GPHY, BCM56275-GPHY,
BCM8750, BCM8752, BCM8754, BCM84740,
BCM84164, BCM84758, BCM84780, BCM84784,
BCM84318, BCM84328, Sesto, BCM82780,
copper sfp

drivshell>
2021-10-28 00:12:32 -07:00

109 lines
3.2 KiB
Makefile

# -*- Makefile -*-
#
# Linux KNET module.
#
# $Copyright: Copyright 2018-2021 Broadcom. All rights reserved.
# The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries.
#
# 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.
#
# 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 for more details.
#
# A copy of the GNU General Public License version 2 (GPLv2) can
# be found in the LICENSES folder.$
#
CNETDIR = $(SDK)/bcmcnet
KNETDIR = $(SDK)/linux/knet
SRCIDIR = $(CNETDIR)/include/bcmcnet
DSTIDIR = $(KNETDIR)/include/bcmcnet
# Change comma-separated list to space-separated list
comma = ,
empty =
space = $(empty) $(empty)
spc_sep = $(subst $(comma),$(space),$1)
# Convert chip name to uppercase
chip_uc = $(subst a,A,$(subst b,B,$(subst c,C,$(subst m,M,$1))))
# Convert chip name to lowercase
chip_lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst M,m,$1))))
#
# If SDK_CHIPS is defined, then exclude any chip directory which is
# not part of this list.
#
KNET_CHIPS := $(subst $(CNETDIR)/chip/,,$(wildcard $(CNETDIR)/chip/bcm*))
ifdef SDK_CHIPS
# Create space-separated lowercase version of chip list
SDK_CHIPS_SPC := $(call spc_sep,$(SDK_CHIPS))
SDK_CHIPS_LC := $(call chip_lc,$(SDK_CHIPS_SPC))
# Configure build flags according to chip list
KNET_CHIPS := $(filter $(SDK_CHIPS_LC),$(KNET_CHIPS))
KNET_CPPFLAGS := CHIP_DEFAULT=0 $(addsuffix =1,$(call chip_uc,$(KNET_CHIPS)))
KNET_CPPFLAGS := $(addprefix -DBCMDRD_CONFIG_INCLUDE_,$(KNET_CPPFLAGS))
export KNET_CPPFLAGS
endif
.PHONY: mklinks rmlinks
knet: mklinks
$(MAKE) all
#
# Suppress symlink error messages.
#
# Note that we do not use "ln -f" as this may cause failures if
# multiple builds are done in parallel on the same source tree.
#
R = 2>/dev/null
mklinks:
mkdir -p $(DSTIDIR)
-ln -s $(KNETDIR)/ngknet_dep.h $(DSTIDIR)/bcmcnet_dep.h $(R)
-ln -s $(KNETDIR)/ngknet_buff.h $(DSTIDIR)/bcmcnet_buff.h $(R)
-ln -s $(SRCIDIR)/bcmcnet_types.h $(DSTIDIR) $(R)
-ln -s $(SRCIDIR)/bcmcnet_internal.h $(DSTIDIR) $(R)
-ln -s $(SRCIDIR)/bcmcnet_core.h $(DSTIDIR) $(R)
-ln -s $(SRCIDIR)/bcmcnet_dev.h $(DSTIDIR) $(R)
-ln -s $(SRCIDIR)/bcmcnet_rxtx.h $(DSTIDIR) $(R)
-ln -s $(SRCIDIR)/bcmcnet_cmicd.h $(DSTIDIR) $(R)
-ln -s $(SRCIDIR)/bcmcnet_cmicx.h $(DSTIDIR) $(R)
-ln -s $(SRCIDIR)/bcmcnet_cmicr.h $(DSTIDIR) $(R)
-ln -s $(SRCIDIR)/bcmcnet_cmicr_acc.h $(DSTIDIR) $(R)
-ln -s $(CNETDIR)/chip/*/*attach.c $(KNETDIR) $(R)
-ln -s $(CNETDIR)/hmi/cmicd/*.c $(KNETDIR) $(R)
-ln -s $(CNETDIR)/hmi/cmicx/*.c $(KNETDIR) $(R)
-ln -s $(CNETDIR)/hmi/cmicr/*.c $(KNETDIR) $(R)
-ln -s $(CNETDIR)/main/bcmcnet_core.c $(KNETDIR) $(R)
-ln -s $(CNETDIR)/main/bcmcnet_dev.c $(KNETDIR) $(R)
-ln -s $(CNETDIR)/main/bcmcnet_rxtx.c $(KNETDIR) $(R)
rmlinks:
-rm -f bcm*
-rm -rf include
CHIP_SRCS := $(addsuffix _pdma_attach.c,$(KNET_CHIPS))
CHIP_OBJS ?= $(patsubst %.c, %.o, $(CHIP_SRCS))
export CHIP_OBJS
include Kbuild
ifeq ($(KERNELRELEASE),)
MOD_NAME = linux_ngknet
include $(SDK)/make/lkm.mk
endif
.PHONY: distclean
distclean: rmlinks