xref: /wlan-driver/qca-wifi-host-cmn/hif/src/usb/if_usb.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name #include <linux/usb.h>
21*5113495bSYour Name #include <linux/usb/hcd.h>
22*5113495bSYour Name #include "if_usb.h"
23*5113495bSYour Name #include "hif_usb_internal.h"
24*5113495bSYour Name #include "target_type.h"		/* TARGET_TYPE_ */
25*5113495bSYour Name #include "regtable_usb.h"
26*5113495bSYour Name #include "ol_fw.h"
27*5113495bSYour Name #include "hif_debug.h"
28*5113495bSYour Name #include "epping_main.h"
29*5113495bSYour Name #include "hif_main.h"
30*5113495bSYour Name #include "usb_api.h"
31*5113495bSYour Name #ifdef CONFIG_PLD_USB_CNSS
32*5113495bSYour Name #include "pld_common.h"
33*5113495bSYour Name #endif
34*5113495bSYour Name 
35*5113495bSYour Name #define DELAY_FOR_TARGET_READY 200	/* 200ms */
36*5113495bSYour Name 
37*5113495bSYour Name /* Save memory addresses where we save FW ram dump, and then we could obtain
38*5113495bSYour Name  * them by symbol table.
39*5113495bSYour Name  */
40*5113495bSYour Name uint32_t fw_stack_addr;
41*5113495bSYour Name void *fw_ram_seg_addr[FW_RAM_SEG_CNT];
42*5113495bSYour Name 
43*5113495bSYour Name 
44*5113495bSYour Name 
45*5113495bSYour Name static int hif_usb_unload_dev_num = -1;
46*5113495bSYour Name struct hif_usb_softc *g_usb_sc;
47*5113495bSYour Name 
48*5113495bSYour Name /**
49*5113495bSYour Name  * hif_usb_diag_write_cold_reset() - reset SOC by sending a diag command
50*5113495bSYour Name  * @scn: pointer to ol_softc structure
51*5113495bSYour Name  *
52*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS if success else an appropriate QDF_STATUS error
53*5113495bSYour Name  */
54*5113495bSYour Name static inline QDF_STATUS
hif_usb_diag_write_cold_reset(struct hif_softc * scn)55*5113495bSYour Name hif_usb_diag_write_cold_reset(struct hif_softc *scn)
56*5113495bSYour Name {
57*5113495bSYour Name 	struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
58*5113495bSYour Name 	struct hif_target_info *tgt_info = &scn->target_info;
59*5113495bSYour Name 
60*5113495bSYour Name 	/* For Genoa, chip-reset is handled in CNSS driver */
61*5113495bSYour Name 	if (tgt_info->target_type == TARGET_TYPE_QCN7605)
62*5113495bSYour Name 		return QDF_STATUS_SUCCESS;
63*5113495bSYour Name 
64*5113495bSYour Name 	hif_debug("resetting SOC");
65*5113495bSYour Name 
66*5113495bSYour Name 	return hif_diag_write_access(hif_hdl,
67*5113495bSYour Name 				(ROME_USB_SOC_RESET_CONTROL_COLD_RST_LSB |
68*5113495bSYour Name 				ROME_USB_RTC_SOC_BASE_ADDRESS),
69*5113495bSYour Name 				SOC_RESET_CONTROL_COLD_RST_SET(1));
70*5113495bSYour Name }
71*5113495bSYour Name 
72*5113495bSYour Name /**
73*5113495bSYour Name  * hif_usb_procfs_init() - create init procfs
74*5113495bSYour Name  * @scn: pointer to hif_usb_softc structure
75*5113495bSYour Name  *
76*5113495bSYour Name  * Return: int 0 if success else an appropriate error number
77*5113495bSYour Name  */
78*5113495bSYour Name static int
hif_usb_procfs_init(struct hif_softc * scn)79*5113495bSYour Name hif_usb_procfs_init(struct hif_softc *scn)
80*5113495bSYour Name {
81*5113495bSYour Name 	int ret = 0;
82*5113495bSYour Name 
83*5113495bSYour Name 	HIF_ENTER();
84*5113495bSYour Name 
85*5113495bSYour Name 	if (athdiag_procfs_init(scn) != 0) {
86*5113495bSYour Name 		hif_err("athdiag_procfs_init failed");
87*5113495bSYour Name 		ret = A_ERROR;
88*5113495bSYour Name 	}
89*5113495bSYour Name 
90*5113495bSYour Name 	scn->athdiag_procfs_inited = true;
91*5113495bSYour Name 
92*5113495bSYour Name 	HIF_EXIT();
93*5113495bSYour Name 	return ret;
94*5113495bSYour Name }
95*5113495bSYour Name 
96*5113495bSYour Name /**
97*5113495bSYour Name  * hif_usb_nointrs() - disable IRQ
98*5113495bSYour Name  * @scn: pointer to struct hif_softc
99*5113495bSYour Name  *
100*5113495bSYour Name  * This function stops interrupt(s)
101*5113495bSYour Name  *
102*5113495bSYour Name  * Return: none
103*5113495bSYour Name  */
hif_usb_nointrs(struct hif_softc * scn)104*5113495bSYour Name void hif_usb_nointrs(struct hif_softc *scn)
105*5113495bSYour Name {
106*5113495bSYour Name 
107*5113495bSYour Name }
108*5113495bSYour Name 
109*5113495bSYour Name /**
110*5113495bSYour Name  * hif_usb_reboot() - called at reboot time to reset WLAN SOC
111*5113495bSYour Name  * @nb: pointer to notifier_block registered during register_reboot_notifier
112*5113495bSYour Name  * @val: code indicating reboot reason
113*5113495bSYour Name  * @v: unused pointer
114*5113495bSYour Name  *
115*5113495bSYour Name  * Return: int 0 if success else an appropriate error number
116*5113495bSYour Name  */
hif_usb_reboot(struct notifier_block * nb,unsigned long val,void * v)117*5113495bSYour Name static int hif_usb_reboot(struct notifier_block *nb, unsigned long val,
118*5113495bSYour Name 				void *v)
119*5113495bSYour Name {
120*5113495bSYour Name 	struct hif_usb_softc *sc;
121*5113495bSYour Name 
122*5113495bSYour Name 	HIF_ENTER();
123*5113495bSYour Name 	sc = container_of(nb, struct hif_usb_softc, reboot_notifier);
124*5113495bSYour Name 	/* do cold reset */
125*5113495bSYour Name 	hif_usb_diag_write_cold_reset(HIF_GET_SOFTC(sc));
126*5113495bSYour Name 	HIF_EXIT();
127*5113495bSYour Name 	return NOTIFY_DONE;
128*5113495bSYour Name }
129*5113495bSYour Name 
130*5113495bSYour Name /**
131*5113495bSYour Name  * hif_usb_disable_lpm() - Disable lpm feature of usb2.0
132*5113495bSYour Name  * @udev: pointer to usb_device for which LPM is to be disabled
133*5113495bSYour Name  *
134*5113495bSYour Name  * LPM needs to be disabled to avoid usb2.0 probe timeout
135*5113495bSYour Name  *
136*5113495bSYour Name  * Return: int 0 if success else an appropriate error number
137*5113495bSYour Name  */
hif_usb_disable_lpm(struct usb_device * udev)138*5113495bSYour Name static int hif_usb_disable_lpm(struct usb_device *udev)
139*5113495bSYour Name {
140*5113495bSYour Name 	struct usb_hcd *hcd;
141*5113495bSYour Name 	int ret = -EPERM;
142*5113495bSYour Name 
143*5113495bSYour Name 	HIF_ENTER();
144*5113495bSYour Name 
145*5113495bSYour Name 	if (!udev || !udev->bus) {
146*5113495bSYour Name 		hif_err("Invalid input parameters");
147*5113495bSYour Name 		goto exit;
148*5113495bSYour Name 	}
149*5113495bSYour Name 
150*5113495bSYour Name 	hcd = bus_to_hcd(udev->bus);
151*5113495bSYour Name 	if (udev->usb2_hw_lpm_enabled) {
152*5113495bSYour Name 		if (hcd->driver->set_usb2_hw_lpm) {
153*5113495bSYour Name 			ret = hcd->driver->set_usb2_hw_lpm(hcd, udev, false);
154*5113495bSYour Name 			if (!ret) {
155*5113495bSYour Name 				udev->usb2_hw_lpm_enabled = false;
156*5113495bSYour Name 				udev->usb2_hw_lpm_capable = false;
157*5113495bSYour Name 				hif_info("LPM is disabled");
158*5113495bSYour Name 			} else {
159*5113495bSYour Name 				hif_info("Fail to disable LPM");
160*5113495bSYour Name 			}
161*5113495bSYour Name 		} else {
162*5113495bSYour Name 			hif_info("hcd doesn't support LPM");
163*5113495bSYour Name 		}
164*5113495bSYour Name 	} else {
165*5113495bSYour Name 		hif_info("LPM isn't enabled");
166*5113495bSYour Name 	}
167*5113495bSYour Name exit:
168*5113495bSYour Name 	HIF_EXIT();
169*5113495bSYour Name 	return ret;
170*5113495bSYour Name }
171*5113495bSYour Name 
172*5113495bSYour Name /**
173*5113495bSYour Name  * hif_usb_enable_bus() - enable usb bus
174*5113495bSYour Name  * @scn: hif_softc struct
175*5113495bSYour Name  * @dev: device pointer
176*5113495bSYour Name  * @bdev: bus dev pointer
177*5113495bSYour Name  * @bid: bus id pointer
178*5113495bSYour Name  * @type: enum hif_enable_type such as HIF_ENABLE_TYPE_PROBE
179*5113495bSYour Name  *
180*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success and error QDF status on failure
181*5113495bSYour Name  */
hif_usb_enable_bus(struct hif_softc * scn,struct device * dev,void * bdev,const struct hif_bus_id * bid,enum hif_enable_type type)182*5113495bSYour Name QDF_STATUS hif_usb_enable_bus(struct hif_softc *scn,
183*5113495bSYour Name 			struct device *dev, void *bdev,
184*5113495bSYour Name 			const struct hif_bus_id *bid,
185*5113495bSYour Name 			enum hif_enable_type type)
186*5113495bSYour Name 
187*5113495bSYour Name {
188*5113495bSYour Name 	struct usb_interface *interface = (struct usb_interface *)bdev;
189*5113495bSYour Name 	struct usb_device_id *id = (struct usb_device_id *)bid;
190*5113495bSYour Name 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
191*5113495bSYour Name 	struct hif_usb_softc *sc;
192*5113495bSYour Name 	struct usb_device *usbdev = interface_to_usbdev(interface);
193*5113495bSYour Name 	int vendor_id, product_id;
194*5113495bSYour Name 	struct hif_target_info *tgt_info;
195*5113495bSYour Name 	struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
196*5113495bSYour Name 	u32 hif_type;
197*5113495bSYour Name 	u32 target_type;
198*5113495bSYour Name 
199*5113495bSYour Name 	if (!scn) {
200*5113495bSYour Name 		hif_err("hif_ctx is NULL");
201*5113495bSYour Name 		goto err_usb;
202*5113495bSYour Name 	}
203*5113495bSYour Name 
204*5113495bSYour Name 	sc = HIF_GET_USB_SOFTC(scn);
205*5113495bSYour Name 
206*5113495bSYour Name 	hif_debug("hif_softc %pK usbdev %pK interface %pK",
207*5113495bSYour Name 		scn,
208*5113495bSYour Name 		usbdev,
209*5113495bSYour Name 		interface);
210*5113495bSYour Name 
211*5113495bSYour Name 	vendor_id = qdf_le16_to_cpu(usbdev->descriptor.idVendor);
212*5113495bSYour Name 	product_id = qdf_le16_to_cpu(usbdev->descriptor.idProduct);
213*5113495bSYour Name 
214*5113495bSYour Name 	hif_err("con_mode = 0x%x, vendor_id = 0x%x product_id = 0x%x",
215*5113495bSYour Name 		hif_get_conparam(scn), vendor_id, product_id);
216*5113495bSYour Name 
217*5113495bSYour Name 	sc->pdev = (void *)usbdev;
218*5113495bSYour Name 	sc->dev = &usbdev->dev;
219*5113495bSYour Name 	sc->devid = id->idProduct;
220*5113495bSYour Name 
221*5113495bSYour Name 	hif_get_device_type(product_id, 0, &hif_type, &target_type);
222*5113495bSYour Name 	tgt_info = hif_get_target_info_handle(hif_hdl);
223*5113495bSYour Name 	if (target_type == TARGET_TYPE_QCN7605)
224*5113495bSYour Name 		tgt_info->target_type = TARGET_TYPE_QCN7605;
225*5113495bSYour Name 
226*5113495bSYour Name 	/*
227*5113495bSYour Name 	 * For Genoa, skip set_configuration, since it is handled
228*5113495bSYour Name 	 * by CNSS driver.
229*5113495bSYour Name 	 */
230*5113495bSYour Name 	if (target_type != TARGET_TYPE_QCN7605) {
231*5113495bSYour Name 		usb_get_dev(usbdev);
232*5113495bSYour Name 		if ((usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0),
233*5113495bSYour Name 				     USB_REQ_SET_CONFIGURATION, 0, 1, 0,
234*5113495bSYour Name 				     NULL, 0, HZ)) < 0) {
235*5113495bSYour Name 			hif_err("usb_control_msg failed");
236*5113495bSYour Name 			goto err_usb;
237*5113495bSYour Name 		}
238*5113495bSYour Name 		usb_set_interface(usbdev, 0, 0);
239*5113495bSYour Name 		sc->reboot_notifier.notifier_call = hif_usb_reboot;
240*5113495bSYour Name 		register_reboot_notifier(&sc->reboot_notifier);
241*5113495bSYour Name 	}
242*5113495bSYour Name 
243*5113495bSYour Name 	/* disable lpm to avoid usb2.0 probe timeout */
244*5113495bSYour Name 	hif_usb_disable_lpm(usbdev);
245*5113495bSYour Name 
246*5113495bSYour Name 	/* params need to be added - TODO
247*5113495bSYour Name 	 * scn->enableuartprint = 1;
248*5113495bSYour Name 	 * scn->enablefwlog = 0;
249*5113495bSYour Name 	 * scn->max_no_of_peers = 1;
250*5113495bSYour Name 	 */
251*5113495bSYour Name 
252*5113495bSYour Name 	sc->interface = interface;
253*5113495bSYour Name 	if (hif_usb_device_init(sc) != QDF_STATUS_SUCCESS) {
254*5113495bSYour Name 		hif_err("hif_usb_device_init failed");
255*5113495bSYour Name 		goto err_reset;
256*5113495bSYour Name 	}
257*5113495bSYour Name 
258*5113495bSYour Name 	if (hif_usb_procfs_init(scn))
259*5113495bSYour Name 		goto err_reset;
260*5113495bSYour Name 
261*5113495bSYour Name 	hif_usb_unload_dev_num = usbdev->devnum;
262*5113495bSYour Name 	g_usb_sc = sc;
263*5113495bSYour Name 	HIF_EXIT();
264*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
265*5113495bSYour Name 
266*5113495bSYour Name err_reset:
267*5113495bSYour Name 	hif_usb_diag_write_cold_reset(scn);
268*5113495bSYour Name 	g_usb_sc = NULL;
269*5113495bSYour Name 	hif_usb_unload_dev_num = -1;
270*5113495bSYour Name 	if (target_type != TARGET_TYPE_QCN7605)
271*5113495bSYour Name 		unregister_reboot_notifier(&sc->reboot_notifier);
272*5113495bSYour Name err_usb:
273*5113495bSYour Name 	ret = QDF_STATUS_E_FAILURE;
274*5113495bSYour Name 	if (target_type != TARGET_TYPE_QCN7605)
275*5113495bSYour Name 		usb_put_dev(usbdev);
276*5113495bSYour Name 	return ret;
277*5113495bSYour Name }
278*5113495bSYour Name 
279*5113495bSYour Name 
280*5113495bSYour Name /**
281*5113495bSYour Name  * hif_usb_close() - close bus, delete hif_sc
282*5113495bSYour Name  * @scn: pointer to the hif context.
283*5113495bSYour Name  *
284*5113495bSYour Name  * Return: none
285*5113495bSYour Name  */
hif_usb_close(struct hif_softc * scn)286*5113495bSYour Name void hif_usb_close(struct hif_softc *scn)
287*5113495bSYour Name {
288*5113495bSYour Name 	g_usb_sc = NULL;
289*5113495bSYour Name }
290*5113495bSYour Name 
291*5113495bSYour Name /**
292*5113495bSYour Name  * hif_usb_disable_bus() - This function disables usb bus
293*5113495bSYour Name  * @hif_ctx: pointer to struct hif_softc
294*5113495bSYour Name  *
295*5113495bSYour Name  * Return: none
296*5113495bSYour Name  */
hif_usb_disable_bus(struct hif_softc * hif_ctx)297*5113495bSYour Name void hif_usb_disable_bus(struct hif_softc *hif_ctx)
298*5113495bSYour Name {
299*5113495bSYour Name 	struct hif_usb_softc *sc = HIF_GET_USB_SOFTC(hif_ctx);
300*5113495bSYour Name 	struct usb_interface *interface = sc->interface;
301*5113495bSYour Name 	struct usb_device *udev = interface_to_usbdev(interface);
302*5113495bSYour Name 	struct hif_target_info *tgt_info = &hif_ctx->target_info;
303*5113495bSYour Name 
304*5113495bSYour Name 	hif_info("trying to remove hif_usb!");
305*5113495bSYour Name 
306*5113495bSYour Name 	/* disable lpm to avoid following cold reset will
307*5113495bSYour Name 	 * cause xHCI U1/U2 timeout
308*5113495bSYour Name 	 */
309*5113495bSYour Name 	if (tgt_info->target_type != TARGET_TYPE_QCN7605)
310*5113495bSYour Name 		usb_disable_lpm(udev);
311*5113495bSYour Name 
312*5113495bSYour Name 	/* wait for disable lpm */
313*5113495bSYour Name 	set_current_state(TASK_INTERRUPTIBLE);
314*5113495bSYour Name 	schedule_timeout(msecs_to_jiffies(DELAY_FOR_TARGET_READY));
315*5113495bSYour Name 	set_current_state(TASK_RUNNING);
316*5113495bSYour Name 
317*5113495bSYour Name 	/* do cold reset */
318*5113495bSYour Name 	hif_usb_diag_write_cold_reset(hif_ctx);
319*5113495bSYour Name 
320*5113495bSYour Name 	if (g_usb_sc->suspend_state)
321*5113495bSYour Name 		hif_bus_resume(GET_HIF_OPAQUE_HDL(hif_ctx));
322*5113495bSYour Name 
323*5113495bSYour Name 	if (tgt_info->target_type != TARGET_TYPE_QCN7605) {
324*5113495bSYour Name 		unregister_reboot_notifier(&sc->reboot_notifier);
325*5113495bSYour Name 		usb_put_dev(udev);
326*5113495bSYour Name 	}
327*5113495bSYour Name 
328*5113495bSYour Name 	hif_usb_device_deinit(sc);
329*5113495bSYour Name 
330*5113495bSYour Name 	hif_info("hif_usb removed !!!!!!");
331*5113495bSYour Name }
332*5113495bSYour Name 
333*5113495bSYour Name /**
334*5113495bSYour Name  * hif_usb_bus_suspend() - suspend the bus
335*5113495bSYour Name  * @hif_ctx: hif_ctx
336*5113495bSYour Name  *
337*5113495bSYour Name  * This function suspends the bus, but usb doesn't need to suspend.
338*5113495bSYour Name  * Therefore just remove all the pending urb transactions
339*5113495bSYour Name  *
340*5113495bSYour Name  * Return: 0 for success and non-zero for failure
341*5113495bSYour Name  */
hif_usb_bus_suspend(struct hif_softc * hif_ctx)342*5113495bSYour Name int hif_usb_bus_suspend(struct hif_softc *hif_ctx)
343*5113495bSYour Name {
344*5113495bSYour Name 	struct hif_usb_softc *sc = HIF_GET_USB_SOFTC(hif_ctx);
345*5113495bSYour Name 	struct HIF_DEVICE_USB *device = HIF_GET_USB_DEVICE(hif_ctx);
346*5113495bSYour Name 
347*5113495bSYour Name 	HIF_ENTER();
348*5113495bSYour Name 	sc->suspend_state = 1;
349*5113495bSYour Name 	usb_hif_flush_all(device);
350*5113495bSYour Name 	HIF_EXIT();
351*5113495bSYour Name 	return 0;
352*5113495bSYour Name }
353*5113495bSYour Name 
354*5113495bSYour Name /**
355*5113495bSYour Name  * hif_usb_bus_resume() - hif resume API
356*5113495bSYour Name  * @hif_ctx: struct hif_opaque_softc
357*5113495bSYour Name  *
358*5113495bSYour Name  * This function resumes the bus. but usb doesn't need to resume.
359*5113495bSYour Name  * Post recv urbs for RX data pipe
360*5113495bSYour Name  *
361*5113495bSYour Name  * Return: 0 for success and non-zero for failure
362*5113495bSYour Name  */
hif_usb_bus_resume(struct hif_softc * hif_ctx)363*5113495bSYour Name int hif_usb_bus_resume(struct hif_softc *hif_ctx)
364*5113495bSYour Name {
365*5113495bSYour Name 	struct hif_usb_softc *sc = HIF_GET_USB_SOFTC(hif_ctx);
366*5113495bSYour Name 	struct HIF_DEVICE_USB *device = HIF_GET_USB_DEVICE(hif_ctx);
367*5113495bSYour Name 
368*5113495bSYour Name 	HIF_ENTER();
369*5113495bSYour Name 	sc->suspend_state = 0;
370*5113495bSYour Name 	usb_hif_start_recv_pipes(device);
371*5113495bSYour Name 
372*5113495bSYour Name 	HIF_EXIT();
373*5113495bSYour Name 	return 0;
374*5113495bSYour Name }
375*5113495bSYour Name 
376*5113495bSYour Name /**
377*5113495bSYour Name  * hif_usb_bus_reset_resume() - resume the bus after reset
378*5113495bSYour Name  * @hif_ctx: HIF context
379*5113495bSYour Name  *
380*5113495bSYour Name  * This function is called to tell the driver that USB device has been resumed
381*5113495bSYour Name  * and it has also been reset. The driver should redo any necessary
382*5113495bSYour Name  * initialization. This function resets WLAN SOC.
383*5113495bSYour Name  *
384*5113495bSYour Name  * Return: int 0 for success, non zero for failure
385*5113495bSYour Name  */
hif_usb_bus_reset_resume(struct hif_softc * hif_ctx)386*5113495bSYour Name int hif_usb_bus_reset_resume(struct hif_softc *hif_ctx)
387*5113495bSYour Name {
388*5113495bSYour Name 	int ret = 0;
389*5113495bSYour Name 
390*5113495bSYour Name 	HIF_ENTER();
391*5113495bSYour Name 	if (hif_usb_diag_write_cold_reset(hif_ctx) != QDF_STATUS_SUCCESS)
392*5113495bSYour Name 		ret = 1;
393*5113495bSYour Name 
394*5113495bSYour Name 	HIF_EXIT();
395*5113495bSYour Name 	return ret;
396*5113495bSYour Name }
397*5113495bSYour Name 
398*5113495bSYour Name /**
399*5113495bSYour Name  * hif_usb_open()- initialization routine for usb bus
400*5113495bSYour Name  * @hif_ctx: HIF context
401*5113495bSYour Name  * @bus_type: bus type
402*5113495bSYour Name  *
403*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success and error QDF status on failure
404*5113495bSYour Name  */
hif_usb_open(struct hif_softc * hif_ctx,enum qdf_bus_type bus_type)405*5113495bSYour Name QDF_STATUS hif_usb_open(struct hif_softc *hif_ctx,
406*5113495bSYour Name 		enum qdf_bus_type bus_type)
407*5113495bSYour Name {
408*5113495bSYour Name 	hif_ctx->bus_type = bus_type;
409*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
410*5113495bSYour Name }
411*5113495bSYour Name 
412*5113495bSYour Name /**
413*5113495bSYour Name  * hif_usb_disable_isr() - disable isr
414*5113495bSYour Name  * @hif_ctx: struct hif_softc
415*5113495bSYour Name  *
416*5113495bSYour Name  * Return: void
417*5113495bSYour Name  */
hif_usb_disable_isr(struct hif_softc * hif_ctx)418*5113495bSYour Name void hif_usb_disable_isr(struct hif_softc *hif_ctx)
419*5113495bSYour Name {
420*5113495bSYour Name 	/* TODO */
421*5113495bSYour Name }
422*5113495bSYour Name 
423*5113495bSYour Name /**
424*5113495bSYour Name  * hif_usb_reg_tbl_attach()- attach hif, target register tables
425*5113495bSYour Name  * @scn: pointer to ol_softc structure
426*5113495bSYour Name  *
427*5113495bSYour Name  * Attach host and target register tables based on target_type, target_version
428*5113495bSYour Name  *
429*5113495bSYour Name  * Return: none
430*5113495bSYour Name  */
hif_usb_reg_tbl_attach(struct hif_softc * scn)431*5113495bSYour Name void hif_usb_reg_tbl_attach(struct hif_softc *scn)
432*5113495bSYour Name {
433*5113495bSYour Name 	u_int32_t hif_type, target_type;
434*5113495bSYour Name 	int32_t ret = 0;
435*5113495bSYour Name 	uint32_t chip_id;
436*5113495bSYour Name 	QDF_STATUS rv;
437*5113495bSYour Name 	struct hif_target_info *tgt_info = &scn->target_info;
438*5113495bSYour Name 	struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
439*5113495bSYour Name 
440*5113495bSYour Name 	if (!scn->hostdef && !scn->targetdef) {
441*5113495bSYour Name 		switch (tgt_info->target_type) {
442*5113495bSYour Name 		case TARGET_TYPE_AR6320:
443*5113495bSYour Name 			switch (tgt_info->target_version) {
444*5113495bSYour Name 			case AR6320_REV1_VERSION:
445*5113495bSYour Name 			case AR6320_REV1_1_VERSION:
446*5113495bSYour Name 			case AR6320_REV1_3_VERSION:
447*5113495bSYour Name 				hif_type = HIF_TYPE_AR6320;
448*5113495bSYour Name 				target_type = TARGET_TYPE_AR6320;
449*5113495bSYour Name 				break;
450*5113495bSYour Name 			case AR6320_REV2_1_VERSION:
451*5113495bSYour Name 			case AR6320_REV3_VERSION:
452*5113495bSYour Name 			case QCA9377_REV1_1_VERSION:
453*5113495bSYour Name 			case QCA9379_REV1_VERSION:
454*5113495bSYour Name 				hif_type = HIF_TYPE_AR6320V2;
455*5113495bSYour Name 				target_type = TARGET_TYPE_AR6320V2;
456*5113495bSYour Name 				break;
457*5113495bSYour Name 			default:
458*5113495bSYour Name 				ret = -1;
459*5113495bSYour Name 				break;
460*5113495bSYour Name 			}
461*5113495bSYour Name 			break;
462*5113495bSYour Name 		default:
463*5113495bSYour Name 			ret = -1;
464*5113495bSYour Name 			break;
465*5113495bSYour Name 		}
466*5113495bSYour Name 
467*5113495bSYour Name 		if (ret)
468*5113495bSYour Name 			return;
469*5113495bSYour Name 
470*5113495bSYour Name 		/* assign target register table if we find
471*5113495bSYour Name 		 * corresponding type
472*5113495bSYour Name 		 */
473*5113495bSYour Name 		hif_register_tbl_attach(scn, hif_type);
474*5113495bSYour Name 		target_register_tbl_attach(scn, target_type);
475*5113495bSYour Name 		/* read the chip revision*/
476*5113495bSYour Name 		rv = hif_diag_read_access(hif_hdl,
477*5113495bSYour Name 					(CHIP_ID_ADDRESS |
478*5113495bSYour Name 					RTC_SOC_BASE_ADDRESS),
479*5113495bSYour Name 					&chip_id);
480*5113495bSYour Name 		if (rv != QDF_STATUS_SUCCESS) {
481*5113495bSYour Name 			hif_err("get chip id val: %d", rv);
482*5113495bSYour Name 		}
483*5113495bSYour Name 		tgt_info->target_revision =
484*5113495bSYour Name 				CHIP_ID_REVISION_GET(chip_id);
485*5113495bSYour Name 	}
486*5113495bSYour Name }
487*5113495bSYour Name 
488*5113495bSYour Name /**
489*5113495bSYour Name  * hif_usb_get_hw_info()- attach register table for USB
490*5113495bSYour Name  * @hif_ctx: pointer to hif_softc structure
491*5113495bSYour Name  *
492*5113495bSYour Name  * This function is used to attach the host and target register tables.
493*5113495bSYour Name  * Ideally, we should not attach register tables as a part of this function.
494*5113495bSYour Name  * There is scope of cleanup to move register table attach during
495*5113495bSYour Name  * initialization for USB bus.
496*5113495bSYour Name  *
497*5113495bSYour Name  * The reason we are doing register table attach for USB here is that, it relies
498*5113495bSYour Name  * on target_info->target_type and target_info->target_version,
499*5113495bSYour Name  * which get populated during bmi_firmware_download. "hif_get_fw_info" is the
500*5113495bSYour Name  * only initialization related call into HIF there after.
501*5113495bSYour Name  *
502*5113495bSYour Name  * To fix this, we can move the "get target info, functionality currently in
503*5113495bSYour Name  * bmi_firmware_download into hif initialization functions. This change will
504*5113495bSYour Name  * affect all buses. Can be taken up as a part of convergence.
505*5113495bSYour Name  *
506*5113495bSYour Name  * Return: none
507*5113495bSYour Name  */
hif_usb_get_hw_info(struct hif_softc * hif_ctx)508*5113495bSYour Name void hif_usb_get_hw_info(struct hif_softc *hif_ctx)
509*5113495bSYour Name {
510*5113495bSYour Name 	hif_usb_reg_tbl_attach(hif_ctx);
511*5113495bSYour Name }
512*5113495bSYour Name 
513*5113495bSYour Name #if defined(CONFIG_PLD_USB_CNSS) && !defined(CONFIG_BYPASS_QMI)
514*5113495bSYour Name /**
515*5113495bSYour Name  * hif_usb_bus_configure() - configure the bus
516*5113495bSYour Name  * @scn: pointer to the hif context.
517*5113495bSYour Name  *
518*5113495bSYour Name  * return: 0 for success. nonzero for failure.
519*5113495bSYour Name  */
hif_usb_bus_configure(struct hif_softc * scn)520*5113495bSYour Name int hif_usb_bus_configure(struct hif_softc *scn)
521*5113495bSYour Name {
522*5113495bSYour Name 	struct pld_wlan_enable_cfg cfg;
523*5113495bSYour Name 	enum pld_driver_mode mode;
524*5113495bSYour Name 	uint32_t con_mode = hif_get_conparam(scn);
525*5113495bSYour Name 
526*5113495bSYour Name 	if (QDF_GLOBAL_FTM_MODE == con_mode)
527*5113495bSYour Name 		mode = PLD_FTM;
528*5113495bSYour Name 	else if (QDF_GLOBAL_COLDBOOT_CALIB_MODE == con_mode)
529*5113495bSYour Name 		mode = PLD_COLDBOOT_CALIBRATION;
530*5113495bSYour Name 	else if (QDF_IS_EPPING_ENABLED(con_mode))
531*5113495bSYour Name 		mode = PLD_EPPING;
532*5113495bSYour Name 	else
533*5113495bSYour Name 		mode = PLD_MISSION;
534*5113495bSYour Name 
535*5113495bSYour Name 	return pld_wlan_enable(scn->qdf_dev->dev, &cfg, mode);
536*5113495bSYour Name }
537*5113495bSYour Name #else
538*5113495bSYour Name /**
539*5113495bSYour Name  * hif_usb_bus_configure() - configure the bus
540*5113495bSYour Name  * @scn: pointer to the hif context.
541*5113495bSYour Name  *
542*5113495bSYour Name  * return: 0 for success. nonzero for failure.
543*5113495bSYour Name  */
hif_usb_bus_configure(struct hif_softc * scn)544*5113495bSYour Name int hif_usb_bus_configure(struct hif_softc *scn)
545*5113495bSYour Name {
546*5113495bSYour Name 	return 0;
547*5113495bSYour Name }
548*5113495bSYour Name #endif
549*5113495bSYour Name 
550*5113495bSYour Name /**
551*5113495bSYour Name  * hif_usb_irq_enable() - hif_usb_irq_enable
552*5113495bSYour Name  * @scn: hif_softc
553*5113495bSYour Name  * @ce_id: ce_id
554*5113495bSYour Name  *
555*5113495bSYour Name  * Return: void
556*5113495bSYour Name  */
hif_usb_irq_enable(struct hif_softc * scn,int ce_id)557*5113495bSYour Name void hif_usb_irq_enable(struct hif_softc *scn, int ce_id)
558*5113495bSYour Name {
559*5113495bSYour Name }
560*5113495bSYour Name 
561*5113495bSYour Name /**
562*5113495bSYour Name  * hif_usb_irq_disable() - hif_usb_irq_disable
563*5113495bSYour Name  * @scn: hif_softc
564*5113495bSYour Name  * @ce_id: ce_id
565*5113495bSYour Name  *
566*5113495bSYour Name  * Return: void
567*5113495bSYour Name  */
hif_usb_irq_disable(struct hif_softc * scn,int ce_id)568*5113495bSYour Name void hif_usb_irq_disable(struct hif_softc *scn, int ce_id)
569*5113495bSYour Name {
570*5113495bSYour Name }
571*5113495bSYour Name 
572*5113495bSYour Name /**
573*5113495bSYour Name  * hif_usb_shutdown_bus_device() - This function shuts down the device
574*5113495bSYour Name  * @scn: hif opaque pointer
575*5113495bSYour Name  *
576*5113495bSYour Name  * Return: void
577*5113495bSYour Name  */
hif_usb_shutdown_bus_device(struct hif_softc * scn)578*5113495bSYour Name void hif_usb_shutdown_bus_device(struct hif_softc *scn)
579*5113495bSYour Name {
580*5113495bSYour Name }
581*5113495bSYour Name 
582*5113495bSYour Name /**
583*5113495bSYour Name  * hif_trigger_dump() - trigger various dump cmd
584*5113495bSYour Name  * @scn: struct hif_opaque_softc
585*5113495bSYour Name  * @cmd_id: dump command id
586*5113495bSYour Name  * @start: start/stop dump
587*5113495bSYour Name  *
588*5113495bSYour Name  * Return: None
589*5113495bSYour Name  */
hif_trigger_dump(struct hif_opaque_softc * scn,uint8_t cmd_id,bool start)590*5113495bSYour Name void hif_trigger_dump(struct hif_opaque_softc *scn, uint8_t cmd_id, bool start)
591*5113495bSYour Name {
592*5113495bSYour Name }
593*5113495bSYour Name 
594*5113495bSYour Name /**
595*5113495bSYour Name  * hif_wlan_disable() - call the platform driver to disable wlan
596*5113495bSYour Name  * @scn: scn
597*5113495bSYour Name  *
598*5113495bSYour Name  * Return: void
599*5113495bSYour Name  */
hif_wlan_disable(struct hif_softc * scn)600*5113495bSYour Name void hif_wlan_disable(struct hif_softc *scn)
601*5113495bSYour Name {
602*5113495bSYour Name }
603*5113495bSYour Name 
604*5113495bSYour Name /**
605*5113495bSYour Name  * hif_fw_assert_ramdump_pattern() - handle firmware assert with ramdump pattern
606*5113495bSYour Name  * @sc: pointer to hif_usb_softc structure
607*5113495bSYour Name  *
608*5113495bSYour Name  * Return: void
609*5113495bSYour Name  */
610*5113495bSYour Name 
hif_fw_assert_ramdump_pattern(struct hif_usb_softc * sc)611*5113495bSYour Name void hif_fw_assert_ramdump_pattern(struct hif_usb_softc *sc)
612*5113495bSYour Name {
613*5113495bSYour Name 	uint32_t *reg, pattern, i = 0;
614*5113495bSYour Name 	uint32_t len;
615*5113495bSYour Name 	uint8_t *data;
616*5113495bSYour Name 	uint8_t *ram_ptr = NULL;
617*5113495bSYour Name 	char *fw_ram_seg_name[FW_RAM_SEG_CNT] = {"DRAM", "IRAM", "AXI"};
618*5113495bSYour Name 	size_t fw_ram_reg_size[FW_RAM_SEG_CNT] = {
619*5113495bSYour Name 				  FW_RAMDUMP_DRAMSIZE,
620*5113495bSYour Name 				  FW_RAMDUMP_IRAMSIZE,
621*5113495bSYour Name 				  FW_RAMDUMP_AXISIZE };
622*5113495bSYour Name 
623*5113495bSYour Name 	data = sc->fw_data;
624*5113495bSYour Name 	len = sc->fw_data_len;
625*5113495bSYour Name 	pattern = *((uint32_t *) data);
626*5113495bSYour Name 
627*5113495bSYour Name 	qdf_assert(sc->ramdump_index < FW_RAM_SEG_CNT);
628*5113495bSYour Name 	i = sc->ramdump_index;
629*5113495bSYour Name 	reg = (uint32_t *) (data + 4);
630*5113495bSYour Name 	if (sc->fw_ram_dumping == 0) {
631*5113495bSYour Name 		sc->fw_ram_dumping = 1;
632*5113495bSYour Name 		hif_info("Firmware %s dump:", fw_ram_seg_name[i]);
633*5113495bSYour Name 		sc->ramdump[i] =
634*5113495bSYour Name 			qdf_mem_malloc(sizeof(struct fw_ramdump) +
635*5113495bSYour Name 					fw_ram_reg_size[i]);
636*5113495bSYour Name 		if (!sc->ramdump[i])
637*5113495bSYour Name 			QDF_BUG(0);
638*5113495bSYour Name 
639*5113495bSYour Name 		(sc->ramdump[i])->mem = (uint8_t *) (sc->ramdump[i] + 1);
640*5113495bSYour Name 		fw_ram_seg_addr[i] = (sc->ramdump[i])->mem;
641*5113495bSYour Name 		hif_info("FW %s start addr = %#08x Memory addr for %s = %pK",
642*5113495bSYour Name 			fw_ram_seg_name[i], *reg,
643*5113495bSYour Name 			fw_ram_seg_name[i],
644*5113495bSYour Name 			(sc->ramdump[i])->mem);
645*5113495bSYour Name 		(sc->ramdump[i])->start_addr = *reg;
646*5113495bSYour Name 		(sc->ramdump[i])->length = 0;
647*5113495bSYour Name 	}
648*5113495bSYour Name 	reg++;
649*5113495bSYour Name 	ram_ptr = (sc->ramdump[i])->mem + (sc->ramdump[i])->length;
650*5113495bSYour Name 	(sc->ramdump[i])->length += (len - 8);
651*5113495bSYour Name 	if (sc->ramdump[i]->length <= fw_ram_reg_size[i]) {
652*5113495bSYour Name 		qdf_mem_copy(ram_ptr, (uint8_t *) reg, len - 8);
653*5113495bSYour Name 	} else {
654*5113495bSYour Name 		hif_err("memory copy overlap");
655*5113495bSYour Name 		QDF_BUG(0);
656*5113495bSYour Name 	}
657*5113495bSYour Name 
658*5113495bSYour Name 	if (pattern == FW_RAMDUMP_END_PATTERN) {
659*5113495bSYour Name 		hif_err("%s memory size = %d", fw_ram_seg_name[i],
660*5113495bSYour Name 			(sc->ramdump[i])->length);
661*5113495bSYour Name 		if (i == (FW_RAM_SEG_CNT - 1))
662*5113495bSYour Name 			QDF_BUG(0);
663*5113495bSYour Name 
664*5113495bSYour Name 		sc->ramdump_index++;
665*5113495bSYour Name 		sc->fw_ram_dumping = 0;
666*5113495bSYour Name 	}
667*5113495bSYour Name }
668*5113495bSYour Name 
669*5113495bSYour Name /**
670*5113495bSYour Name  * hif_usb_ramdump_handler() - dump bus debug registers
671*5113495bSYour Name  * @scn: struct hif_opaque_softc
672*5113495bSYour Name  *
673*5113495bSYour Name  * This function is to receive information of firmware crash dump, and
674*5113495bSYour Name  * save it in host memory. It consists of 5 parts: registers, call stack,
675*5113495bSYour Name  * DRAM dump, IRAM dump, and AXI dump, and they are reported to host in order.
676*5113495bSYour Name  *
677*5113495bSYour Name  * registers: wrapped in a USB packet by starting as FW_ASSERT_PATTERN and
678*5113495bSYour Name  *            60 registers.
679*5113495bSYour Name  * call stack: wrapped in multiple USB packets, and each of them starts as
680*5113495bSYour Name  *             FW_REG_PATTERN and contains multiple double-words. The tail
681*5113495bSYour Name  *             of the last packet is FW_REG_END_PATTERN.
682*5113495bSYour Name  * DRAM dump: wrapped in multiple USB pakcets, and each of them start as
683*5113495bSYour Name  *            FW_RAMDUMP_PATTERN and contains multiple double-wors. The tail
684*5113495bSYour Name  *            of the last packet is FW_RAMDUMP_END_PATTERN;
685*5113495bSYour Name  * IRAM dump and AXI dump are with the same format as DRAM dump.
686*5113495bSYour Name  *
687*5113495bSYour Name  * Return: 0 for success or error code
688*5113495bSYour Name  */
689*5113495bSYour Name 
hif_usb_ramdump_handler(struct hif_opaque_softc * scn)690*5113495bSYour Name void hif_usb_ramdump_handler(struct hif_opaque_softc *scn)
691*5113495bSYour Name {
692*5113495bSYour Name 	uint32_t *reg, pattern, i, start_addr = 0;
693*5113495bSYour Name 	uint32_t len;
694*5113495bSYour Name 	uint8_t *data;
695*5113495bSYour Name 	uint8_t str_buf[128];
696*5113495bSYour Name 	uint32_t remaining;
697*5113495bSYour Name 	struct hif_usb_softc *sc = HIF_GET_USB_SOFTC(scn);
698*5113495bSYour Name 	struct hif_softc *hif_ctx = HIF_GET_SOFTC(scn);
699*5113495bSYour Name 	struct hif_target_info *tgt_info = &hif_ctx->target_info;
700*5113495bSYour Name 
701*5113495bSYour Name 	data = sc->fw_data;
702*5113495bSYour Name 	len = sc->fw_data_len;
703*5113495bSYour Name 	pattern = *((uint32_t *) data);
704*5113495bSYour Name 
705*5113495bSYour Name 	if (pattern == FW_ASSERT_PATTERN) {
706*5113495bSYour Name 		hif_err("Firmware crash detected...");
707*5113495bSYour Name 		hif_err("target_type: %d target_version: %d target_revision: %d",
708*5113495bSYour Name 			tgt_info->target_type,
709*5113495bSYour Name 			tgt_info->target_version,
710*5113495bSYour Name 			tgt_info->target_revision);
711*5113495bSYour Name 
712*5113495bSYour Name 		reg = (uint32_t *) (data + 4);
713*5113495bSYour Name 		print_hex_dump(KERN_DEBUG, " ", DUMP_PREFIX_OFFSET, 16, 4, reg,
714*5113495bSYour Name 				min_t(uint32_t, len - 4, FW_REG_DUMP_CNT * 4),
715*5113495bSYour Name 				false);
716*5113495bSYour Name 		sc->fw_ram_dumping = 0;
717*5113495bSYour Name 
718*5113495bSYour Name 	} else if (pattern == FW_REG_PATTERN) {
719*5113495bSYour Name 		reg = (uint32_t *) (data + 4);
720*5113495bSYour Name 		start_addr = *reg++;
721*5113495bSYour Name 		if (sc->fw_ram_dumping == 0) {
722*5113495bSYour Name 			qdf_nofl_err("Firmware stack dump:");
723*5113495bSYour Name 			sc->fw_ram_dumping = 1;
724*5113495bSYour Name 			fw_stack_addr = start_addr;
725*5113495bSYour Name 		}
726*5113495bSYour Name 		remaining = len - 8;
727*5113495bSYour Name 		/* len is in byte, but it's printed in double-word. */
728*5113495bSYour Name 		for (i = 0; i < (len - 8); i += 16) {
729*5113495bSYour Name 			if ((*reg == FW_REG_END_PATTERN) && (i == len - 12)) {
730*5113495bSYour Name 				sc->fw_ram_dumping = 0;
731*5113495bSYour Name 				qdf_nofl_err("Stack start address = %#08x",
732*5113495bSYour Name 					     fw_stack_addr);
733*5113495bSYour Name 				break;
734*5113495bSYour Name 			}
735*5113495bSYour Name 			hex_dump_to_buffer(reg, remaining, 16, 4, str_buf,
736*5113495bSYour Name 						sizeof(str_buf), false);
737*5113495bSYour Name 			qdf_nofl_err("%#08x: %s", start_addr + i, str_buf);
738*5113495bSYour Name 			remaining -= 16;
739*5113495bSYour Name 			reg += 4;
740*5113495bSYour Name 		}
741*5113495bSYour Name 	} else if ((!sc->enable_self_recovery) &&
742*5113495bSYour Name 			((pattern & FW_RAMDUMP_PATTERN_MASK) ==
743*5113495bSYour Name 						FW_RAMDUMP_PATTERN)) {
744*5113495bSYour Name 		hif_fw_assert_ramdump_pattern(sc);
745*5113495bSYour Name 	}
746*5113495bSYour Name }
747*5113495bSYour Name 
748*5113495bSYour Name #ifndef QCA_WIFI_3_0
749*5113495bSYour Name /**
750*5113495bSYour Name  * hif_check_fw_reg() - hif_check_fw_reg
751*5113495bSYour Name  * @scn: scn
752*5113495bSYour Name  *
753*5113495bSYour Name  * Return: int
754*5113495bSYour Name  */
hif_check_fw_reg(struct hif_opaque_softc * scn)755*5113495bSYour Name int hif_check_fw_reg(struct hif_opaque_softc *scn)
756*5113495bSYour Name {
757*5113495bSYour Name 	return 0;
758*5113495bSYour Name }
759*5113495bSYour Name #endif
760*5113495bSYour Name 
761*5113495bSYour Name /**
762*5113495bSYour Name  * hif_usb_needs_bmi() - return true if the soc needs bmi through the driver
763*5113495bSYour Name  * @scn: hif context
764*5113495bSYour Name  *
765*5113495bSYour Name  * Return: true if soc needs driver bmi otherwise false
766*5113495bSYour Name  */
hif_usb_needs_bmi(struct hif_softc * scn)767*5113495bSYour Name bool hif_usb_needs_bmi(struct hif_softc *scn)
768*5113495bSYour Name {
769*5113495bSYour Name 	struct hif_target_info *tgt_info = &scn->target_info;
770*5113495bSYour Name 
771*5113495bSYour Name 	/* BMI is not supported in Genoa */
772*5113495bSYour Name 	if (tgt_info->target_type == TARGET_TYPE_QCN7605)
773*5113495bSYour Name 		return false;
774*5113495bSYour Name 
775*5113495bSYour Name 	return true;
776*5113495bSYour Name }
777