openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

Makefile.linux-slk (4617B)


      1 #
      2 #  Copyright 2017 Broadcom
      3 #  
      4 #  This program is free software; you can redistribute it and/or modify
      5 #  it under the terms of the GNU General Public License, version 2, as
      6 #  published by the Free Software Foundation (the "GPL").
      7 #  
      8 #  This program is distributed in the hope that it will be useful, but
      9 #  WITHOUT ANY WARRANTY; without even the implied warranty of
     10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     11 #  General Public License version 2 (GPLv2) for more details.
     12 #  
     13 #  You should have received a copy of the GNU General Public License
     14 #  version 2 (GPLv2) along with this source code.
     15 #
     16 # $Id: Makefile.linux-slk-3_14,v 1.2 Broadcom SDK $
     17 # $Copyright: (c) 2013 Broadcom Corp.
     18 # All Rights Reserved.$
     19 # Makefile for SLK(BCM957812)
     20 
     21 # User must select one platform from below.By default ARM_LINUX is selected. .
     22 ifeq (,$(BUILD_PLATFORM))
     23 BUILD_PLATFORM=ARM_LINUX
     24 endif
     25 
     26 # Toolchain base directory for NS2 XMC card
     27 ifeq (BE,$(ENDIAN_MODE))
     28 TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/toolchains/slk/linaro-be
     29 TARGET_ARCHITECTURE:=aarch64_be-linux-gnu
     30 KERNDIR ?= /projects/ntsw-tools/linux/iproc_ldks/slk-be/poky/brcm-released-source/git
     31 else
     32 TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/toolchains/slk/linaro-le
     33 # Compiler for target architecture
     34 TARGET_ARCHITECTURE:= aarch64-linux-gnu
     35 # Kernel directory
     36 KERNDIR ?= /projects/ntsw-tools/linux/iproc_ldks/slk/poky/brcm-released-source/git
     37 endif
     38 
     39 ifeq (,$(CROSS_COMPILE))
     40 CROSS_COMPILE:= $(TARGET_ARCHITECTURE)-
     41 endif
     42 
     43 # armtools
     44 TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_BASE_DIR)/bin
     45 override PATH:=$(TOOLCHAIN_BIN_DIR):$(PATH)
     46 LD_LIBRARY_PATH=$(TOOLCHAIN_BASE_DIR)/lib
     47 
     48 export TOOLCHAIN_BIN_DIR LD_LIBRARY_PATH
     49 
     50 # Default Linux include directory
     51 ifeq (,$(LINUX_INCLUDE))
     52 LINUX_INCLUDE := $(KERNDIR)/include
     53 endif
     54 
     55 ifeq (BE,$(ENDIAN_MODE))
     56 CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1
     57 ENDIAN = BE_HOST=1
     58 else
     59 CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=0
     60 ENDIAN = LE_HOST=1
     61 endif
     62 
     63 CFGFLAGS += -D$(ENDIAN) -DBCM958525
     64 CFGFLAGS += -DBCM_PLATFORM_STRING=\"SLK_BCM957812\"
     65 CFGFLAGS += -DSAL_BDE_DMA_MEM_DEFAULT=32
     66 ifeq (1,$(SLK_32BIT))
     67 CFGFLAGS += -DSAL_BDE_32BIT_USER_64BIT_KERNEL
     68 else
     69 CFGFLAGS += -DPTRS_ARE_64BITS -DLONGS_ARE_64BITS
     70 endif
     71 CFGFLAGS += -DPHYS_ADDRS_ARE_64BITS
     72 
     73 CFLAGS += -Wno-unused-value -Wno-unused-but-set-variable -Wno-sizeof-pointer-memaccess -fno-aggressive-loop-optimizations
     74 
     75 ifdef DPP_CHIPS
     76 CFLAGS += -DDUNE_BCM -D__DUNE_LINUX_BCM_CPU_PCP_DMA__
     77 CFGFLAGS += -DSOC_CM_FUNCTION
     78 endif
     79 
     80 ifdef DFE_CHIPS
     81 CFLAGS += -DDUNE_BCM
     82 CFGFLAGS += -DSOC_CM_FUNCTION
     83 endif
     84 
     85 ifdef SAND_CHIPS
     86 CFLAGS += -D__DUNE_SLK_BCM_CPU__ -D__DUNE_LINUX_BCM_CPU_PCIE__
     87 endif
     88 
     89 # Enable cached DMA memory by default
     90 ifeq (,$(SAL_BDE_USE_CACHED_DMA_MEM))
     91 SAL_BDE_USE_CACHED_DMA_MEM = 1
     92 endif
     93 ifeq ($(SAL_BDE_USE_CACHED_DMA_MEM),1)
     94 CFGFLAGS += -DSAL_BDE_CACHE_DMA_MEM
     95 endif
     96 
     97 ifeq (1,$(SLK_32BIT))
     98 ARCH = arm
     99 else
    100 ARCH = arm64
    101 endif
    102 
    103 KBUILD_VERBOSE = 1
    104 
    105 export ARCH KBUILD_VERBOSE
    106 
    107 comma = ,
    108 basetarget = $(basename $(notdir $@))
    109 modname = $(basetarget)
    110 
    111 # Extra variables.
    112 EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
    113 
    114 name-fix = $(subst $(comma),_,$(subst -,_,$1))
    115 basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
    116 modname_flags  = $(if $(filter 1,$(words $(modname))),\
    117                  -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
    118 
    119 KFLAG_INCLD = $(TOOLCHAIN_BASE_DIR)/lib/gcc/$(TARGET_ARCHITECTURE)/4.9.2/include
    120 
    121 ifeq (,$(KFLAGS))
    122 KFLAGS := -D__LINUX_ARM_ARCH__=8 -D__KERNEL__ -DPTRS_ARE_64BITS -DLONGS_ARE_64BITS -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/generated/autoconf.h -I$(KERNDIR)/arch/arm64/include -I$(KERNDIR)/arch/arm64/include/generated -I$(KERNDIR)/arch/arm64/include/generated/asm -I$(KERNDIR)/include/uapi -I$(KERNDIR)/include/generated/uapi -I$(KERNDIR)/arch/arm64/include/uapi -Wall -Wstrict-prototypes -Wno-trigraphs -Os -fno-strict-aliasing -fno-common -fno-pic -pipe -ffreestanding -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign 
    123 endif
    124 
    125 ifdef LTSW_CHIPS
    126 # Default open source target build
    127 ifeq (BE,$(ENDIAN_MODE))
    128 OPENSRC_BUILD ?= linaro_arm64_be
    129 else
    130 OPENSRC_BUILD ?= linaro_arm64_le
    131 endif
    132 
    133 # Hardware interface (see $SDKLT/bcma/sys/probe directory)
    134 SYSTEM_INTERFACE ?= ngbde
    135 
    136 # Turn on direct register access if running on real hardware.
    137 ifeq (ngbde,$(SYSTEM_INTERFACE))
    138 LTSW_ADD_CPPFLAGS += -DBCMDRD_CONFIG_MEMMAP_DIRECT=1
    139 endif
    140 
    141 export SYSTEM_INTERFACE
    142 endif
    143 
    144 ifneq ($(targetplat),user)
    145 include ${SDK}/make/Makefile.linux-kernel-3_6
    146 endif