blob: ea700e6812ca68be832d73569d1c7c91c3004082 [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)
122ifeq ($(KVER),$(filter 4.4%,$(KVER)))
123 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
124endif
Luo Jiecc392582017-08-12 15:20:34 +0800125ifeq ($(KVER),$(filter 4.1% 4.9%, $(KVER)))
Luo Jie26116592017-06-06 15:59:46 +0800126 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
127endif
mingxinh7458b242017-02-21 18:30:24 +0800128endif
129
Yue Lun03a82d92013-10-21 10:15:02 +0800130ifeq ($(BOARD_TYPE), ap136)
131OS_SUB=31
132GCC_VER=4
133TOOL_PATH=$(TOPDIR)/build/gcc-4.3.3/build_mips/staging_dir/usr/bin
134SYS_PATH=$(TOPDIR)/linux/kernels/mips-linux-2.6.31
135CPU_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
136endif
137
138#For MIPS Linux2.4
139 #TOOL_PATH=/home/perforce/kernel2.4/5.3.1.20/tools/gcc-3.3.3-2.4.25/toolchain_mips/bin
140 #SYS_PATH=/home/perforce/kernel2.4/5.3.1.20/src/kernels/mips-linux-2.4.25
141
142 #TOOLPREFIX=$(CPU)-$(OS)-
143 #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
144
Luo Jie82b4a882017-06-29 20:50:18 +0800145ifeq ($(SWCONFIG_FEATURE), disable)
146SWCONFIG=FALSE
147else
148SWCONFIG=TRUE
149endif
150
Yue Lun03a82d92013-10-21 10:15:02 +0800151KERNEL_MODE=TRUE
152#compatiable with OpenWRT
153ifeq ($(SWITCH_SSDK_MODE),user)
154KERNEL_MODE=FLASE
155endif
156
157#FAL=FALSE or not define FAL, FAL will not be included in SSDK
Yue Lundd6e3d92013-10-25 13:03:31 +0800158FAL=TRUE
Yue Lun03a82d92013-10-21 10:15:02 +0800159
mingxinh7458b242017-02-21 18:30:24 +0800160#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 +0800161CHIP_TYPE=ALL_CHIP
Yue Lun03a82d92013-10-21 10:15:02 +0800162
163#UK_IF=FALSE or not define UK_IF, UK_IF will not be included in SSDK
164#when UK_IF=TRUE one of UK_NETLINK,UK_IOCTL must be defined as TRUE
165UK_IF=TRUE
166#UK_IOCTL=TRUE define user-kernel space communication based on ioctl
167UK_IOCTL=TRUE
168UK_MINOR_DEV=254
169
170#API_LOCK=FALSE or not define API_LOCK, API_LOCK will not be included in SSDK
171API_LOCK=FALSE
172
173#REG_ACCESS_SPEEDUP=FALSE or not define REG_ACCESS_SPEEDUP, REG_ACCESS_SPEEDUP will not be enabled, now only ISIS supports
174REG_ACCESS_SPEEDUP=FALSE
175
176#ALL supported features:
177#ACL FDB IGMP LEAKY LED MIB MIRROR MISC PORTCONTROL PORTVLAN QOS RATE STP VLAN
178#IN_X=FALSE or not define IN_X, X will not be included in SSDK
179IN_ACL=TRUE
180IN_FDB=TRUE
xiaofeis3237f352015-10-30 15:38:20 +0800181IN_FDB_MINI=FALSE
Yue Lun03a82d92013-10-21 10:15:02 +0800182IN_IGMP=TRUE
183IN_LEAKY=TRUE
184IN_LED=TRUE
185IN_MIB=TRUE
186IN_MIRROR=TRUE
187IN_MISC=TRUE
xiaofeis3237f352015-10-30 15:38:20 +0800188IN_MISC_MINI=FALSE
Yue Lun03a82d92013-10-21 10:15:02 +0800189IN_PORTCONTROL=TRUE
xiaofeis3237f352015-10-30 15:38:20 +0800190IN_PORTCONTROL_MINI=FALSE
Yue Lun03a82d92013-10-21 10:15:02 +0800191IN_PORTVLAN=TRUE
xiaofeis3237f352015-10-30 15:38:20 +0800192IN_PORTVLAN_MINI=FALSE
Yue Lun03a82d92013-10-21 10:15:02 +0800193IN_QOS=TRUE
xiaofeis3237f352015-10-30 15:38:20 +0800194IN_QOS_MINI=FALSE
Yue Lun03a82d92013-10-21 10:15:02 +0800195IN_RATE=TRUE
196IN_STP=TRUE
197IN_VLAN=TRUE
xiaofeis3237f352015-10-30 15:38:20 +0800198IN_VLAN_MINI=FALSE
Yue Lun03a82d92013-10-21 10:15:02 +0800199IN_REDUCED_ACL=FALSE
200IN_COSMAP=TRUE
xiaofeis3237f352015-10-30 15:38:20 +0800201IN_COSMAP_MINI=FALSE
Yue Lun03a82d92013-10-21 10:15:02 +0800202IN_IP=TRUE
203IN_NAT=TRUE
mingxinh7458b242017-02-21 18:30:24 +0800204IN_FLOW=TRUE
Yue Lun03a82d92013-10-21 10:15:02 +0800205IN_TRUNK=TRUE
mingxinh3b69f732017-04-06 18:33:36 +0800206IN_RSS_HASH=TRUE
Yue Lun03a82d92013-10-21 10:15:02 +0800207IN_SEC=TRUE
mingxinh7458b242017-02-21 18:30:24 +0800208IN_QM=TRUE
209IN_PPPOE=TRUE
Yue Lunf564a1f2014-01-07 15:54:34 +0800210ifeq ($(HNAT_FEATURE), enable)
211IN_NAT_HELPER=TRUE
212else
Yue Lun03a82d92013-10-21 10:15:02 +0800213IN_NAT_HELPER=FALSE
Yue Lunf564a1f2014-01-07 15:54:34 +0800214endif
xiaofeisad0eef02015-02-09 16:14:32 +0800215ifeq ($(RFS_FEATURE), enable)
216IN_RFS=TRUE
217else
218IN_RFS=FALSE
219endif
Yue Lun03a82d92013-10-21 10:15:02 +0800220IN_INTERFACECONTROL=TRUE
221IN_MACBLOCK=FALSE
xiaofeis3237f352015-10-30 15:38:20 +0800222IN_MALIBU_PHY=TRUE
Liu Zhongjian7b7ef152017-06-12 20:25:23 +0800223ifeq (ALL_CHIP, $(CHIP_TYPE))
Liu Zhongjianc6834c02017-04-28 15:43:29 +0800224IN_AQUANTIA_PHY=TRUE
Liu Zhongjiane7cef672017-07-19 16:31:24 +0800225IN_QCA803X_PHY=TRUE
Liu Zhongjian01334942018-06-04 20:47:00 +0800226IN_QCA808X_PHY=TRUE
xiaofeisd96a9872018-02-28 17:47:17 +0800227IN_SFP_PHY=TRUE
Liu Zhongjian7b7ef152017-06-12 20:25:23 +0800228else
Liu Zhongjiane7cef672017-07-19 16:31:24 +0800229IN_QCA803X_PHY=FALSE
Liu Zhongjian01334942018-06-04 20:47:00 +0800230IN_QCA808X_PHY=FALSE
Liu Zhongjian7b7ef152017-06-12 20:25:23 +0800231IN_AQUANTIA_PHY=FALSE
xiaofeisd96a9872018-02-28 17:47:17 +0800232IN_SFP_PHY=FALSE
Liu Zhongjian7b7ef152017-06-12 20:25:23 +0800233endif
Ram Chandra Jangir963e4d22015-12-21 20:53:40 +0530234ifeq ($(SFE_FEATURE), enable)
235IN_SFE=TRUE
236else
237IN_SFE=FALSE
238endif
Luo Jie5e3044d2018-03-13 17:56:37 +0800239ifeq ($(IN_QCA808X_PHY), TRUE)
240IN_PHY_I2C_MODE=TRUE
241else
242IN_PHY_I2C_MODE=FALSE
Luo Jie32781122018-08-22 18:05:44 +0800243endif
244ifeq ($(PTP_FEATURE), enable)
245IN_PTP=TRUE
246else
Luo Jie8314e702018-06-04 11:23:57 +0800247IN_PTP=FALSE
Luo Jie5e3044d2018-03-13 17:56:37 +0800248endif
mingxinh7458b242017-02-21 18:30:24 +0800249IN_VSI=TRUE
250IN_CTRLPKT=TRUE
251IN_SERVCODE=TRUE
252IN_BM=TRUE
253IN_SHAPER=TRUE
254IN_POLICER=TRUE
esonga1689652017-03-30 18:07:37 +0800255IN_UNIPHY=TRUE
mingxinh2066f352017-03-07 19:52:30 +0800256ifneq ($(HK_CHIP), enable)
257CHIP_TYPE=NONHK_CHIP
258endif
esongb3269092018-01-25 16:54:04 +0800259HAWKEYE_CHIP=TRUE