tizen 2.4 release
[kernel/u-boot-tm1.git] / drivers / usb / gadget / dwc_otg / dwc_otg_core_if.h
1 /* ==========================================================================
2  * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_core_if.h $
3  * $Revision: #4 $
4  * $Date: 2008/12/18 $
5  * $Change: 1155299 $
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 #if !defined(__DWC_CORE_IF_H__)
34 #define __DWC_CORE_IF_H__
35
36 #include "dwc_os.h"
37
38 /** @file
39  * This file defines DWC_OTG Core API
40  */
41
42 struct dwc_otg_core_if;
43 typedef struct dwc_otg_core_if dwc_otg_core_if_t;
44
45 /** Maximum number of Periodic FIFOs */
46 #define MAX_PERIO_FIFOS 15
47 /** Maximum number of Periodic FIFOs */
48 #define MAX_TX_FIFOS 15
49
50 /** Maximum number of Endpoints/HostChannels */
51 #define MAX_EPS_CHANNELS 16
52
53 extern dwc_otg_core_if_t *dwc_otg_cil_init(const uint32_t * _reg_base_addr);
54 extern void dwc_otg_core_init(dwc_otg_core_if_t * _core_if);
55 extern void dwc_otg_cil_remove(dwc_otg_core_if_t * _core_if);
56
57 extern void dwc_otg_enable_global_interrupts(dwc_otg_core_if_t * _core_if);
58 extern void dwc_otg_disable_global_interrupts(dwc_otg_core_if_t * _core_if);
59
60 extern uint8_t dwc_otg_is_device_mode(dwc_otg_core_if_t * _core_if);
61 extern uint8_t dwc_otg_is_host_mode(dwc_otg_core_if_t * _core_if);
62
63 extern uint8_t dwc_otg_is_dma_enable(dwc_otg_core_if_t * core_if);
64
65 /** This function should be called on every hardware interrupt. */
66 extern int32_t dwc_otg_handle_common_intr(dwc_otg_core_if_t * _core_if);
67
68 /** @name OTG Core Parameters */
69 /** @{ */
70
71 /**
72  * Specifies the OTG capabilities. The driver will automatically
73  * detect the value for this parameter if none is specified.
74  * 0 - HNP and SRP capable (default)
75  * 1 - SRP Only capable
76  * 2 - No HNP/SRP capable
77  */
78 extern int dwc_otg_set_param_otg_cap(dwc_otg_core_if_t * core_if, int32_t val);
79 extern int32_t dwc_otg_get_param_otg_cap(dwc_otg_core_if_t * core_if);
80 #define DWC_OTG_CAP_PARAM_HNP_SRP_CAPABLE 0
81 #define DWC_OTG_CAP_PARAM_SRP_ONLY_CAPABLE 1
82 #define DWC_OTG_CAP_PARAM_NO_HNP_SRP_CAPABLE 2
83 #define dwc_param_otg_cap_default DWC_OTG_CAP_PARAM_HNP_SRP_CAPABLE
84
85 extern int dwc_otg_set_param_opt(dwc_otg_core_if_t * core_if, int32_t val);
86 extern int32_t dwc_otg_get_param_opt(dwc_otg_core_if_t * core_if);
87 #define dwc_param_opt_default 1
88
89 /**
90  * Specifies whether to use slave or DMA mode for accessing the data
91  * FIFOs. The driver will automatically detect the value for this
92  * parameter if none is specified.
93  * 0 - Slave
94  * 1 - DMA (default, if available)
95  */
96 extern int dwc_otg_set_param_dma_enable(dwc_otg_core_if_t * core_if,
97                                         int32_t val);
98 extern int32_t dwc_otg_get_param_dma_enable(dwc_otg_core_if_t * core_if);
99 #define dwc_param_dma_enable_default 1
100
101 /**
102  * When DMA mode is enabled specifies whether to use
103  * address DMA or DMA Descritor mode for accessing the data
104  * FIFOs in device mode. The driver will automatically detect
105  * the value for this parameter if none is specified.
106  * 0 - address DMA
107  * 1 - DMA Descriptor(default, if available)
108  */
109 extern int dwc_otg_set_param_dma_desc_enable(dwc_otg_core_if_t * core_if,
110                                              int32_t val);
111 extern int32_t dwc_otg_get_param_dma_desc_enable(dwc_otg_core_if_t * core_if);
112 #if defined( CONFIG_SC8830) || defined(CONFIG_SC9630)
113 #define dwc_param_dma_desc_enable_default 0
114 #else
115 #define dwc_param_dma_desc_enable_default 1
116 #endif
117
118 /** The DMA Burst size (applicable only for External DMA
119  * Mode). 1, 4, 8 16, 32, 64, 128, 256 (default 32)
120  */
121 extern int dwc_otg_set_param_dma_burst_size(dwc_otg_core_if_t * core_if,
122                                             int32_t val);
123 extern int32_t dwc_otg_get_param_dma_burst_size(dwc_otg_core_if_t * core_if);
124 #define dwc_param_dma_burst_size_default 32
125
126 /**
127  * Specifies the maximum speed of operation in host and device mode.
128  * The actual speed depends on the speed of the attached device and
129  * the value of phy_type. The actual speed depends on the speed of the
130  * attached device.
131  * 0 - High Speed (default)
132  * 1 - Full Speed
133  */
134 extern int dwc_otg_set_param_speed(dwc_otg_core_if_t * core_if, int32_t val);
135 extern int32_t dwc_otg_get_param_speed(dwc_otg_core_if_t * core_if);
136 #define dwc_param_speed_default 0
137 #define DWC_SPEED_PARAM_HIGH 0
138 #define DWC_SPEED_PARAM_FULL 1
139
140 /** Specifies whether low power mode is supported when attached
141  *      to a Full Speed or Low Speed device in host mode.
142  * 0 - Don't support low power mode (default)
143  * 1 - Support low power mode
144  */
145 extern int dwc_otg_set_param_host_support_fs_ls_low_power(dwc_otg_core_if_t *
146                                                           core_if, int32_t val);
147 extern int32_t dwc_otg_get_param_host_support_fs_ls_low_power(dwc_otg_core_if_t
148                                                               * core_if);
149 #define dwc_param_host_support_fs_ls_low_power_default 0
150
151 /** Specifies the PHY clock rate in low power mode when connected to a
152  * Low Speed device in host mode. This parameter is applicable only if
153  * HOST_SUPPORT_FS_LS_LOW_POWER is enabled. If PHY_TYPE is set to FS
154  * then defaults to 6 MHZ otherwise 48 MHZ.
155  *
156  * 0 - 48 MHz
157  * 1 - 6 MHz
158  */
159 extern int dwc_otg_set_param_host_ls_low_power_phy_clk(dwc_otg_core_if_t *
160                                                        core_if, int32_t val);
161 extern int32_t dwc_otg_get_param_host_ls_low_power_phy_clk(dwc_otg_core_if_t *
162                                                            core_if);
163 #define dwc_param_host_ls_low_power_phy_clk_default 0
164 #define DWC_HOST_LS_LOW_POWER_PHY_CLK_PARAM_48MHZ 0
165 #define DWC_HOST_LS_LOW_POWER_PHY_CLK_PARAM_6MHZ 1
166
167 /**
168  * 0 - Use cC FIFO size parameters
169  * 1 - Allow dynamic FIFO sizing (default)
170  */
171 extern int dwc_otg_set_param_enable_dynamic_fifo(dwc_otg_core_if_t * core_if,
172                                                  int32_t val);
173 extern int32_t dwc_otg_get_param_enable_dynamic_fifo(dwc_otg_core_if_t *
174                                                      core_if);
175 #define dwc_param_enable_dynamic_fifo_default 1
176
177 /** Total number of 4-byte words in the data FIFO memory. This
178  * memory includes the Rx FIFO, non-periodic Tx FIFO, and periodic
179  * Tx FIFOs.
180  * 32 to 32768 (default 8192)
181  * Note: The total FIFO memory depth in the FPGA configuration is 8192.
182  */
183 extern int dwc_otg_set_param_data_fifo_size(dwc_otg_core_if_t * core_if,
184                                             int32_t val);
185 extern int32_t dwc_otg_get_param_data_fifo_size(dwc_otg_core_if_t * core_if);
186 #define dwc_param_data_fifo_size_default 8192
187
188 /** Number of 4-byte words in the Rx FIFO in device mode when dynamic
189  * FIFO sizing is enabled.
190  * 16 to 32768 (default 1064)
191  */
192 extern int dwc_otg_set_param_dev_rx_fifo_size(dwc_otg_core_if_t * core_if,
193                                               int32_t val);
194 extern int32_t dwc_otg_get_param_dev_rx_fifo_size(dwc_otg_core_if_t * core_if);
195 #define dwc_param_dev_rx_fifo_size_default 1064
196
197 /** Number of 4-byte words in the non-periodic Tx FIFO in device mode
198  * when dynamic FIFO sizing is enabled.
199  * 16 to 32768 (default 1024)
200  */
201 extern int dwc_otg_set_param_dev_nperio_tx_fifo_size(dwc_otg_core_if_t *
202                                                      core_if, int32_t val);
203 extern int32_t dwc_otg_get_param_dev_nperio_tx_fifo_size(dwc_otg_core_if_t *
204                                                          core_if);
205 #define dwc_param_dev_nperio_tx_fifo_size_default 1024
206
207 /** Number of 4-byte words in each of the periodic Tx FIFOs in device
208  * mode when dynamic FIFO sizing is enabled.
209  * 4 to 768 (default 256)
210  */
211 extern int dwc_otg_set_param_dev_perio_tx_fifo_size(dwc_otg_core_if_t * core_if,
212                                                     int32_t val, int fifo_num);
213 extern int32_t dwc_otg_get_param_dev_perio_tx_fifo_size(dwc_otg_core_if_t *
214                                                         core_if, int fifo_num);
215 #define dwc_param_dev_perio_tx_fifo_size_default 256
216
217 /** Number of 4-byte words in the Rx FIFO in host mode when dynamic
218  * FIFO sizing is enabled.
219  * 16 to 32768 (default 1024)
220  */
221 extern int dwc_otg_set_param_host_rx_fifo_size(dwc_otg_core_if_t * core_if,
222                                                int32_t val);
223 extern int32_t dwc_otg_get_param_host_rx_fifo_size(dwc_otg_core_if_t * core_if);
224 #define dwc_param_host_rx_fifo_size_default 1024
225
226 /** Number of 4-byte words in the non-periodic Tx FIFO in host mode
227  * when Dynamic FIFO sizing is enabled in the core.
228  * 16 to 32768 (default 1024)
229  */
230 extern int dwc_otg_set_param_host_nperio_tx_fifo_size(dwc_otg_core_if_t *
231                                                       core_if, int32_t val);
232 extern int32_t dwc_otg_get_param_host_nperio_tx_fifo_size(dwc_otg_core_if_t *
233                                                           core_if);
234 #define dwc_param_host_nperio_tx_fifo_size_default 1024
235
236 /** Number of 4-byte words in the host periodic Tx FIFO when dynamic
237  * FIFO sizing is enabled.
238  * 16 to 32768 (default 1024)
239  */
240 extern int dwc_otg_set_param_host_perio_tx_fifo_size(dwc_otg_core_if_t *
241                                                      core_if, int32_t val);
242 extern int32_t dwc_otg_get_param_host_perio_tx_fifo_size(dwc_otg_core_if_t *
243                                                          core_if);
244 #define dwc_param_host_perio_tx_fifo_size_default 1024
245
246 /** The maximum transfer size supported in bytes.
247  * 2047 to 65,535  (default 65,535)
248  */
249 extern int dwc_otg_set_param_max_transfer_size(dwc_otg_core_if_t * core_if,
250                                                int32_t val);
251 extern int32_t dwc_otg_get_param_max_transfer_size(dwc_otg_core_if_t * core_if);
252 #define dwc_param_max_transfer_size_default 65535
253
254 /** The maximum number of packets in a transfer.
255  * 15 to 511  (default 511)
256  */
257 extern int dwc_otg_set_param_max_packet_count(dwc_otg_core_if_t * core_if,
258                                               int32_t val);
259 extern int32_t dwc_otg_get_param_max_packet_count(dwc_otg_core_if_t * core_if);
260 #define dwc_param_max_packet_count_default 511
261
262 /** The number of host channel registers to use.
263  * 1 to 16 (default 12)
264  * Note: The FPGA configuration supports a maximum of 12 host channels.
265  */
266 extern int dwc_otg_set_param_host_channels(dwc_otg_core_if_t * core_if,
267                                            int32_t val);
268 extern int32_t dwc_otg_get_param_host_channels(dwc_otg_core_if_t * core_if);
269 #define dwc_param_host_channels_default 12
270
271 /** The number of endpoints in addition to EP0 available for device
272  * mode operations.
273  * 1 to 15 (default 6 IN and OUT)
274  * Note: The FPGA configuration supports a maximum of 6 IN and OUT
275  * endpoints in addition to EP0.
276  */
277 extern int dwc_otg_set_param_dev_endpoints(dwc_otg_core_if_t * core_if,
278                                            int32_t val);
279 extern int32_t dwc_otg_get_param_dev_endpoints(dwc_otg_core_if_t * core_if);
280 #define dwc_param_dev_endpoints_default 6
281
282 /**
283  * Specifies the type of PHY interface to use. By default, the driver
284  * will automatically detect the phy_type.
285  *
286  * 0 - Full Speed PHY
287  * 1 - UTMI+ (default)
288  * 2 - ULPI
289  */
290 extern int dwc_otg_set_param_phy_type(dwc_otg_core_if_t * core_if, int32_t val);
291 extern int32_t dwc_otg_get_param_phy_type(dwc_otg_core_if_t * core_if);
292 #define DWC_PHY_TYPE_PARAM_FS 0
293 #define DWC_PHY_TYPE_PARAM_UTMI 1
294 #define DWC_PHY_TYPE_PARAM_ULPI 2
295 #define dwc_param_phy_type_default DWC_PHY_TYPE_PARAM_UTMI
296
297 /**
298  * Specifies the UTMI+ Data Width.      This parameter is
299  * applicable for a PHY_TYPE of UTMI+ or ULPI. (For a ULPI
300  * PHY_TYPE, this parameter indicates the data width between
301  * the MAC and the ULPI Wrapper.) Also, this parameter is
302  * applicable only if the OTG_HSPHY_WIDTH cC parameter was set
303  * to "8 and 16 bits", meaning that the core has been
304  * configured to work at either data path width.
305  *
306  * 8 or 16 bits (default 16)
307  */
308 extern int dwc_otg_set_param_phy_utmi_width(dwc_otg_core_if_t * core_if,
309                                             int32_t val);
310 extern int32_t dwc_otg_get_param_phy_utmi_width(dwc_otg_core_if_t * core_if);
311 #define dwc_param_phy_utmi_width_default 16
312
313 /**
314  * Specifies whether the ULPI operates at double or single
315  * data rate. This parameter is only applicable if PHY_TYPE is
316  * ULPI.
317  *
318  * 0 - single data rate ULPI interface with 8 bit wide data
319  * bus (default)
320  * 1 - double data rate ULPI interface with 4 bit wide data
321  * bus
322  */
323 extern int dwc_otg_set_param_phy_ulpi_ddr(dwc_otg_core_if_t * core_if,
324                                           int32_t val);
325 extern int32_t dwc_otg_get_param_phy_ulpi_ddr(dwc_otg_core_if_t * core_if);
326 #define dwc_param_phy_ulpi_ddr_default 0
327
328 /**
329  * Specifies whether to use the internal or external supply to
330  * drive the vbus with a ULPI phy.
331  */
332 extern int dwc_otg_set_param_phy_ulpi_ext_vbus(dwc_otg_core_if_t * core_if,
333                                                int32_t val);
334 extern int32_t dwc_otg_get_param_phy_ulpi_ext_vbus(dwc_otg_core_if_t * core_if);
335 #define DWC_PHY_ULPI_INTERNAL_VBUS 0
336 #define DWC_PHY_ULPI_EXTERNAL_VBUS 1
337 #define dwc_param_phy_ulpi_ext_vbus_default DWC_PHY_ULPI_INTERNAL_VBUS
338
339 /**
340  * Specifies whether to use the I2Cinterface for full speed PHY. This
341  * parameter is only applicable if PHY_TYPE is FS.
342  * 0 - No (default)
343  * 1 - Yes
344  */
345 extern int dwc_otg_set_param_i2c_enable(dwc_otg_core_if_t * core_if,
346                                         int32_t val);
347 extern int32_t dwc_otg_get_param_i2c_enable(dwc_otg_core_if_t * core_if);
348 #define dwc_param_i2c_enable_default 0
349
350 extern int dwc_otg_set_param_ulpi_fs_ls(dwc_otg_core_if_t * core_if,
351                                         int32_t val);
352 extern int32_t dwc_otg_get_param_ulpi_fs_ls(dwc_otg_core_if_t * core_if);
353 #define dwc_param_ulpi_fs_ls_default 0
354
355 extern int dwc_otg_set_param_ts_dline(dwc_otg_core_if_t * core_if, int32_t val);
356 extern int32_t dwc_otg_get_param_ts_dline(dwc_otg_core_if_t * core_if);
357 #define dwc_param_ts_dline_default 0
358
359 /**
360  * Specifies whether dedicated transmit FIFOs are
361  * enabled for non periodic IN endpoints in device mode
362  * 0 - No
363  * 1 - Yes
364  */
365 extern int dwc_otg_set_param_en_multiple_tx_fifo(dwc_otg_core_if_t * core_if,
366                                                  int32_t val);
367 extern int32_t dwc_otg_get_param_en_multiple_tx_fifo(dwc_otg_core_if_t *
368                                                      core_if);
369 #define dwc_param_en_multiple_tx_fifo_default 1
370
371 /** Number of 4-byte words in each of the Tx FIFOs in device
372  * mode when dynamic FIFO sizing is enabled.
373  * 4 to 768 (default 256)
374  */
375 extern int dwc_otg_set_param_dev_tx_fifo_size(dwc_otg_core_if_t * core_if,
376                                               int fifo_num, int32_t val);
377 extern int32_t dwc_otg_get_param_dev_tx_fifo_size(dwc_otg_core_if_t * core_if,
378                                                   int fifo_num);
379 #define dwc_param_dev_tx_fifo_size_default 256
380
381 /** Thresholding enable flag-
382  * bit 0 - enable non-ISO Tx thresholding
383  * bit 1 - enable ISO Tx thresholding
384  * bit 2 - enable Rx thresholding
385  */
386 extern int dwc_otg_set_param_thr_ctl(dwc_otg_core_if_t * core_if, int32_t val);
387 extern int32_t dwc_otg_get_thr_ctl(dwc_otg_core_if_t * core_if, int fifo_num);
388 #define dwc_param_thr_ctl_default 0
389
390 /** Thresholding length for Tx
391  * FIFOs in 32 bit DWORDs
392  */
393 extern int dwc_otg_set_param_tx_thr_length(dwc_otg_core_if_t * core_if,
394                                            int32_t val);
395 extern int32_t dwc_otg_get_tx_thr_length(dwc_otg_core_if_t * core_if);
396 #define dwc_param_tx_thr_length_default 64
397
398 /** Thresholding length for Rx
399  *      FIFOs in 32 bit DWORDs
400  */
401 extern int dwc_otg_set_param_rx_thr_length(dwc_otg_core_if_t * core_if,
402                                            int32_t val);
403 extern int32_t dwc_otg_get_rx_thr_length(dwc_otg_core_if_t * core_if);
404 #define dwc_param_rx_thr_length_default 64
405
406 /**
407  * Specifies whether LPM (Link Power Management) support is enabled
408  */
409 extern int dwc_otg_set_param_lpm_enable(dwc_otg_core_if_t * core_if,
410                                         int32_t val);
411 extern int32_t dwc_otg_get_param_lpm_enable(dwc_otg_core_if_t * core_if);
412 #define dwc_param_lpm_enable_default 1
413
414 /**
415  * Specifies whether PTI enhancement is enabled
416  */
417 extern int dwc_otg_set_param_pti_enable(dwc_otg_core_if_t * core_if,
418                                         int32_t val);
419 extern int32_t dwc_otg_get_param_pti_enable(dwc_otg_core_if_t * core_if);
420 #define dwc_param_pti_enable_default 0
421
422 /**
423  * Specifies whether MPI enhancement is enabled
424  */
425 extern int dwc_otg_set_param_mpi_enable(dwc_otg_core_if_t * core_if,
426                                         int32_t val);
427 extern int32_t dwc_otg_get_param_mpi_enable(dwc_otg_core_if_t * core_if);
428 #define dwc_param_mpi_enable_default 0
429
430 /**
431  * Specifies whether IC_USB capability is enabled
432  */
433 extern int dwc_otg_set_param_ic_usb_cap(dwc_otg_core_if_t * core_if,
434                                         int32_t val);
435 extern int32_t dwc_otg_get_param_ic_usb_cap(dwc_otg_core_if_t * core_if);
436 #define dwc_param_ic_usb_cap_default 0
437
438 extern int dwc_otg_set_param_ahb_thr_ratio(dwc_otg_core_if_t * core_if, int32_t val);
439 extern int32_t dwc_otg_get_param_ahb_thr_ratio(dwc_otg_core_if_t * core_if);
440 #define dwc_param_ahb_thr_ratio_default 0
441
442 /** @} */
443
444 /** @name Access to registers and bit-fields */
445
446 /**
447  * Dump core registers and SPRAM
448  */
449 extern void dwc_otg_dump_dev_registers(dwc_otg_core_if_t * _core_if);
450 extern void dwc_otg_dump_spram(dwc_otg_core_if_t * _core_if);
451 extern void dwc_otg_dump_host_registers(dwc_otg_core_if_t * _core_if);
452 extern void dwc_otg_dump_global_registers(dwc_otg_core_if_t * _core_if);
453
454 /**
455  * Get host negotiation status.
456  */
457 extern uint32_t dwc_otg_get_hnpstatus(dwc_otg_core_if_t * core_if);
458
459 /**
460  * Get srp status
461  */
462 extern uint32_t dwc_otg_get_srpstatus(dwc_otg_core_if_t * core_if);
463
464 /**
465  * Set hnpreq bit in the GOTGCTL register.
466  */
467 extern void dwc_otg_set_hnpreq(dwc_otg_core_if_t * core_if, uint32_t val);
468
469 /**
470  * Get Content of SNPSID register.
471  */
472 extern uint32_t dwc_otg_get_gsnpsid(dwc_otg_core_if_t * core_if);
473
474 /**
475  * Get current mode.
476  * Returns 0 if in device mode, and 1 if in host mode.
477  */
478 extern uint32_t dwc_otg_get_mode(dwc_otg_core_if_t * core_if);
479
480 /**
481  * Get value of hnpcapable field in the GUSBCFG register
482  */
483 extern uint32_t dwc_otg_get_hnpcapable(dwc_otg_core_if_t * core_if);
484 /**
485  * Set value of hnpcapable field in the GUSBCFG register
486  */
487 extern void dwc_otg_set_hnpcapable(dwc_otg_core_if_t * core_if, uint32_t val);
488
489 /**
490  * Get value of srpcapable field in the GUSBCFG register
491  */
492 extern uint32_t dwc_otg_get_srpcapable(dwc_otg_core_if_t * core_if);
493 /**
494  * Set value of srpcapable field in the GUSBCFG register
495  */
496 extern void dwc_otg_set_srpcapable(dwc_otg_core_if_t * core_if, uint32_t val);
497
498 /**
499  * Get value of devspeed field in the DCFG register
500  */
501 extern uint32_t dwc_otg_get_devspeed(dwc_otg_core_if_t * core_if);
502 /**
503  * Set value of devspeed field in the DCFG register
504  */
505 extern void dwc_otg_set_devspeed(dwc_otg_core_if_t * core_if, uint32_t val);
506
507 /**
508  * Get the value of busconnected field from the HPRT0 register
509  */
510 extern uint32_t dwc_otg_get_busconnected(dwc_otg_core_if_t * core_if);
511
512 /**
513  * Gets the device enumeration Speed.
514  */
515 extern uint32_t dwc_otg_get_enumspeed(dwc_otg_core_if_t * core_if);
516
517 /**
518  * Get value of prtpwr field from the HPRT0 register
519  */
520 extern uint32_t dwc_otg_get_prtpower(dwc_otg_core_if_t * core_if);
521 /**
522  * Set value of prtpwr field from the HPRT0 register
523  */
524 extern void dwc_otg_set_prtpower(dwc_otg_core_if_t * core_if, uint32_t val);
525
526 /**
527  * Get value of prtsusp field from the HPRT0 regsiter
528  */
529 extern uint32_t dwc_otg_get_prtsuspend(dwc_otg_core_if_t * core_if);
530 /**
531  * Set value of prtpwr field from the HPRT0 register
532  */
533 extern void dwc_otg_set_prtsuspend(dwc_otg_core_if_t * core_if, uint32_t val);
534
535 /**
536  * Set value of prtres field from the HPRT0 register
537  *FIXME Remove?
538  */
539 extern void dwc_otg_set_prtresume(dwc_otg_core_if_t * core_if, uint32_t val);
540
541 /**
542  * Get value of rmtwkupsig bit in DCTL register
543  */
544 extern uint32_t dwc_otg_get_remotewakesig(dwc_otg_core_if_t * core_if);
545
546 /**
547  * Get value of prt_sleep_sts field from the GLPMCFG register
548  */
549 extern uint32_t dwc_otg_get_lpm_portsleepstatus(dwc_otg_core_if_t * core_if);
550
551 /**
552  * Get value of rem_wkup_en field from the GLPMCFG register
553  */
554 extern uint32_t dwc_otg_get_lpm_remotewakeenabled(dwc_otg_core_if_t * core_if);
555
556 /**
557  * Get value of appl_resp field from the GLPMCFG register
558  */
559 extern uint32_t dwc_otg_get_lpmresponse(dwc_otg_core_if_t * core_if);
560 /**
561  * Set value of appl_resp field from the GLPMCFG register
562  */
563 extern void dwc_otg_set_lpmresponse(dwc_otg_core_if_t * core_if, uint32_t val);
564
565 /**
566  * Get value of hsic_connect field from the GLPMCFG register
567  */
568 extern uint32_t dwc_otg_get_hsic_connect(dwc_otg_core_if_t * core_if);
569 /**
570  * Set value of hsic_connect field from the GLPMCFG register
571  */
572 extern void dwc_otg_set_hsic_connect(dwc_otg_core_if_t * core_if, uint32_t val);
573
574 /**
575  * Get value of inv_sel_hsic field from the GLPMCFG register.
576  */
577 extern uint32_t dwc_otg_get_inv_sel_hsic(dwc_otg_core_if_t * core_if);
578 /**
579  * Set value of inv_sel_hsic field from the GLPMFG register.
580  */
581 extern void dwc_otg_set_inv_sel_hsic(dwc_otg_core_if_t * core_if, uint32_t val);
582
583 /*
584  * Some functions for accessing registers
585  */
586
587 /**
588  *  GOTGCTL register
589  */
590 extern uint32_t dwc_otg_get_gotgctl(dwc_otg_core_if_t * core_if);
591 extern void dwc_otg_set_gotgctl(dwc_otg_core_if_t * core_if, uint32_t val);
592
593 /**
594  * GUSBCFG register
595  */
596 extern uint32_t dwc_otg_get_gusbcfg(dwc_otg_core_if_t * core_if);
597 extern void dwc_otg_set_gusbcfg(dwc_otg_core_if_t * core_if, uint32_t val);
598
599 /**
600  * GRXFSIZ register
601  */
602 extern uint32_t dwc_otg_get_grxfsiz(dwc_otg_core_if_t * core_if);
603 extern void dwc_otg_set_grxfsiz(dwc_otg_core_if_t * core_if, uint32_t val);
604
605 /**
606  * GNPTXFSIZ register
607  */
608 extern uint32_t dwc_otg_get_gnptxfsiz(dwc_otg_core_if_t * core_if);
609 extern void dwc_otg_set_gnptxfsiz(dwc_otg_core_if_t * core_if, uint32_t val);
610
611 extern uint32_t dwc_otg_get_gpvndctl(dwc_otg_core_if_t * core_if);
612 extern void dwc_otg_set_gpvndctl(dwc_otg_core_if_t * core_if, uint32_t val);
613
614 /**
615  * GGPIO register
616  */
617 extern uint32_t dwc_otg_get_ggpio(dwc_otg_core_if_t * core_if);
618 extern void dwc_otg_set_ggpio(dwc_otg_core_if_t * core_if, uint32_t val);
619
620 /**
621  * GUID register
622  */
623 extern uint32_t dwc_otg_get_guid(dwc_otg_core_if_t * core_if);
624 extern void dwc_otg_set_guid(dwc_otg_core_if_t * core_if, uint32_t val);
625
626 /**
627  * HPRT0 register
628  */
629 extern uint32_t dwc_otg_get_hprt0(dwc_otg_core_if_t * core_if);
630 extern void dwc_otg_set_hprt0(dwc_otg_core_if_t * core_if, uint32_t val);
631
632 /**
633  * GHPTXFSIZE
634  */
635 extern uint32_t dwc_otg_get_hptxfsiz(dwc_otg_core_if_t * core_if);
636
637 /** @} */
638
639 #endif                          /* __DWC_CORE_IF_H__ */