-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
executable file
·172 lines (148 loc) · 5.84 KB
/
Makefile
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
ECRNX_VERS_NUM=ECR6600U_V1.1.0B03P06
# config_ceva_rtos = y use ceva rtos and add task_cli id
# config_ceva_rtos = n use freertos and no task_cli id
export DRIVER_PATH ?= $(shell pwd)
#if build the host driver within linux kernel, the DRIVER_PATH should be defined to absolutly path
#export DRIVER_PATH ?= /home/pi/linux/drivers/net/wireless/wifi_host_driver
ifeq ($(product), 6600u)
-include $(DRIVER_PATH)/feature_config/6600u_config
else
-include $(DRIVER_PATH)/feature_config/6600_config
ifeq ($(os), )
export CONFIG_CEVA_RTOS=y
else
export CONFIG_CEVA_RTOS=n
endif
endif
###################### Platform Related #######################
CONFIG_PLATFORM_RTK_RTD2851D = n
CONFIG_PLATFORM_MTK_MT9255 = n
CONFIG_PLATFORM_RASPBERRY = y
CONFIG_PLATFORM_X86 = n
CONFIG_PLATFORM_AML_T963 = n
CONFIG_PLATFORM_INGENIC = n
CONFIG_PLATFORM_CVITEK_CV1821 = n
###############################################################
ifeq ($(CONFIG_PLATFORM_RTK_RTD2851D), y)
export KERNELDIR=/work3/zhanghong/realtek/rtk10/vendor/realtek/tool/kernel/linux/linux-4.14/
export KBUILDDIR=/work3/zhanghong/realtek/rtk10/vendor/realtek/tool/kernel/linux/linux-4.14/
endif
ifeq ($(CONFIG_PLATFORM_MTK_MT9255), y)
export KERNELDIR= $(DRIVER_PATH)/../../../../../../kernel/fusion/4.9
export KBUILDDIR= $(DRIVER_PATH)/../../../../../../kernel/fusion/4.9
export CROSS_COMPILE:=$(DRIVER_PATH)/../../../../../../prebuilts/mtk_toolchain/gcc-arm-linux-gnu-5.5.0-ubuntu/x86_64/bin/arm-linux-gnueabi-
endif
ifeq ($(CONFIG_PLATFORM_RASPBERRY), y)
export KERNELDIR=/lib/modules/$(shell uname -r)/build
export KBUILDDIR=/lib/modules/$(shell uname -r)/build
endif
ifeq ($(CONFIG_PLATFORM_X86), y)
export KERNELDIR=/lib/modules/$(shell uname -r)/build
export KBUILDDIR=/lib/modules/$(shell uname -r)/build
endif
ifeq ($(CONFIG_PLATFORM_AML_T963), y)
ifeq ($(DRIVER_DIR), )
export DRIVER_PATH ?= $(shell pwd)
else
export DRIVER_PATH ?= $(DRIVER_DIR)
endif
export KERNELDIR ?= $(DRIVER_PATH)/../../../../../../out/target/product/T963/obj/KERNEL_OBJ
export KBUILDDIR ?= $(DRIVER_PATH)/../../../../../../out/target/product/T963/obj/KERNEL_OBJ
CROSS_COMPILE ?= /opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
ARCH := arm
endif
ifeq ($(CONFIG_PLATFORM_INGENIC), y)
ifeq ($(product), 6600u)
else
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_MINIMAL_MEMORY_USAGE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_INGENIC
ARCH ?= mips
CROSS_COMPILE ?= ${HOME}/toolchina/mips-gcc472-glibc216-64bit/bin/mips-linux-gnu-
export KERNELDIR=${HOME}/Ingenic-SDK-T31-1.1.5-20220506/opensource/kernel
export KBUILDDIR=${HOME}/Ingenic-SDK-T31-1.1.5-20220506/opensource/kernel
ifeq ($(CONFIG_SDIO_HCI), y)
EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS
_PLATFORM_FILES += platform/platform_ingenic_sido.o
endif
endif
endif
#
# } // WAITING FOR KCONFIG
#
subdir-ccflags-$(CONFIG_6600_HAL) += -DCONFIG_6600_HAL
subdir-ccflags-$(CONFIG_DEBUG_FS) += -DCONFIG_ECRNX_DEBUGFS
subdir-ccflags-$(CONFIG_DEBUG_FS) += -DCONFIG_ECRNX_UM_HELPER_DFLT=\"$(CONFIG_ECRNX_UM_HELPER_DFLT)\"
subdir-ccflags-$(CONFIG_ECRNX_P2P_DEBUGFS) += -DCONFIG_ECRNX_P2P_DEBUGFS
subdir-ccflags-$(CONFIG_CEVA_RTOS) += -DCONFIG_CEVA_RTOS
subdir-ccflags-$(CONFIG_ECRNX_DBG) += -DCONFIG_ECRNX_DBG
#CVITEK kernel has not added rt related patches
ifeq ($(CONFIG_PLATFORM_CVITEK_CV1821), y)
subdir-ccflags-y += -DCONFIG_ECRNX_TASKLET
else
subdir-ccflags-$(CONFIG_ECRNX_KTHREAD) += -DCONFIG_ECRNX_KTHREAD
subdir-ccflags-$(CONFIG_ECRNX_WORKQUEUE) += -DCONFIG_ECRNX_WORKQUEUE
subdir-ccflags-$(CONFIG_ECRNX_TASKLET) += -DCONFIG_ECRNX_TASKLET
endif
subdir-ccflags-y += -DCONFIG_ECRNX_DBG_MASK=$(CONFIG_ECRNX_DBG_MASK)
# FW VARS
subdir-ccflags-y += -DNX_VIRT_DEV_MAX=$(NX_VIRT_DEV_MAX)
subdir-ccflags-y += -DNX_REMOTE_STA_MAX=$(NX_REMOTE_STA_MAX)
subdir-ccflags-y += -DNX_MU_GROUP_MAX=$(NX_MU_GROUP_MAX)
subdir-ccflags-y += -DNX_TXDESC_CNT=$(NX_TXDESC_CNT)
subdir-ccflags-y += -DNX_TX_MAX_RATES=$(NX_TX_MAX_RATES)
subdir-ccflags-y += -DNX_CHAN_CTXT_CNT=$(NX_CHAN_CTXT_CNT)
#subdir-ccflags-y += -DCONFIG_POWERKEY_GPIO=$(CONFIG_POWERKEY_GPIO)
# FW ARCH:
subdir-ccflags-$(CONFIG_ECRNX_SDM) += -DCONFIG_ECRNX_SDM
subdir-ccflags-$(CONFIG_ECRNX_TL4) += -DCONFIG_ECRNX_TL4
subdir-ccflags-$(CONFIG_ECRNX_OLD_IPC) += -DCONFIG_ECRNX_OLD_IPC
#FW VER INFO
DRIVER_BUILD_TIME = "$(shell TZ=CST date -u "+%Y-%m-%d %H:%M:%S CST")"
subdir-ccflags-y += -DECRNX_VERS_MOD=\"$(ECRNX_VERS_NUM)\"
subdir-ccflags-y += -DECRNX_VERS_BANNER=\"$(ECRNX_MODULE_NAME)-$(ECRNX_VERS_NUM)-build\:$(DRIVER_BUILD_TIME)\"
#FW PATH
subdir-ccflags-y += -DCONFIG_FW_PATH=\"$(CONFIG_FW_PATH)\"
subdir-ccflags-$(CONFIG_CUSTOM_FIRMWARE_DOWNLOAD) += -DCONFIG_CUSTOM_FIRMWARE_DOWNLOAD=\"$(CONFIG_CUSTOM_FIRMWARE_DOWNLOAD)\"
ifeq ($(CONFIG_ECRNX_FULLMAC), m)
MAC_SRC = fullmac
else ifeq ($(CONFIG_ECRNX_SOFTMAC), m)
MAC_SRC = softmac
endif
obj-m := $(ECRNX_MODULE_NAME).o
ifneq ($(KERNELRELEASE),)
include $(DRIVER_PATH)/$(MAC_SRC)/Makefile
else
all: modules strip
.PHONY: modules clean copy strip
modules:
ifeq ($(product), 6600u)
$(warning "select chip is $(product).")
else
$(warning "select chip is 6600.")
endif
rm -rf *.ko
ifeq ($(os), )
$(warning "select slave is used CEVA RTOS.")
else
$(warning "select slave is not used CEVA_RTOS.")
endif
ifeq ($(CONFIG_PLATFORM_MTK_MT9255), y)
$(MAKE) -C $(KERNELDIR) CROSS_COMPILE=$(CROSS_COMPILE) O=$(KBUILDDIR) M=$(DRIVER_PATH) $@
else ifeq ($(CONFIG_PLATFORM_AML_T963), y)
$(MAKE) -C $(KERNELDIR) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(ARCH) O=$(KBUILDDIR) M=$(DRIVER_PATH) $@
else
$(MAKE) -C $(KERNELDIR) O=$(KBUILDDIR) M=$(DRIVER_PATH) $@
endif
@rm -rf *.o
@rm -rf *.mod *.mod.c
copy:
cp -f $(DRIVER_PATH)/fullmac/$(ECRNX_MODULE_NAME).ko $(MODDESTDIR)
strip:
@$(CROSS_COMPILE)strip --strip-unneeded $(ECRNX_MODULE_NAME).ko
clean:
rm -rf *.o
rm -rf *.ko *.mod *.mod.c
$(MAKE) -C $(KERNELDIR) O=$(KBUILDDIR) M=$(DRIVER_PATH) $@
# @$(DRIVER_PATH)/mklink.sh clean
endif