xref: /wlan-dirver/qca-wifi-host-cmn/hif/src/dispatcher/multibus_ahb.c (revision 901120c066e139c7f8a2c8e4820561fdd83c67ef)
1 /*
2  * Copyright (c) 2016-2018,2020-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #include "hif.h"
21 #include "hif_main.h"
22 #include "multibus.h"
23 #include "ce_main.h"
24 #include "if_pci.h"
25 #include "ahb_api.h"
26 #include "dummy.h"
27 
28 /**
29  * hif_initialize_ahb_ops() - initialize the ahb ops
30  * @bus_ops: hif_bus_ops table pointer to initialize
31  *
32  * This function will assign the set of callbacks that needs
33  * to be called for ipq4019 platform
34  *
35  * Return: QDF_STATUS_SUCCESS
36  */
37 QDF_STATUS hif_initialize_ahb_ops(struct hif_bus_ops *bus_ops)
38 {
39 	bus_ops->hif_bus_open = &hif_ahb_open;
40 	bus_ops->hif_bus_close = &hif_ahb_close;
41 	bus_ops->hif_bus_prevent_linkdown = &hif_dummy_bus_prevent_linkdown;
42 	bus_ops->hif_reset_soc = &hif_dummy_reset_soc;
43 	bus_ops->hif_bus_suspend = &hif_dummy_bus_suspend;
44 	bus_ops->hif_bus_resume = &hif_dummy_bus_resume;
45 	bus_ops->hif_target_sleep_state_adjust =
46 		&hif_dummy_target_sleep_state_adjust;
47 
48 	bus_ops->hif_disable_isr = &hif_ahb_disable_isr;
49 	bus_ops->hif_nointrs = &hif_ahb_nointrs;
50 	bus_ops->hif_enable_bus = &hif_ahb_enable_bus;
51 	bus_ops->hif_disable_bus = &hif_ahb_disable_bus;
52 	bus_ops->hif_bus_configure = &hif_ahb_bus_configure;
53 	bus_ops->hif_get_config_item = &hif_dummy_get_config_item;
54 	bus_ops->hif_set_mailbox_swap = &hif_dummy_set_mailbox_swap;
55 	bus_ops->hif_claim_device = &hif_dummy_claim_device;
56 	bus_ops->hif_shutdown_device = &hif_ce_stop;
57 	bus_ops->hif_stop = &hif_ce_stop;
58 	bus_ops->hif_cancel_deferred_target_sleep =
59 				&hif_dummy_cancel_deferred_target_sleep;
60 	bus_ops->hif_irq_disable = &hif_ahb_irq_disable;
61 	bus_ops->hif_irq_enable = &hif_ahb_irq_enable;
62 	bus_ops->hif_dump_registers = &hif_ahb_dump_registers;
63 	bus_ops->hif_dump_target_memory = &hif_dummy_dump_target_memory;
64 	bus_ops->hif_reg_read32 = &hif_dummy_bus_reg_read32;
65 	bus_ops->hif_reg_write32 = &hif_dummy_bus_reg_write32;
66 	bus_ops->hif_ipa_get_ce_resource = &hif_dummy_ipa_get_ce_resource;
67 	bus_ops->hif_mask_interrupt_call = &hif_dummy_mask_interrupt_call;
68 	bus_ops->hif_enable_power_management =
69 		&hif_dummy_enable_power_management;
70 	bus_ops->hif_disable_power_management =
71 		&hif_dummy_disable_power_management;
72 	bus_ops->hif_grp_irq_configure = &hif_ahb_configure_grp_irq;
73 	bus_ops->hif_grp_irq_deconfigure = &hif_ahb_deconfigure_grp_irq;
74 	bus_ops->hif_addr_in_boundary = &hif_dummy_addr_in_boundary;
75 	bus_ops->hif_needs_bmi = &hif_ahb_needs_bmi;
76 	bus_ops->hif_display_stats = &hif_ahb_display_stats;
77 	bus_ops->hif_clear_stats = &hif_ahb_clear_stats;
78 	bus_ops->hif_config_irq_affinity =
79 		&hif_dummy_config_irq_affinity;
80 	bus_ops->hif_config_irq_by_ceid = &hif_ahb_configure_irq_by_ceid;
81 	bus_ops->hif_log_bus_info = &hif_dummy_log_bus_info;
82 
83 	return QDF_STATUS_SUCCESS;
84 }
85 
86 /**
87  * hif_ahb_get_context_size() - return the size of the snoc context
88  *
89  * Return the size of the context.  (0 for invalid bus)
90  */
91 int hif_ahb_get_context_size(void)
92 {
93 	return sizeof(struct hif_pci_softc);
94 }
95