forked from jarsy/bcm-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.linux-gtr-2_6
executable file
·116 lines (88 loc) · 4.52 KB
/
Makefile.linux-gtr-2_6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# $Id: Makefile.linux-gtr-2_6,v 1.5 Broadcom SDK $
# $Copyright: (c) 2016 Broadcom.
# Broadcom Proprietary and Confidential. All rights reserved.$
# User must select one platform from below.By default WR_LINUX is selected. .
ifeq (,$(BUILD_PLATFORM))
BUILD_PLATFORM=WR_LINUX
endif
# Specify the KERNEL VERSION you want to use for building SDK.
ifeq (,$(KERN_VER))
KERN_VER=2.6.32.9
endif
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips64-nlm-linux-
endif
XMC ?= /projects/ntsw-tools/toolchains/xlp316/sdk-base
KERNDIR ?= $(XMC)/linux
TOOLCHAINS_DIR=$(XMC)/toolchains_bin
TOOLCHAIN_EXEC_PREFIX=$(XMC)/toolchains_bin/mipscross/elf
TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_EXEC_PREFIX)/bin
override PATH := $(TOOLCHAIN_EXEC_PREFIX)/bin:$(TOOLCHAINS_DIR)/mipscross/linux/bin:$(PATH)
export TOOLCHAIN_EXEC_PREFIX 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=\"GTR_XLP316\"
CFGFLAGS += -DSAL_BDE_XLP
CFGFLAGS += -DSAL_BDE_32BIT_USER_64BIT_KERNEL
CFGFLAGS += -DSAL_BDE_USE_MMAP2
CFGFLAGS += -DSAL_BDE_DMA_MEM_DEFAULT=16
# Enable cached DMA memory by default
ifeq (,$(SAL_BDE_USE_CACHED_DMA_MEM))
SAL_BDE_USE_CACHED_DMA_MEM = 1
endif
ifeq ($(SAL_BDE_USE_CACHED_DMA_MEM),1)
CFGFLAGS += -DSAL_BDE_CACHE_DMA_MEM
endif
# Extra variables.
EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
ARCH = mips
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)))")
CFLAGS += -mabi=32
#CFLAGS += -mabi=64 -DPTRS_ARE_64BITS -DLONGS_ARE_64BITS
MODULE_LDFLAGS += -m elf64btsmip
ifdef SBX_CHIPS
CFLAGS += -DBDE_LINUX_NON_INTERRUPTIBLE
endif
ifdef DPP_CHIPS
CFLAGS += -DDUNE_BCM -D__DUNE_GTR_BCM_CPU__ -D__DUNE_LINUX_BCM_CPU_PCIE__ -D__DUNE_LINUX_BCM_CPU_PCP_DMA__
CFGFLAGS += -DSOC_CM_FUNCTION
endif
ifdef DFE_CHIPS
CFLAGS += -DDUNE_BCM -D__DUNE_GTR_BCM_CPU__ -D__DUNE_LINUX_BCM_CPU_PCIE__
CFGFLAGS += -DSOC_CM_FUNCTION
endif
ifdef SHADOW_PLX
CFLAGS += -DBCM_PLX9656_LOCAL_BUS -DBDE_LINUX_NON_INTERRUPTIBLE -DSHADOW_SVK
endif
#Is the XMC SDK VERSION >= 2.3 ?
ifneq (,$(findstring /sdk-base-2.3,$(XMC)))
LD_LIBRARY_PATH = $(XMC)/toolchains_bin/mipscross/elf/mips64-nlm-elf/lib
KFLAG_INCLD = $(XMC)/toolchains_bin/mipscross/elf/lib/gcc/mips64-nlm-elf/4.6.1/include
ifeq (,$(KFLAGS))
KFLAGS := -march=xlp -mabi=64 -DABI_64 -msym32 -fno-pic -G 0 -mno-abicalls -mlong-calls -mplt -DSAL_BDE_XLP -DSAL_BDE_32BIT_USER_64BIT_KERNEL -DPTRS_ARE_64BITS -DLONGS_ARE_64BITS -D__KERNEL__ -DNLM_HAL_NETLBOOT -DNLM_HAL_LINUX_KERNEL -nostdinc -isystem $(KFLAG_INCLD) -include $(LINUX_INCLUDE)/linux/version.h -include $(LINUX_INCLUDE)/generated/autoconf.h -I$(LINUX_INCLUDE) -I$(LINUX_INCLUDE)/config -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips/include -I$(KERNDIR)/arch/mips/include/asm/mach-netlogic -I$(KERNDIR)/arch/mips/include/asm/mach-generic -I$(KERNDIR)/include/asm-mips -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -msoft-float -pipe -funit-at-a-time -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign
endif
else
LD_LIBRARY_PATH = $(XMC)/toolchains_bin/mipscross/elf/i686-pc-linux-gnu/mips64-nlm-elf/lib
KFLAG_INCLD = $(XMC)/toolchains_bin/mipscross/elf/lib/gcc/mips64-nlm-elf/4.4.5/include
ifeq (,$(KFLAGS))
KFLAGS := -march=xlp -mabi=64 -DABI_64 -msym32 -fno-pic -G 0 -mno-abicalls -mlong-calls -mplt -DSAL_BDE_XLP -DSAL_BDE_32BIT_USER_64BIT_KERNEL -DPTRS_ARE_64BITS -DLONGS_ARE_64BITS -D__KERNEL__ -Wp, -DNLM_HAL_NETLBOOT -DNLM_HAL_LINUX_KERNEL -nostdinc -isystem $(KFLAG_INCLD) -include $(LINUX_INCLUDE)/linux/version.h -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(LINUX_INCLUDE) -I$(LINUX_INCLUDE)/config -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips/include -I$(KERNDIR)/arch/mips/include/asm/mach-netlogic -I$(KERNDIR)/arch/mips/include/asm/mach-generic -I$(KERNDIR)/include/asm-mips -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -msoft-float -pipe -funit-at-a-time -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign
endif
endif
export LD_LIBRARY_PATH
ifneq ($(targetplat),user)
include ${SDK}/make/Makefile.linux-kernel-2_6
endif