blob: eae540a812de51940954a71939915dc97c153bfa [file] [log] [blame]
Yue Lunf564a1f2014-01-07 15:54:34 +08001#CPU=mips
Yue Lun03a82d92013-10-21 10:15:02 +08002
3OS=linux
4
Vasudevan Murugesanf5fe7492015-06-10 19:45:37 +05305ifeq ($(KVER),$(filter 3.14%,$(KVER)))
lunyd975a202014-05-15 22:17:17 +08006OS_VER=3_14
7endif
8
Liu Zhongjianf8134e92016-09-21 14:42:01 +08009ifeq ($(KVER),$(filter 4.4%,$(KVER)))
10OS_VER=4_4
11endif
Luo Jie26116592017-06-06 15:59:46 +080012
13ifeq ($(KVER),$(filter 4.1%,$(KVER)))
14OS_VER=4_1
15endif
16
Yue Lunf564a1f2014-01-07 15:54:34 +080017ifeq ($(KVER), 3.4.0)
Yue Lundd6e3d92013-10-25 13:03:31 +080018OS_VER=3_4
Yue Lunf564a1f2014-01-07 15:54:34 +080019endif
20
Ram Chandra Jangir88dfc382015-09-04 11:50:17 +053021ifeq ($(KVER), 3.18)
22OS_VER=3_18
23endif
24
Ram Chandra Jangir511c9a42015-09-25 19:25:57 +053025ifeq ($(KVER), 3.18.21)
Ram Chandra Jangir88dfc382015-09-04 11:50:17 +053026OS_VER=3_18
27endif
28
Yili Zhaob8db20b2014-10-17 18:29:06 -070029ifeq ($(KVER), 3.4.103)
30OS_VER=3_4
31endif
32
Yue Lunf564a1f2014-01-07 15:54:34 +080033ifeq ($(KVER), 3.3.8)
34OS_VER=3_2
35endif
36
37ifeq ($(ARCH), arm)
38BOARD=ipq806x
39endif
40
41ifeq ($(ARCH), mips)
42BOARD=ar71xx
43endif
44
45ifeq ($(BOARD), ar71xx)
46BOARD_NAME=BOARD_AR71XX
47endif
48
49ifeq ($(BOARD), ipq806x)
50BOARD_NAME=BOARD_IPQ806X
51endif
52
Yue Lundd6e3d92013-10-25 13:03:31 +080053OS_SUB=31
Yue Lundd6e3d92013-10-25 13:03:31 +080054
Yue Lun03a82d92013-10-21 10:15:02 +080055ifndef OS_VER
56OS_VER=2_6
57endif
58# OS subversion, 2.6.31 for WASP (db120)
59#OS_SUB=31
60# GCC version, 3 or 4
61#GCC_VER=4
62
63#For MIPS Linux2.6
64 #pb45
65 #TOOL_PATH=/disk/pb45/sw/build/gcc-3.4.4-2.16.1/build_mips_nofpu/bin
66 #SYS_PATH=/disk/pb45/sw/linux/kernels/mips-linux-2.6.15
Ram Chandra Jangir963e4d22015-12-21 20:53:40 +053067
Yue Lun03a82d92013-10-21 10:15:02 +080068 #ap81
69# compatiable with OpenWRT
Ram Chandra Jangir963e4d22015-12-21 20:53:40 +053070ifndef TOOL_PATH
Yue Lun03a82d92013-10-21 10:15:02 +080071TOOL_PATH=/disk/ap81fus/sw/build/gcc-3.4.4-2.16.1/build_mips/bin
72endif
Ram Chandra Jangir963e4d22015-12-21 20:53:40 +053073ifndef SYS_PATH
Yue Lun03a82d92013-10-21 10:15:02 +080074SYS_PATH=/disk/ap81fus/sw/linux/kernels/mips-linux-2.6.15
75endif
76ifeq ($(ARCH), mips)
Zou Shunxiang0b4f1422014-04-17 13:59:28 +080077 CPU_CFLAG=-Wstrict-prototypes -fomit-frame-pointer -G 0 -mno-abicalls -fno-common -fno-strict-aliasing -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB -D$(BOARD_NAME)
Yue Lun03a82d92013-10-21 10:15:02 +080078endif
79
80
81#db120
82ifeq ($(BOARD_TYPE),db12x)
83OS_SUB=31
84GCC_VER=4
85TOOL_PATH=$(TOPDIR)/build/gcc-4.3.3/build_mips/staging_dir/usr/bin
86SYS_PATH=$(TOPDIR)/linux/kernels/mips-linux-2.6.31
87CPU_CFLAG=-Wstrict-prototypes -fomit-frame-pointer -G 0 -mno-abicalls -fno-strict-aliasing -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB
88endif
89
90ifeq ($(ARCH), arm)
lunyd975a202014-05-15 22:17:17 +080091ifeq ($(KVER), 3.4.0)
Yue Lunf564a1f2014-01-07 15:54:34 +080092 CPU_CFLAG=-D__LINUX_ARM_ARCH__=7 -DMODULE -fno-common -DCONFIG_MMU -D$(BOARD_NAME)
Yue Lun03a82d92013-10-21 10:15:02 +080093endif
Yili Zhaob8db20b2014-10-17 18:29:06 -070094ifeq ($(KVER), 3.4.103)
95 CPU_CFLAG=-D__LINUX_ARM_ARCH__=7 -DMODULE -fno-common -DCONFIG_MMU -D$(BOARD_NAME)
96endif
Ram Chandra Jangir511c9a42015-09-25 19:25:57 +053097ifeq ($(KVER), 3.18.21)
Ram Chandra Jangir88dfc382015-09-04 11:50:17 +053098 CPU_CFLAG=-D__LINUX_ARM_ARCH__=7 -DMODULE -fno-common -DCONFIG_MMU -D$(BOARD_NAME)
99endif
Liu Zhongjianf8134e92016-09-21 14:42:01 +0800100ifeq ($(KVER),$(filter 4.4%,$(KVER)))
101 CPU_CFLAG=-D__LINUX_ARM_ARCH__=7 -DMODULE -fno-common -DCONFIG_MMU -D$(BOARD_NAME)
102endif
Ram Chandra Jangir88dfc382015-09-04 11:50:17 +0530103
Vasudevan Murugesanf5fe7492015-06-10 19:45:37 +0530104ifeq ($(KVER),$(filter 3.14%,$(KVER)))
xiaofeisccdee9c2016-03-07 21:01:03 +0800105 CPU_CFLAG= -DMODULE -nostdinc -D$(BOARD_NAME) -mlittle-endian -Wundef -Wstrict-prototypes -Wno-trigraphs -Werror -fno-strict-aliasing -fno-common -Wno-format-security -fno-delete-null-pointer-checks -O2 -fno-dwarf2-cfi-asm -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -DCC_HAVE_ASM_GOTO -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(mem)"
lunyd975a202014-05-15 22:17:17 +0800106endif
Ram Chandra Jangir88dfc382015-09-04 11:50:17 +0530107
Liu Zhongjianf8134e92016-09-21 14:42:01 +0800108ifeq ($(KVER),$(filter 4.4%,$(KVER)))
mingxinh5451c452017-04-06 14:21:35 +0800109 CPU_CFLAG= -DMODULE -nostdinc -D$(BOARD_NAME) -mlittle-endian -Wundef -Wstrict-prototypes -Wno-trigraphs -Werror -fno-strict-aliasing -fno-common -Wno-format-security -fno-delete-null-pointer-checks -O2 -fno-dwarf2-cfi-asm -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -DCC_HAVE_ASM_GOTO -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(mem)"
Liu Zhongjianf8134e92016-09-21 14:42:01 +0800110endif
111
Ram Chandra Jangir88dfc382015-09-04 11:50:17 +0530112ifeq ($(KVER),$(filter 3.18%,$(KVER)))
xiaofeis9ebb3ff2016-02-29 16:49:31 +0800113 CPU_CFLAG= -DMODULE -nostdinc -D$(BOARD_NAME) -mlittle-endian -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Wno-format-security -fno-delete-null-pointer-checks -O2 -fno-dwarf2-cfi-asm -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -DCC_HAVE_ASM_GOTO -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(mem)"
Ram Chandra Jangir88dfc382015-09-04 11:50:17 +0530114endif
lunyd975a202014-05-15 22:17:17 +0800115endif
Yue Lun03a82d92013-10-21 10:15:02 +0800116
mingxinh7458b242017-02-21 18:30:24 +0800117ifeq ($(ARCH), arm64)
118ifeq ($(KVER),$(filter 4.4%,$(KVER)))
119 CPU_CFLAG= -DMODULE -Os -pipe -march=armv8-a -mcpu=cortex-a53+crypto -fno-caller-saves -fhonour-copts -fno-common -Wno-error=unused-but-set-variable -Wno-error=unused-result -mcmodel=large
120endif
Luo Jie26116592017-06-06 15:59:46 +0800121ifeq ($(KVER),$(filter 4.1%,$(KVER)))
122 CPU_CFLAG= -DMODULE -Os -pipe -march=armv8-a -mcpu=cortex-a53+crypto -fno-caller-saves -fno-common -Wno-error=unused-but-set-variable -Wno-error=unused-result -mcmodel=large
123endif
mingxinh7458b242017-02-21 18:30:24 +0800124endif
125
Yue Lun03a82d92013-10-21 10:15:02 +0800126ifeq ($(BOARD_TYPE), ap136)
127OS_SUB=31
128GCC_VER=4
129TOOL_PATH=$(TOPDIR)/build/gcc-4.3.3/build_mips/staging_dir/usr/bin
130SYS_PATH=$(TOPDIR)/linux/kernels/mips-linux-2.6.31
131CPU_CFLAG=-Wstrict-prototypes -fomit-frame-pointer -G 0 -mno-abicalls -fno-strict-aliasing -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB
132endif
133
134#For MIPS Linux2.4
135 #TOOL_PATH=/home/perforce/kernel2.4/5.3.1.20/tools/gcc-3.3.3-2.4.25/toolchain_mips/bin
136 #SYS_PATH=/home/perforce/kernel2.4/5.3.1.20/src/kernels/mips-linux-2.4.25
137
138 #TOOLPREFIX=$(CPU)-$(OS)-
139 #CPU_CFLAG=-Wstrict-prototypes -Wundef -fomit-frame-pointer -G 0 -mno-abicalls -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2 -fno-pic -pipe -mabi=32 -march=r4600 -Wa,-32 -Wa,-march=r4600 -Wa,--trap -DMODULE -mlong-calls -DEXPORT_SYMTAB
140
Luo Jie82b4a882017-06-29 20:50:18 +0800141ifeq ($(SWCONFIG_FEATURE), disable)
142SWCONFIG=FALSE
143else
144SWCONFIG=TRUE
145endif
146
Yue Lun03a82d92013-10-21 10:15:02 +0800147KERNEL_MODE=TRUE
148#compatiable with OpenWRT
149ifeq ($(SWITCH_SSDK_MODE),user)
150KERNEL_MODE=FLASE
151endif
152
153#FAL=FALSE or not define FAL, FAL will not be included in SSDK
Yue Lundd6e3d92013-10-25 13:03:31 +0800154FAL=TRUE
Yue Lun03a82d92013-10-21 10:15:02 +0800155
mingxinh7458b242017-02-21 18:30:24 +0800156#CHIP_TYPE can be defined as ATHENA, GARUDA, SHIVA, HORUS, ISIS, ISISC, DESS, HPPE and ALL_CHIP(ALL_CHIP means GARUDA, SHIVA, HORUS, ISIS, ISISC, DESS and HPPE)
Zou Shunxiang0b4f1422014-04-17 13:59:28 +0800157CHIP_TYPE=ALL_CHIP
Yue Lun03a82d92013-10-21 10:15:02 +0800158
159#UK_IF=FALSE or not define UK_IF, UK_IF will not be included in SSDK
160#when UK_IF=TRUE one of UK_NETLINK,UK_IOCTL must be defined as TRUE
161UK_IF=TRUE
162#UK_IOCTL=TRUE define user-kernel space communication based on ioctl
163UK_IOCTL=TRUE
164UK_MINOR_DEV=254
165
166#API_LOCK=FALSE or not define API_LOCK, API_LOCK will not be included in SSDK
167API_LOCK=FALSE
168
169#REG_ACCESS_SPEEDUP=FALSE or not define REG_ACCESS_SPEEDUP, REG_ACCESS_SPEEDUP will not be enabled, now only ISIS supports
170REG_ACCESS_SPEEDUP=FALSE
171
172#ALL supported features:
173#ACL FDB IGMP LEAKY LED MIB MIRROR MISC PORTCONTROL PORTVLAN QOS RATE STP VLAN
174#IN_X=FALSE or not define IN_X, X will not be included in SSDK
175IN_ACL=TRUE
176IN_FDB=TRUE
xiaofeis3237f352015-10-30 15:38:20 +0800177IN_FDB_MINI=FALSE
Yue Lun03a82d92013-10-21 10:15:02 +0800178IN_IGMP=TRUE
179IN_LEAKY=TRUE
180IN_LED=TRUE
181IN_MIB=TRUE
182IN_MIRROR=TRUE
183IN_MISC=TRUE
xiaofeis3237f352015-10-30 15:38:20 +0800184IN_MISC_MINI=FALSE
Yue Lun03a82d92013-10-21 10:15:02 +0800185IN_PORTCONTROL=TRUE
xiaofeis3237f352015-10-30 15:38:20 +0800186IN_PORTCONTROL_MINI=FALSE
Yue Lun03a82d92013-10-21 10:15:02 +0800187IN_PORTVLAN=TRUE
xiaofeis3237f352015-10-30 15:38:20 +0800188IN_PORTVLAN_MINI=FALSE
Yue Lun03a82d92013-10-21 10:15:02 +0800189IN_QOS=TRUE
xiaofeis3237f352015-10-30 15:38:20 +0800190IN_QOS_MINI=FALSE
Yue Lun03a82d92013-10-21 10:15:02 +0800191IN_RATE=TRUE
192IN_STP=TRUE
193IN_VLAN=TRUE
xiaofeis3237f352015-10-30 15:38:20 +0800194IN_VLAN_MINI=FALSE
Yue Lun03a82d92013-10-21 10:15:02 +0800195IN_REDUCED_ACL=FALSE
196IN_COSMAP=TRUE
xiaofeis3237f352015-10-30 15:38:20 +0800197IN_COSMAP_MINI=FALSE
Yue Lun03a82d92013-10-21 10:15:02 +0800198IN_IP=TRUE
199IN_NAT=TRUE
mingxinh7458b242017-02-21 18:30:24 +0800200IN_FLOW=TRUE
Yue Lun03a82d92013-10-21 10:15:02 +0800201IN_TRUNK=TRUE
mingxinh3b69f732017-04-06 18:33:36 +0800202IN_RSS_HASH=TRUE
Yue Lun03a82d92013-10-21 10:15:02 +0800203IN_SEC=TRUE
mingxinh7458b242017-02-21 18:30:24 +0800204IN_QM=TRUE
205IN_PPPOE=TRUE
Yue Lunf564a1f2014-01-07 15:54:34 +0800206ifeq ($(HNAT_FEATURE), enable)
207IN_NAT_HELPER=TRUE
208else
Yue Lun03a82d92013-10-21 10:15:02 +0800209IN_NAT_HELPER=FALSE
Yue Lunf564a1f2014-01-07 15:54:34 +0800210endif
xiaofeisad0eef02015-02-09 16:14:32 +0800211ifeq ($(RFS_FEATURE), enable)
212IN_RFS=TRUE
213else
214IN_RFS=FALSE
215endif
Yue Lun03a82d92013-10-21 10:15:02 +0800216IN_INTERFACECONTROL=TRUE
217IN_MACBLOCK=FALSE
xiaofeis3237f352015-10-30 15:38:20 +0800218IN_MALIBU_PHY=TRUE
Liu Zhongjian7b7ef152017-06-12 20:25:23 +0800219ifeq (ALL_CHIP, $(CHIP_TYPE))
Liu Zhongjianc6834c02017-04-28 15:43:29 +0800220IN_AQUANTIA_PHY=TRUE
Liu Zhongjian7b7ef152017-06-12 20:25:23 +0800221else
222IN_AQUANTIA_PHY=FALSE
223endif
Ram Chandra Jangir963e4d22015-12-21 20:53:40 +0530224ifeq ($(SFE_FEATURE), enable)
225IN_SFE=TRUE
226else
227IN_SFE=FALSE
228endif
mingxinh7458b242017-02-21 18:30:24 +0800229IN_VSI=TRUE
230IN_CTRLPKT=TRUE
231IN_SERVCODE=TRUE
232IN_BM=TRUE
233IN_SHAPER=TRUE
234IN_POLICER=TRUE
esonga1689652017-03-30 18:07:37 +0800235IN_UNIPHY=TRUE
mingxinh2066f352017-03-07 19:52:30 +0800236ifneq ($(HK_CHIP), enable)
237CHIP_TYPE=NONHK_CHIP
238endif
xiaofeisce9267f2017-05-25 04:21:01 +0800239HAWKEYE_CHIP=TRUE