blob: 2425745a437ba17badf943cec1d8574330d6ca21 [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
Luo Jiecc392582017-08-12 15:20:34 +080017ifeq ($(KVER),$(filter 4.9%,$(KVER)))
18OS_VER=4_9
19endif
20
Yue Lunf564a1f2014-01-07 15:54:34 +080021ifeq ($(KVER), 3.4.0)
Yue Lundd6e3d92013-10-25 13:03:31 +080022OS_VER=3_4
Yue Lunf564a1f2014-01-07 15:54:34 +080023endif
24
Ram Chandra Jangir88dfc382015-09-04 11:50:17 +053025ifeq ($(KVER), 3.18)
26OS_VER=3_18
27endif
28
Ram Chandra Jangir511c9a42015-09-25 19:25:57 +053029ifeq ($(KVER), 3.18.21)
Ram Chandra Jangir88dfc382015-09-04 11:50:17 +053030OS_VER=3_18
31endif
32
Yili Zhaob8db20b2014-10-17 18:29:06 -070033ifeq ($(KVER), 3.4.103)
34OS_VER=3_4
35endif
36
Yue Lunf564a1f2014-01-07 15:54:34 +080037ifeq ($(KVER), 3.3.8)
38OS_VER=3_2
39endif
40
41ifeq ($(ARCH), arm)
42BOARD=ipq806x
43endif
44
45ifeq ($(ARCH), mips)
46BOARD=ar71xx
47endif
48
49ifeq ($(BOARD), ar71xx)
50BOARD_NAME=BOARD_AR71XX
51endif
52
53ifeq ($(BOARD), ipq806x)
54BOARD_NAME=BOARD_IPQ806X
55endif
56
Yue Lundd6e3d92013-10-25 13:03:31 +080057OS_SUB=31
Yue Lundd6e3d92013-10-25 13:03:31 +080058
Yue Lun03a82d92013-10-21 10:15:02 +080059ifndef OS_VER
60OS_VER=2_6
61endif
62# OS subversion, 2.6.31 for WASP (db120)
63#OS_SUB=31
64# GCC version, 3 or 4
65#GCC_VER=4
66
67#For MIPS Linux2.6
68 #pb45
69 #TOOL_PATH=/disk/pb45/sw/build/gcc-3.4.4-2.16.1/build_mips_nofpu/bin
70 #SYS_PATH=/disk/pb45/sw/linux/kernels/mips-linux-2.6.15
Ram Chandra Jangir963e4d22015-12-21 20:53:40 +053071
Yue Lun03a82d92013-10-21 10:15:02 +080072 #ap81
73# compatiable with OpenWRT
Ram Chandra Jangir963e4d22015-12-21 20:53:40 +053074ifndef TOOL_PATH
Yue Lun03a82d92013-10-21 10:15:02 +080075TOOL_PATH=/disk/ap81fus/sw/build/gcc-3.4.4-2.16.1/build_mips/bin
76endif
Ram Chandra Jangir963e4d22015-12-21 20:53:40 +053077ifndef SYS_PATH
Yue Lun03a82d92013-10-21 10:15:02 +080078SYS_PATH=/disk/ap81fus/sw/linux/kernels/mips-linux-2.6.15
79endif
80ifeq ($(ARCH), mips)
Zou Shunxiang0b4f1422014-04-17 13:59:28 +080081 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 +080082endif
83
84
85#db120
86ifeq ($(BOARD_TYPE),db12x)
87OS_SUB=31
88GCC_VER=4
89TOOL_PATH=$(TOPDIR)/build/gcc-4.3.3/build_mips/staging_dir/usr/bin
90SYS_PATH=$(TOPDIR)/linux/kernels/mips-linux-2.6.31
91CPU_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
92endif
93
94ifeq ($(ARCH), arm)
lunyd975a202014-05-15 22:17:17 +080095ifeq ($(KVER), 3.4.0)
Yue Lunf564a1f2014-01-07 15:54:34 +080096 CPU_CFLAG=-D__LINUX_ARM_ARCH__=7 -DMODULE -fno-common -DCONFIG_MMU -D$(BOARD_NAME)
Yue Lun03a82d92013-10-21 10:15:02 +080097endif
Yili Zhaob8db20b2014-10-17 18:29:06 -070098ifeq ($(KVER), 3.4.103)
99 CPU_CFLAG=-D__LINUX_ARM_ARCH__=7 -DMODULE -fno-common -DCONFIG_MMU -D$(BOARD_NAME)
100endif
Ram Chandra Jangir511c9a42015-09-25 19:25:57 +0530101ifeq ($(KVER), 3.18.21)
Ram Chandra Jangir88dfc382015-09-04 11:50:17 +0530102 CPU_CFLAG=-D__LINUX_ARM_ARCH__=7 -DMODULE -fno-common -DCONFIG_MMU -D$(BOARD_NAME)
103endif
Liu Zhongjianf8134e92016-09-21 14:42:01 +0800104ifeq ($(KVER),$(filter 4.4%,$(KVER)))
105 CPU_CFLAG=-D__LINUX_ARM_ARCH__=7 -DMODULE -fno-common -DCONFIG_MMU -D$(BOARD_NAME)
106endif
Ram Chandra Jangir88dfc382015-09-04 11:50:17 +0530107
Vasudevan Murugesanf5fe7492015-06-10 19:45:37 +0530108ifeq ($(KVER),$(filter 3.14%,$(KVER)))
xiaofeisccdee9c2016-03-07 21:01:03 +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)"
lunyd975a202014-05-15 22:17:17 +0800110endif
Ram Chandra Jangir88dfc382015-09-04 11:50:17 +0530111
Luo Jie25a04052017-10-23 19:37:13 +0800112ifeq ($(KVER),$(filter 4.9% 4.4%,$(KVER)))
xiaofeis81ae1f72018-06-26 17:13:35 +0800113 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=2048 -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 +0800114endif
115
Ram Chandra Jangir88dfc382015-09-04 11:50:17 +0530116ifeq ($(KVER),$(filter 3.18%,$(KVER)))
xiaofeis9ebb3ff2016-02-29 16:49:31 +0800117 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 +0530118endif
lunyd975a202014-05-15 22:17:17 +0800119endif
Yue Lun03a82d92013-10-21 10:15:02 +0800120
mingxinh7458b242017-02-21 18:30:24 +0800121ifeq ($(ARCH), arm64)
xiaofeis1ee5b692018-12-24 18:03:48 +0800122ifeq ($(KVER),$(filter 4.1% 4.4% 4.9%,$(KVER)))
Luo Jiecf7ddf02019-01-10 13:59:57 +0800123 CPU_CFLAG= -DMODULE -Os -pipe -march=armv8-a -mcpu=cortex-a53+crypto -fno-caller-saves -fno-strict-aliasing -Werror -fno-common -Wno-format-security -Wno-pointer-sign -Wno-unused-but-set-variable -Wno-error=unused-result -mcmodel=large
Luo Jie26116592017-06-06 15:59:46 +0800124endif
mingxinh7458b242017-02-21 18:30:24 +0800125endif
126
Yue Lun03a82d92013-10-21 10:15:02 +0800127ifeq ($(BOARD_TYPE), ap136)
128OS_SUB=31
129GCC_VER=4
130TOOL_PATH=$(TOPDIR)/build/gcc-4.3.3/build_mips/staging_dir/usr/bin
131SYS_PATH=$(TOPDIR)/linux/kernels/mips-linux-2.6.31
132CPU_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
133endif
134
135#For MIPS Linux2.4
136 #TOOL_PATH=/home/perforce/kernel2.4/5.3.1.20/tools/gcc-3.3.3-2.4.25/toolchain_mips/bin
137 #SYS_PATH=/home/perforce/kernel2.4/5.3.1.20/src/kernels/mips-linux-2.4.25
138
139 #TOOLPREFIX=$(CPU)-$(OS)-
140 #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
141
Luo Jie82b4a882017-06-29 20:50:18 +0800142ifeq ($(SWCONFIG_FEATURE), disable)
143SWCONFIG=FALSE
144else
145SWCONFIG=TRUE
146endif
147
Yue Lun03a82d92013-10-21 10:15:02 +0800148KERNEL_MODE=TRUE
149#compatiable with OpenWRT
150ifeq ($(SWITCH_SSDK_MODE),user)
151KERNEL_MODE=FLASE
152endif
153
154#FAL=FALSE or not define FAL, FAL will not be included in SSDK
Yue Lundd6e3d92013-10-25 13:03:31 +0800155FAL=TRUE
Yue Lun03a82d92013-10-21 10:15:02 +0800156
linchencc23a942018-12-05 14:49:22 +0800157#CHIP_TYPE can be defined as ATHENA, GARUDA, SHIVA, HORUS, ISIS, ISISC, DESS, HPPE, CPPE and ALL_CHIP(ALL_CHIP means GARUDA, SHIVA, HORUS, ISIS, ISISC, DESS and HPPE CPPE)
Luo Jieb059c2a2018-12-12 15:33:12 +0800158ifndef CHIP_TYPE
Zou Shunxiang0b4f1422014-04-17 13:59:28 +0800159CHIP_TYPE=ALL_CHIP
Luo Jieb059c2a2018-12-12 15:33:12 +0800160endif
Yue Lun03a82d92013-10-21 10:15:02 +0800161
162#UK_IF=FALSE or not define UK_IF, UK_IF will not be included in SSDK
163#when UK_IF=TRUE one of UK_NETLINK,UK_IOCTL must be defined as TRUE
164UK_IF=TRUE
165#UK_IOCTL=TRUE define user-kernel space communication based on ioctl
166UK_IOCTL=TRUE
167UK_MINOR_DEV=254
168
169#API_LOCK=FALSE or not define API_LOCK, API_LOCK will not be included in SSDK
170API_LOCK=FALSE
171
172#REG_ACCESS_SPEEDUP=FALSE or not define REG_ACCESS_SPEEDUP, REG_ACCESS_SPEEDUP will not be enabled, now only ISIS supports
173REG_ACCESS_SPEEDUP=FALSE
174
175#ALL supported features:
176#ACL FDB IGMP LEAKY LED MIB MIRROR MISC PORTCONTROL PORTVLAN QOS RATE STP VLAN
177#IN_X=FALSE or not define IN_X, X will not be included in SSDK
178IN_ACL=TRUE
179IN_FDB=TRUE
180IN_IGMP=TRUE
181IN_LEAKY=TRUE
182IN_LED=TRUE
183IN_MIB=TRUE
184IN_MIRROR=TRUE
185IN_MISC=TRUE
186IN_PORTCONTROL=TRUE
187IN_PORTVLAN=TRUE
188IN_QOS=TRUE
189IN_RATE=TRUE
190IN_STP=TRUE
191IN_VLAN=TRUE
192IN_REDUCED_ACL=FALSE
193IN_COSMAP=TRUE
194IN_IP=TRUE
195IN_NAT=TRUE
mingxinh7458b242017-02-21 18:30:24 +0800196IN_FLOW=TRUE
Yue Lun03a82d92013-10-21 10:15:02 +0800197IN_TRUNK=TRUE
mingxinh3b69f732017-04-06 18:33:36 +0800198IN_RSS_HASH=TRUE
Yue Lun03a82d92013-10-21 10:15:02 +0800199IN_SEC=TRUE
mingxinh7458b242017-02-21 18:30:24 +0800200IN_QM=TRUE
201IN_PPPOE=TRUE
Yue Lunf564a1f2014-01-07 15:54:34 +0800202ifeq ($(HNAT_FEATURE), enable)
203IN_NAT_HELPER=TRUE
204else
Yue Lun03a82d92013-10-21 10:15:02 +0800205IN_NAT_HELPER=FALSE
Yue Lunf564a1f2014-01-07 15:54:34 +0800206endif
xiaofeisad0eef02015-02-09 16:14:32 +0800207ifeq ($(RFS_FEATURE), enable)
208IN_RFS=TRUE
209else
210IN_RFS=FALSE
211endif
Yue Lun03a82d92013-10-21 10:15:02 +0800212IN_INTERFACECONTROL=TRUE
213IN_MACBLOCK=FALSE
Luo Jieb059c2a2018-12-12 15:33:12 +0800214#The PHY CHIP defined according to the switch CHIP
Liu Zhongjian7b7ef152017-06-12 20:25:23 +0800215ifeq (ALL_CHIP, $(CHIP_TYPE))
Liu Zhongjianc6834c02017-04-28 15:43:29 +0800216IN_AQUANTIA_PHY=TRUE
Liu Zhongjiane7cef672017-07-19 16:31:24 +0800217IN_QCA803X_PHY=TRUE
Liu Zhongjian01334942018-06-04 20:47:00 +0800218IN_QCA808X_PHY=TRUE
Luo Jieb059c2a2018-12-12 15:33:12 +0800219IN_MALIBU_PHY=TRUE
xiaofeisd96a9872018-02-28 17:47:17 +0800220IN_SFP_PHY=TRUE
Luo Jieb059c2a2018-12-12 15:33:12 +0800221else ifeq (HPPE, $(CHIP_TYPE))
222IN_AQUANTIA_PHY=TRUE
223IN_QCA803X_PHY=TRUE
224IN_QCA808X_PHY=TRUE
225IN_SFP_PHY=TRUE
226IN_MALIBU_PHY=TRUE
227else ifeq (CPPE, $(CHIP_TYPE))
228IN_QCA808X_PHY=TRUE
229IN_MALIBU_PHY=TRUE
230else ifeq (DESS, $(CHIP_TYPE))
231IN_MALIBU_PHY=TRUE
Liu Zhongjian7b7ef152017-06-12 20:25:23 +0800232else
Liu Zhongjiane7cef672017-07-19 16:31:24 +0800233IN_QCA803X_PHY=FALSE
Liu Zhongjian01334942018-06-04 20:47:00 +0800234IN_QCA808X_PHY=FALSE
Liu Zhongjian7b7ef152017-06-12 20:25:23 +0800235IN_AQUANTIA_PHY=FALSE
Luo Jieb059c2a2018-12-12 15:33:12 +0800236IN_MALIBU_PHY=FALSE
xiaofeisd96a9872018-02-28 17:47:17 +0800237IN_SFP_PHY=FALSE
Liu Zhongjian7b7ef152017-06-12 20:25:23 +0800238endif
Ram Chandra Jangir963e4d22015-12-21 20:53:40 +0530239ifeq ($(SFE_FEATURE), enable)
240IN_SFE=TRUE
241else
242IN_SFE=FALSE
243endif
Luo Jieb059c2a2018-12-12 15:33:12 +0800244#QCA808X PHY features
Luo Jie5e3044d2018-03-13 17:56:37 +0800245ifeq ($(IN_QCA808X_PHY), TRUE)
246IN_PHY_I2C_MODE=TRUE
Luo Jie32781122018-08-22 18:05:44 +0800247ifeq ($(PTP_FEATURE), enable)
248IN_PTP=TRUE
249else
Luo Jie8314e702018-06-04 11:23:57 +0800250IN_PTP=FALSE
Luo Jie5e3044d2018-03-13 17:56:37 +0800251endif
Luo Jieb059c2a2018-12-12 15:33:12 +0800252else
253IN_PHY_I2C_MODE=FALSE
254endif
255#IN_PHY_I2C_MODE depends on IN_SFP_PHY
256ifeq ($(IN_PHY_I2C_MODE), TRUE)
257IN_SFP_PHY=TRUE
258endif
mingxinh7458b242017-02-21 18:30:24 +0800259IN_VSI=TRUE
260IN_CTRLPKT=TRUE
261IN_SERVCODE=TRUE
262IN_BM=TRUE
263IN_SHAPER=TRUE
264IN_POLICER=TRUE
esonga1689652017-03-30 18:07:37 +0800265IN_UNIPHY=TRUE
Luo Jieb059c2a2018-12-12 15:33:12 +0800266#MINI SSDK enabled
267ifeq ($(MINI_SSDK), enable)
268IN_FDB_MINI=TRUE
269IN_MISC_MINI=TRUE
270IN_PORTCONTROL_MINI=TRUE
271IN_QOS_MINI=TRUE
272IN_COSMAP_MINI=TRUE
273IN_PORTVLAN_MINI=TRUE
274IN_VLAN_MINI=TRUE
275IN_VSI_MINI=TRUE
276IN_BM_MINI=TRUE
277IN_SHAPER_MINI=TRUE
278IN_POLICER_MINI=TRUE
279IN_FLOW_MINI=TRUE
280IN_QM_MINI=TRUE
281IN_UNIPHY_MINI=TRUE
zhongjiacce26902018-12-27 10:07:12 +0800282IN_IP_MINI=TRUE
Luo Jieb059c2a2018-12-12 15:33:12 +0800283#disable modules for MINI HPPE/CPPE
284ifneq (, $(filter HPPE CPPE, $(CHIP_TYPE)))
285IN_SERVCODE=FALSE
286IN_PPPOE=FALSE
287IN_NAT=FALSE
Luo Jieb059c2a2018-12-12 15:33:12 +0800288IN_COSMAP=FALSE
289IN_RATE=FALSE
290IN_IGMP=FALSE
291IN_LEAKY=FALSE
292IN_LED=FALSE
293IN_INTERFACECONTROL=FALSE
294endif
295endif
mingxinh2066f352017-03-07 19:52:30 +0800296ifneq ($(HK_CHIP), enable)
297CHIP_TYPE=NONHK_CHIP
298endif
xiaofeisd84da892018-12-05 13:39:56 +0800299ifeq ($(RUMI_FEATURE), enable)
300HAWKEYE_CHIP=FALSE
301else
esongb3269092018-01-25 16:54:04 +0800302HAWKEYE_CHIP=TRUE
xiaofeisd84da892018-12-05 13:39:56 +0800303endif