From e93d52557a4e17a61e91382559f28eee2620e036 Mon Sep 17 00:00:00 2001 From: Yue Ma Date: Mon, 24 Oct 2016 18:38:11 -0700 Subject: [PATCH] qcacld-3.0: Remove obsolete codeswap feature Codeswap feature is introduced for a WLAN chipset which is already cancelled. It is no longer used in host driver. Remove the feature to avoid any confusion for future development. Change-Id: I70ae291ded2d2e290408e2f5b177e872f1f3d7e8 CRs-fixed: 1082183 --- Kbuild | 7 ------- core/bmi/src/ol_fw.c | 27 --------------------------- core/pld/inc/pld_common.h | 23 ----------------------- core/pld/src/pld_common.c | 33 --------------------------------- core/pld/src/pld_pcie.c | 25 ------------------------- core/pld/src/pld_pcie.h | 6 ------ 6 files changed, 121 deletions(-) diff --git a/Kbuild b/Kbuild index f8f2e9af635a..6c934325efef 100644 --- a/Kbuild +++ b/Kbuild @@ -1454,13 +1454,6 @@ CDEFINES += -DWLAN_FEATURE_RX_FULL_REORDER_OL endif endif -#enable Code swap feature -ifeq ($(CONFIG_CNSS), y) -ifeq ($(CONFIG_HIF_PCI), 1) -CDEFINES += -DCONFIG_CODESWAP_FEATURE -endif -endif - #Enable Signed firmware support for split binary format ifeq ($(CONFIG_QCA_SIGNED_SPLIT_BINARY_SUPPORT), 1) CDEFINES += -DQCA_SIGNED_SPLIT_BINARY_SUPPORT diff --git a/core/bmi/src/ol_fw.c b/core/bmi/src/ol_fw.c index 6eb34d64391a..5eeab5c1538d 100644 --- a/core/bmi/src/ol_fw.c +++ b/core/bmi/src/ol_fw.c @@ -1204,31 +1204,6 @@ end: return status; } -/* AXI Start Address */ -#define TARGET_ADDR (0xa0000) - -static void ol_transfer_codeswap_struct(struct ol_context *ol_ctx) -{ - struct pld_codeswap_codeseg_info wlan_codeswap; - QDF_STATUS rv; - qdf_device_t qdf_dev = ol_ctx->qdf_dev; - - if (pld_get_codeswap_struct(qdf_dev->dev, &wlan_codeswap)) { - BMI_ERR("%s: failed to get codeswap structure", __func__); - return; - } - - rv = bmi_write_memory(TARGET_ADDR, - (uint8_t *) &wlan_codeswap, sizeof(wlan_codeswap), - ol_ctx); - - if (rv != QDF_STATUS_SUCCESS) { - BMI_ERR("Failed to Write 0xa0000 to Target"); - return; - } - BMI_INFO("codeswap structure is successfully downloaded"); -} - QDF_STATUS ol_download_firmware(struct ol_context *ol_ctx) { struct hif_opaque_softc *scn = ol_ctx->scn; @@ -1304,8 +1279,6 @@ QDF_STATUS ol_download_firmware(struct ol_context *ol_ctx) BMI_INFO("%s: Using 0x%x for the remainder of init", __func__, address); - ol_transfer_codeswap_struct(ol_ctx); - status = ol_transfer_bin_file(ol_ctx, ATH_OTP_FILE, address, true); /* Execute the OTP code only if entry found and downloaded */ diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h index 20f62cb2e913..3a9bd1266c11 100644 --- a/core/pld/inc/pld_common.h +++ b/core/pld/inc/pld_common.h @@ -96,27 +96,6 @@ struct pld_fw_files { char setup_file[PLD_MAX_FILE_NAME]; }; -#define PLD_CODESWAP_MAX_CODESEGS 16 - -/** - * struct pld_codeswap_codeseg_info - code swap segment information - * @codeseg_total_bytes: total bytes of segments - * @num_codesegs: number of code segments - * @codeseg_size: code segment size - * @codeseg_size_log2: log2 of code segment size - * @codeseg_busaddr: array of addresses of each code segment - * - * pld_codeswap_codeseg_info is used to store code swap segment - * information. - */ -struct pld_codeswap_codeseg_info { - u32 codeseg_total_bytes; - u32 num_codesegs; - u32 codeseg_size; - u32 codeseg_size_log2; - void *codeseg_busaddr[PLD_CODESWAP_MAX_CODESEGS]; -}; - /** * enum pld_platform_cap_flag - platform capability flag * @PLD_HAS_EXTERNAL_SWREG: has external regulator @@ -333,8 +312,6 @@ int pld_get_fw_files_for_target(struct device *dev, u32 target_type, u32 target_version); void pld_is_pci_link_down(struct device *dev); int pld_shadow_control(struct device *dev, bool enable); -int pld_get_codeswap_struct(struct device *dev, - struct pld_codeswap_codeseg_info *swap_seg); int pld_set_wlan_unsafe_channel(struct device *dev, u16 *unsafe_ch_list, u16 ch_count); int pld_get_wlan_unsafe_channel(struct device *dev, u16 *unsafe_ch_list, diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index b94473ef3894..649b00680612 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -538,39 +538,6 @@ int pld_shadow_control(struct device *dev, bool enable) return ret; } -/** - * pld_get_codeswap_struct() - Get codeswap structure - * @dev: device - * @swap_seg: buffer to codeswap information - * - * Return codeswap structure information to the buffer. - * - * Return: 0 for success - * Non zero failure code for errors - */ -int pld_get_codeswap_struct(struct device *dev, - struct pld_codeswap_codeseg_info *swap_seg) -{ - int ret = 0; - - switch (pld_get_bus_type(dev)) { - case PLD_BUS_TYPE_PCIE: - ret = pld_pcie_get_codeswap_struct(swap_seg); - break; - case PLD_BUS_TYPE_SNOC: - break; - case PLD_BUS_TYPE_SDIO: - break; - case PLD_BUS_TYPE_USB: - break; - default: - ret = -EINVAL; - break; - } - - return ret; -} - /** * pld_set_wlan_unsafe_channel() - Set unsafe channel * @dev: device diff --git a/core/pld/src/pld_pcie.c b/core/pld/src/pld_pcie.c index ada4fd1126b5..f481f3ca9930 100644 --- a/core/pld/src/pld_pcie.c +++ b/core/pld/src/pld_pcie.c @@ -457,31 +457,6 @@ int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files, return 0; } -/** - * pld_pcie_get_codeswap_struct() - Get codeswap structure - * @swap_seg: buffer to codeswap information - * - * Return codeswap structure information to the buffer. - * - * Return: 0 for success - * Non zero failure code for errors - */ -int pld_pcie_get_codeswap_struct(struct pld_codeswap_codeseg_info *swap_seg) -{ - int ret = 0; - struct codeswap_codeseg_info cnss_swap_seg; - - if (swap_seg == NULL) - return -ENODEV; - - ret = cnss_get_codeswap_struct(&cnss_swap_seg); - if (0 != ret) - return ret; - - memcpy(swap_seg, &cnss_swap_seg, sizeof(*swap_seg)); - return 0; -} - /** * pld_pcie_get_platform_cap() - Get platform capabilities * @cap: buffer to the capabilities diff --git a/core/pld/src/pld_pcie.h b/core/pld/src/pld_pcie.h index f14f555d5628..4831120c9e7d 100644 --- a/core/pld/src/pld_pcie.h +++ b/core/pld/src/pld_pcie.h @@ -137,11 +137,6 @@ static inline int pld_pcie_shadow_control(bool enable) return 0; } static inline int -pld_pcie_get_codeswap_struct(struct pld_codeswap_codeseg_info *swap_seg) -{ - return 0; -} -static inline int pld_pcie_set_wlan_unsafe_channel(u16 *unsafe_ch_list, u16 ch_count) { return 0; @@ -230,7 +225,6 @@ static inline uint8_t *pld_pcie_get_wlan_mac_address(struct device *dev, #else int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files, u32 target_type, u32 target_version); -int pld_pcie_get_codeswap_struct(struct pld_codeswap_codeseg_info *swap_seg); int pld_pcie_get_platform_cap(struct pld_platform_cap *cap); void pld_pcie_set_driver_status(enum pld_driver_status status);