]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
iwlwifi: pcie: support dumping FH in a000 hw
authorLiad Kaufman <liad.kaufman@intel.com>
Sun, 26 Mar 2017 10:56:28 +0000 (13:56 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Mon, 5 Jun 2017 20:29:37 +0000 (23:29 +0300)
FH in A000 HW are placed in a different location,
and need to be read as prph, rather than direct.
Support A000 dumping as well as legacy.

Signed-off-by: Liad Kaufman <liad.kaufman@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/trans.c

index 62f9fe926d781ee3dc87fff75b4fd270e5ab97f0..2a992277c6712eb7f6db67e8e13204c9d94f8382 100644 (file)
@@ -77,6 +77,8 @@
  */
 #define FH_MEM_LOWER_BOUND                   (0x1000)
 #define FH_MEM_UPPER_BOUND                   (0x2000)
+#define FH_MEM_LOWER_BOUND_GEN2              (0xa06000)
+#define FH_MEM_UPPER_BOUND_GEN2              (0xa08000)
 
 /**
  * Keep-Warm (KW) buffer base address.
index 3af02f491e80f539bce424f78d4c12956e4ad708..375bdca157049e72f47bec23d6347873e22ef46a 100644 (file)
@@ -2575,8 +2575,15 @@ static u32 iwl_trans_pcie_fh_regs_dump(struct iwl_trans *trans,
        (*data)->len = cpu_to_le32(fh_regs_len);
        val = (void *)(*data)->data;
 
-       for (i = FH_MEM_LOWER_BOUND; i < FH_MEM_UPPER_BOUND; i += sizeof(u32))
-               *val++ = cpu_to_le32(iwl_trans_pcie_read32(trans, i));
+       if (!trans->cfg->gen2)
+               for (i = FH_MEM_LOWER_BOUND; i < FH_MEM_UPPER_BOUND;
+                    i += sizeof(u32))
+                       *val++ = cpu_to_le32(iwl_trans_pcie_read32(trans, i));
+       else
+               for (i = FH_MEM_LOWER_BOUND_GEN2; i < FH_MEM_UPPER_BOUND_GEN2;
+                    i += sizeof(u32))
+                       *val++ = cpu_to_le32(iwl_trans_pcie_read_prph(trans,
+                                                                     i));
 
        iwl_trans_release_nic_access(trans, &flags);
 
@@ -2752,7 +2759,12 @@ static struct iwl_trans_dump_data
        len += sizeof(*data) + IWL_CSR_TO_DUMP;
 
        /* FH registers */
-       len += sizeof(*data) + (FH_MEM_UPPER_BOUND - FH_MEM_LOWER_BOUND);
+       if (trans->cfg->gen2)
+               len += sizeof(*data) +
+                      (FH_MEM_UPPER_BOUND_GEN2 - FH_MEM_LOWER_BOUND_GEN2);
+       else
+               len += sizeof(*data) +
+                      (FH_MEM_UPPER_BOUND - FH_MEM_LOWER_BOUND);
 
        if (dump_rbs) {
                /* Dump RBs is supported only for pre-9000 devices (1 queue) */