sonic-buildimage/platform/broadcom/saibcm-modules/make/Makefile.linux-xlr
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

205 lines
7.6 KiB
Makefile

#
# Copyright 2007-2020 Broadcom Inc. All rights reserved.
#
# Permission is granted to use, copy, modify and/or distribute this
# software under either one of the licenses below.
#
# License Option 1: GPL
#
# 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.
#
#
# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license
#
# This software is governed by the Broadcom Open Network Switch APIs license:
# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa
#
# $Id: Makefile.linux-xlr-4_19,v 0.1 Broadcom SDK $
# $Copyright: (c) 2015 Broadcom Corp.
# All Rights Reserved.$
#
# XLR system make file.
#
# Most of this was taken from target x86-smp_generic_64-2_6.
#
#############################################################################
# this segment is custom and not sourced from any existing makefile #
# (base thanks to http:<slash><slash>confluence.broadcom.com/display/NTSWSW/X86+System) #
#############################################################################
# set up a basic feature list. tcl, etc. #
#ifeq (,$(FEATURE_LIST))
#FEATURE_LIST = TCL BFD PTP CINT L3 I2C MEM_SCAN EDITLINE BCM_SAL_PROFILE CUSTOMER TEST CHASSIS MSTP RCPU
#endif
# some basic path variables for tools and kernel source, etc #
XLR_TOOLS_BASE = /projects/ntsw-tools/linux/xlr-54
TOOLCHAIN_DIR = $(XLR_TOOLS_BASE)/buildroot/host/usr
KERNDIR = $(XLR_TOOLS_BASE)/kernel/linux
# Target machine for EDK-Host defconfig
TARGET_MACHINE ?= x86_64
# set up cross compile prefix, tools dir variables. #
export CROSS_COMPILE := x86_64-broadcom-linux-gnu-
export TOOLS_DIR := $(TOOLCHAIN_DIR)/bin
# architecture. #
ARCH = x86_64
TARGET_ARCHITECTURE = x86_64-broadcom-linux-gnu
# Noisy kernel build
KBUILD_VERBOSE = 1
export ARCH KBUILD_VERBOSE
# set up paths. #
export LIBRARY_PATH := $(TOOLCHAIN_DIR)/lib:$(TOOLCHAIN_DIR)/lib64:$(LIBRARY_PATH)
export PATH := $(TOOLCHAIN_DIR)/bin:$(KERNDIR):$(PATH)
# set up SYSINC path #
CROSS_GCC_VER ?= $(shell $(TOOLCHAIN_DIR)/bin/$(CROSS_COMPILE)gcc -dumpversion)
export SYSINC := $(TOOLCHAIN_DIR)/lib/gcc/$(TARGET_ARCHITECTURE)/$(CROSS_GCC_VER)/include
# Glibc 2.27 or later version doesn't support SVID libm error handling.
# Building tcl 8.3.3 with the new toolchain will occur errors.
export TCL840 := 1
# Common CFLAGS
CFLAGS += -DUSE_LINUX_BDE_MMAP=1
#CFLAGS += -DBDE_LINUX_USE_MSI_INTERRUPT
CFLAGS += -Wno-error=unused-value
CFLAGS += -Wno-error=unused-function
CFLAGS += -Wno-error=cpp
CFLAGS += -Wno-error=array-bounds
CFLAGS += -Wno-error=strict-overflow
CFLAGS += -L$(TOOLCHAIN_DIR)/lib
CFLAGS += -L$(TOOLCHAIN_DIR)/lib64
#CFLAGS += -Wl,--rpath=/lib64 # may need to set rpath and dynamic-linker path here (and possibly in KLFAGS below) in the future, #
#CFLAGS += -Wl,--dynamic-linker=/lib64/ld-linux-x86-64.so.2 # if we want to build the target executable to be used with shared libs #
# Compiler-specific CFLAGS
ifeq (1,$(USE_CLANG)) # CLANG-specific CFLAGS
CFLAGS += -Wno-strlcpy-strlcat-size
CFLAGS += -Wno-strncat-size
else # GCC-specific CFLAGS
CFLAGS += -Wno-error=unused-but-set-variable
CFLAGS += -Wno-error=maybe-uninitialized
CFLAGS += -Wno-error=aggressive-loop-optimizations
CFLAGS += -Wno-error=sizeof-pointer-div #SDK-233830
CFLAGS += -Wno-error=memset-elt-size #SDK-232626
ifeq "$(shell expr `echo $(CROSS_GCC_VER) | cut -f1 -d.` \>= 8)" "1"
CFLAGS += -Wno-stringop-overflow
CFLAGS += -Wno-stringop-truncation
CFLAGS += -Wno-error=restrict
endif
ifeq "$(shell expr `echo $(CROSS_GCC_VER) | cut -f1 -d.` \>= 9)" "1"
CFLAGS += -Wno-address-of-packed-member
endif
ifeq "$(shell expr `echo $(CROSS_GCC_VER) | cut -f1 -d.` \== 10)" "1"
#There might be a bug in GCC10 that cannot detect initialization correctly.
CFLAGS += -Wno-error=uninitialized
CFLAGS += -Wno-error=format-overflow
CFLAGS += -fcommon
endif
endif # Compiler-specific CFLAGS
#XLDK-568 fix inline references
CFGFLAGS += -fgnu89-inline
#XLR-54
CFLAGS += -Wno-unused-variable #SDK-232993
CFLAGS += -Wno-deprecated-declarations #SDK-233174
#CFLAGS += -Wno-unused-function
#CFLAGS += -Wno-aggressive-loop-optimizations
#CFLAGS += -Wno-maybe-uninitialized
# set up KFLAGS appropriately. #
ifeq (,$(KFLAGS))
KFLAGS := -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib64 -I$(KERNDIR) -lc -nostdinc -isystem $(SYSINC) -Iinclude -I$(KERNDIR)/arch/x86/include -I$(KERNDIR)/arch/x86/include/generated -I$(KERNDIR)/arch/x86/include/generated/uapi -I$(KERNDIR)/arch/x86/include/uapi -I$(KERNDIR)/include -I$(KERNDIR)/include/generated -I$(KERNDIR)/include/generated/uapi -I$(KERNDIR)/include/uapi -include $(KERNDIR)/include/generated/autoconf.h -D__KERNEL__ -DNDEBUG -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Wno-format-security -fno-delete-null-pointer-checks -Os -mno-sse -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -fno-dwarf2-cfi-asm -fconserve-stack
endif
######################################################################
# this segment comes from make/Makefile.linux-x86-smp_generic_64-2_6 #
######################################################################
CFGFLAGS += -DLONGS_ARE_64BITS
CFGFLAGS += -DPTRS_ARE_64BITS
CFGFLAGS += -DPHYS_ADDRS_ARE_64BITS
CFGFLAGS += -DSAL_SPL_LOCK_ON_IRQ
##############################################################
# This segment comes from make/Makefile.linux-x86-common-2_6 #
##############################################################
CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=0
ENDIAN = LE_HOST=1
CFGFLAGS += -D$(ENDIAN)
CFGFLAGS += -DBCM_PLATFORM_STRING=\"X86\"
CFGFLAGS += -DSAL_BDE_DMA_MEM_DEFAULT=32
# Extra variables.
EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
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)))")
ifdef LTSW_CHIPS
# Ensure we do not use an out-of-date libelf.so
ELFUTILS_MIN = 158
ELFUTILS_DIR ?= /projects/ntsw-tools/lib
# Default open source target build
OPENSRC_BUILD ?= fed21-x86_64
# Hardware interface (see $SDKLT/bcma/sys/probe directory)
SYSTEM_INTERFACE ?= ngbde
# Support BCMSIM in the same build
ifeq (1,$(BCM_SIM_PATH_SUPPORT))
EXTRA_SYSTEM_INTERFACES = plisim
endif
# Turn on direct register access if running on real hardware.
ifeq (ngbde,$(SYSTEM_INTERFACE))
# Except if using multiple probe interfaces
ifeq (,$(EXTRA_SYSTEM_INTERFACES))
LTSW_ADD_CPPFLAGS += -DBCMDRD_CONFIG_MEMMAP_DIRECT=1
endif
endif
export SYSTEM_INTERFACE
export EXTRA_SYSTEM_INTERFACES
endif
ifneq (, $(EDKHOST))
# Default open source target build
OPENSRC_BUILD ?= fed21-x86_64
endif
ifneq ($(targetplat),user)
# By default we exclude -Werror from x86 kernel builds
BCM_CFLAGS = -Wall
include ${SDK}/make/Makefile.linux-kernel-2_6
endif