tizen 2.4 release
[kernel/u-boot-tm1.git] / drivers / usb / gadget / dwc_otg / dwc_otg_driver.h
1 /* ==========================================================================
2  * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_driver.h $
3  * $Revision: #15 $
4  * $Date: 2008/12/24 $
5  * $Change: 1158473 $
6  *
7  * Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
8  * "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
9  * otherwise expressly agreed to in writing between Synopsys and you.
10  * 
11  * The Software IS NOT an item of Licensed Software or Licensed Product under
12  * any End User Software License Agreement or Agreement for Licensed Product
13  * with Synopsys or any supplement thereto. You are permitted to use and
14  * redistribute this Software in source and binary forms, with or without
15  * modification, provided that redistributions of source code must retain this
16  * notice. You may not view, use, disclose, copy or distribute this file or
17  * any information contained herein except pursuant to this license grant from
18  * Synopsys. If you do not agree with this notice, including the disclaimer
19  * below, then you are not authorized to use the Software.
20  * 
21  * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
25  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
31  * DAMAGE.
32  * ========================================================================== */
33
34 #ifndef __DWC_OTG_DRIVER_H__
35 #define __DWC_OTG_DRIVER_H__
36
37 /** @file
38  * This file contains the interface to the Linux driver.
39  */
40 #include "dwc_otg_core_if.h"
41
42 /* Type declarations */
43 struct dwc_otg_pcd;
44 struct dwc_otg_hcd;
45
46
47 /**
48  * This structure is a wrapper that encapsulates the driver components used to
49  * manage a single DWC_otg controller.
50  */
51 typedef struct dwc_otg_device {
52         /** Base address returned from ioremap() */
53         void *base;
54
55
56         /** Pointer to the core interface structure. */
57         dwc_otg_core_if_t *core_if;
58
59         /** Register offset for Diagnostic API. */
60         uint32_t reg_offset;
61
62         /** Pointer to the PCD structure. */
63         struct dwc_otg_pcd *pcd;
64
65         /** Pointer to the HCD structure. */
66         struct dwc_otg_hcd *hcd;
67
68         /** Flag to indicate whether the common IRQ handler is installed. */
69         uint8_t common_irq_installed;
70
71 } dwc_otg_device_t;
72
73 /*We must clear S3C24XX_EINTPEND external interrupt register 
74  * because after clearing in this register trigerred IRQ from 
75  * H/W core in kernel interrupt can be occured again before OTG
76  * handlers clear all IRQ sources of Core registers because of
77  * timing latencies and Low Level IRQ Type.
78  */
79 #ifdef CONFIG_MACH_IPMATE
80 #define  S3C2410X_CLEAR_EINTPEND()   \
81 do { \
82         __raw_writel(1UL << 11,S3C24XX_EINTPEND); \
83 } while (0)
84 #else
85 #define  S3C2410X_CLEAR_EINTPEND()   do { } while (0)
86 #endif
87
88 #if defined (CONFIG_WHALE)
89  #if defined (CONFIG_WHALE_USB2_DOWNLOAD)
90   #define USB_PHYS            0x20300000
91  #else
92   #define USB_PHYS            0x20500000
93  #endif
94 #else
95 #if defined(CONFIG_SPX20)
96  #define USB_PHYS             0x20200000
97 #endif
98 #endif
99
100 #if defined(CONFIG_SPX20)
101 /*for shuttle sprd usb phy reset control*/
102 #define USB_GUSBCFG_OFFSET    0x0c
103 #define USB_GUSBCFG    (USB_PHYS + USB_GUSBCFG_OFFSET)
104 #endif
105
106 #endif