iwlwifi: introduce device family AX210
[linux-block.git] / drivers / net / wireless / intel / iwlwifi / pcie / ctxt-info-gen3.c
index ceb3aa03d5618a749dd46be305c47c0f6a37590c..55b9120a136068817301aed3dda19e9b6ddf6d24 100644 (file)
@@ -66,6 +66,7 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
        void *iml_img;
        u32 control_flags = 0;
        int ret;
+       int cmdq_size = max_t(u32, TFD_CMD_SLOTS, trans->cfg->min_txq_size);
 
        /* Allocate prph scratch */
        prph_scratch = dma_alloc_coherent(trans->dev, sizeof(*prph_scratch),
@@ -151,7 +152,7 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
        ctxt_info_gen3->mcr_base_addr =
                cpu_to_le64(trans_pcie->rxq->used_bd_dma);
        ctxt_info_gen3->mtr_size =
-               cpu_to_le16(TFD_QUEUE_CB_SIZE(TFD_CMD_SLOTS));
+               cpu_to_le16(TFD_QUEUE_CB_SIZE(cmdq_size));
        ctxt_info_gen3->mcr_size =
                cpu_to_le16(RX_QUEUE_CB_SIZE(MQ_RX_TABLE_SIZE));
 
@@ -175,8 +176,14 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
        iwl_write64(trans, CSR_IML_DATA_ADDR,
                    trans_pcie->iml_dma_addr);
        iwl_write32(trans, CSR_IML_SIZE_ADDR, trans->iml_len);
-       iwl_set_bit(trans, CSR_CTXT_INFO_BOOT_CTRL, CSR_AUTO_FUNC_BOOT_ENA);
-       iwl_set_bit(trans, CSR_GP_CNTRL, CSR_AUTO_FUNC_INIT);
+
+       if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_AX210) {
+               iwl_write_prph(trans, UREG_CPU_INIT_RUN, 1);
+       } else {
+               iwl_set_bit(trans, CSR_CTXT_INFO_BOOT_CTRL,
+                           CSR_AUTO_FUNC_BOOT_ENA);
+               iwl_set_bit(trans, CSR_GP_CNTRL, CSR_AUTO_FUNC_INIT);
+       }
 
        return 0;
 }