Lines Matching +full:fw +full:- +full:cfg

1 // SPDX-License-Identifier: BSD-3-Clause-Clear
3 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
4 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
11 #include <linux/dma-mapping.h>
27 { .compatible = "qcom,ipq8074-wifi",
30 { .compatible = "qcom,ipq6018-wifi",
33 { .compatible = "qcom,wcn6750-wifi",
36 { .compatible = "qcom,ipq5018-wifi",
47 "misc-pulse1",
48 "misc-latch",
49 "sw-exception",
63 "host2wbm-desc-feed",
64 "host2reo-re-injection",
65 "host2reo-command",
66 "host2rxdma-monitor-ring3",
67 "host2rxdma-monitor-ring2",
68 "host2rxdma-monitor-ring1",
69 "reo2ost-exception",
70 "wbm2host-rx-release",
71 "reo2host-status",
72 "reo2host-destination-ring4",
73 "reo2host-destination-ring3",
74 "reo2host-destination-ring2",
75 "reo2host-destination-ring1",
76 "rxdma2host-monitor-destination-mac3",
77 "rxdma2host-monitor-destination-mac2",
78 "rxdma2host-monitor-destination-mac1",
79 "ppdu-end-interrupts-mac3",
80 "ppdu-end-interrupts-mac2",
81 "ppdu-end-interrupts-mac1",
82 "rxdma2host-monitor-status-ring-mac3",
83 "rxdma2host-monitor-status-ring-mac2",
84 "rxdma2host-monitor-status-ring-mac1",
85 "host2rxdma-host-buf-ring-mac3",
86 "host2rxdma-host-buf-ring-mac2",
87 "host2rxdma-host-buf-ring-mac1",
88 "rxdma2host-destination-ring-mac3",
89 "rxdma2host-destination-ring-mac2",
90 "rxdma2host-destination-ring-mac1",
91 "host2tcl-input-ring4",
92 "host2tcl-input-ring3",
93 "host2tcl-input-ring2",
94 "host2tcl-input-ring1",
95 "wbm2host-tx-completions-ring3",
96 "wbm2host-tx-completions-ring2",
97 "wbm2host-tx-completions-ring1",
98 "tcl2host-status-ring",
101 /* enum ext_irq_num - irq numbers that can be used by external modules
146 return ab->pci.msi.irqs[vector]; in ath11k_ahb_get_msi_irq_wcn6750()
173 iowrite32(value, ab->mem + window_start + in ath11k_ahb_window_write32_wcn6750()
185 val = ioread32(ab->mem + window_start + in ath11k_ahb_window_read32_wcn6750()
200 return ioread32(ab->mem + offset); in ath11k_ahb_read32()
205 iowrite32(value, ab->mem + offset); in ath11k_ahb_write32()
212 for (i = 0; i < ab->hw_params.ce_count; i++) { in ath11k_ahb_kill_tasklets()
213 struct ath11k_ce_pipe *ce_pipe = &ab->ce.ce_pipe[i]; in ath11k_ahb_kill_tasklets()
218 tasklet_kill(&ce_pipe->intr_tq); in ath11k_ahb_kill_tasklets()
226 for (i = 0; i < irq_grp->num_irq; i++) in ath11k_ahb_ext_grp_disable()
227 disable_irq_nosync(irq_grp->ab->irq_num[irq_grp->irqs[i]]); in ath11k_ahb_ext_grp_disable()
235 struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i]; in __ath11k_ahb_ext_irq_disable()
239 if (irq_grp->napi_enabled) { in __ath11k_ahb_ext_irq_disable()
240 napi_synchronize(&irq_grp->napi); in __ath11k_ahb_ext_irq_disable()
241 napi_disable(&irq_grp->napi); in __ath11k_ahb_ext_irq_disable()
242 irq_grp->napi_enabled = false; in __ath11k_ahb_ext_irq_disable()
251 for (i = 0; i < irq_grp->num_irq; i++) in ath11k_ahb_ext_grp_enable()
252 enable_irq(irq_grp->ab->irq_num[irq_grp->irqs[i]]); in ath11k_ahb_ext_grp_enable()
274 const struct ce_ie_addr *ce_ie_addr = ab->hw_params.ce_ie_addr; in ath11k_ahb_ce_irq_enable()
277 ie1_reg_addr = ce_ie_addr->ie1_reg_addr + ATH11K_CE_OFFSET(ab); in ath11k_ahb_ce_irq_enable()
278 ie2_reg_addr = ce_ie_addr->ie2_reg_addr + ATH11K_CE_OFFSET(ab); in ath11k_ahb_ce_irq_enable()
279 ie3_reg_addr = ce_ie_addr->ie3_reg_addr + ATH11K_CE_OFFSET(ab); in ath11k_ahb_ce_irq_enable()
281 ce_attr = &ab->hw_params.host_ce_config[ce_id]; in ath11k_ahb_ce_irq_enable()
282 if (ce_attr->src_nentries) in ath11k_ahb_ce_irq_enable()
285 if (ce_attr->dest_nentries) { in ath11k_ahb_ce_irq_enable()
295 const struct ce_ie_addr *ce_ie_addr = ab->hw_params.ce_ie_addr; in ath11k_ahb_ce_irq_disable()
298 ie1_reg_addr = ce_ie_addr->ie1_reg_addr + ATH11K_CE_OFFSET(ab); in ath11k_ahb_ce_irq_disable()
299 ie2_reg_addr = ce_ie_addr->ie2_reg_addr + ATH11K_CE_OFFSET(ab); in ath11k_ahb_ce_irq_disable()
300 ie3_reg_addr = ce_ie_addr->ie3_reg_addr + ATH11K_CE_OFFSET(ab); in ath11k_ahb_ce_irq_disable()
302 ce_attr = &ab->hw_params.host_ce_config[ce_id]; in ath11k_ahb_ce_irq_disable()
303 if (ce_attr->src_nentries) in ath11k_ahb_ce_irq_disable()
306 if (ce_attr->dest_nentries) { in ath11k_ahb_ce_irq_disable()
318 for (i = 0; i < ab->hw_params.ce_count; i++) { in ath11k_ahb_sync_ce_irqs()
323 synchronize_irq(ab->irq_num[irq_idx]); in ath11k_ahb_sync_ce_irqs()
333 struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i]; in ath11k_ahb_sync_ext_irqs()
335 for (j = 0; j < irq_grp->num_irq; j++) { in ath11k_ahb_sync_ext_irqs()
336 irq_idx = irq_grp->irqs[j]; in ath11k_ahb_sync_ext_irqs()
337 synchronize_irq(ab->irq_num[irq_idx]); in ath11k_ahb_sync_ext_irqs()
346 for (i = 0; i < ab->hw_params.ce_count; i++) { in ath11k_ahb_ce_irqs_enable()
357 for (i = 0; i < ab->hw_params.ce_count; i++) { in ath11k_ahb_ce_irqs_disable()
377 struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i]; in ath11k_ahb_ext_irq_enable()
379 if (!irq_grp->napi_enabled) { in ath11k_ahb_ext_irq_enable()
380 napi_enable(&irq_grp->napi); in ath11k_ahb_ext_irq_enable()
381 irq_grp->napi_enabled = true; in ath11k_ahb_ext_irq_enable()
395 if (!test_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags)) in ath11k_ahb_stop()
399 del_timer_sync(&ab->rx_replenish_retry); in ath11k_ahb_stop()
408 ret = rproc_boot(ab_ahb->tgt_rproc); in ath11k_ahb_power_up()
419 rproc_shutdown(ab_ahb->tgt_rproc); in ath11k_ahb_power_down()
424 struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg; in ath11k_ahb_init_qmi_ce_config() local
426 cfg->tgt_ce_len = ab->hw_params.target_ce_count; in ath11k_ahb_init_qmi_ce_config()
427 cfg->tgt_ce = ab->hw_params.target_ce_config; in ath11k_ahb_init_qmi_ce_config()
428 cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len; in ath11k_ahb_init_qmi_ce_config()
429 cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map; in ath11k_ahb_init_qmi_ce_config()
430 ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id; in ath11k_ahb_init_qmi_ce_config()
438 struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i]; in ath11k_ahb_free_ext_irq()
440 for (j = 0; j < irq_grp->num_irq; j++) in ath11k_ahb_free_ext_irq()
441 free_irq(ab->irq_num[irq_grp->irqs[j]], irq_grp); in ath11k_ahb_free_ext_irq()
443 netif_napi_del(&irq_grp->napi); in ath11k_ahb_free_ext_irq()
452 if (ab->hw_params.hybrid_bus_type) in ath11k_ahb_free_irq()
455 for (i = 0; i < ab->hw_params.ce_count; i++) { in ath11k_ahb_free_irq()
459 free_irq(ab->irq_num[irq_idx], &ab->ce.ce_pipe[i]); in ath11k_ahb_free_irq()
469 ath11k_ce_per_engine_service(ce_pipe->ab, ce_pipe->pipe_num); in ath11k_ahb_ce_tasklet()
471 ath11k_ahb_ce_irq_enable(ce_pipe->ab, ce_pipe->pipe_num); in ath11k_ahb_ce_tasklet()
479 ce_pipe->timestamp = jiffies; in ath11k_ahb_ce_interrupt_handler()
481 ath11k_ahb_ce_irq_disable(ce_pipe->ab, ce_pipe->pipe_num); in ath11k_ahb_ce_interrupt_handler()
483 tasklet_schedule(&ce_pipe->intr_tq); in ath11k_ahb_ce_interrupt_handler()
493 struct ath11k_base *ab = irq_grp->ab; in ath11k_ahb_ext_grp_napi_poll()
513 irq_grp->timestamp = jiffies; in ath11k_ahb_ext_interrupt_handler()
517 napi_schedule(&irq_grp->napi); in ath11k_ahb_ext_interrupt_handler()
524 struct ath11k_hw_params *hw = &ab->hw_params; in ath11k_ahb_config_ext_irq()
530 struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i]; in ath11k_ahb_config_ext_irq()
533 irq_grp->ab = ab; in ath11k_ahb_config_ext_irq()
534 irq_grp->grp_id = i; in ath11k_ahb_config_ext_irq()
535 init_dummy_netdev(&irq_grp->napi_ndev); in ath11k_ahb_config_ext_irq()
536 netif_napi_add(&irq_grp->napi_ndev, &irq_grp->napi, in ath11k_ahb_config_ext_irq()
540 if (ab->hw_params.ring_mask->tx[i] & BIT(j)) { in ath11k_ahb_config_ext_irq()
541 irq_grp->irqs[num_irq++] = in ath11k_ahb_config_ext_irq()
542 wbm2host_tx_completions_ring1 - j; in ath11k_ahb_config_ext_irq()
545 if (ab->hw_params.ring_mask->rx[i] & BIT(j)) { in ath11k_ahb_config_ext_irq()
546 irq_grp->irqs[num_irq++] = in ath11k_ahb_config_ext_irq()
547 reo2host_destination_ring1 - j; in ath11k_ahb_config_ext_irq()
550 if (ab->hw_params.ring_mask->rx_err[i] & BIT(j)) in ath11k_ahb_config_ext_irq()
551 irq_grp->irqs[num_irq++] = reo2host_exception; in ath11k_ahb_config_ext_irq()
553 if (ab->hw_params.ring_mask->rx_wbm_rel[i] & BIT(j)) in ath11k_ahb_config_ext_irq()
554 irq_grp->irqs[num_irq++] = wbm2host_rx_release; in ath11k_ahb_config_ext_irq()
556 if (ab->hw_params.ring_mask->reo_status[i] & BIT(j)) in ath11k_ahb_config_ext_irq()
557 irq_grp->irqs[num_irq++] = reo2host_status; in ath11k_ahb_config_ext_irq()
559 if (j < ab->hw_params.max_radios) { in ath11k_ahb_config_ext_irq()
560 if (ab->hw_params.ring_mask->rxdma2host[i] & BIT(j)) { in ath11k_ahb_config_ext_irq()
561 irq_grp->irqs[num_irq++] = in ath11k_ahb_config_ext_irq()
562 rxdma2host_destination_ring_mac1 - in ath11k_ahb_config_ext_irq()
566 if (ab->hw_params.ring_mask->host2rxdma[i] & BIT(j)) { in ath11k_ahb_config_ext_irq()
567 irq_grp->irqs[num_irq++] = in ath11k_ahb_config_ext_irq()
568 host2rxdma_host_buf_ring_mac1 - in ath11k_ahb_config_ext_irq()
572 if (ab->hw_params.ring_mask->rx_mon_status[i] & BIT(j)) { in ath11k_ahb_config_ext_irq()
573 irq_grp->irqs[num_irq++] = in ath11k_ahb_config_ext_irq()
574 ppdu_end_interrupts_mac1 - in ath11k_ahb_config_ext_irq()
576 irq_grp->irqs[num_irq++] = in ath11k_ahb_config_ext_irq()
577 rxdma2host_monitor_status_ring_mac1 - in ath11k_ahb_config_ext_irq()
582 irq_grp->num_irq = num_irq; in ath11k_ahb_config_ext_irq()
584 for (j = 0; j < irq_grp->num_irq; j++) { in ath11k_ahb_config_ext_irq()
585 int irq_idx = irq_grp->irqs[j]; in ath11k_ahb_config_ext_irq()
587 irq = platform_get_irq_byname(ab->pdev, in ath11k_ahb_config_ext_irq()
589 ab->irq_num[irq_idx] = irq; in ath11k_ahb_config_ext_irq()
609 if (ab->hw_params.hybrid_bus_type) in ath11k_ahb_config_irq()
613 for (i = 0; i < ab->hw_params.ce_count; i++) { in ath11k_ahb_config_irq()
614 struct ath11k_ce_pipe *ce_pipe = &ab->ce.ce_pipe[i]; in ath11k_ahb_config_irq()
621 tasklet_setup(&ce_pipe->intr_tq, ath11k_ahb_ce_tasklet); in ath11k_ahb_config_irq()
622 irq = platform_get_irq_byname(ab->pdev, irq_name[irq_idx]); in ath11k_ahb_config_irq()
629 ab->irq_num[irq_idx] = irq; in ath11k_ahb_config_irq()
645 for (i = 0; i < ab->hw_params.svc_to_ce_map_len; i++) { in ath11k_ahb_map_service_to_pipe()
646 entry = &ab->hw_params.svc_to_ce_map[i]; in ath11k_ahb_map_service_to_pipe()
648 if (__le32_to_cpu(entry->service_id) != service_id) in ath11k_ahb_map_service_to_pipe()
651 switch (__le32_to_cpu(entry->pipedir)) { in ath11k_ahb_map_service_to_pipe()
656 *dl_pipe = __le32_to_cpu(entry->pipenum); in ath11k_ahb_map_service_to_pipe()
661 *ul_pipe = __le32_to_cpu(entry->pipenum); in ath11k_ahb_map_service_to_pipe()
667 *dl_pipe = __le32_to_cpu(entry->pipenum); in ath11k_ahb_map_service_to_pipe()
668 *ul_pipe = __le32_to_cpu(entry->pipenum); in ath11k_ahb_map_service_to_pipe()
676 return -ENOENT; in ath11k_ahb_map_service_to_pipe()
688 if (!device_may_wakeup(ab->dev)) in ath11k_ahb_hif_suspend()
689 return -EPERM; in ath11k_ahb_hif_suspend()
691 wake_irq = ab->irq_num[ATH11K_PCI_IRQ_CE0_OFFSET + ATH11K_PCI_CE_WAKE_IRQ]; in ath11k_ahb_hif_suspend()
699 value = u32_encode_bits(ab_ahb->smp2p_info.seq_no++, in ath11k_ahb_hif_suspend()
704 ret = qcom_smem_state_update_bits(ab_ahb->smp2p_info.smem_state, in ath11k_ahb_hif_suspend()
723 if (!device_may_wakeup(ab->dev)) in ath11k_ahb_hif_resume()
724 return -EPERM; in ath11k_ahb_hif_resume()
726 wake_irq = ab->irq_num[ATH11K_PCI_IRQ_CE0_OFFSET + ATH11K_PCI_CE_WAKE_IRQ]; in ath11k_ahb_hif_resume()
734 reinit_completion(&ab->wow.wakeup_completed); in ath11k_ahb_hif_resume()
736 value = u32_encode_bits(ab_ahb->smp2p_info.seq_no++, in ath11k_ahb_hif_resume()
741 ret = qcom_smem_state_update_bits(ab_ahb->smp2p_info.smem_state, in ath11k_ahb_hif_resume()
748 ret = wait_for_completion_timeout(&ab->wow.wakeup_completed, 3 * HZ); in ath11k_ahb_hif_resume()
751 return -ETIMEDOUT; in ath11k_ahb_hif_resume()
794 struct device *dev = ab->dev; in ath11k_core_get_rproc()
798 if (of_property_read_u32(dev->of_node, "qcom,rproc", &rproc_phandle)) { in ath11k_core_get_rproc()
800 return -ENOENT; in ath11k_core_get_rproc()
806 return -EINVAL; in ath11k_core_get_rproc()
808 ab_ahb->tgt_rproc = prproc; in ath11k_core_get_rproc()
815 struct platform_device *pdev = ab->pdev; in ath11k_ahb_setup_msi_resources()
832 return -ENOENT; in ath11k_ahb_setup_msi_resources()
835 msi_addr_pa = res->start; in ath11k_ahb_setup_msi_resources()
836 msi_addr_iova = dma_map_resource(ab->dev, msi_addr_pa, PAGE_SIZE, in ath11k_ahb_setup_msi_resources()
838 if (dma_mapping_error(ab->dev, msi_addr_iova)) in ath11k_ahb_setup_msi_resources()
839 return -ENOMEM; in ath11k_ahb_setup_msi_resources()
841 ab->pci.msi.addr_lo = lower_32_bits(msi_addr_iova); in ath11k_ahb_setup_msi_resources()
842 ab->pci.msi.addr_hi = upper_32_bits(msi_addr_iova); in ath11k_ahb_setup_msi_resources()
844 ret = of_property_read_u32_index(ab->dev->of_node, "interrupts", 1, &int_prop); in ath11k_ahb_setup_msi_resources()
848 ab->pci.msi.ep_base_data = int_prop + 32; in ath11k_ahb_setup_msi_resources()
850 for (i = 0; i < ab->pci.msi.config->total_vectors; i++) { in ath11k_ahb_setup_msi_resources()
855 ab->pci.msi.irqs[i] = ret; in ath11k_ahb_setup_msi_resources()
858 set_bit(ATH11K_FLAG_MULTI_MSI_VECTORS, &ab->dev_flags); in ath11k_ahb_setup_msi_resources()
867 if (!ab->hw_params.smp2p_wow_exit) in ath11k_ahb_setup_smp2p_handle()
870 ab_ahb->smp2p_info.smem_state = qcom_smem_state_get(ab->dev, "wlan-smp2p-out", in ath11k_ahb_setup_smp2p_handle()
871 &ab_ahb->smp2p_info.smem_bit); in ath11k_ahb_setup_smp2p_handle()
872 if (IS_ERR(ab_ahb->smp2p_info.smem_state)) { in ath11k_ahb_setup_smp2p_handle()
874 PTR_ERR(ab_ahb->smp2p_info.smem_state)); in ath11k_ahb_setup_smp2p_handle()
875 return PTR_ERR(ab_ahb->smp2p_info.smem_state); in ath11k_ahb_setup_smp2p_handle()
885 if (!ab->hw_params.smp2p_wow_exit) in ath11k_ahb_release_smp2p_handle()
888 qcom_smem_state_put(ab_ahb->smp2p_info.smem_state); in ath11k_ahb_release_smp2p_handle()
893 struct platform_device *pdev = ab->pdev; in ath11k_ahb_setup_resources()
897 if (ab->hw_params.hybrid_bus_type) in ath11k_ahb_setup_resources()
902 dev_err(&pdev->dev, "ioremap error\n"); in ath11k_ahb_setup_resources()
906 ab->mem = mem; in ath11k_ahb_setup_resources()
907 ab->mem_len = resource_size(mem_res); in ath11k_ahb_setup_resources()
915 struct device *dev = ab->dev; in ath11k_ahb_setup_msa_resources()
920 node = of_parse_phandle(dev->of_node, "memory-region", 0); in ath11k_ahb_setup_msa_resources()
922 return -ENOENT; in ath11k_ahb_setup_msa_resources()
931 ab_ahb->fw.msa_paddr = r.start; in ath11k_ahb_setup_msa_resources()
932 ab_ahb->fw.msa_size = resource_size(&r); in ath11k_ahb_setup_msa_resources()
934 node = of_parse_phandle(dev->of_node, "memory-region", 1); in ath11k_ahb_setup_msa_resources()
936 return -ENOENT; in ath11k_ahb_setup_msa_resources()
945 ab_ahb->fw.ce_paddr = r.start; in ath11k_ahb_setup_msa_resources()
946 ab_ahb->fw.ce_size = resource_size(&r); in ath11k_ahb_setup_msa_resources()
954 struct device *host_dev = ab->dev; in ath11k_ahb_fw_resources_init()
964 if (!ab->hw_params.fixed_fw_mem) in ath11k_ahb_fw_resources_init()
973 node = of_get_child_by_name(host_dev->of_node, "wifi-firmware"); in ath11k_ahb_fw_resources_init()
975 ab_ahb->fw.use_tz = true; in ath11k_ahb_fw_resources_init()
979 info.fwnode = &node->fwnode; in ath11k_ahb_fw_resources_init()
981 info.name = node->name; in ath11k_ahb_fw_resources_init()
990 ret = of_dma_configure(&pdev->dev, node, true); in ath11k_ahb_fw_resources_init()
996 ab_ahb->fw.dev = &pdev->dev; in ath11k_ahb_fw_resources_init()
1001 ret = -ENOMEM; in ath11k_ahb_fw_resources_init()
1005 ret = iommu_attach_device(iommu_dom, ab_ahb->fw.dev); in ath11k_ahb_fw_resources_init()
1011 ret = iommu_map(iommu_dom, ab_ahb->fw.msa_paddr, in ath11k_ahb_fw_resources_init()
1012 ab_ahb->fw.msa_paddr, ab_ahb->fw.msa_size, in ath11k_ahb_fw_resources_init()
1019 ret = iommu_map(iommu_dom, ab_ahb->fw.ce_paddr, in ath11k_ahb_fw_resources_init()
1020 ab_ahb->fw.ce_paddr, ab_ahb->fw.ce_size, in ath11k_ahb_fw_resources_init()
1027 ab_ahb->fw.use_tz = false; in ath11k_ahb_fw_resources_init()
1028 ab_ahb->fw.iommu_domain = iommu_dom; in ath11k_ahb_fw_resources_init()
1034 iommu_unmap(iommu_dom, ab_ahb->fw.msa_paddr, ab_ahb->fw.msa_size); in ath11k_ahb_fw_resources_init()
1037 iommu_detach_device(iommu_dom, ab_ahb->fw.dev); in ath11k_ahb_fw_resources_init()
1058 if (!ab->hw_params.fixed_fw_mem) in ath11k_ahb_fw_resource_deinit()
1061 if (ab_ahb->fw.use_tz) in ath11k_ahb_fw_resource_deinit()
1064 iommu = ab_ahb->fw.iommu_domain; in ath11k_ahb_fw_resource_deinit()
1066 unmapped_size = iommu_unmap(iommu, ab_ahb->fw.msa_paddr, ab_ahb->fw.msa_size); in ath11k_ahb_fw_resource_deinit()
1067 if (unmapped_size != ab_ahb->fw.msa_size) in ath11k_ahb_fw_resource_deinit()
1071 unmapped_size = iommu_unmap(iommu, ab_ahb->fw.ce_paddr, ab_ahb->fw.ce_size); in ath11k_ahb_fw_resource_deinit()
1072 if (unmapped_size != ab_ahb->fw.ce_size) in ath11k_ahb_fw_resource_deinit()
1076 iommu_detach_device(iommu, ab_ahb->fw.dev); in ath11k_ahb_fw_resource_deinit()
1079 platform_device_unregister(to_platform_device(ab_ahb->fw.dev)); in ath11k_ahb_fw_resource_deinit()
1093 of_id = of_match_device(ath11k_ahb_of_match, &pdev->dev); in ath11k_ahb_probe()
1095 dev_err(&pdev->dev, "failed to find matching device tree id\n"); in ath11k_ahb_probe()
1096 return -EINVAL; in ath11k_ahb_probe()
1099 hw_rev = (enum ath11k_hw_rev)of_id->data; in ath11k_ahb_probe()
1113 dev_err(&pdev->dev, "unsupported device type %d\n", hw_rev); in ath11k_ahb_probe()
1114 return -EOPNOTSUPP; in ath11k_ahb_probe()
1117 ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); in ath11k_ahb_probe()
1119 dev_err(&pdev->dev, "failed to set 32-bit consistent dma\n"); in ath11k_ahb_probe()
1123 ab = ath11k_core_alloc(&pdev->dev, sizeof(struct ath11k_ahb), in ath11k_ahb_probe()
1126 dev_err(&pdev->dev, "failed to allocate ath11k base\n"); in ath11k_ahb_probe()
1127 return -ENOMEM; in ath11k_ahb_probe()
1130 ab->hif.ops = hif_ops; in ath11k_ahb_probe()
1131 ab->pdev = pdev; in ath11k_ahb_probe()
1132 ab->hw_rev = hw_rev; in ath11k_ahb_probe()
1133 ab->fw_mode = ATH11K_FIRMWARE_MODE_NORMAL; in ath11k_ahb_probe()
1150 ab->mem_ce = ab->mem; in ath11k_ahb_probe()
1152 if (ab->hw_params.ce_remap) { in ath11k_ahb_probe()
1153 const struct ce_remap *ce_remap = ab->hw_params.ce_remap; in ath11k_ahb_probe()
1158 ab->mem_ce = ioremap(ce_remap->base, ce_remap->size); in ath11k_ahb_probe()
1159 if (!ab->mem_ce) { in ath11k_ahb_probe()
1160 dev_err(&pdev->dev, "ce ioremap error\n"); in ath11k_ahb_probe()
1161 ret = -ENOMEM; in ath11k_ahb_probe()
1231 if (test_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags)) { in ath11k_ahb_remove_prepare()
1232 left = wait_for_completion_timeout(&ab->driver_recovery, in ath11k_ahb_remove_prepare()
1238 set_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags); in ath11k_ahb_remove_prepare()
1239 cancel_work_sync(&ab->restart_work); in ath11k_ahb_remove_prepare()
1240 cancel_work_sync(&ab->qmi.event_work); in ath11k_ahb_remove_prepare()
1245 struct platform_device *pdev = ab->pdev; in ath11k_ahb_free_resources()
1253 if (ab->hw_params.ce_remap) in ath11k_ahb_free_resources()
1254 iounmap(ab->mem_ce); in ath11k_ahb_free_resources()
1264 if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) { in ath11k_ahb_remove()
1290 if (!(test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags))) in ath11k_ahb_shutdown()