blob: 0f020f36a5fcc922b86a15f9bbabfa511c4d454b [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001# Android makefile for the WLAN Module
2
3# Assume no targets will be supported
4WLAN_CHIPSET :=
5
6ifeq ($(BOARD_HAS_QCOM_WLAN), true)
7
8# Build/Package options for 8084/8092/8960/8992/8994 target
9ifeq ($(call is-board-platform-in-list, apq8084 mpq8092 msm8960 msm8992 msm8994 msm8996 msm8998),true)
10 WLAN_CHIPSET := qca_cld
11 WLAN_SELECT := CONFIG_QCA_CLD_WLAN=m
12endif # platform
13
14# Build/Package only in case of supported target
15ifneq ($(WLAN_CHIPSET),)
16
17LOCAL_PATH := $(call my-dir)
18
19# This makefile is only for DLKM
20ifneq ($(findstring vendor,$(LOCAL_PATH)),)
21
22ifneq ($(findstring opensource,$(LOCAL_PATH)),)
23 WLAN_PROPRIETARY := 0
24 WLAN_BLD_DIR := vendor/qcom/opensource/wlan
25else
26 WLAN_PROPRIETARY := 1
27 WLAN_BLD_DIR := vendor/qcom/proprietary/wlan-noship
28endif # opensource
29
30# DLKM_DIR was moved for JELLY_BEAN (PLATFORM_SDK 16)
31ifeq ($(call is-platform-sdk-version-at-least,16),true)
32 DLKM_DIR := $(TOP)/device/qcom/common/dlkm
33else
34 DLKM_DIR := build/dlkm
35endif # platform-sdk-version
36
37# Copy WCNSS_cfg.dat and WCNSS_qcom_cfg.ini file from firmware_bin/ folder to target out directory.
38ifeq ($(call is-board-platform-in-list, msm8960),true)
39$(shell rm -f $(TARGET_OUT_ETC)/firmware/wlan/qca_cld/WCNSS_cfg.dat)
40$(shell rm -f $(TARGET_OUT_ETC)/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini)
41$(shell cp $(LOCAL_PATH)/firmware_bin/WCNSS_cfg.dat $(TARGET_OUT_ETC)/firmware/wlan/qca_cld)
42$(shell cp $(LOCAL_PATH)/firmware_bin/WCNSS_qcom_cfg.ini $(TARGET_OUT_ETC)/firmware/wlan/qca_cld)
43endif
44
45# Build wlan.ko as $(WLAN_CHIPSET)_wlan.ko
46###########################################################
47# This is set once per LOCAL_PATH, not per (kernel) module
48ifeq ($(WLAN_PROPRIETARY),1)
49 KBUILD_OPTIONS := WLAN_ROOT=../$(WLAN_BLD_DIR)/qcacld-new
50else
51 KBUILD_OPTIONS := WLAN_ROOT=../$(WLAN_BLD_DIR)/qcacld-3.0
52endif # WLAN_PROPRIETARY
53# We are actually building wlan.ko here, as per the
54# requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE.
55# This means we need to rename the module to <chipset>_wlan.ko
56# after wlan.ko is built.
57KBUILD_OPTIONS += MODNAME=wlan
58KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
59KBUILD_OPTIONS += $(WLAN_SELECT)
60
61include $(CLEAR_VARS)
62ifeq ($(WLAN_PROPRIETARY),1)
63 LOCAL_MODULE := proprietary_$(WLAN_CHIPSET)_wlan.ko
64else
65 LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko
66endif # WLAN_PROPRIETARY
67LOCAL_MODULE_KBUILD_NAME := wlan.ko
68LOCAL_MODULE_TAGS := debug
69LOCAL_MODULE_DEBUG_ENABLE := true
70LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET)
71include $(DLKM_DIR)/AndroidKernelModule.mk
72###########################################################
73
74# Create Symbolic link
75ifeq ($(WLAN_PROPRIETARY),1)
76$(shell mkdir -p $(TARGET_OUT)/lib/modules; \
77 ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(LOCAL_MODULE) \
78 $(TARGET_OUT)/lib/modules/wlan.ko)
79endif
80$(shell ln -sf /persist/wlan_mac.bin $(TARGET_OUT_ETC)/firmware/wlan/qca_cld/wlan_mac.bin)
81
82ifeq ($(call is-board-platform-in-list, msm8960),true)
83$(shell ln -sf /firmware/image/bdwlan20.bin $(TARGET_OUT_ETC)/firmware/fakeboar.bin)
84$(shell ln -sf /firmware/image/otp20.bin $(TARGET_OUT_ETC)/firmware/otp.bin)
85$(shell ln -sf /firmware/image/utf20.bin $(TARGET_OUT_ETC)/firmware/utf.bin)
86$(shell ln -sf /firmware/image/qwlan20.bin $(TARGET_OUT_ETC)/firmware/athwlan.bin)
87
88$(shell ln -sf /firmware/image/bdwlan20.bin $(TARGET_OUT_ETC)/firmware/bdwlan20.bin)
89$(shell ln -sf /firmware/image/otp20.bin $(TARGET_OUT_ETC)/firmware/otp20.bin)
90$(shell ln -sf /firmware/image/utf20.bin $(TARGET_OUT_ETC)/firmware/utf20.bin)
91$(shell ln -sf /firmware/image/qwlan20.bin $(TARGET_OUT_ETC)/firmware/qwlan20.bin)
92
93$(shell ln -sf /firmware/image/bdwlan30.bin $(TARGET_OUT_ETC)/firmware/bdwlan30.bin)
94$(shell ln -sf /firmware/image/otp30.bin $(TARGET_OUT_ETC)/firmware/otp30.bin)
95$(shell ln -sf /firmware/image/utf30.bin $(TARGET_OUT_ETC)/firmware/utf30.bin)
96$(shell ln -sf /firmware/image/qwlan30.bin $(TARGET_OUT_ETC)/firmware/qwlan30.bin)
97endif
98
99# Copy config ini files to target
100#ifeq ($(call is-board-platform-in-list, msm8992 msm8994),false)
101ifeq ($(WLAN_PROPRIETARY),1)
102$(shell mkdir -p $(TARGET_OUT)/etc/firmware/wlan/$(WLAN_CHIPSET))
103$(shell mkdir -p $(TARGET_OUT)/etc/wifi)
104$(shell rm -f $(TARGET_OUT)/etc/wifi/WCNSS_qcom_cfg.ini)
105$(shell rm -f $(TARGET_OUT)/etc/firmware/wlan/$(WLAN_SHIPSET)/WCNSS_cfg.dat)
106$(shell cp $(LOCAL_PATH)/config/WCNSS_qcom_cfg.ini $(TARGET_OUT)/etc/wifi)
107$(shell cp $(LOCAL_PATH)/firmware_bin/WCNSS_cfg.dat $(TARGET_OUT)/etc/firmware/wlan/$(WLAN_CHIPSET))
108endif
109#endif
110
111endif # DLKM check
112
113endif # supported target check
114endif # WLAN enabled check