Lines Matching full:trans
6 #include "iwl-trans.h"
33 iwl_pcie_ctxt_info_dbg_enable(struct iwl_trans *trans, in iwl_pcie_ctxt_info_dbg_enable() argument
41 if (!iwl_trans_dbg_ini_valid(trans)) { in iwl_pcie_ctxt_info_dbg_enable()
42 struct iwl_dram_data *fw_mon = &trans->dbg.fw_mon; in iwl_pcie_ctxt_info_dbg_enable()
44 iwl_pcie_alloc_fw_monitor(trans, 0); in iwl_pcie_ctxt_info_dbg_enable()
49 IWL_DEBUG_FW(trans, in iwl_pcie_ctxt_info_dbg_enable()
59 fw_mon_cfg = &trans->dbg.fw_mon_cfg[alloc_id]; in iwl_pcie_ctxt_info_dbg_enable()
64 IWL_DEBUG_FW(trans, in iwl_pcie_ctxt_info_dbg_enable()
70 IWL_DEBUG_FW(trans, in iwl_pcie_ctxt_info_dbg_enable()
75 if (trans->dbg.fw_mon_ini[alloc_id].num_frags) { in iwl_pcie_ctxt_info_dbg_enable()
77 &trans->dbg.fw_mon_ini[alloc_id].frags[0]; in iwl_pcie_ctxt_info_dbg_enable()
81 dbg_cfg->debug_token_config = cpu_to_le32(trans->dbg.ucode_preset); in iwl_pcie_ctxt_info_dbg_enable()
82 IWL_DEBUG_FW(trans, in iwl_pcie_ctxt_info_dbg_enable()
85 IWL_DEBUG_FW(trans, in iwl_pcie_ctxt_info_dbg_enable()
88 trans->dbg.fw_mon_ini[alloc_id].num_frags); in iwl_pcie_ctxt_info_dbg_enable()
92 IWL_DEBUG_FW(trans, "WRT: Invalid buffer destination (%d)\n", in iwl_pcie_ctxt_info_dbg_enable()
100 int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, in iwl_pcie_ctxt_info_gen3_init() argument
103 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); in iwl_pcie_ctxt_info_gen3_init()
112 trans->cfg->min_txq_size); in iwl_pcie_ctxt_info_gen3_init()
134 if (trans->dsbr_urm_fw_dependent) in iwl_pcie_ctxt_info_gen3_init()
137 if (trans->dsbr_urm_permanent) in iwl_pcie_ctxt_info_gen3_init()
140 if (trans->ext_32khz_clock_valid) in iwl_pcie_ctxt_info_gen3_init()
144 prph_scratch = dma_alloc_coherent(trans->dev, sizeof(*prph_scratch), in iwl_pcie_ctxt_info_gen3_init()
154 cpu_to_le16((u16)trans->hw_rev); in iwl_pcie_ctxt_info_gen3_init()
160 if (trans->trans_cfg->imr_enabled) in iwl_pcie_ctxt_info_gen3_init()
163 if (CSR_HW_REV_TYPE(trans->hw_rev) == IWL_CFG_MAC_TYPE_GL && in iwl_pcie_ctxt_info_gen3_init()
166 IWL_DEBUG_FW(trans, in iwl_pcie_ctxt_info_gen3_init()
175 iwl_pcie_ctxt_info_dbg_enable(trans, &prph_sc_ctrl->hwm_cfg, in iwl_pcie_ctxt_info_gen3_init()
181 prph_sc_ctrl->step_cfg.mbx_addr_0 = cpu_to_le32(trans->mbx_addr_0_step); in iwl_pcie_ctxt_info_gen3_init()
182 prph_sc_ctrl->step_cfg.mbx_addr_1 = cpu_to_le32(trans->mbx_addr_1_step); in iwl_pcie_ctxt_info_gen3_init()
185 ret = iwl_pcie_init_fw_sec(trans, fw, &prph_scratch->dram); in iwl_pcie_ctxt_info_gen3_init()
200 prph_info = dma_alloc_coherent(trans->dev, PAGE_SIZE, in iwl_pcie_ctxt_info_gen3_init()
209 ctxt_info_gen3 = dma_alloc_coherent(trans->dev, in iwl_pcie_ctxt_info_gen3_init()
237 cpu_to_le16(RX_QUEUE_CB_SIZE(trans->cfg->num_rbds)); in iwl_pcie_ctxt_info_gen3_init()
244 trans_pcie->iml = dma_alloc_coherent(trans->dev, trans->iml_len, in iwl_pcie_ctxt_info_gen3_init()
252 memcpy(trans_pcie->iml, trans->iml, trans->iml_len); in iwl_pcie_ctxt_info_gen3_init()
254 iwl_enable_fw_load_int_ctx_info(trans); in iwl_pcie_ctxt_info_gen3_init()
257 iwl_write64(trans, CSR_CTXT_INFO_ADDR, in iwl_pcie_ctxt_info_gen3_init()
259 iwl_write64(trans, CSR_IML_DATA_ADDR, in iwl_pcie_ctxt_info_gen3_init()
261 iwl_write32(trans, CSR_IML_SIZE_ADDR, trans->iml_len); in iwl_pcie_ctxt_info_gen3_init()
263 iwl_set_bit(trans, CSR_CTXT_INFO_BOOT_CTRL, in iwl_pcie_ctxt_info_gen3_init()
269 dma_free_coherent(trans->dev, sizeof(*trans_pcie->ctxt_info_gen3), in iwl_pcie_ctxt_info_gen3_init()
274 dma_free_coherent(trans->dev, PAGE_SIZE, prph_info, in iwl_pcie_ctxt_info_gen3_init()
278 dma_free_coherent(trans->dev, in iwl_pcie_ctxt_info_gen3_init()
286 void iwl_pcie_ctxt_info_gen3_free(struct iwl_trans *trans, bool alive) in iwl_pcie_ctxt_info_gen3_free() argument
288 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); in iwl_pcie_ctxt_info_gen3_free()
291 dma_free_coherent(trans->dev, trans->iml_len, trans_pcie->iml, in iwl_pcie_ctxt_info_gen3_free()
297 iwl_pcie_ctxt_info_free_fw_img(trans); in iwl_pcie_ctxt_info_gen3_free()
306 dma_free_coherent(trans->dev, sizeof(*trans_pcie->ctxt_info_gen3), in iwl_pcie_ctxt_info_gen3_free()
312 dma_free_coherent(trans->dev, sizeof(*trans_pcie->prph_scratch), in iwl_pcie_ctxt_info_gen3_free()
319 dma_free_coherent(trans->dev, PAGE_SIZE, trans_pcie->prph_info, in iwl_pcie_ctxt_info_gen3_free()
325 static int iwl_pcie_load_payloads_continuously(struct iwl_trans *trans, in iwl_pcie_load_payloads_continuously() argument
332 IWL_DEBUG_FW(trans, "expected 2 payloads, got %d.\n", in iwl_pcie_load_payloads_continuously()
340 IWL_DEBUG_FW(trans, "sizes of payloads overflow.\n"); in iwl_pcie_load_payloads_continuously()
345 dram->block = iwl_pcie_ctxt_info_dma_alloc_coherent(trans, len, in iwl_pcie_load_payloads_continuously()
348 IWL_DEBUG_FW(trans, "Failed to allocate PNVM DMA.\n"); in iwl_pcie_load_payloads_continuously()
360 (struct iwl_trans *trans, in iwl_pcie_load_payloads_segments() argument
374 (trans, in iwl_pcie_load_payloads_segments()
378 IWL_DEBUG_FW(trans, "Failed to allocate PNVM DMA.\n"); in iwl_pcie_load_payloads_segments()
390 if (iwl_pcie_ctxt_info_alloc_dma(trans, in iwl_pcie_load_payloads_segments()
395 trans->dev); in iwl_pcie_load_payloads_segments()
414 int iwl_trans_pcie_ctx_info_gen3_load_pnvm(struct iwl_trans *trans, in iwl_trans_pcie_ctx_info_gen3_load_pnvm() argument
418 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); in iwl_trans_pcie_ctx_info_gen3_load_pnvm()
425 if (trans->pnvm_loaded) in iwl_trans_pcie_ctx_info_gen3_load_pnvm()
431 if (trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210) in iwl_trans_pcie_ctx_info_gen3_load_pnvm()
435 IWL_DEBUG_FW(trans, "no payloads\n"); in iwl_trans_pcie_ctx_info_gen3_load_pnvm()
441 ret = iwl_pcie_load_payloads_segments(trans, in iwl_trans_pcie_ctx_info_gen3_load_pnvm()
445 trans->pnvm_loaded = true; in iwl_trans_pcie_ctx_info_gen3_load_pnvm()
449 (trans, in iwl_trans_pcie_ctx_info_gen3_load_pnvm()
454 trans->pnvm_loaded = true; in iwl_trans_pcie_ctx_info_gen3_load_pnvm()
473 static void iwl_pcie_set_pnvm_segments(struct iwl_trans *trans) in iwl_pcie_set_pnvm_segments() argument
475 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); in iwl_pcie_set_pnvm_segments()
486 static void iwl_pcie_set_continuous_pnvm(struct iwl_trans *trans) in iwl_pcie_set_continuous_pnvm() argument
488 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); in iwl_pcie_set_continuous_pnvm()
498 void iwl_trans_pcie_ctx_info_gen3_set_pnvm(struct iwl_trans *trans, in iwl_trans_pcie_ctx_info_gen3_set_pnvm() argument
501 if (trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210) in iwl_trans_pcie_ctx_info_gen3_set_pnvm()
505 iwl_pcie_set_pnvm_segments(trans); in iwl_trans_pcie_ctx_info_gen3_set_pnvm()
507 iwl_pcie_set_continuous_pnvm(trans); in iwl_trans_pcie_ctx_info_gen3_set_pnvm()
510 int iwl_trans_pcie_ctx_info_gen3_load_reduce_power(struct iwl_trans *trans, in iwl_trans_pcie_ctx_info_gen3_load_reduce_power() argument
514 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); in iwl_trans_pcie_ctx_info_gen3_load_reduce_power()
521 if (trans->reduce_power_loaded) in iwl_trans_pcie_ctx_info_gen3_load_reduce_power()
524 if (trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210) in iwl_trans_pcie_ctx_info_gen3_load_reduce_power()
531 IWL_DEBUG_FW(trans, "no payloads\n"); in iwl_trans_pcie_ctx_info_gen3_load_reduce_power()
537 ret = iwl_pcie_load_payloads_segments(trans, in iwl_trans_pcie_ctx_info_gen3_load_reduce_power()
541 trans->reduce_power_loaded = true; in iwl_trans_pcie_ctx_info_gen3_load_reduce_power()
545 (trans, in iwl_trans_pcie_ctx_info_gen3_load_reduce_power()
550 trans->reduce_power_loaded = true; in iwl_trans_pcie_ctx_info_gen3_load_reduce_power()
557 static void iwl_pcie_set_reduce_power_segments(struct iwl_trans *trans) in iwl_pcie_set_reduce_power_segments() argument
559 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); in iwl_pcie_set_reduce_power_segments()
570 static void iwl_pcie_set_continuous_reduce_power(struct iwl_trans *trans) in iwl_pcie_set_continuous_reduce_power() argument
572 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); in iwl_pcie_set_continuous_reduce_power()
583 iwl_trans_pcie_ctx_info_gen3_set_reduce_power(struct iwl_trans *trans, in iwl_trans_pcie_ctx_info_gen3_set_reduce_power() argument
586 if (trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210) in iwl_trans_pcie_ctx_info_gen3_set_reduce_power()
590 iwl_pcie_set_reduce_power_segments(trans); in iwl_trans_pcie_ctx_info_gen3_set_reduce_power()
592 iwl_pcie_set_continuous_reduce_power(trans); in iwl_trans_pcie_ctx_info_gen3_set_reduce_power()