killing things - respin
v2 cover killing things - respin
Just to avoid many merge conflicts I'm re-sending prev 2 patches in the same sack.
Bartosz Markowski (7):
ath10k: kill pci_write32_v1_workaround function
ath10k: kill TARGET_TYPE_AR9888
ath10k: replace AR9888 occurrences with QCA988x
ath10k: kill obsolete defines in hw.h
ath10k: remove odd line break
ath10k: change FW folder name from AR9888 -> QCA988X
ath10k: add new PCI 'feature' to track QCA988x_1.0 hacks
drivers/net/wireless/ath/ath10k/bmi.h | 12 +++-- drivers/net/wireless/ath/ath10k/core.c | 56 +++++++++--------------- drivers/net/wireless/ath/ath10k/core.h | 12 ++--- drivers/net/wireless/ath/ath10k/htt.h | 2 +- drivers/net/wireless/ath/ath10k/hw.h | 38 +++++++--------- drivers/net/wireless/ath/ath10k/pci.c | 63 ++++++++++++--------------- drivers/net/wireless/ath/ath10k/pci.h | 46 +++++++++---------- drivers/net/wireless/ath/ath10k/targaddrs.h | 6 +-- 8 files changed, 98 insertions(+), 137 deletions(-)
Signature · 1 line
1.7.10
PATCH v2 1/7 ath10k: kill pci_write32_v1_workaround function
--- drivers/net/wireless/ath/ath10k/pci.h | 38 +++++++++++++++------------------ 1 file changed, 17 insertions(+), 21 deletions(-)
drivers/net/wireless/ath/ath10k/pci.h +17 -21
@@ -268,26 +268,6 @@ static inline void ath10k_pci_reg_write32(void __iomem *mem, u32 addr, u32 val)/* Wait up to this many Ms for a Diagnostic Access CE operation to complete */ #define DIAG_ACCESS_CE_TIMEOUT_MS 10 -static inline void pci_write32_v1_workaround (struct ath10k *ar,u32 offset,u32 value) -{ -struct ath10k_pci *ar_pci =ath10k_pci_priv (ar); -void __iomem *addr = ar_pci->mem; - -if (ar_pci->hw_v1_workaround) { -unsigned long irq_flags; - -spin_lock_irqsave (&ar_pci->hw_v1_workaround_lock, irq_flags); - -ioread32 (addr+offset+4 );/* 3rd read prior to write */ -ioread32 (addr+offset+4 );/* 2nd read prior to write */ -ioread32 (addr+offset+4 );/* 1st read prior to write */ -iowrite32 (value, addr+offset); - -spin_unlock_irqrestore (&ar_pci->hw_v1_workaround_lock, irq_flags); - }else -iowrite32 (value, addr+offset); -} -/* * This API allows the Host to access Target registers directly * and relatively efficiently over PCIe.
@@ -318,7 +298,23 @@ static inline void pci_write32_v1_workaround(struct ath10k *ar, u32 offset, u32* multiple code paths may issue BEGIN/END on a single targid. */ static inline void ath10k_pci_write32 (struct ath10k *ar,u32 offset,u32 value) { -pci_write32_v1_workaround (ar, offset, value); + +struct ath10k_pci *ar_pci =ath10k_pci_priv (ar); +void __iomem *addr = ar_pci->mem; + +if (ar_pci->hw_v1_workaround) { +unsigned long irq_flags; + +spin_lock_irqsave (&ar_pci->hw_v1_workaround_lock, irq_flags); + +ioread32 (addr+offset+4 );/* 3rd read prior to write */ +ioread32 (addr+offset+4 );/* 2nd read prior to write */ +ioread32 (addr+offset+4 );/* 1st read prior to write */ +iowrite32 (value, addr+offset); + +spin_unlock_irqrestore (&ar_pci->hw_v1_workaround_lock, irq_flags); + }else +iowrite32 (value, addr+offset); }static inline u32 ath10k_pci_read32 (struct ath10k *ar,u32 offset) {
Signature · 1 line
1.7.10
PATCH v2 2/7 ath10k: kill TARGET_TYPE_AR9888
In reply to Bartosz MarkowskiGet rid of target_type variable also. At the moment ath10k does not support anything else then QCA988x HW.
--- drivers/net/wireless/ath/ath10k/bmi.h | 8 +++----- drivers/net/wireless/ath/ath10k/core.c | 28 ++++++---------------------- drivers/net/wireless/ath/ath10k/core.h | 12 +++--------- drivers/net/wireless/ath/ath10k/hw.h | 2 -- drivers/net/wireless/ath/ath10k/pci.c | 21 +++++++-------------- 5 files changed, 19 insertions(+), 52 deletions(-)
drivers/net/wireless/ath/ath10k/bmi.h +3 -5
@@ -198,8 +198,7 @@ int ath10k_bmi_write_memory(struct ath10k *ar, u32 address,u32 addr; \__le32 tmp; \ \ - addr =host_interest_item_address (ar->target_type, \ -HI_ITEM (item)); \ + addr =host_interest_item_address (HI_ITEM (item)); \ ret =ath10k_bmi_read_memory (ar, addr, (u8 *) &tmp,4 ); \ *val =__le32_to_cpu (tmp); \ ret; \
@@ -211,10 +210,9 @@ int ath10k_bmi_write_memory(struct ath10k *ar, u32 address,u32 address; \__le32 v =__cpu_to_le32 (val); \ \ - address =host_interest_item_address (ar->target_type, \ -HI_ITEM (item)); \ + address =host_interest_item_address (HI_ITEM (item)); \ ret =ath10k_bmi_write_memory (ar, address, \ - (u8 *) &v,sizeof (v)); \ + (u8 *) &v,sizeof (v)); \ ret; \ })
drivers/net/wireless/ath/ath10k/core.c +6 -22
@@ -191,7 +191,6 @@ static int ath10k_init_transfer_bin_file(struct ath10k *ar,const struct firmware *fw_entry;u32 fw_entry_size;u8 *temp_eeprom =NULL , *fw_buf =NULL ; -u32 board_data_size;switch (file) {default :
@@ -240,7 +239,6 @@ static int ath10k_init_transfer_bin_file(struct ath10k *ar,if (file ==ATH10K_FILE_BOARD_DATA && fw_entry->data) {u32 board_ext_address; -int32_t board_ext_data_size; temp_eeprom =kmalloc (fw_entry_size,GFP_ATOMIC );if (!temp_eeprom) {
@@ -251,16 +249,6 @@ static int ath10k_init_transfer_bin_file(struct ath10k *ar,memcpy (temp_eeprom, fw_buf, fw_entry_size); -switch (ar->target_type) { -default : - board_ext_data_size =0 ; -break ; -case TARGET_TYPE_AR9888 : - board_data_size =AR9888_BOARD_DATA_SZ ; - board_ext_data_size =AR9888_BOARD_EXT_DATA_SZ ; -break ; - } -/* Determine where in Target RAM to write Board Data */ ath10k_bmi_read32 (ar, hi_board_ext_data, &board_ext_address);
@@ -272,12 +260,10 @@ static int ath10k_init_transfer_bin_file(struct ath10k *ar,* Check whether the target has allocated memory for extended * board data and file contains extended board data */ -if (board_ext_address && (fw_entry_size == (board_data_size + - board_ext_data_size))) { +if (board_ext_address && (fw_entry_size == (AR9888_BOARD_DATA_SZ +AR9888_BOARD_EXT_DATA_SZ ))) { status =ath10k_bmi_write_memory (ar, board_ext_address, - (u8 *)(((unsigned long )temp_eeprom) + - board_data_size), - board_ext_data_size); + (u8 *)(((unsigned long )temp_eeprom) +AR9888_BOARD_DATA_SZ ), +AR9888_BOARD_EXT_DATA_SZ );if (status !=0 ) {ath10k_err ("ath10k: BMI operation failed\n" );
@@ -288,9 +274,9 @@ static int ath10k_init_transfer_bin_file(struct ath10k *ar,* Record the fact that extended board Data IS initialized */ ath10k_bmi_write32 (ar, hi_board_ext_data_config, - (board_ext_data_size <<16 ) |1 ); + (AR9888_BOARD_EXT_DATA_SZ <<16 ) |1 ); - fw_entry_size = board_data_size; + fw_entry_size =AR9888_BOARD_DATA_SZ ; } }
@@ -410,7 +396,7 @@ static int ath10k_init_hw_params(struct ath10k *ar) }struct ath10k *ath10k_core_create (void *hif_priv,struct device *dev, -enum ath10k_bus bus,u32 target_type, +enum ath10k_bus bus,const struct ath10k_hif_ops *hif_ops) {struct ath10k *ar;
@@ -426,7 +412,6 @@ struct ath10k *ath10k_core_create(void *hif_priv, struct device *dev, ar->p2p = !!ath10k_p2p; ar->dev = dev; - ar->target_type = target_type; ar->hif.priv = hif_priv; ar->hif.ops = hif_ops;
@@ -487,7 +472,6 @@ int ath10k_core_register(struct ath10k *ar)if (status) goto err; - ar->target_type = target_info.type; ar->target_version = target_info.version; ar->hw->wiphy->hw_version = target_info.version;
drivers/net/wireless/ath/ath10k/core.h +3 -9
@@ -105,14 +105,9 @@ static inline int ath10k_skb_unmap(struct device *dev, struct sk_buff *skb)return 0 ; } -static inline u32 host_interest_item_address (u32 target_type,u32 item_offset) +static inline u32 host_interest_item_address (u32 item_offset) { -switch (target_type) { -default : -WARN_ON (1 ); -case TARGET_TYPE_AR9888 : -return AR9888_HOST_INTEREST_ADDRESS + item_offset; - } +return AR9888_HOST_INTEREST_ADDRESS + item_offset; }struct ath10k_bmi {
@@ -266,7 +261,6 @@ struct ath10k {struct device *dev;u8 mac_addr[ETH_ALEN ]; -u32 target_type;u32 target_version;u8 fw_version_major;u32 fw_version_minor;
@@ -370,7 +364,7 @@ static inline struct ath_common *ath10k_common(struct ath10k *ar) }struct ath10k *ath10k_core_create (void *hif_priv,struct device *dev, -enum ath10k_bus bus,u32 target_type, +enum ath10k_bus bus,const struct ath10k_hif_ops *hif_ops);void ath10k_core_destroy (struct ath10k *ar);
drivers/net/wireless/ath/ath10k/hw.h +0 -2
@@ -20,8 +20,6 @@#include "targaddrs.h" -#define TARGET_TYPE_AR9888 7 -/* Supported FW version */ #define SUPPORTED_FW_MAJOR 1#define SUPPORTED_FW_MINOR 0
drivers/net/wireless/ath/ath10k/pci.c +7 -14
@@ -694,10 +694,9 @@ static void ath10k_pci_hif_dump_area(struct ath10k *ar)u32 host_addr;u32 i; - host_addr =host_interest_item_address (ar->target_type, -HI_ITEM (hi_failure_state)); -if (ath10k_pci_diag_read_mem (ar, host_addr, (u8 *) ®_dump_area, -sizeof (u32)) !=0 ) { + host_addr =host_interest_item_address (HI_ITEM (hi_failure_state)); +if (ath10k_pci_diag_read_mem (ar, host_addr, + (u8 *) ®_dump_area,sizeof (u32)) !=0 ) {ath10k_warn ("could not read hi_failure_state\n" );return ; }
@@ -1478,8 +1477,7 @@ static int ath10k_pci_init_config(struct ath10k *ar)int ret =0 ;/* Download to Target the CE Config and the service-to-CE map */ - interconnect_targ_addr =host_interest_item_address (ar->target_type, -HI_ITEM (hi_interconnect_state)); + interconnect_targ_addr =host_interest_item_address (HI_ITEM (hi_interconnect_state));/* Supply Target-side CE configuration */ ret = ath10k_pci_diag_read_access(ar, interconnect_targ_addr,
@@ -1560,8 +1558,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) }/* configure early allocation */ - ealloc_targ_addr =host_interest_item_address (ar->target_type, -HI_ITEM (hi_early_alloc)); + ealloc_targ_addr =host_interest_item_address (HI_ITEM (hi_early_alloc)); ret =ath10k_pci_diag_read_access (ar, ealloc_targ_addr, &ealloc_value);if (ret !=0 ) {
@@ -1582,8 +1579,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) }/* Tell Target to proceed with initialization */ - flag2_targ_addr =host_interest_item_address (ar->target_type, -HI_ITEM (hi_option_flag2)); + flag2_targ_addr =host_interest_item_address (HI_ITEM (hi_option_flag2)); ret =ath10k_pci_diag_read_access (ar, flag2_targ_addr, &flag2_value);if (ret !=0 ) {
@@ -2154,7 +2150,6 @@ static int ath10k_pci_probe(struct pci_dev *pdev,u32 fw_indicator;u32 lcr_val;int retries =3 ; -u32 target_type;ath10k_dbg (ATH10K_DBG_PCI ,"%s\n" , __func__); retry:
@@ -2169,10 +2164,8 @@ retry:switch (pci_dev->device) {case AR9888_1_0_DEVICE_ID : - target_type =TARGET_TYPE_AR9888 ;break ;case AR9888_2_0_DEVICE_ID : - target_type =TARGET_TYPE_AR9888 ;set_bit (ATH10K_PCI_FEATURE_MSI_X , ar_pci->features);break ;default :
@@ -2184,7 +2177,7 @@ retry:ath10k_pci_dump_features (ar_pci); ar =ath10k_core_create (ar_pci, ar_pci->dev,ATH10K_BUS_PCI , - target_type, &ath10k_pci_hif_ops); + &ath10k_pci_hif_ops);if (!ar) {ath10k_err ("ath10k_core_create failed!\n" ); ret = -EINVAL ;
Signature · 1 line
1.7.10
PATCH v2 3/7 ath10k: replace AR9888 occurrences with QCA988x
In reply to Bartosz Markowski--- drivers/net/wireless/ath/ath10k/bmi.h | 4 +-- drivers/net/wireless/ath/ath10k/core.c | 38 +++++++++++++-------------- drivers/net/wireless/ath/ath10k/core.h | 2 +- drivers/net/wireless/ath/ath10k/htt.h | 2 +- drivers/net/wireless/ath/ath10k/hw.h | 32 +++++++++++----------- drivers/net/wireless/ath/ath10k/pci.c | 36 ++++++++++++------------- drivers/net/wireless/ath/ath10k/pci.h | 2 +- drivers/net/wireless/ath/ath10k/targaddrs.h | 6 ++--- 8 files changed, 61 insertions(+), 61 deletions(-)
drivers/net/wireless/ath/ath10k/bmi.h +2 -2
@@ -27,8 +27,8 @@* to read memory, write memory, execute code, and to define an * application entry PC. * -* It is used to download an application to AR9K, to provide -* patches to code that is already resident on AR9K, and generally +* It is used to download an application to QCA988x, to provide +* patches to code that is already resident on QCA988x, and generally * to examine and modify state. The Host has an opportunity to use * BMI only once during bootup. Once the Host issues a BMI_DONE * command, this opportunity ends.
drivers/net/wireless/ath/ath10k/core.c +19 -19
@@ -45,25 +45,25 @@ enum ath10k_file {static const struct ath10k_hw_params ath10k_hw_params_list[] = { { - .id =AR9888_HW_1_0_VERSION , + .id =QCA988X_HW_1_0_VERSION , .name ="qca988x hw1.0" , - .patch_load_addr =AR9888_HW_1_0_PATCH_LOAD_ADDR , + .patch_load_addr =QCA988X_HW_1_0_PATCH_LOAD_ADDR , .fw = { - .dir =AR9888_HW_1_0_FW_DIR , - .fw =AR9888_HW_1_0_FW_FILE , - .otp =AR9888_HW_1_0_OTP_FILE , - .board =AR9888_HW_1_0_BOARD_DATA_FILE , + .dir =QCA988X_HW_1_0_FW_DIR , + .fw =QCA988X_HW_1_0_FW_FILE , + .otp =QCA988X_HW_1_0_OTP_FILE , + .board =QCA988X_HW_1_0_BOARD_DATA_FILE , }, }, { - .id =AR9888_HW_2_0_VERSION , + .id =QCA988X_HW_2_0_VERSION , .name ="qca988x hw2.0" , - .patch_load_addr =AR9888_HW_2_0_PATCH_LOAD_ADDR , + .patch_load_addr =QCA988X_HW_2_0_PATCH_LOAD_ADDR , .fw = { - .dir =AR9888_HW_2_0_FW_DIR , - .fw =AR9888_HW_2_0_FW_FILE , - .otp =AR9888_HW_2_0_OTP_FILE , - .board =AR9888_HW_2_0_BOARD_DATA_FILE , + .dir =QCA988X_HW_2_0_FW_DIR , + .fw =QCA988X_HW_2_0_FW_FILE , + .otp =QCA988X_HW_2_0_OTP_FILE , + .board =QCA988X_HW_2_0_BOARD_DATA_FILE , }, }, };
@@ -260,10 +260,10 @@ static int ath10k_init_transfer_bin_file(struct ath10k *ar,* Check whether the target has allocated memory for extended * board data and file contains extended board data */ -if (board_ext_address && (fw_entry_size == (AR9888_BOARD_DATA_SZ +AR9888_BOARD_EXT_DATA_SZ ))) { +if (board_ext_address && (fw_entry_size == (QCA988X_BOARD_DATA_SZ +QCA988X_BOARD_EXT_DATA_SZ ))) { status =ath10k_bmi_write_memory (ar, board_ext_address, - (u8 *)(((unsigned long )temp_eeprom) +AR9888_BOARD_DATA_SZ ), -AR9888_BOARD_EXT_DATA_SZ ); + (u8 *)(((unsigned long )temp_eeprom) +QCA988X_BOARD_DATA_SZ ), +QCA988X_BOARD_EXT_DATA_SZ );if (status !=0 ) {ath10k_err ("ath10k: BMI operation failed\n" );
@@ -274,9 +274,9 @@ static int ath10k_init_transfer_bin_file(struct ath10k *ar,* Record the fact that extended board Data IS initialized */ ath10k_bmi_write32 (ar, hi_board_ext_data_config, - (AR9888_BOARD_EXT_DATA_SZ <<16 ) |1 ); + (QCA988X_BOARD_EXT_DATA_SZ <<16 ) |1 ); - fw_entry_size =AR9888_BOARD_DATA_SZ ; + fw_entry_size =QCA988X_BOARD_DATA_SZ ; } }
@@ -354,7 +354,7 @@ static int ath10k_init_download_firmware(struct ath10k *ar) }if (uart_print) { -/* Configure GPIO AR9888 UART */ +/* Configure GPIO QCA988X UART */ ath10k_bmi_write32 (ar, hi_dbg_uart_txpin,7 );ath10k_bmi_write32 (ar, hi_serial_enable,1 ); }else {
@@ -610,5 +610,5 @@ int ath10k_core_target_resume(struct ath10k *ar) {EXPORT_SYMBOL (ath10k_core_target_resume);MODULE_AUTHOR ("Qualcomm Atheros" ); -MODULE_DESCRIPTION ("Core module for AR9888 PCIe devices." ); +MODULE_DESCRIPTION ("Core module for QCA988X PCIe devices." );MODULE_LICENSE ("Dual BSD/GPL" );
drivers/net/wireless/ath/ath10k/core.h +1 -1
@@ -107,7 +107,7 @@ static inline int ath10k_skb_unmap(struct device *dev, struct sk_buff *skb)static inline u32 host_interest_item_address (u32 item_offset) { -return AR9888_HOST_INTEREST_ADDRESS + item_offset; +return QCA988X_HOST_INTEREST_ADDRESS + item_offset; }struct ath10k_bmi {
drivers/net/wireless/ath/ath10k/htt.h +1 -1
@@ -962,7 +962,7 @@ static inline struct htt_stats_conf_item *htt_stats_conf_next_item(* MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and * MSDU_EXT/FRAG_DESC. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr. -* For AR9888 HW the firmware will use fragment_desc_ptr but in WIFI2.0 +* For QCA988X HW the firmware will use fragment_desc_ptr but in WIFI2.0 * the hardware does the mapping/translation. * * Total banks that can be configured is configured to 16.
drivers/net/wireless/ath/ath10k/hw.h +16 -16
@@ -26,21 +26,21 @@#define SUPPORTED_FW_RELEASE 0#define SUPPORTED_FW_BUILD 599 -/* AR9888 1.0 definitions */ -#define AR9888_HW_1_0_VERSION 0x4000002c -#define AR9888_HW_1_0_FW_DIR "ath10k/AR9888/hw1.0" -#define AR9888_HW_1_0_FW_FILE "firmware.bin" -#define AR9888_HW_1_0_OTP_FILE "otp.bin" -#define AR9888_HW_1_0_BOARD_DATA_FILE "board.bin" -#define AR9888_HW_1_0_PATCH_LOAD_ADDR 0x1234 +/* QCA988X 1.0 definitions */ +#define QCA988X_HW_1_0_VERSION 0x4000002c +#define QCA988X_HW_1_0_FW_DIR "ath10k/AR9888/hw1.0" +#define QCA988X_HW_1_0_FW_FILE "firmware.bin" +#define QCA988X_HW_1_0_OTP_FILE "otp.bin" +#define QCA988X_HW_1_0_BOARD_DATA_FILE "board.bin" +#define QCA988X_HW_1_0_PATCH_LOAD_ADDR 0x1234 -/* AR9888 2.0 definitions */ -#define AR9888_HW_2_0_VERSION 0x4100016c -#define AR9888_HW_2_0_FW_DIR "ath10k/AR9888/hw2.0" -#define AR9888_HW_2_0_FW_FILE "firmware.bin" -#define AR9888_HW_2_0_OTP_FILE "otp.bin" -#define AR9888_HW_2_0_BOARD_DATA_FILE "board.bin" -#define AR9888_HW_2_0_PATCH_LOAD_ADDR 0x1234 +/* QCA988X 2.0 definitions */ +#define QCA988X_HW_2_0_VERSION 0x4100016c +#define QCA988X_HW_2_0_FW_DIR "ath10k/AR9888/hw2.0" +#define QCA988X_HW_2_0_FW_FILE "firmware.bin" +#define QCA988X_HW_2_0_OTP_FILE "otp.bin" +#define QCA988X_HW_2_0_BOARD_DATA_FILE "board.bin" +#define QCA988X_HW_2_0_PATCH_LOAD_ADDR 0x1234/* Known pecularities: * - current FW doesn't support raw rx mode (last tested v599)
@@ -298,8 +298,8 @@ enum ath10k_mcast2ucast_mode {#define WINDOW_READ_ADDR_ADDRESS MISSING#define WINDOW_WRITE_ADDR_ADDRESS MISSING -#define MY_TARGET_BOARD_DATA_SZ AR9888_BOARD_DATA_SZ -#define MY_TARGET_BOARD_EXT_DATA_SZ AR9888_BOARD_EXT_DATA_SZ +#define MY_TARGET_BOARD_DATA_SZ QCA988X_BOARD_DATA_SZ +#define MY_TARGET_BOARD_EXT_DATA_SZ QCA988X_BOARD_EXT_DATA_SZ#define RTC_STATE_V_GET (x) \ (((x) & RTC_STATE_V_MASK) >> RTC_STATE_V_LSB)
drivers/net/wireless/ath/ath10k/pci.c +18 -18
@@ -36,12 +36,12 @@ unsigned int ath10k_target_ps;module_param (ath10k_target_ps, uint,0644 );MODULE_PARM_DESC (ath10k_target_ps,"Enable ath10k Target (SoC) PS option" ); -#define AR9888_1_0_DEVICE_ID (0xabcd) -#define AR9888_2_0_DEVICE_ID (0x003c) +#define QCA988X_1_0_DEVICE_ID (0xabcd) +#define QCA988X_2_0_DEVICE_ID (0x003c)static DEFINE_PCI_DEVICE_TABLE (ath10k_pci_id_table) = { - {PCI_VDEVICE (ATHEROS ,AR9888_1_0_DEVICE_ID ) },/* PCI-E AR9888 V1 */ - {PCI_VDEVICE (ATHEROS ,AR9888_2_0_DEVICE_ID ) },/* PCI-E AR9888 V2 */ + {PCI_VDEVICE (ATHEROS ,QCA988X_1_0_DEVICE_ID ) },/* PCI-E QCA988X V1 */ + {PCI_VDEVICE (ATHEROS ,QCA988X_2_0_DEVICE_ID ) },/* PCI-E QCA988X V2 */ {0 } };
@@ -690,7 +690,7 @@ static u16 ath10k_pci_hif_get_free_queue_number(struct ath10k *ar, u8 pipe)static void ath10k_pci_hif_dump_area (struct ath10k *ar) {u32 reg_dump_area =0 ; -u32 reg_dump_values[REG_DUMP_COUNT_AR9888 ]; +u32 reg_dump_values[REG_DUMP_COUNT_QCA988X ];u32 host_addr;u32 i;
@@ -705,13 +705,13 @@ static void ath10k_pci_hif_dump_area(struct ath10k *ar)if (ath10k_pci_diag_read_mem (ar, reg_dump_area, (u8 *) ®_dump_values[0 ], -REG_DUMP_COUNT_AR9888 *sizeof (u32)) !=0 ) { +REG_DUMP_COUNT_QCA988X *sizeof (u32)) !=0 ) {ath10k_err ("could not dump FW Dump Area\n" );return ; }ath10k_err ("target Register Dump\n" ); -for (i =0 ; i <REG_DUMP_COUNT_AR9888 ; i++) +for (i =0 ; i <REG_DUMP_COUNT_QCA988X ; i++)ath10k_err ("[%02d]: 0x%08X\n" , i, reg_dump_values[i]); }
@@ -2163,9 +2163,9 @@ retry: ar_pci->dev = &pdev->dev;switch (pci_dev->device) { -case AR9888_1_0_DEVICE_ID : +case QCA988X_1_0_DEVICE_ID :break ; -case AR9888_2_0_DEVICE_ID : +case QCA988X_2_0_DEVICE_ID :set_bit (ATH10K_PCI_FEATURE_MSI_X , ar_pci->features);break ;default :
@@ -2184,8 +2184,8 @@ retry: goto err_ar_pci; } -/* Enable AR9888 V1 HW workarounds */ -if (pci_dev->device ==AR9888_1_0_DEVICE_ID ) { +/* Enable QCA988X_1.0 HW workarounds */ +if (pci_dev->device ==QCA988X_1_0_DEVICE_ID ) { ar_pci->hw_v1_workaround = true;spin_lock_init (&ar_pci->hw_v1_workaround_lock); }
@@ -2507,11 +2507,11 @@ static void __exit ath10k_pci_exit(void)module_exit (ath10k_pci_exit);MODULE_AUTHOR ("Qualcomm Atheros" ); -MODULE_DESCRIPTION ("Driver support for Atheros AR9888 PCIe devices" ); +MODULE_DESCRIPTION ("Driver support for Atheros QCA988X PCIe devices" );MODULE_LICENSE ("Dual BSD/GPL" ); -MODULE_FIRMWARE (AR9888_HW_1_0_FW_DIR "/" AR9888_HW_1_0_FW_FILE ); -MODULE_FIRMWARE (AR9888_HW_1_0_FW_DIR "/" AR9888_HW_1_0_OTP_FILE ); -MODULE_FIRMWARE (AR9888_HW_1_0_FW_DIR "/" AR9888_HW_1_0_BOARD_DATA_FILE ); -MODULE_FIRMWARE (AR9888_HW_2_0_FW_DIR "/" AR9888_HW_2_0_FW_FILE ); -MODULE_FIRMWARE (AR9888_HW_2_0_FW_DIR "/" AR9888_HW_2_0_OTP_FILE ); -MODULE_FIRMWARE (AR9888_HW_2_0_FW_DIR "/" AR9888_HW_2_0_BOARD_DATA_FILE ); +MODULE_FIRMWARE (QCA988X_HW_1_0_FW_DIR "/" QCA988X_HW_1_0_FW_FILE ); +MODULE_FIRMWARE (QCA988X_HW_1_0_FW_DIR "/" QCA988X_HW_1_0_OTP_FILE ); +MODULE_FIRMWARE (QCA988X_HW_1_0_FW_DIR "/" QCA988X_HW_1_0_BOARD_DATA_FILE ); +MODULE_FIRMWARE (QCA988X_HW_2_0_FW_DIR "/" QCA988X_HW_2_0_FW_FILE ); +MODULE_FIRMWARE (QCA988X_HW_2_0_FW_DIR "/" QCA988X_HW_2_0_OTP_FILE ); +MODULE_FIRMWARE (QCA988X_HW_2_0_FW_DIR "/" QCA988X_HW_2_0_BOARD_DATA_FILE );
drivers/net/wireless/ath/ath10k/pci.h +1 -1
@@ -24,7 +24,7 @@#include "ce.h" /* FW dump area */ -#define REG_DUMP_COUNT_AR9888 60 +#define REG_DUMP_COUNT_QCA988X 60/* * maximum number of bytes that can be handled atomically by DiagRead/DiagWrite
drivers/net/wireless/ath/ath10k/targaddrs.h +3 -3
@@ -31,7 +31,7 @@* write a single binary that works with all Target Types. * May be used in assembler code as well as C. */ -#define AR9888_HOST_INTEREST_ADDRESS 0x00400800 +#define QCA988X_HOST_INTEREST_ADDRESS 0x00400800#define HOST_INTEREST_MAX_SIZE 0x200/*
@@ -443,7 +443,7 @@ Fw Mode/SubMode Mask ((HOST_INTEREST ->hi_smps_options &HI_SMPS_ALLOW_MASK )) /* Reserve 1024 bytes for extended board data */ -#define AR9888_BOARD_DATA_SZ 7168 -#define AR9888_BOARD_EXT_DATA_SZ 0 +#define QCA988X_BOARD_DATA_SZ 7168 +#define QCA988X_BOARD_EXT_DATA_SZ 0#endif /* __TARGADDRS_H__ */
Signature · 1 line
1.7.10
PATCH v2 4/7 ath10k: kill obsolete defines in hw.h
In reply to Bartosz Markowski--- drivers/net/wireless/ath/ath10k/hw.h | 3 --- 1 file changed, 3 deletions(-)
drivers/net/wireless/ath/ath10k/hw.h +0 -3
@@ -298,9 +298,6 @@ enum ath10k_mcast2ucast_mode {#define WINDOW_READ_ADDR_ADDRESS MISSING#define WINDOW_WRITE_ADDR_ADDRESS MISSING -#define MY_TARGET_BOARD_DATA_SZ QCA988X_BOARD_DATA_SZ -#define MY_TARGET_BOARD_EXT_DATA_SZ QCA988X_BOARD_EXT_DATA_SZ -#define RTC_STATE_V_GET (x) \ (((x) & RTC_STATE_V_MASK) >> RTC_STATE_V_LSB)
Signature · 1 line
1.7.10
PATCH v2 5/7 ath10k: remove odd line break
In reply to Bartosz Markowski--- drivers/net/wireless/ath/ath10k/hw.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wireless/ath/ath10k/hw.h +1 -2
@@ -298,7 +298,6 @@ enum ath10k_mcast2ucast_mode {#define WINDOW_READ_ADDR_ADDRESS MISSING#define WINDOW_WRITE_ADDR_ADDRESS MISSING -#define RTC_STATE_V_GET (x) \ - (((x) & RTC_STATE_V_MASK) >> RTC_STATE_V_LSB) +#define RTC_STATE_V_GET (x) (((x) & RTC_STATE_V_MASK) >> RTC_STATE_V_LSB)#endif /* _HW_H_ */
Signature · 1 line
1.7.10
PATCH v2 6/7 ath10k: change FW folder name from AR9888 -> QCA988X
In reply to Bartosz Markowski--- drivers/net/wireless/ath/ath10k/hw.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath10k/hw.h +2 -2
@@ -28,7 +28,7 @@/* QCA988X 1.0 definitions */ #define QCA988X_HW_1_0_VERSION 0x4000002c -#define QCA988X_HW_1_0_FW_DIR "ath10k/AR9888/hw1.0" +#define QCA988X_HW_1_0_FW_DIR "ath10k/QCA988X/hw1.0"#define QCA988X_HW_1_0_FW_FILE "firmware.bin"#define QCA988X_HW_1_0_OTP_FILE "otp.bin"#define QCA988X_HW_1_0_BOARD_DATA_FILE "board.bin"
@@ -36,7 +36,7 @@/* QCA988X 2.0 definitions */ #define QCA988X_HW_2_0_VERSION 0x4100016c -#define QCA988X_HW_2_0_FW_DIR "ath10k/AR9888/hw2.0" +#define QCA988X_HW_2_0_FW_DIR "ath10k/QCA988X/hw2.0"#define QCA988X_HW_2_0_FW_FILE "firmware.bin"#define QCA988X_HW_2_0_OTP_FILE "otp.bin"#define QCA988X_HW_2_0_BOARD_DATA_FILE "board.bin"
Signature · 1 line
1.7.10
PATCH v2 7/7 ath10k: add new PCI 'feature' to track QCA988x_1.0 hacks
In reply to Bartosz MarkowskiThis is to remove excessive bool variable from ar_pci struct and to not check directly device version, again.
--- drivers/net/wireless/ath/ath10k/pci.c | 8 +++++--- drivers/net/wireless/ath/ath10k/pci.h | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +5 -3
@@ -2134,6 +2134,9 @@ static void ath10k_pci_dump_features(struct ath10k_pci *ar_pci)case ATH10K_PCI_FEATURE_MSI_X :ath10k_dbg (ATH10K_DBG_PCI ,"device supports MSI-X\n" );break ; +case ATH10K_PCI_FEATURE_HW_1_0_WARKAROUND : +ath10k_dbg (ATH10K_DBG_PCI ,"QCA988X_1.0 workaround enabled\n" ); +break ; } } }
@@ -2164,6 +2167,7 @@ retry:switch (pci_dev->device) {case QCA988X_1_0_DEVICE_ID : +set_bit (ATH10K_PCI_FEATURE_HW_1_0_WARKAROUND , ar_pci->features);break ;case QCA988X_2_0_DEVICE_ID :set_bit (ATH10K_PCI_FEATURE_MSI_X , ar_pci->features);
@@ -2185,10 +2189,8 @@ retry: }/* Enable QCA988X_1.0 HW workarounds */ -if (pci_dev->device ==QCA988X_1_0_DEVICE_ID ) { - ar_pci->hw_v1_workaround = true; +if (test_bit (ATH10K_PCI_FEATURE_HW_1_0_WARKAROUND , ar_pci->features))spin_lock_init (&ar_pci->hw_v1_workaround_lock); - } ar_pci->ar = ar;pci_set_drvdata (pdev, ar);
drivers/net/wireless/ath/ath10k/pci.h +4 -4
@@ -151,7 +151,8 @@ struct service_to_pipe { };enum ath10k_pci_features { -ATH10K_PCI_FEATURE_MSI_X =0 , +ATH10K_PCI_FEATURE_MSI_X =0 , +ATH10K_PCI_FEATURE_HW_1_0_WARKAROUND =1 ,/* keep last */ ATH10K_PCI_FEATURE_COUNT
@@ -228,7 +229,6 @@ struct ath10k_pci {/* Map CE id to ce_state */ struct ce_state *ce_id_to_state[CE_COUNT_MAX ]; -bool hw_v1_workaround;spinlock_t hw_v1_workaround_lock; };
@@ -302,7 +302,7 @@ static inline void ath10k_pci_write32(struct ath10k *ar, u32 offset, u32 value)struct ath10k_pci *ar_pci =ath10k_pci_priv (ar);void __iomem *addr = ar_pci->mem; -if (ar_pci->hw_v1_workaround) { +if (test_bit (ATH10K_PCI_FEATURE_HW_1_0_WARKAROUND , ar_pci->features)) {unsigned long irq_flags;spin_lock_irqsave (&ar_pci->hw_v1_workaround_lock, irq_flags);
@@ -335,7 +335,7 @@ static inline void ath10k_set_source_ring_write_index(struct ath10k *ar,struct ath10k_pci *ar_pci =ath10k_pci_priv (ar);void __iomem *indicator_addr; -if (!ar_pci->hw_v1_workaround) { +if (!test_bit (ATH10K_PCI_FEATURE_HW_1_0_WARKAROUND , ar_pci->features)) {CE_SRC_RING_WRITE_IDX_SET (ar, ctrl_addr, write_index);return ; }
Signature · 1 line
1.7.10
v2 cover killing things - respin
In reply to Bartosz MarkowskiQuoted 11 lines · Bartosz Markowski
Just to avoid many merge conflicts I'm re-sending prev 2 patches in the same sack.
Bartosz Markowski (7):
ath10k: killpci_write32_v1_workaroundfunction
ath10k: killTARGET_TYPE_AR9888
ath10k: replace AR9888 occurrences with QCA988x
ath10k: kill obsolete defines inhw.h
ath10k: remove odd line break
ath10k: change FW folder name from AR9888 -> QCA988X
ath10k: add new PCI 'feature' to track QCA988x_1.0 hacks
Thanks, all patches expect patch 5 applied. I had already fixed what patch 5 did in my patch.
Signature · 1 line
Kalle Valo