AM261x MCU+ SDK: dev.h Source File

| AM261x MCU+ SDK 26.00.00 |

dev.h
Go to the documentation of this file.
1 /* ==========================================================================
2 * $File: //dwh/usb_iip/dev/software/DWC_usb3/driver/dev.h $
3 * $Revision: #6 $
4 * $Date: 2013/12/17 $
5 * $Change: 2392669 $
6 *
7 * Synopsys SS USB3 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_DEV_H_
35 #define _DWC_DEV_H_
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
49 typedef struct dwc_usb3_device {
56 volatile u8 __iomem *base;
57
59 int gasket_ofs;
60
61 #if defined(__linux__) || defined(LINUXTEST)
62 #ifdef DWC_PLATFORM_DEV
63
64 struct platform_device *platdev;
65 #else
66
67 struct pci_dev *pcidev;
68 #endif
69
70 resource_size_t rsrc_start;
71
73 resource_size_t rsrc_len;
74
76 int irq;
77
78 struct task_struct *pme_thread;
79 #endif
80 /* ==== End of OS-specific stuff ==== */
81
83 int hiber_cnt;
84
86 u32 hibernate;
87
88 #define DWC_HIBER_AWAKE 0U
89 #define DWC_HIBER_ENTER_NOSAVE 1U
90 #define DWC_HIBER_ENTER_SAVE 2U
91 #define DWC_HIBER_SLEEPING 3U
92 #define DWC_HIBER_WAIT_LINK_UP 4U
93 #define DWC_HIBER_WAIT_U0 5U
94 #define DWC_HIBER_SS_DIS_QUIRK 6U
95
96 int pme_ready;
97
99 struct dwc_usb3_pcd pcd;
100
102 u32 snpsid;
103
105 dwc_usb3_core_params_t *core_params;
106
108 dwc_usb3_core_global_regs_t __iomem *core_global_regs;
109
110 #ifdef SSIC
111 dwc_usb3_ssic_regs_t __iomem *ssic_regs;
112 #endif
113
115 #define DWC_EVENT_BUF_SIZE 256U // size in dwords
116 #define DWC_NUM_EVENT_BUFS 1U
117
120 u32 *event_ptr[DWC_NUM_EVENT_BUFS];
121 u32 *event_buf[DWC_NUM_EVENT_BUFS];
122 dwc_dma_t event_buf_dma[DWC_NUM_EVENT_BUFS];
126 u16 total_fifo_size;
127
129 u16 rx_fifo_size;
130
133 u32 hwparams0;
134 u32 hwparams1;
135 u32 hwparams2;
136 u32 hwparams3;
137 u32 hwparams4;
138 u32 hwparams5;
139 u32 hwparams6;
140 u32 hwparams7;
141 u32 hwparams8;
146 u32 dcfg_save;
147 u32 dctl_save;
148 u32 gtxfifosiz0_save;
149 u32 gtxfifosiz1_save;
150 u32 gtxfifosiz2_save;
151 u32 gtxfifosiz3_save;
152 u32 grxfifosiz0_save;
159 void (*soft_reset_hook)(struct dwc_usb3_device *dev, int softrst, int rstor);
160 void (*phy_config_hook)(struct dwc_usb3_device *dev, int softrst, int rstor);
161 void (*fifo_sizing_hook)(struct dwc_usb3_device *dev, int softrst, int rstor);
162 void (*gctl_init_hook)(struct dwc_usb3_device *dev, int softrst, int rstor);
163 void (*set_address_hook)(struct dwc_usb3_device *dev, int softrst, int rstor);
164 void (*ep0_start_hook)(struct dwc_usb3_device *dev, int softrst, int rstor);
170 u32 hird_thresh;
171
176 u32 gsbuscfg0;
177 u32 gsbuscfg1;
178
179 /* alternate interface number */
180 u16 alt_interface;
181
183 unsigned int cmn_initialized : 1;
184
186 unsigned int gadget_initialized : 1;
187
189 unsigned int pcd_initialized : 1;
190
192 unsigned int cmn_irq_installed : 1;
193
195 unsigned int sysfs_initialized : 1;
196
198 unsigned int hiber_wait_connect : 1;
199
201 unsigned int hiber_wait_u0 : 1;
202
205 unsigned int program_gsbuscfg : 1;
206 } dwc_usb3_device_t;
207
208 #ifdef __cplusplus
209 }
210 #endif
211
212 #endif /* _DWC_DEV_H_ */
task_struct
Definition: os_defs.h:116
u32
unsigned int u32
Definition: os_defs.h:41
u16
unsigned short u16
Definition: os_defs.h:43
dwc_usb3_device_t::gtxfifosiz0_save
u32 gtxfifosiz0_save
Definition: dev.h:148
dwc_usb3_device_t::hwparams2
u32 hwparams2
Definition: dev.h:135
dwc_usb3_device_t::hwparams6
u32 hwparams6
Definition: dev.h:139
dwc_usb3_device_t::gtxfifosiz2_save
u32 gtxfifosiz2_save
Definition: dev.h:150
__iomem
#define __iomem
Definition: os_defs.h:74
dwc_usb3_device_t::total_fifo_size
u16 total_fifo_size
Definition: dev.h:126
dwc_usb3_device_t::gsbuscfg1
u32 gsbuscfg1
Definition: dev.h:177
dwc_usb3_device_t::hwparams0
u32 hwparams0
Definition: dev.h:133
dwc_usb3_device_t::hwparams5
u32 hwparams5
Definition: dev.h:138
dwc_dma_t
unsigned long dwc_dma_t
Definition: os_defs.h:62
dwc_usb3_device_t::pme_ready
int pme_ready
Definition: dev.h:96
dwc_usb3_device_t::gtxfifosiz1_save
u32 gtxfifosiz1_save
Definition: dev.h:149
dwc_usb3_device_t::core_params
dwc_usb3_core_params_t * core_params
Definition: dev.h:105
dwc_usb3_device_t::pcd_initialized
unsigned int pcd_initialized
Definition: dev.h:189
DWC_NUM_EVENT_BUFS
#define DWC_NUM_EVENT_BUFS
Definition: dev.h:116
dwc_usb3_device_t
Definition: dev.h:49
dwc_usb3_device_t::rx_fifo_size
u16 rx_fifo_size
Definition: dev.h:129
dwc_usb3_device_t::cmn_initialized
unsigned int cmn_initialized
Definition: dev.h:183
dwc_usb3_device_t::hibernate
u32 hibernate
Definition: dev.h:86
dwc_usb3_device_t::base
volatile u8 __iomem * base
Definition: dev.h:56
dwc_usb3_core_global_regs_t
Definition: hw.h:1045
dwc_usb3_device_t::hwparams7
u32 hwparams7
Definition: dev.h:140
dwc_usb3_device_t::alt_interface
u16 alt_interface
Definition: dev.h:180
dwc_usb3_device_t::gadget_initialized
unsigned int gadget_initialized
Definition: dev.h:186
dwc_usb3_device_t::hwparams4
u32 hwparams4
Definition: dev.h:137
dwc_usb3_device_t::grxfifosiz0_save
u32 grxfifosiz0_save
Definition: dev.h:152
dwc_usb3_device_t::hwparams3
u32 hwparams3
Definition: dev.h:136
dwc_usb3_device_t::gtxfifosiz3_save
u32 gtxfifosiz3_save
Definition: dev.h:151
dwc_usb3_device_t::hiber_cnt
int hiber_cnt
Definition: dev.h:83
dwc_usb3_device_t::core_global_regs
dwc_usb3_core_global_regs_t __iomem * core_global_regs
Definition: dev.h:108
dwc_usb3_device_t::gsbuscfg0
u32 gsbuscfg0
Definition: dev.h:176
dwc_usb3_device_t::hwparams8
u32 hwparams8
Definition: dev.h:141
dwc_usb3_device_t::hiber_wait_connect
unsigned int hiber_wait_connect
Definition: dev.h:198
dwc_usb3_core_params_t
Definition: os_defs.h:168
dwc_usb3_device_t::dcfg_save
u32 dcfg_save
Definition: dev.h:146
dwc_usb3_device_t::hird_thresh
u32 hird_thresh
Definition: dev.h:170
dwc_usb3_device_t::hiber_wait_u0
unsigned int hiber_wait_u0
Definition: dev.h:201
dwc_usb3_device_t::snpsid
u32 snpsid
Definition: dev.h:102
dwc_usb3_device_t::gasket_ofs
int gasket_ofs
Definition: dev.h:59
dwc_usb3_device_t::dctl_save
u32 dctl_save
Definition: dev.h:147
u8
unsigned char u8
Definition: os_defs.h:45
dwc_usb3_device_t::sysfs_initialized
unsigned int sysfs_initialized
Definition: dev.h:195
dwc_usb3_device_t::cmn_irq_installed
unsigned int cmn_irq_installed
Definition: dev.h:192
dwc_usb3_device_t::program_gsbuscfg
unsigned int program_gsbuscfg
Definition: dev.h:205
dwc_usb3_device_t::hwparams1
u32 hwparams1
Definition: dev.h:134