iwlwifi: update registers changed for 22560 devices
authorGolan Ben Ami <golan.ben.ami@intel.com>
Sun, 4 Feb 2018 15:04:31 +0000 (17:04 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 26 Jul 2018 10:16:18 +0000 (13:16 +0300)
In 22560 devices the firmware will do all the hw configurations,
but that's not ready yet.
Update the correct registers in the driver until the FW is ready
and does it by itself.

Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-fh.h
drivers/net/wireless/intel/iwlwifi/pcie/rx.c

index f286fc7..df0e9ff 100644 (file)
@@ -434,13 +434,15 @@ static inline unsigned int FH_MEM_CBBC_QUEUE(struct iwl_trans *trans,
  * RXF to DRAM.
  * Once the RXF-to-DRAM DMA is active, this flag is immediately turned off.
  */
-#define RFH_GEN_STATUS 0xA09808
+#define RFH_GEN_STATUS         0xA09808
+#define RFH_GEN_STATUS_GEN3    0xA07824
 #define RBD_FETCH_IDLE BIT(29)
 #define SRAM_DMA_IDLE  BIT(30)
 #define RXF_DMA_IDLE   BIT(31)
 
 /* DMA configuration */
-#define RFH_RXF_DMA_CFG 0xA09820
+#define RFH_RXF_DMA_CFG                0xA09820
+#define RFH_RXF_DMA_CFG_GEN3   0xA07880
 /* RB size */
 #define RFH_RXF_DMA_RB_SIZE_MASK (0x000F0000) /* bits 16-19 */
 #define RFH_RXF_DMA_RB_SIZE_POS 16
index 707242f..8cd0c3d 100644 (file)
@@ -167,7 +167,12 @@ static inline __le32 iwl_pcie_dma_addr2rbd_ptr(dma_addr_t dma_addr)
  */
 int iwl_pcie_rx_stop(struct iwl_trans *trans)
 {
-       if (trans->cfg->mq_rx_supported) {
+       if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) {
+               /* TODO: remove this for 22560 once fw does it */
+               iwl_write_prph(trans, RFH_RXF_DMA_CFG_GEN3, 0);
+               return iwl_poll_prph_bit(trans, RFH_GEN_STATUS_GEN3,
+                                        RXF_DMA_IDLE, RXF_DMA_IDLE, 1000);
+       } else if (trans->cfg->mq_rx_supported) {
                iwl_write_prph(trans, RFH_RXF_DMA_CFG, 0);
                return iwl_poll_prph_bit(trans, RFH_GEN_STATUS,
                                           RXF_DMA_IDLE, RXF_DMA_IDLE, 1000);