2 * Copyright (c) 2013 Qualcomm Atheros, Inc.
\r
3 * All rights reserved.
\r
5 * Redistribution and use in source and binary forms, with or without
\r
6 * modification, are permitted (subject to the limitations in the
\r
7 * disclaimer below) provided that the following conditions are met:
\r
9 * * Redistributions of source code must retain the above copyright
\r
10 * notice, this list of conditions and the following disclaimer.
\r
12 * * Redistributions in binary form must reproduce the above copyright
\r
13 * notice, this list of conditions and the following disclaimer in the
\r
14 * documentation and/or other materials provided with the
\r
17 * * Neither the name of Qualcomm Atheros nor the names of its
\r
18 * contributors may be used to endorse or promote products derived
\r
19 * from this software without specific prior written permission.
\r
21 * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
\r
22 * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
\r
23 * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
\r
24 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
\r
25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
\r
26 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
\r
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
\r
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
\r
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
\r
30 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
\r
31 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
\r
32 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
\r
33 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
35 #include "sys_cfg.h"
\r
36 #include "dt_defs.h"
\r
37 #include "reg_defs.h"
\r
40 #include <hif_api.h>
\r
41 #include <Magpie_api.h>
\r
42 #include <vdesc_api.h>
\r
43 #include <adf_os_mem.h>
\r
44 #include <adf_os_io.h>
\r
46 #include "hif_usb.h"
\r
49 * -- support more than 64 bytes command on ep4 --
\r
51 int _HIFusb_get_max_msg_len_patch(hif_handle_t handle, int pipe)
\r
54 case HIF_USB_PIPE_INTERRUPT:
\r
55 case HIF_USB_PIPE_COMMAND:
\r
64 * -- move the usb_task to here --
\r
66 void _HIFusb_isr_handler_patch(hif_handle_t h)
\r
70 _HIFusb_isr_handler();
\r
75 * -- reset usb dma --
\r
77 * - make sure DMA_START bit0 is zero
\r
78 * - update DMA_START bit4 to 1
\r
79 * - update DESC_START_ADDR
\r
80 * - update DMA_START bit 0
\r
82 void _HIFusb_start_patch(hif_handle_t handle)
\r
84 MAGPIE_REG_USB_TX0_DMA_START = 0x0;
\r
85 MAGPIE_REG_USB_RX0_DMA_START = 0x0;
\r
86 MAGPIE_REG_USB_RX1_DMA_START = 0x0;
\r
87 MAGPIE_REG_USB_RX2_DMA_START = 0x0;
\r
91 if(!MAGPIE_REG_USB_TX0_DMA_START &&
\r
92 !MAGPIE_REG_USB_RX0_DMA_START &&
\r
93 !MAGPIE_REG_USB_RX1_DMA_START &&
\r
94 !MAGPIE_REG_USB_RX2_DMA_START )
\r
96 MAGPIE_REG_USB_TX0_DMA_START = MAGPIE_REG_USB_TX0_DMA_START|BIT4;
\r
97 MAGPIE_REG_USB_RX0_DMA_START = MAGPIE_REG_USB_RX0_DMA_START|BIT4;
\r
98 MAGPIE_REG_USB_RX1_DMA_START = MAGPIE_REG_USB_RX1_DMA_START|BIT4;
\r
99 MAGPIE_REG_USB_RX2_DMA_START = MAGPIE_REG_USB_RX2_DMA_START|BIT4;
\r