Zvikomborero VIncent Zvikaramba | b726168 | 2016-08-03 01:27:15 -0400 | [diff] [blame] | 1 | # Android makefile for the WLAN Module |
| 2 | |
Zvikomborero VIncent Zvikaramba | 7c436f9 | 2016-08-03 21:47:30 -0400 | [diff] [blame^] | 3 | # Assume no targets will be supported |
| 4 | WLAN_CHIPSET := |
| 5 | |
| 6 | # Build/Package options for 8960 target |
| 7 | ifeq ($(TARGET_BOARD_PLATFORM),msm8960) |
| 8 | WLAN_CHIPSET := prima |
| 9 | WLAN_SELECT := CONFIG_PRIMA_WLAN=m |
| 10 | endif |
| 11 | |
| 12 | # Build/Package options for 8916, 8974, 8226, 8610, 8909, 8952, 8937, 8953 targets |
| 13 | ifneq (,$(filter msm8916 msm8974 msm8226 msm8610 msm8909 msm8952 msm8937 msm8953 titanium,$(TARGET_BOARD_PLATFORM))) |
| 14 | WLAN_CHIPSET := pronto |
| 15 | WLAN_SELECT := CONFIG_PRONTO_WLAN=m |
| 16 | endif |
| 17 | |
| 18 | # Build/Package only in case of supported target |
| 19 | ifneq ($(WLAN_CHIPSET),) |
| 20 | |
Zvikomborero VIncent Zvikaramba | b726168 | 2016-08-03 01:27:15 -0400 | [diff] [blame] | 21 | LOCAL_PATH := $(call my-dir) |
| 22 | |
Zvikomborero VIncent Zvikaramba | 7c436f9 | 2016-08-03 21:47:30 -0400 | [diff] [blame^] | 23 | # This makefile is only for DLKM |
| 24 | ifneq ($(findstring vendor,$(LOCAL_PATH)),) |
| 25 | |
| 26 | # Determine if we are Proprietary or Open Source |
| 27 | ifneq ($(findstring opensource,$(LOCAL_PATH)),) |
| 28 | WLAN_PROPRIETARY := 0 |
| 29 | else |
| 30 | WLAN_PROPRIETARY := 1 |
| 31 | endif |
| 32 | |
| 33 | ifeq ($(WLAN_PROPRIETARY),1) |
| 34 | WLAN_BLD_DIR := vendor/qcom/proprietary/wlan |
| 35 | else |
| 36 | WLAN_BLD_DIR := vendor/qcom/opensource/wlan |
| 37 | endif |
| 38 | |
| 39 | # DLKM_DIR was moved for JELLY_BEAN (PLATFORM_SDK 16) |
| 40 | ifeq (1,$(filter 1,$(shell echo "$$(( $(PLATFORM_SDK_VERSION) >= 16 ))" ))) |
| 41 | DLKM_DIR := $(TOP)/device/qcom/common/dlkm |
| 42 | else |
| 43 | DLKM_DIR := build/dlkm |
| 44 | endif |
| 45 | |
| 46 | # Copy WCNSS_cfg.dat file from firmware_bin/ folder to target out directory. |
| 47 | ifeq ($(WLAN_PROPRIETARY),0) |
| 48 | |
| 49 | $(shell mkdir -p $(TARGET_OUT_ETC)/firmware/wlan/prima) |
| 50 | $(shell rm -f $(TARGET_OUT_ETC)/firmware/wlan/prima/WCNSS_cfg.dat) |
| 51 | $(shell cp $(LOCAL_PATH)/firmware_bin/WCNSS_cfg.dat $(TARGET_OUT_ETC)/firmware/wlan/prima) |
| 52 | |
| 53 | else |
| 54 | |
Zvikomborero VIncent Zvikaramba | b726168 | 2016-08-03 01:27:15 -0400 | [diff] [blame] | 55 | include $(CLEAR_VARS) |
| 56 | LOCAL_MODULE := WCNSS_qcom_wlan_nv.bin |
| 57 | LOCAL_MODULE_TAGS := optional |
| 58 | LOCAL_MODULE_CLASS := ETC |
| 59 | LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist |
| 60 | LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE) |
| 61 | include $(BUILD_PREBUILT) |
| 62 | |
| 63 | include $(CLEAR_VARS) |
| 64 | LOCAL_MODULE := WCNSS_cfg.dat |
| 65 | LOCAL_MODULE_TAGS := optional |
| 66 | LOCAL_MODULE_CLASS := ETC |
| 67 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/firmware/wlan/prima |
| 68 | LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE) |
| 69 | include $(BUILD_PREBUILT) |
| 70 | |
| 71 | include $(CLEAR_VARS) |
| 72 | LOCAL_MODULE := WCNSS_qcom_cfg.ini |
| 73 | LOCAL_MODULE_TAGS := optional |
| 74 | LOCAL_MODULE_CLASS := ETC |
| 75 | LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist |
| 76 | LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE) |
| 77 | include $(BUILD_PREBUILT) |
| 78 | |
Zvikomborero VIncent Zvikaramba | 7c436f9 | 2016-08-03 21:47:30 -0400 | [diff] [blame^] | 79 | endif |
| 80 | |
| 81 | ifeq ($(TARGET_KERNEL_VERSION),) |
| 82 | $(info "WLAN: TARGET_KERNEL_VERSION is not defined, assuming default") |
| 83 | TARGET_KERNEL_SOURCE := kernel |
| 84 | KERNEL_TO_BUILD_ROOT_OFFSET := ../ |
| 85 | endif |
| 86 | |
| 87 | ifeq ($(KERNEL_TO_BUILD_ROOT_OFFSET),) |
| 88 | $(info "WLAN: KERNEL_TO_BUILD_ROOT_OFFSET is not defined, assuming default") |
| 89 | KERNEL_TO_BUILD_ROOT_OFFSET := ../ |
| 90 | endif |
| 91 | |
| 92 | # Build wlan.ko as either prima_wlan.ko or pronto_wlan.ko |
| 93 | ########################################################### |
| 94 | |
| 95 | # This is set once per LOCAL_PATH, not per (kernel) module |
| 96 | KBUILD_OPTIONS := WLAN_ROOT=$(KERNEL_TO_BUILD_ROOT_OFFSET)$(WLAN_BLD_DIR)/prima |
| 97 | # We are actually building wlan.ko here, as per the |
| 98 | # requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE. |
| 99 | # This means we need to rename the module to <chipset>_wlan.ko |
| 100 | # after wlan.ko is built. |
| 101 | KBUILD_OPTIONS += MODNAME=wlan |
| 102 | KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) |
| 103 | KBUILD_OPTIONS += $(WLAN_SELECT) |
| 104 | |
| 105 | |
| 106 | VERSION=$(shell grep -w "VERSION =" $(TOP)/kernel/Makefile | sed 's/^VERSION = //' ) |
| 107 | PATCHLEVEL=$(shell grep -w "PATCHLEVEL =" $(TOP)/kernel/Makefile | sed 's/^PATCHLEVEL = //' ) |
| 108 | |
| 109 | include $(CLEAR_VARS) |
| 110 | LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko |
| 111 | LOCAL_MODULE_KBUILD_NAME := wlan.ko |
| 112 | LOCAL_MODULE_TAGS := debug |
| 113 | LOCAL_MODULE_DEBUG_ENABLE := true |
| 114 | LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET) |
| 115 | include $(DLKM_DIR)/AndroidKernelModule.mk |
| 116 | ########################################################### |
| 117 | |
Zvikomborero VIncent Zvikaramba | b726168 | 2016-08-03 01:27:15 -0400 | [diff] [blame] | 118 | #Create symbolic link |
| 119 | $(shell mkdir -p $(TARGET_OUT)/lib/modules; \ |
| 120 | ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(WLAN_CHIPSET)_wlan.ko \ |
| 121 | $(TARGET_OUT)/lib/modules/wlan.ko) |
Zvikomborero VIncent Zvikaramba | 7c436f9 | 2016-08-03 21:47:30 -0400 | [diff] [blame^] | 122 | |
| 123 | endif # DLKM check |
| 124 | |
| 125 | endif # supported target check |