rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | ############################################################################### |
| 2 | # Necessary Check |
| 3 | ifneq ($(CONFIG_MTK_COMBO),) |
| 4 | ifeq ($(CONFIG_MTK_COMBO_CHIP),) |
| 5 | $(error CONFIG_MTK_COMBO_CHIP not defined) |
| 6 | endif |
| 7 | |
| 8 | ifeq ($(TARGET_BUILD_VARIANT),$(filter $(TARGET_BUILD_VARIANT),userdebug user)) |
| 9 | #ldflags-y += -s |
| 10 | endif |
| 11 | |
| 12 | # Force build fail on modpost warning |
| 13 | KBUILD_MODPOST_FAIL_ON_WARNINGS := y |
| 14 | ############################################################################### |
| 15 | |
| 16 | #ccflags-y += -D MTK_WCN_REMOVE_KERNEL_MODULE |
| 17 | ifeq ($(CONFIG_ARM64), y) |
| 18 | ccflags-y += -D CONFIG_MTK_WCN_ARM64 |
| 19 | endif |
| 20 | |
| 21 | ifeq ($(CONFIG_MTK_CONN_LTE_IDC_SUPPORT),y) |
| 22 | ccflags-y += -D WMT_IDC_SUPPORT=1 |
| 23 | else |
| 24 | ccflags-y += -D WMT_IDC_SUPPORT=0 |
| 25 | endif |
| 26 | ccflags-y += -D MTK_WCN_WMT_STP_EXP_SYMBOL_ABSTRACT |
| 27 | ifndef MTK_PLATFORM |
| 28 | MTK_PLATFORM := $(subst ",,$(CONFIG_MTK_PLATFORM)) |
| 29 | endif |
| 30 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/include |
| 31 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat/$(MTK_PLATFORM)/include |
| 32 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat/$(MTK_PLATFORM)/include/mach |
| 33 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat |
| 34 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/base/power/$(MTK_PLATFORM) |
| 35 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/base/power/include |
| 36 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/base/power/include/clkbuf_v1 |
| 37 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/base/power/include/clkbuf_v1/$(MTK_PLATFORM) |
| 38 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/btif/common/inc |
| 39 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/eccci |
| 40 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/eccci/$(MTK_PLATFORM) |
| 41 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/eemcs |
| 42 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/conn_md/include |
| 43 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/mach/$(MTK_PLATFORM)/include/mach |
| 44 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/emi/submodule |
| 45 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/emi/$(MTK_PLATFORM) |
| 46 | ccflags-y += -I$(srctree)/drivers/mmc/core |
| 47 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/connectivity/common |
| 48 | ############################################################################### |
| 49 | |
| 50 | |
| 51 | ccflags-y += -Werror |
| 52 | |
| 53 | ifneq ($(filter "MT6628",$(CONFIG_MTK_COMBO_CHIP)),) |
| 54 | ccflags-y += -D MT6628 |
| 55 | ccflags-y += -D MERGE_INTERFACE_SUPPORT |
| 56 | endif |
| 57 | ifneq ($(filter "MT6630",$(CONFIG_MTK_COMBO_CHIP)),) |
| 58 | ccflags-y += -D MT6630 |
| 59 | ifneq ($(CONFIG_ARCH_MT2601),y) |
| 60 | ccflags-y += -D MERGE_INTERFACE_SUPPORT |
| 61 | endif |
| 62 | endif |
| 63 | |
| 64 | ifneq ($(filter "MT6632",$(CONFIG_MTK_COMBO_CHIP)),) |
| 65 | ccflags-y += -D MT6632 |
| 66 | ccflags-y += -D MERGE_INTERFACE_SUPPORT |
| 67 | endif |
| 68 | |
| 69 | #obj-y += common_main/ |
| 70 | #obj-y += common_detect/ |
| 71 | |
| 72 | |
| 73 | |
| 74 | ############################################################################### |
| 75 | MODULE_NAME := wmt_drv |
| 76 | ifeq ($(CONFIG_WLAN_DRV_BUILD_IN),y) |
| 77 | $(warning $(MODULE_NAME) build-in boot.img) |
| 78 | obj-y += $(MODULE_NAME).o |
| 79 | else |
| 80 | $(warning $(MODULE_NAME) is kernel module) |
| 81 | obj-m += $(MODULE_NAME).o |
| 82 | endif |
| 83 | |
| 84 | ############################################################################### |
| 85 | # common_detect |
| 86 | ############################################################################### |
| 87 | ccflags-y += -I$(srctree)/arch/arm/mach-$(MTK_PLATFORM)/$(ARCH_MTK_PROJECT)/dct/dct |
| 88 | ccflags-y += -DWMT_PLAT_ALPS=1 |
| 89 | |
| 90 | COMBO_CHIP_SUPPORT := false |
| 91 | ifneq ($(filter "MT6620E3",$(CONFIG_MTK_COMBO_CHIP)),) |
| 92 | COMBO_CHIP_SUPPORT := true |
| 93 | endif |
| 94 | ifneq ($(filter "MT6628",$(CONFIG_MTK_COMBO_CHIP)),) |
| 95 | COMBO_CHIP_SUPPORT := true |
| 96 | endif |
| 97 | ifneq ($(filter "MT6630",$(CONFIG_MTK_COMBO_CHIP)),) |
| 98 | COMBO_CHIP_SUPPORT := true |
| 99 | endif |
| 100 | ifneq ($(filter "MT6632",$(CONFIG_MTK_COMBO_CHIP)),) |
| 101 | COMBO_CHIP_SUPPORT := true |
| 102 | endif |
| 103 | ifeq ($(COMBO_CHIP_SUPPORT), true) |
| 104 | ccflags-y += -D MTK_WCN_COMBO_CHIP_SUPPORT |
| 105 | endif |
| 106 | |
| 107 | ifneq ($(filter "CONSYS_%",$(CONFIG_MTK_COMBO_CHIP)),) |
| 108 | ccflags-y += -D MTK_WCN_SOC_CHIP_SUPPORT |
| 109 | endif |
| 110 | |
| 111 | ccflags-y += -I$(src)/common_main/linux/include |
| 112 | ccflags-y += -I$(src)/common_detect/drv_init/inc |
| 113 | ccflags-y += -I$(src)/common_detect |
| 114 | ccflags-y += -I$(src)/debug_utility |
| 115 | |
| 116 | $(MODULE_NAME)-objs += common_detect/wmt_detect_pwr.o |
| 117 | $(MODULE_NAME)-objs += common_detect/wmt_detect.o |
| 118 | $(MODULE_NAME)-objs += common_detect/sdio_detect.o |
| 119 | $(MODULE_NAME)-objs += common_detect/mtk_wcn_stub_alps.o |
| 120 | $(MODULE_NAME)-objs += common_detect/wmt_gpio.o |
| 121 | |
| 122 | |
| 123 | ifneq ($(filter "MT6630",$(CONFIG_MTK_COMBO_CHIP)),) |
| 124 | ccflags-y += -D MTK_WCN_WLAN_GEN3 |
| 125 | endif |
| 126 | |
| 127 | ifneq ($(filter "MT6632",$(CONFIG_MTK_COMBO_CHIP)),) |
| 128 | ccflags-y += -D MTK_WCN_WLAN_GEN4 |
| 129 | endif |
| 130 | |
| 131 | ifneq ($(filter "CONSYS_6797" "CONSYS_6759" "CONSYS_6758" "CONSYS_6771" "CONSYS_6775",$(CONFIG_MTK_COMBO_CHIP)),) |
| 132 | ccflags-y += -D MTK_WCN_WLAN_GEN3 |
| 133 | else ifneq ($(filter "CONSYS_%",$(CONFIG_MTK_COMBO_CHIP)),) |
| 134 | ccflags-y += -D MTK_WCN_WLAN_GEN2 |
| 135 | endif |
| 136 | |
| 137 | $(MODULE_NAME)-objs += common_detect/drv_init/fm_drv_init.o |
| 138 | $(MODULE_NAME)-objs += common_detect/drv_init/conn_drv_init.o |
| 139 | $(MODULE_NAME)-objs += common_detect/drv_init/bluetooth_drv_init.o |
| 140 | $(MODULE_NAME)-objs += common_detect/drv_init/wlan_drv_init.o |
| 141 | $(MODULE_NAME)-objs += common_detect/drv_init/common_drv_init.o |
| 142 | $(MODULE_NAME)-objs += common_detect/drv_init/gps_drv_init.o |
| 143 | |
| 144 | |
| 145 | ############################################################################### |
| 146 | # common_main |
| 147 | ############################################################################### |
| 148 | ccflags-y += -I$(src)/common_main/linux/include |
| 149 | ccflags-y += -I$(src)/common_main/linux/pri/include |
| 150 | ccflags-y += -I$(src)/common_main/platform/include |
| 151 | ccflags-y += -I$(src)/common_main/core/include |
| 152 | ccflags-y += -I$(src)/common_main/include |
| 153 | |
| 154 | ccflags-y += -D WMT_PLAT_ALPS=1 |
| 155 | ccflags-y += -D WMT_UART_RX_MODE_WORK=0 # 1. work thread 0. tasklet |
| 156 | ccflags-y += -D WMT_SDIO_MODE=1 |
| 157 | ccflags-y += -D WMT_CREATE_NODE_DYNAMIC=1 |
| 158 | |
| 159 | ifneq ($(TARGET_BUILD_VARIANT),eng) |
| 160 | ifeq ($(CONFIG_EXTREME_LOW_RAM), y) |
| 161 | ccflags-y += -DLOG_STP_DEBUG_DISABLE |
| 162 | endif |
| 163 | endif |
| 164 | |
| 165 | ifneq ($(filter mt2712,$(CONFIG_MTK_PLATFORM)),) |
| 166 | ccflags-y += -DLOG_STP_DEBUG_DISABLE |
| 167 | endif |
| 168 | |
| 169 | ifneq ($(TARGET_BUILD_VARIANT), user) |
| 170 | ccflags-y += -D WMT_DBG_SUPPORT=1 |
| 171 | else |
| 172 | ccflags-y += -D WMT_DBG_SUPPORT=0 |
| 173 | endif |
| 174 | |
| 175 | ifeq ($(CONFIG_ARCH_MT6580), y) |
| 176 | ccflags-y += -D CFG_WMT_READ_EFUSE_VCN33 |
| 177 | endif |
| 178 | |
| 179 | # STEP: (Support Connac) |
| 180 | # MTK eng/userdebug/user load: Support |
| 181 | # Customer eng/userdebug load: Support |
| 182 | # Customer user load: Not support |
| 183 | |
| 184 | ifeq ($(wildcard vendor/mediatek/proprietary/external/aee_config_internal/init.aee.mtk.system.rc),) |
| 185 | ccflags-y += -D CFG_WMT_STEP |
| 186 | else |
| 187 | ifneq ($(TARGET_BUILD_VARIANT),user) |
| 188 | ccflags-y += -D CFG_WMT_STEP |
| 189 | endif |
| 190 | endif |
| 191 | |
| 192 | ifeq ($(findstring evb, $(MTK_PROJECT)), evb) |
| 193 | ccflags-y += -D CFG_WMT_EVB |
| 194 | endif |
| 195 | |
| 196 | ifneq ($(filter "CONSYS_%",$(CONFIG_MTK_COMBO_CHIP)),) |
| 197 | $(MODULE_NAME)-objs += common_main/platform/$(MTK_PLATFORM).o |
| 198 | endif |
| 199 | |
| 200 | #$(MODULE_NAME)-objs += common_main/platform/wmt_plat_stub.o |
| 201 | $(MODULE_NAME)-objs += common_main/platform/wmt_plat_alps.o |
| 202 | $(MODULE_NAME)-objs += common_main/platform/mtk_wcn_consys_hw.o |
| 203 | $(MODULE_NAME)-objs += common_main/platform/mtk_wcn_cmb_hw.o |
| 204 | |
| 205 | $(MODULE_NAME)-objs += common_main/core/wmt_ic_6628.o |
| 206 | $(MODULE_NAME)-objs += common_main/core/wmt_conf.o |
| 207 | $(MODULE_NAME)-objs += common_main/core/stp_core.o |
| 208 | $(MODULE_NAME)-objs += common_main/core/wmt_ctrl.o |
| 209 | $(MODULE_NAME)-objs += common_main/core/wmt_func.o |
| 210 | $(MODULE_NAME)-objs += common_main/core/wmt_core.o |
| 211 | $(MODULE_NAME)-objs += common_main/core/psm_core.o |
| 212 | $(MODULE_NAME)-objs += common_main/core/wmt_ic_soc.o |
| 213 | $(MODULE_NAME)-objs += common_main/core/wmt_lib.o |
| 214 | $(MODULE_NAME)-objs += common_main/core/wmt_ic_6620.o |
| 215 | $(MODULE_NAME)-objs += common_main/core/stp_exp.o |
| 216 | $(MODULE_NAME)-objs += common_main/core/wmt_ic_6632.o |
| 217 | $(MODULE_NAME)-objs += common_main/core/wmt_exp.o |
| 218 | $(MODULE_NAME)-objs += common_main/core/btm_core.o |
| 219 | $(MODULE_NAME)-objs += common_main/core/wmt_ic_6630.o |
| 220 | |
| 221 | $(MODULE_NAME)-objs += common_main/linux/hif_sdio.o |
| 222 | $(MODULE_NAME)-objs += common_main/linux/stp_dbg_soc.o |
| 223 | $(MODULE_NAME)-objs += common_main/linux/stp_dbg_combo.o |
| 224 | $(MODULE_NAME)-objs += common_main/linux/osal.o |
| 225 | $(MODULE_NAME)-objs += common_main/linux/wmt_dev.o |
| 226 | $(MODULE_NAME)-objs += common_main/linux/stp_sdio.o |
| 227 | $(MODULE_NAME)-objs += common_main/linux/bgw_desense.o |
| 228 | $(MODULE_NAME)-objs += common_main/linux/wmt_idc.o |
| 229 | $(MODULE_NAME)-objs += common_main/linux/stp_uart.o |
| 230 | $(MODULE_NAME)-objs += common_main/linux/wmt_dbg.o |
| 231 | $(MODULE_NAME)-objs += common_main/linux/stp_dbg.o |
| 232 | ifneq ($(CONFIG_MTK_CONNSYS_DEDICATED_LOG_PATH),) |
| 233 | $(MODULE_NAME)-objs += common_main/linux/fw_log_wmt.o |
| 234 | endif |
| 235 | $(MODULE_NAME)-objs += common_main/linux/wmt_step.o |
| 236 | |
| 237 | ifeq ($(CONFIG_MTK_BTIF), y) |
| 238 | $(MODULE_NAME)-objs += common_main/linux/stp_btif.o |
| 239 | endif |
| 240 | |
| 241 | $(MODULE_NAME)-objs += debug_utility/ring.o |
| 242 | $(MODULE_NAME)-objs += debug_utility/ring_emi.o |
| 243 | $(MODULE_NAME)-objs += debug_utility/connsys_debug_utility.o |
| 244 | ############################################################################### |
| 245 | # test |
| 246 | ############################################################################### |
| 247 | ifeq ($(TARGET_BUILD_VARIANT),eng) |
| 248 | ccflags-y += -I$(src)/test/include |
| 249 | endif |
| 250 | |
| 251 | ifeq ($(TARGET_BUILD_VARIANT),eng) |
| 252 | $(MODULE_NAME)-objs += test/wmt_step_test.o |
| 253 | endif |
| 254 | |
| 255 | endif |