Lines Matching refs:scn

195 static inline int hif_get_pci_slot(struct hif_softc *scn)  in hif_get_pci_slot()  argument
197 int pci_slot = pld_get_pci_slot(scn->qdf_dev->dev); in hif_get_pci_slot()
225 struct hif_softc *scn = HIF_GET_SOFTC(sc); in hif_pci_route_adrastea_interrupt() local
239 if (scn->notice_send) in hif_pci_route_adrastea_interrupt()
252 static void pci_dispatch_interrupt(struct hif_softc *scn) in pci_dispatch_interrupt() argument
256 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in pci_dispatch_interrupt()
258 if (scn->hif_init_done != true) in pci_dispatch_interrupt()
261 if (Q_TARGET_ACCESS_BEGIN(scn) < 0) in pci_dispatch_interrupt()
264 intr_summary = CE_INTERRUPT_SUMMARY(scn); in pci_dispatch_interrupt()
267 if ((scn->target_status != TARGET_STATUS_RESET) && in pci_dispatch_interrupt()
268 (!qdf_atomic_read(&scn->link_suspended))) { in pci_dispatch_interrupt()
270 hif_write32_mb(scn, scn->mem + in pci_dispatch_interrupt()
275 hif_read32_mb(scn, scn->mem + in pci_dispatch_interrupt()
279 Q_TARGET_ACCESS_END(scn); in pci_dispatch_interrupt()
282 Q_TARGET_ACCESS_END(scn); in pci_dispatch_interrupt()
284 scn->ce_irq_summary = intr_summary; in pci_dispatch_interrupt()
285 for (id = 0; intr_summary && (id < scn->ce_count); id++) { in pci_dispatch_interrupt()
296 struct hif_softc *scn = HIF_GET_SOFTC(sc); in hif_pci_legacy_ce_interrupt_handler() local
307 if (Q_TARGET_ACCESS_BEGIN(scn) < 0) in hif_pci_legacy_ce_interrupt_handler()
393 fw_indicator = A_TARGET_READ(scn, fw_indicator_address); in hif_pci_legacy_ce_interrupt_handler()
399 if (Q_TARGET_ACCESS_END(scn) < 0) in hif_pci_legacy_ce_interrupt_handler()
406 qdf_atomic_set(&scn->tasklet_from_intr, 1); in hif_pci_legacy_ce_interrupt_handler()
408 qdf_atomic_inc(&scn->active_tasklet_cnt); in hif_pci_legacy_ce_interrupt_handler()
411 pci_dispatch_interrupt(scn); in hif_pci_legacy_ce_interrupt_handler()
417 bool hif_pci_targ_is_present(struct hif_softc *scn, void *__iomem *mem) in hif_pci_targ_is_present() argument
422 int hif_get_irq_num(struct hif_opaque_softc *scn, int *irq, uint32_t size) in hif_get_irq_num() argument
424 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in hif_get_irq_num()
456 void hif_pci_cancel_deferred_target_sleep(struct hif_softc *scn) in hif_pci_cancel_deferred_target_sleep() argument
458 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_pci_cancel_deferred_target_sleep()
459 A_target_id_t pci_addr = scn->mem; in hif_pci_cancel_deferred_target_sleep()
469 hif_write32_mb(scn, pci_addr + PCIE_LOCAL_BASE_ADDRESS + in hif_pci_cancel_deferred_target_sleep()
478 inline void hif_pci_cancel_deferred_target_sleep(struct hif_softc *scn) in hif_pci_cancel_deferred_target_sleep() argument
513 static bool hif_targ_is_awake(struct hif_softc *scn, void *__iomem *mem) in hif_targ_is_awake() argument
517 if (scn->recovery) in hif_targ_is_awake()
519 val = hif_read32_mb(scn, mem + PCIE_LOCAL_BASE_ADDRESS in hif_targ_is_awake()
531 struct hif_softc *scn = HIF_GET_SOFTC(sc); in hif_pci_device_reset() local
533 if (!scn->hostdef) in hif_pci_device_reset()
555 if (hif_targ_is_awake(scn, mem)) in hif_pci_device_reset()
604 struct hif_softc *scn = HIF_GET_SOFTC(sc); in hif_pci_device_warm_reset() local
622 if (hif_targ_is_awake(scn, mem)) in hif_pci_device_warm_reset()
724 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_check_fw_reg() local
725 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in hif_check_fw_reg()
729 if (Q_TARGET_ACCESS_BEGIN(scn) < 0) in hif_check_fw_reg()
732 if (Q_TARGET_ACCESS_END(scn) < 0) in hif_check_fw_reg()
746 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_check_soc_status() local
750 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in hif_check_soc_status()
773 while (!hif_targ_is_awake(scn, sc->mem)) { in hif_check_soc_status()
810 static void __hif_pci_dump_registers(struct hif_softc *scn) in __hif_pci_dump_registers() argument
812 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in __hif_pci_dump_registers()
818 if (Q_TARGET_ACCESS_BEGIN(scn) < 0) in __hif_pci_dump_registers()
938 Q_TARGET_ACCESS_END(scn); in __hif_pci_dump_registers()
952 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_pci_dump_registers() local
954 status = hif_dump_ce_registers(scn); in hif_pci_dump_registers()
960 __hif_pci_dump_registers(scn); in hif_pci_dump_registers()
971 struct hif_softc *scn = HIF_GET_SOFTC(sc); in reschedule_tasklet_work_handler() local
973 if (!scn) { in reschedule_tasklet_work_handler()
978 if (scn->hif_init_done == false) { in reschedule_tasklet_work_handler()
1005 struct hif_softc *scn = HIF_GET_SOFTC(sc); in wlan_tasklet() local
1007 if (scn->hif_init_done == false) in wlan_tasklet()
1010 if (qdf_atomic_read(&scn->link_suspended)) in wlan_tasklet()
1014 hif_fw_interrupt_handler(sc->irq_event, scn); in wlan_tasklet()
1015 if (scn->target_status == TARGET_STATUS_RESET) in wlan_tasklet()
1020 qdf_atomic_set(&scn->tasklet_from_intr, 0); in wlan_tasklet()
1021 qdf_atomic_dec(&scn->active_tasklet_cnt); in wlan_tasklet()
1032 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_disable_power_gating() local
1035 if (!scn) { in hif_disable_power_gating()
1177 static void hif_wake_target_cpu(struct hif_softc *scn) in hif_wake_target_cpu() argument
1181 struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); in hif_wake_target_cpu()
1203 static void soc_wake_reset(struct hif_softc *scn) in soc_wake_reset() argument
1205 hif_write32_mb(scn, scn->mem + in soc_wake_reset()
1224 struct hif_softc *scn = HIF_GET_SOFTC(hif_state); in hif_sleep_entry() local
1227 if (scn->recovery) in hif_sleep_entry()
1230 if (hif_is_driver_unloading(scn)) in hif_sleep_entry()
1239 if (!qdf_atomic_read(&scn->link_suspended)) { in hif_sleep_entry()
1240 soc_wake_reset(scn); in hif_sleep_entry()
1257 static void hif_set_hia_extnd(struct hif_softc *scn) in hif_set_hia_extnd() argument
1259 struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); in hif_set_hia_extnd()
1272 = CHIP_ID_REVISION_GET(hif_read32_mb(scn, scn->mem in hif_set_hia_extnd()
1396 static void hif_set_hia_extnd(struct hif_softc *scn) in hif_set_hia_extnd() argument
1413 static int hif_set_hia(struct hif_softc *scn) in hif_set_hia() argument
1433 struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); in hif_set_hia()
1442 hif_get_target_ce_config(scn, in hif_set_hia()
1454 host_interest_area = hif_read32_mb(scn, scn->mem + in hif_set_hia()
1464 hif_write32_mb(scn, scn->mem + 0x113014, 0); in hif_set_hia()
1652 hif_set_hia_extnd(scn); in hif_set_hia()
1676 hif_wake_target_cpu(scn); in hif_set_hia()
2001 struct hif_softc *scn = HIF_GET_SOFTC(sc); in hif_pci_probe_tgt_wakeup() local
2015 while (!hif_targ_is_awake(scn, sc->mem)) { in hif_pci_probe_tgt_wakeup()
2064 struct hif_softc *scn = HIF_GET_SOFTC(sc); in hif_pci_configure_legacy_irq() local
2065 uint32_t target_type = scn->target_info.target_type; in hif_pci_configure_legacy_irq()
2078 scn->wake_irq = sc->pdev->irq; in hif_pci_configure_legacy_irq()
2099 hif_write32_mb(scn, scn->mem + PCIE_LOCAL_BASE_ADDRESS + in hif_pci_configure_legacy_irq()
2108 static int hif_ce_srng_free_irq(struct hif_softc *scn) in hif_ce_srng_free_irq() argument
2115 struct HIF_CE_state *ce_sc = HIF_GET_CE_STATE(scn); in hif_ce_srng_free_irq()
2117 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in hif_ce_srng_free_irq()
2119 if (!pld_get_enable_intx(scn->qdf_dev->dev)) { in hif_ce_srng_free_irq()
2120 ret = pld_get_user_msi_assignment(scn->qdf_dev->dev, "CE", in hif_ce_srng_free_irq()
2131 for (ce_id = 0; ce_id < scn->ce_count; ce_id++) { in hif_ce_srng_free_irq()
2144 pfrm_free_irq(scn->qdf_dev->dev, irq, &ce_sc->tasklets[ce_id]); in hif_ce_srng_free_irq()
2150 void hif_pci_deconfigure_grp_irq(struct hif_softc *scn) in hif_pci_deconfigure_grp_irq() argument
2153 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_pci_deconfigure_grp_irq()
2162 if (scn->irq_unlazy_disable) { in hif_pci_deconfigure_grp_irq()
2168 pfrm_free_irq(scn->qdf_dev->dev, in hif_pci_deconfigure_grp_irq()
2184 void hif_pci_nointrs(struct hif_softc *scn) in hif_pci_nointrs() argument
2187 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in hif_pci_nointrs()
2188 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_pci_nointrs()
2190 scn->free_irq_done = true; in hif_pci_nointrs()
2193 if (scn->request_irq_done == false) in hif_pci_nointrs()
2196 hif_pci_deconfigure_grp_irq(scn); in hif_pci_nointrs()
2198 ret = hif_ce_srng_free_irq(scn); in hif_pci_nointrs()
2202 if (scn->wake_irq) in hif_pci_nointrs()
2203 pfrm_free_irq(scn->qdf_dev->dev, scn->wake_irq, scn); in hif_pci_nointrs()
2204 scn->wake_irq = 0; in hif_pci_nointrs()
2217 scn->request_irq_done = false; in hif_pci_nointrs()
2236 void hif_pci_disable_bus(struct hif_softc *scn) in hif_pci_disable_bus() argument
2238 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in hif_pci_disable_bus()
2241 struct hif_target_info *tgt_info = &scn->target_info; in hif_pci_disable_bus()
2251 hif_vote_link_down(GET_HIF_OPAQUE_HDL(scn)); in hif_pci_disable_bus()
2273 hif_dump_pipe_debug_count(scn); in hif_pci_disable_bus()
2274 if (scn->athdiag_procfs_inited) { in hif_pci_disable_bus()
2276 scn->athdiag_procfs_inited = false; in hif_pci_disable_bus()
2279 scn->mem = NULL; in hif_pci_disable_bus()
2297 void hif_pci_prevent_linkdown(struct hif_softc *scn, bool flag) in hif_pci_prevent_linkdown() argument
2302 hif_runtime_prevent_linkdown(scn, flag); in hif_pci_prevent_linkdown()
2304 errno = pld_wlan_pm_control(scn->qdf_dev->dev, flag); in hif_pci_prevent_linkdown()
2309 void hif_pci_prevent_linkdown(struct hif_softc *scn, bool flag) in hif_pci_prevent_linkdown() argument
2326 static void hif_pci_config_low_power_int_register(struct hif_softc *scn, in hif_pci_config_low_power_int_register() argument
2331 struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); in hif_pci_config_low_power_int_register()
2348 address = scn->mem + PCIE_LOW_POWER_INT_MASK_OFFSET; in hif_pci_config_low_power_int_register()
2351 value = hif_read32_mb(scn, address); in hif_pci_config_low_power_int_register()
2356 hif_write32_mb(scn, address, value); in hif_pci_config_low_power_int_register()
2359 value = hif_read32_mb(scn, address); in hif_pci_config_low_power_int_register()
2364 hif_write32_mb(scn, address, value); in hif_pci_config_low_power_int_register()
2368 static inline void hif_pci_config_low_power_int_register(struct hif_softc *scn, in hif_pci_config_low_power_int_register() argument
2380 int hif_pci_bus_suspend(struct hif_softc *scn) in hif_pci_bus_suspend() argument
2384 hif_apps_irqs_disable(GET_HIF_OPAQUE_HDL(scn)); in hif_pci_bus_suspend()
2390 ret = hif_drain_fw_diag_ce(scn); in hif_pci_bus_suspend()
2394 ret = hif_try_complete_tasks(scn); in hif_pci_bus_suspend()
2396 hif_apps_irqs_enable(GET_HIF_OPAQUE_HDL(scn)); in hif_pci_bus_suspend()
2401 hif_cancel_deferred_target_sleep(scn); in hif_pci_bus_suspend()
2408 hif_pci_config_low_power_int_register(scn, false); in hif_pci_bus_suspend()
2410 scn->bus_suspended = true; in hif_pci_bus_suspend()
2425 static int __hif_check_link_status(struct hif_softc *scn) in __hif_check_link_status() argument
2428 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in __hif_check_link_status()
2429 struct hif_driver_state_callbacks *cbk = hif_get_callbacks_handle(scn); in __hif_check_link_status()
2444 scn->recovery = true; in __hif_check_link_status()
2455 static inline int __hif_check_link_status(struct hif_softc *scn) in __hif_check_link_status() argument
2463 bool hif_log_pcie_info(struct hif_softc *scn, uint8_t *data, in hif_log_pcie_info() argument
2466 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in hif_log_pcie_info()
2491 qdf_get_bus_reg_dump(scn->qdf_dev->dev, data, in hif_log_pcie_info()
2503 int hif_pci_bus_resume(struct hif_softc *scn) in hif_pci_bus_resume() argument
2507 scn->bus_suspended = false; in hif_pci_bus_resume()
2509 errno = __hif_check_link_status(scn); in hif_pci_bus_resume()
2513 hif_apps_irqs_enable(GET_HIF_OPAQUE_HDL(scn)); in hif_pci_bus_resume()
2527 int hif_pci_bus_suspend_noirq(struct hif_softc *scn) in hif_pci_bus_suspend_noirq() argument
2529 if (hif_can_suspend_link(GET_HIF_OPAQUE_HDL(scn))) in hif_pci_bus_suspend_noirq()
2530 qdf_atomic_set(&scn->link_suspended, 1); in hif_pci_bus_suspend_noirq()
2544 int hif_pci_bus_resume_noirq(struct hif_softc *scn) in hif_pci_bus_resume_noirq() argument
2551 qdf_atomic_set(&scn->link_suspended, 0); in hif_pci_bus_resume_noirq()
2557 static void hif_free_msi_ctx(struct hif_softc *scn) in hif_free_msi_ctx() argument
2559 struct hif_pci_softc *sc = scn->hif_sc; in hif_free_msi_ctx()
2561 struct device *dev = scn->qdf_dev->dev; in hif_free_msi_ctx()
2564 OS_GET_DMA_MEM_CONTEXT(scn, dmacontext)); in hif_free_msi_ctx()
2569 static void hif_free_msi_ctx(struct hif_softc *scn) in hif_free_msi_ctx() argument
2574 void hif_pci_disable_isr(struct hif_softc *scn) in hif_pci_disable_isr() argument
2576 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in hif_pci_disable_isr()
2578 hif_exec_kill(&scn->osc); in hif_pci_disable_isr()
2579 hif_nointrs(scn); in hif_pci_disable_isr()
2580 hif_free_msi_ctx(scn); in hif_pci_disable_isr()
2582 ce_tasklet_kill(scn); in hif_pci_disable_isr()
2584 qdf_atomic_set(&scn->active_tasklet_cnt, 0); in hif_pci_disable_isr()
2585 qdf_atomic_set(&scn->active_grp_tasklet_cnt, 0); in hif_pci_disable_isr()
2622 struct hif_softc *scn = HIF_GET_SOFTC(sc); in hif_log_soc_wakeup_timeout() local
2625 struct hif_driver_state_callbacks *cbk = hif_get_callbacks_handle(scn); in hif_log_soc_wakeup_timeout()
2626 A_target_id_t pci_addr = scn->mem; in hif_log_soc_wakeup_timeout()
2651 hif_read32_mb(scn, pci_addr + PCIE_LOCAL_BASE_ADDRESS + in hif_log_soc_wakeup_timeout()
2655 hif_read32_mb(scn, pci_addr + PCIE_LOCAL_BASE_ADDRESS + in hif_log_soc_wakeup_timeout()
2663 scn->recovery = true; in hif_log_soc_wakeup_timeout()
2709 int hif_pci_target_sleep_state_adjust(struct hif_softc *scn, in hif_pci_target_sleep_state_adjust() argument
2712 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_pci_target_sleep_state_adjust()
2713 A_target_id_t pci_addr = scn->mem; in hif_pci_target_sleep_state_adjust()
2715 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in hif_pci_target_sleep_state_adjust()
2717 if (scn->recovery) in hif_pci_target_sleep_state_adjust()
2720 if (qdf_atomic_read(&scn->link_suspended)) { in hif_pci_target_sleep_state_adjust()
2774 if (hif_targ_is_awake(scn, pci_addr)) { in hif_pci_target_sleep_state_adjust()
2778 if (!hif_pci_targ_is_present(scn, pci_addr)) in hif_pci_target_sleep_state_adjust()
2819 uint32_t hif_target_read_checked(struct hif_softc *scn, uint32_t offset) in hif_target_read_checked() argument
2824 addr = scn->mem + offset; in hif_target_read_checked()
2825 value = hif_read32_mb(scn, addr); in hif_target_read_checked()
2844 hif_target_write_checked(struct hif_softc *scn, uint32_t offset, uint32_t value) in hif_target_write_checked() argument
2848 addr = scn->mem + (offset); in hif_target_write_checked()
2849 hif_write32_mb(scn, addr, value); in hif_target_write_checked()
2916 static int hif_ce_msi_map_ce_to_irq(struct hif_softc *scn, int ce_id) in hif_ce_msi_map_ce_to_irq() argument
2918 struct hif_pci_softc *pci_scn = HIF_GET_PCI_SOFTC(scn); in hif_ce_msi_map_ce_to_irq()
2965 static int hif_ce_configure_legacyirq(struct hif_softc *scn) in hif_ce_configure_legacyirq() argument
2969 struct HIF_CE_state *ce_sc = HIF_GET_CE_STATE(scn); in hif_ce_configure_legacyirq()
2971 struct hif_pci_softc *pci_sc = HIF_GET_PCI_SOFTC(scn); in hif_ce_configure_legacyirq()
2973 qdf_device_t qdf_dev = scn->qdf_dev; in hif_ce_configure_legacyirq()
2975 if (!pld_get_enable_intx(scn->qdf_dev->dev)) in hif_ce_configure_legacyirq()
2978 scn->bus_ops.hif_irq_disable = &hif_ce_srng_msi_irq_disable; in hif_ce_configure_legacyirq()
2979 scn->bus_ops.hif_irq_enable = &hif_ce_srng_msi_irq_enable; in hif_ce_configure_legacyirq()
2980 scn->bus_ops.hif_map_ce_to_irq = &hif_ce_msi_map_ce_to_irq; in hif_ce_configure_legacyirq()
2982 for (ce_id = 0; ce_id < scn->ce_count; ce_id++) { in hif_ce_configure_legacyirq()
2989 ret = pfrm_get_irq(scn->qdf_dev->dev, in hif_ce_configure_legacyirq()
2993 dev_err(scn->qdf_dev->dev, "get irq failed\n"); in hif_ce_configure_legacyirq()
2998 pci_slot = hif_get_pci_slot(scn); in hif_ce_configure_legacyirq()
3003 ret = pfrm_request_irq(scn->qdf_dev->dev, irq, in hif_ce_configure_legacyirq()
3026 static int hif_ce_configure_legacyirq(struct hif_softc *scn) in hif_ce_configure_legacyirq() argument
3032 int hif_ce_msi_configure_irq_by_ceid(struct hif_softc *scn, int ce_id) in hif_ce_msi_configure_irq_by_ceid() argument
3041 struct HIF_CE_state *ce_sc = HIF_GET_CE_STATE(scn); in hif_ce_msi_configure_irq_by_ceid()
3042 struct hif_pci_softc *pci_sc = HIF_GET_PCI_SOFTC(scn); in hif_ce_msi_configure_irq_by_ceid()
3050 ret = pld_get_user_msi_assignment(scn->qdf_dev->dev, "CE", in hif_ce_msi_configure_irq_by_ceid()
3059 irq_id = scn->int_assignment->msi_idx[ce_id]; in hif_ce_msi_configure_irq_by_ceid()
3063 pci_slot = hif_get_pci_slot(scn); in hif_ce_msi_configure_irq_by_ceid()
3065 irq = pld_get_msi_irq(scn->qdf_dev->dev, msi_data); in hif_ce_msi_configure_irq_by_ceid()
3066 if (pld_is_one_msi(scn->qdf_dev->dev)) in hif_ce_msi_configure_irq_by_ceid()
3080 hif_affinity_mgr_init_ce_irq(scn, ce_id, irq); in hif_ce_msi_configure_irq_by_ceid()
3086 ret = pfrm_request_irq(scn->qdf_dev->dev, in hif_ce_msi_configure_irq_by_ceid()
3097 static int hif_ce_msi_configure_irq(struct hif_softc *scn) in hif_ce_msi_configure_irq() argument
3104 struct HIF_CE_state *ce_sc = HIF_GET_CE_STATE(scn); in hif_ce_msi_configure_irq()
3107 if (!scn->ini_cfg.disable_wake_irq) { in hif_ce_msi_configure_irq()
3109 ret = pld_get_user_msi_assignment(scn->qdf_dev->dev, "WAKE", in hif_ce_msi_configure_irq()
3116 scn->wake_irq = pld_get_msi_irq(scn->qdf_dev->dev, in hif_ce_msi_configure_irq()
3118 scn->wake_irq_type = HIF_PM_MSI_WAKE; in hif_ce_msi_configure_irq()
3120 ret = pfrm_request_irq(scn->qdf_dev->dev, scn->wake_irq, in hif_ce_msi_configure_irq()
3122 IRQF_NO_SUSPEND, "wlan_wake_irq", scn); in hif_ce_msi_configure_irq()
3129 ret = pld_get_user_msi_assignment(scn->qdf_dev->dev, "CE", in hif_ce_msi_configure_irq()
3135 if (ce_srng_based(scn)) { in hif_ce_msi_configure_irq()
3136 scn->bus_ops.hif_irq_disable = &hif_ce_srng_msi_irq_disable; in hif_ce_msi_configure_irq()
3137 scn->bus_ops.hif_irq_enable = &hif_ce_srng_msi_irq_enable; in hif_ce_msi_configure_irq()
3139 scn->bus_ops.hif_irq_disable = &hif_ce_legacy_msi_irq_disable; in hif_ce_msi_configure_irq()
3140 scn->bus_ops.hif_irq_enable = &hif_ce_legacy_msi_irq_enable; in hif_ce_msi_configure_irq()
3143 scn->bus_ops.hif_map_ce_to_irq = &hif_ce_msi_map_ce_to_irq; in hif_ce_msi_configure_irq()
3148 for (ce_id = 0; ce_id < scn->ce_count; ce_id++) { in hif_ce_msi_configure_irq()
3155 ret = hif_ce_msi_configure_irq_by_ceid(scn, ce_id); in hif_ce_msi_configure_irq()
3164 while (ce_id > 0 && ce_id < scn->ce_count) { in hif_ce_msi_configure_irq()
3169 irq = pld_get_msi_irq(scn->qdf_dev->dev, msi_data); in hif_ce_msi_configure_irq()
3170 pfrm_free_irq(scn->qdf_dev->dev, in hif_ce_msi_configure_irq()
3175 if (!scn->ini_cfg.disable_wake_irq) { in hif_ce_msi_configure_irq()
3176 pfrm_free_irq(scn->qdf_dev->dev, in hif_ce_msi_configure_irq()
3177 scn->wake_irq, scn->qdf_dev->dev); in hif_ce_msi_configure_irq()
3178 scn->wake_irq = 0; in hif_ce_msi_configure_irq()
3179 scn->wake_irq_type = HIF_PM_INVALID_WAKE; in hif_ce_msi_configure_irq()
3188 struct hif_softc *scn = HIF_GET_SOFTC(hif_ext_group->hif); in hif_exec_grp_irq_disable() local
3191 pfrm_disable_irq_nosync(scn->qdf_dev->dev, in hif_exec_grp_irq_disable()
3198 struct hif_softc *scn = HIF_GET_SOFTC(hif_ext_group->hif); in hif_exec_grp_irq_enable() local
3201 pfrm_enable_irq(scn->qdf_dev->dev, hif_ext_group->os_irq[i]); in hif_exec_grp_irq_enable()
3263 void hif_pci_ce_irq_set_affinity_hint(struct hif_softc *scn) in hif_pci_ce_irq_set_affinity_hint() argument
3267 struct HIF_CE_state *ce_sc = HIF_GET_CE_STATE(scn); in hif_pci_ce_irq_set_affinity_hint()
3268 struct hif_pci_softc *pci_sc = HIF_GET_PCI_SOFTC(scn); in hif_pci_ce_irq_set_affinity_hint()
3292 for (ce_id = 0; ce_id < scn->ce_count; ce_id++) { in hif_pci_ce_irq_set_affinity_hint()
3296 ret = hif_affinity_mgr_set_ce_irq_affinity(scn, pci_sc->ce_irq_num[ce_id], in hif_pci_ce_irq_set_affinity_hint()
3317 void hif_pci_config_irq_clear_cpu_affinity(struct hif_softc *scn, in hif_pci_config_irq_clear_cpu_affinity() argument
3320 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_pci_config_irq_clear_cpu_affinity()
3350 void hif_pci_config_irq_affinity(struct hif_softc *scn) in hif_pci_config_irq_affinity() argument
3353 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_pci_config_irq_affinity()
3363 hif_pci_ce_irq_set_affinity_hint(scn); in hif_pci_config_irq_affinity()
3376 static int hif_grp_configure_legacyirq(struct hif_softc *scn, in hif_grp_configure_legacyirq() argument
3383 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in hif_grp_configure_legacyirq()
3385 qdf_device_t qdf_dev = scn->qdf_dev; in hif_grp_configure_legacyirq()
3404 pci_slot = hif_get_pci_slot(scn); in hif_grp_configure_legacyirq()
3407 if (scn->irq_unlazy_disable) in hif_grp_configure_legacyirq()
3418 ret = pfrm_request_irq(scn->qdf_dev->dev, irq, in hif_grp_configure_legacyirq()
3442 static int hif_grp_configure_legacyirq(struct hif_softc *scn, in hif_grp_configure_legacyirq() argument
3449 int hif_pci_configure_grp_irq(struct hif_softc *scn, in hif_pci_configure_grp_irq() argument
3458 if (pld_get_enable_intx(scn->qdf_dev->dev)) in hif_pci_configure_grp_irq()
3459 return hif_grp_configure_legacyirq(scn, hif_ext_group); in hif_pci_configure_grp_irq()
3466 pci_slot = hif_get_pci_slot(scn); in hif_pci_configure_grp_irq()
3469 if (scn->irq_unlazy_disable) in hif_pci_configure_grp_irq()
3473 if (pld_is_one_msi(scn->qdf_dev->dev)) in hif_pci_configure_grp_irq()
3484 scn->qdf_dev->dev, irq, in hif_pci_configure_grp_irq()
3494 hif_affinity_mgr_init_grp_irq(scn, hif_ext_group->grp_id, in hif_pci_configure_grp_irq()
3502 void hif_pci_set_grp_intr_affinity(struct hif_softc *scn, in hif_pci_set_grp_intr_affinity() argument
3506 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_pci_set_grp_intr_affinity()
3557 int hif_configure_irq(struct hif_softc *scn) in hif_configure_irq() argument
3560 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in hif_configure_irq()
3564 if (hif_is_polled_mode_enabled(GET_HIF_OPAQUE_HDL(scn))) { in hif_configure_irq()
3565 scn->request_irq_done = false; in hif_configure_irq()
3571 ret = hif_ce_msi_configure_irq(scn); in hif_configure_irq()
3576 switch (scn->target_info.target_type) { in hif_configure_irq()
3587 ret = hif_ce_configure_legacyirq(scn); in hif_configure_irq()
3598 scn->request_irq_done = true; in hif_configure_irq()
3611 static void hif_trigger_timer_irq(struct hif_softc *scn) in hif_trigger_timer_irq() argument
3617 tmp = hif_read32_mb(scn, scn->mem + (RTC_SOC_BASE_ADDRESS + in hif_trigger_timer_irq()
3622 hif_write32_mb(scn, scn->mem + (RTC_SOC_BASE_ADDRESS + in hif_trigger_timer_irq()
3637 static void hif_target_sync(struct hif_softc *scn) in hif_target_sync() argument
3639 hif_write32_mb(scn, scn->mem + (SOC_CORE_BASE_ADDRESS | in hif_target_sync()
3643 (void)hif_read32_mb(scn, scn->mem + (SOC_CORE_BASE_ADDRESS | in hif_target_sync()
3646 hif_write32_mb(scn, scn->mem + PCIE_LOCAL_BASE_ADDRESS + in hif_target_sync()
3649 while (!hif_targ_is_awake(scn, scn->mem)) in hif_target_sync()
3656 uint32_t target_type = scn->target_info.target_type; in hif_target_sync()
3660 fw_ind = hif_read32_mb(scn, scn->mem + in hif_target_sync()
3666 hif_write32_mb(scn, scn->mem + (SOC_CORE_BASE_ADDRESS | in hif_target_sync()
3670 (void)hif_read32_mb(scn, scn->mem + in hif_target_sync()
3678 hif_trigger_timer_irq(scn); in hif_target_sync()
3688 hif_write32_mb(scn, scn->mem + PCIE_LOCAL_BASE_ADDRESS + in hif_target_sync()
3696 struct hif_softc *scn = HIF_GET_SOFTC(sc); in hif_pci_get_soc_info_pld() local
3714 scn->cmem_start = info.dev_mem_info[0].start; in hif_pci_get_soc_info_pld()
3715 scn->cmem_size = info.dev_mem_info[0].size; in hif_pci_get_soc_info_pld()
3716 scn->target_info.target_version = info.soc_id; in hif_pci_get_soc_info_pld()
3717 scn->target_info.target_revision = 0; in hif_pci_get_soc_info_pld()
3718 scn->target_info.soc_version = info.device_version.major_version; in hif_pci_get_soc_info_pld()
3927 void hif_pci_irq_enable(struct hif_softc *scn, int ce_id) in hif_pci_irq_enable() argument
3930 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in hif_pci_irq_enable()
3933 scn->ce_irq_summary &= ~tmp; in hif_pci_irq_enable()
3934 if (scn->ce_irq_summary == 0) { in hif_pci_irq_enable()
3937 (scn->target_status != TARGET_STATUS_RESET) && in hif_pci_irq_enable()
3938 (!qdf_atomic_read(&scn->link_suspended))) { in hif_pci_irq_enable()
3940 hif_write32_mb(scn, scn->mem + in hif_pci_irq_enable()
3945 hif_read32_mb(scn, scn->mem + in hif_pci_irq_enable()
3950 if (scn->hif_init_done == true) in hif_pci_irq_enable()
3951 Q_TARGET_ACCESS_END(scn); in hif_pci_irq_enable()
3955 hif_fw_interrupt_handler(0, scn); in hif_pci_irq_enable()
3967 void hif_pci_irq_disable(struct hif_softc *scn, int ce_id) in hif_pci_irq_disable() argument
3971 Q_TARGET_ACCESS_BEGIN(scn); in hif_pci_irq_disable()
3974 int hif_pci_legacy_map_ce_to_irq(struct hif_softc *scn, int ce_id) in hif_pci_legacy_map_ce_to_irq() argument
3976 struct hif_pci_softc *pci_scn = HIF_GET_PCI_SOFTC(scn); in hif_pci_legacy_map_ce_to_irq()
3982 int hif_pci_addr_in_boundary(struct hif_softc *scn, uint32_t offset) in hif_pci_addr_in_boundary() argument
3984 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in hif_pci_addr_in_boundary()
3987 tgt_info = hif_get_target_info_handle(GET_HIF_OPAQUE_HDL(scn)); in hif_pci_addr_in_boundary()
4023 bool hif_pci_needs_bmi(struct hif_softc *scn) in hif_pci_needs_bmi() argument
4025 return !ce_srng_based(scn); in hif_pci_needs_bmi()
4040 struct hif_softc *scn = (struct hif_softc *)hif_handle; in hif_soc_wake_request() local
4041 struct hif_pci_softc *pci_scn = HIF_GET_PCI_SOFTC(scn); in hif_soc_wake_request()
4044 if ((qdf_atomic_inc_return(&scn->active_wake_req_cnt) > 1)) { in hif_soc_wake_request()
4049 hif_write32_mb(scn, scn->mem + PCIE_REG_WAKE_UMAC_OFFSET, 1); in hif_soc_wake_request()
4058 scn, scn->mem + in hif_soc_wake_request()
4070 qdf_atomic_dec(&scn->active_wake_req_cnt); in hif_soc_wake_request()
4082 struct hif_softc *scn = (struct hif_softc *)hif_handle; in hif_soc_wake_release() local
4083 struct hif_pci_softc *pci_scn = HIF_GET_PCI_SOFTC(scn); in hif_soc_wake_release()
4086 if (!qdf_atomic_dec_and_test(&scn->active_wake_req_cnt)) { in hif_soc_wake_release()
4092 hif_write32_mb(scn, scn->mem + PCIE_REG_WAKE_UMAC_OFFSET, 0); in hif_soc_wake_release()
4110 struct hif_softc *scn = (struct hif_softc *)hif_handle; in hif_force_wake_request() local
4111 struct hif_pci_softc *pci_scn = HIF_GET_PCI_SOFTC(scn); in hif_force_wake_request()
4126 ret = pld_force_wake_request_sync(scn->qdf_dev->dev, timeout); in hif_force_wake_request()
4139 if (!pld_is_device_awake(scn->qdf_dev->dev)) in hif_force_wake_request()
4154 ret = pld_force_wake_release(scn->qdf_dev->dev); in hif_force_wake_request()
4177 struct hif_softc *scn = (struct hif_softc *)hif_handle; in hif_force_wake_release() local
4178 struct hif_pci_softc *pci_scn = HIF_GET_PCI_SOFTC(scn); in hif_force_wake_release()
4183 ret = pld_force_wake_release(scn->qdf_dev->dev); in hif_force_wake_release()
4210 struct hif_softc *scn = (struct hif_softc *)hif_handle; in hif_force_wake_request() local
4211 struct hif_pci_softc *pci_scn = HIF_GET_PCI_SOFTC(scn); in hif_force_wake_request()
4222 ret = pld_force_wake_request_sync(scn->qdf_dev->dev, timeout); in hif_force_wake_request()
4234 if (!pld_is_device_awake(scn->qdf_dev->dev)) in hif_force_wake_request()
4245 struct hif_softc *scn = (struct hif_softc *)hif_handle; in hif_force_wake_release() local
4246 struct hif_pci_softc *pci_scn = HIF_GET_PCI_SOFTC(scn); in hif_force_wake_release()
4248 ret = pld_force_wake_release(scn->qdf_dev->dev); in hif_force_wake_release()