iwlwifi: pcie: start early debug for 22560 devices
authorGolan Ben Ami <golan.ben.ami@intel.com>
Tue, 26 Dec 2017 12:49:30 +0000 (14:49 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 26 Jul 2018 10:16:15 +0000 (13:16 +0300)
In 22560 devices we can start debug using context info gen3. Configure
the fw to start collecting logs to the dram before init.

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/pcie/ctxt-info-gen3.c
drivers/net/wireless/intel/iwlwifi/pcie/internal.h
drivers/net/wireless/intel/iwlwifi/pcie/trans.c

index fc926354e5738a1ee80ea2c59336c3d15bdbbabb..2146fda8da2fdbdece661ceb3e177ab7c5c2b83e 100644 (file)
@@ -84,13 +84,22 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
        control_flags = IWL_PRPH_SCRATCH_RB_SIZE_4K |
                        IWL_PRPH_SCRATCH_MTR_MODE |
                        (IWL_PRPH_MTR_FORMAT_256B &
-                        IWL_PRPH_SCRATCH_MTR_FORMAT);
+                        IWL_PRPH_SCRATCH_MTR_FORMAT) |
+                       IWL_PRPH_SCRATCH_EARLY_DEBUG_EN |
+                       IWL_PRPH_SCRATCH_EDBG_DEST_DRAM;
        prph_sc_ctrl->control.control_flags = cpu_to_le32(control_flags);
 
        /* initialize RX default queue */
        prph_sc_ctrl->rbd_cfg.free_rbd_addr =
                cpu_to_le64(trans_pcie->rxq->bd_dma);
 
+       /* Configure debug, for integration */
+       iwl_pcie_alloc_fw_monitor(trans, 0);
+       prph_sc_ctrl->hwm_cfg.hwm_base_addr =
+               cpu_to_le64(trans_pcie->fw_mon_phys);
+       prph_sc_ctrl->hwm_cfg.hwm_size =
+               cpu_to_le32(trans_pcie->fw_mon_size);
+
        /* allocate ucode sections in dram and set addresses */
        ret = iwl_pcie_init_fw_sec(trans, fw, &prph_scratch->dram);
        if (ret) {
@@ -157,10 +166,6 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
 
        iwl_enable_interrupts(trans);
 
-       /* Configure debug, if exists */
-       if (trans->dbg_dest_tlv)
-               iwl_pcie_apply_destination(trans);
-
        /* kick FW self load */
        iwl_write64(trans, CSR_CTXT_INFO_ADDR,
                    trans_pcie->ctxt_info_dma_addr);
index 5db9ded4bb237af1415fcf8e9905bfc4972ca9b3..e14d2003244f72d2cdf814eb2dc5a84404dd907a 100644 (file)
@@ -895,6 +895,9 @@ void iwl_pcie_free_tso_page(struct iwl_trans_pcie *trans_pcie,
 struct iwl_tso_hdr_page *get_page_hdr(struct iwl_trans *trans, size_t len);
 #endif
 
+/* common functions that are used by gen3 transport */
+void iwl_pcie_alloc_fw_monitor(struct iwl_trans *trans, u8 max_power);
+
 /* transport gen 2 exported functions */
 int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans,
                                 const struct fw_img *fw, bool run_in_rfkill);
index e0398ef073882214725e6684209bbc1d7771a515..bc14227c95acad6992fe80f6f6f83858654a1859 100644 (file)
@@ -203,7 +203,7 @@ static void iwl_pcie_free_fw_monitor(struct iwl_trans *trans)
        trans_pcie->fw_mon_size = 0;
 }
 
-static void iwl_pcie_alloc_fw_monitor(struct iwl_trans *trans, u8 max_power)
+void iwl_pcie_alloc_fw_monitor(struct iwl_trans *trans, u8 max_power)
 {
        struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
        struct page *page = NULL;