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