#include "dwc_otg_os_dep.h"
#include "dwc_os.h"
#include "dwc_otg_dbg.h"
#include "dwc_otg_driver.h"
#include "dwc_otg_attr.h"
#include "dwc_otg_core_if.h"
#include "dwc_otg_pcd_if.h"
#include "dwc_otg_hcd_if.h"
Go to the source code of this file.
Data Structures | |
| struct | dwc_otg_driver_module_params |
Defines | |
| #define | DWC_DRIVER_VERSION "2.94a 27-OCT-2011" |
| #define | DWC_DRIVER_DESC "HS OTG USB Controller driver" |
Functions | |
| int | pcd_init () |
| This function initialized the PCD portion of the driver. | |
| int | hcd_init () |
| Initializes the HCD. | |
| int | pcd_remove () |
| Cleanup the PCD. | |
| void | hcd_remove () |
| Removes the HCD. | |
| void | dwc_otg_adp_start (dwc_otg_core_if_t *core_if, uint8_t is_host) |
| Called right after driver is loaded to perform initial actions for ADP. | |
| ssize_t | version_show (struct device_driver *dev, char *buf) |
| This function shows the Driver Version. | |
| DRIVER_ATTR (version, S_IRUGO, version_show, NULL) | |
| ssize_t | dbg_level_show (struct device_driver *drv, char *buf) |
| This function shows the driver Debug Level. | |
| ssize_t | dbg_level_store (struct device_driver *drv, const char *buf, size_t count) |
| This function stores the driver Debug Level. | |
| DRIVER_ATTR (debuglevel, S_IRUGO|S_IWUSR, dbg_level_show, dbg_level_store) | |
| int | set_parameters (dwc_otg_core_if_t *core_if) |
| This function is called during module intialization to pass module parameters to the DWC_OTG CORE. | |
| irqreturn_t | dwc_otg_common_irq (int irq, void *dev) |
| This function is the top level interrupt handler for the Common (Device and host modes) interrupts. | |
| void | dwc_otg_driver_remove () |
| This function is called when a lm_device is unregistered with the dwc_otg_driver. | |
| int | dwc_otg_driver_probe () |
| This function is called when an lm_device is bound to a dwc_otg_driver. | |
| int __init | dwc_otg_driver_init (void) |
| This function is called when the dwc_otg_driver is installed with the insmod command. | |
| module_init (dwc_otg_driver_init) | |
| void __exit | dwc_otg_driver_cleanup (void) |
| This function is called when the driver is removed from the kernel with the rmmod command. | |
| module_exit (dwc_otg_driver_cleanup) | |
| MODULE_DESCRIPTION (DWC_DRIVER_DESC) | |
| MODULE_AUTHOR ("Synopsys Inc.") | |
| MODULE_LICENSE ("GPL") | |
| module_param_named (otg_cap, dwc_otg_module_params.otg_cap, int, 0444) | |
| MODULE_PARM_DESC (otg_cap,"OTG Capabilities 0=HNP&SRP 1=SRP Only 2=None") | |
| module_param_named (opt, dwc_otg_module_params.opt, int, 0444) | |
| MODULE_PARM_DESC (opt,"OPT Mode") | |
| module_param_named (dma_enable, dwc_otg_module_params.dma_enable, int, 0444) | |
| MODULE_PARM_DESC (dma_enable,"DMA Mode 0=Slave 1=DMA enabled") | |
| module_param_named (dma_desc_enable, dwc_otg_module_params.dma_desc_enable, int, 0444) | |
| MODULE_PARM_DESC (dma_desc_enable,"DMA Desc Mode 0=Address DMA 1=DMA Descriptor enabled") | |
| module_param_named (dma_burst_size, dwc_otg_module_params.dma_burst_size, int, 0444) | |
| MODULE_PARM_DESC (dma_burst_size,"DMA Burst Size 1, 4, 8, 16, 32, 64, 128, 256") | |
| module_param_named (speed, dwc_otg_module_params.speed, int, 0444) | |
| MODULE_PARM_DESC (speed,"Speed 0=High Speed 1=Full Speed") | |
| module_param_named (host_support_fs_ls_low_power, dwc_otg_module_params.host_support_fs_ls_low_power, int, 0444) | |
| MODULE_PARM_DESC (host_support_fs_ls_low_power,"Support Low Power w/FS or LS 0=Support 1=Don't Support") | |
| module_param_named (host_ls_low_power_phy_clk, dwc_otg_module_params.host_ls_low_power_phy_clk, int, 0444) | |
| MODULE_PARM_DESC (host_ls_low_power_phy_clk,"Low Speed Low Power Clock 0=48Mhz 1=6Mhz") | |
| module_param_named (enable_dynamic_fifo, dwc_otg_module_params.enable_dynamic_fifo, int, 0444) | |
| MODULE_PARM_DESC (enable_dynamic_fifo,"0=cC Setting 1=Allow Dynamic Sizing") | |
| module_param_named (data_fifo_size, dwc_otg_module_params.data_fifo_size, int, 0444) | |
| MODULE_PARM_DESC (data_fifo_size,"Total number of words in the data FIFO memory 32-32768") | |
| module_param_named (dev_rx_fifo_size, dwc_otg_module_params.dev_rx_fifo_size, int, 0444) | |
| MODULE_PARM_DESC (dev_rx_fifo_size,"Number of words in the Rx FIFO 16-32768") | |
| module_param_named (dev_nperio_tx_fifo_size, dwc_otg_module_params.dev_nperio_tx_fifo_size, int, 0444) | |
| MODULE_PARM_DESC (dev_nperio_tx_fifo_size,"Number of words in the non-periodic Tx FIFO 16-32768") | |
| module_param_named (dev_perio_tx_fifo_size_1, dwc_otg_module_params.dev_perio_tx_fifo_size[0], int, 0444) | |
| MODULE_PARM_DESC (dev_perio_tx_fifo_size_1,"Number of words in the periodic Tx FIFO 4-768") | |
| module_param_named (dev_perio_tx_fifo_size_2, dwc_otg_module_params.dev_perio_tx_fifo_size[1], int, 0444) | |
| MODULE_PARM_DESC (dev_perio_tx_fifo_size_2,"Number of words in the periodic Tx FIFO 4-768") | |
| module_param_named (dev_perio_tx_fifo_size_3, dwc_otg_module_params.dev_perio_tx_fifo_size[2], int, 0444) | |
| MODULE_PARM_DESC (dev_perio_tx_fifo_size_3,"Number of words in the periodic Tx FIFO 4-768") | |
| module_param_named (dev_perio_tx_fifo_size_4, dwc_otg_module_params.dev_perio_tx_fifo_size[3], int, 0444) | |
| MODULE_PARM_DESC (dev_perio_tx_fifo_size_4,"Number of words in the periodic Tx FIFO 4-768") | |
| module_param_named (dev_perio_tx_fifo_size_5, dwc_otg_module_params.dev_perio_tx_fifo_size[4], int, 0444) | |
| MODULE_PARM_DESC (dev_perio_tx_fifo_size_5,"Number of words in the periodic Tx FIFO 4-768") | |
| module_param_named (dev_perio_tx_fifo_size_6, dwc_otg_module_params.dev_perio_tx_fifo_size[5], int, 0444) | |
| MODULE_PARM_DESC (dev_perio_tx_fifo_size_6,"Number of words in the periodic Tx FIFO 4-768") | |
| module_param_named (dev_perio_tx_fifo_size_7, dwc_otg_module_params.dev_perio_tx_fifo_size[6], int, 0444) | |
| MODULE_PARM_DESC (dev_perio_tx_fifo_size_7,"Number of words in the periodic Tx FIFO 4-768") | |
| module_param_named (dev_perio_tx_fifo_size_8, dwc_otg_module_params.dev_perio_tx_fifo_size[7], int, 0444) | |
| MODULE_PARM_DESC (dev_perio_tx_fifo_size_8,"Number of words in the periodic Tx FIFO 4-768") | |
| module_param_named (dev_perio_tx_fifo_size_9, dwc_otg_module_params.dev_perio_tx_fifo_size[8], int, 0444) | |
| MODULE_PARM_DESC (dev_perio_tx_fifo_size_9,"Number of words in the periodic Tx FIFO 4-768") | |
| module_param_named (dev_perio_tx_fifo_size_10, dwc_otg_module_params.dev_perio_tx_fifo_size[9], int, 0444) | |
| module_param_named (dev_perio_tx_fifo_size_11, dwc_otg_module_params.dev_perio_tx_fifo_size[10], int, 0444) | |
| module_param_named (dev_perio_tx_fifo_size_12, dwc_otg_module_params.dev_perio_tx_fifo_size[11], int, 0444) | |
| module_param_named (dev_perio_tx_fifo_size_13, dwc_otg_module_params.dev_perio_tx_fifo_size[12], int, 0444) | |
| module_param_named (dev_perio_tx_fifo_size_14, dwc_otg_module_params.dev_perio_tx_fifo_size[13], int, 0444) | |
| module_param_named (dev_perio_tx_fifo_size_15, dwc_otg_module_params.dev_perio_tx_fifo_size[14], int, 0444) | |
| module_param_named (host_rx_fifo_size, dwc_otg_module_params.host_rx_fifo_size, int, 0444) | |
| MODULE_PARM_DESC (host_rx_fifo_size,"Number of words in the Rx FIFO 16-32768") | |
| module_param_named (host_nperio_tx_fifo_size, dwc_otg_module_params.host_nperio_tx_fifo_size, int, 0444) | |
| MODULE_PARM_DESC (host_nperio_tx_fifo_size,"Number of words in the non-periodic Tx FIFO 16-32768") | |
| module_param_named (host_perio_tx_fifo_size, dwc_otg_module_params.host_perio_tx_fifo_size, int, 0444) | |
| MODULE_PARM_DESC (host_perio_tx_fifo_size,"Number of words in the host periodic Tx FIFO 16-32768") | |
| module_param_named (max_transfer_size, dwc_otg_module_params.max_transfer_size, int, 0444) | |
| MODULE_PARM_DESC (max_transfer_size,"The maximum transfer size supported in bytes 2047-65535") | |
| module_param_named (max_packet_count, dwc_otg_module_params.max_packet_count, int, 0444) | |
| MODULE_PARM_DESC (max_packet_count,"The maximum number of packets in a transfer 15-511") | |
| module_param_named (host_channels, dwc_otg_module_params.host_channels, int, 0444) | |
| MODULE_PARM_DESC (host_channels,"The number of host channel registers to use 1-16") | |
| module_param_named (dev_endpoints, dwc_otg_module_params.dev_endpoints, int, 0444) | |
| MODULE_PARM_DESC (dev_endpoints,"The number of endpoints in addition to EP0 available for device mode 1-15") | |
| module_param_named (phy_type, dwc_otg_module_params.phy_type, int, 0444) | |
| MODULE_PARM_DESC (phy_type,"0=Reserved 1=UTMI+ 2=ULPI") | |
| module_param_named (phy_utmi_width, dwc_otg_module_params.phy_utmi_width, int, 0444) | |
| MODULE_PARM_DESC (phy_utmi_width,"Specifies the UTMI+ Data Width 8 or 16 bits") | |
| module_param_named (phy_ulpi_ddr, dwc_otg_module_params.phy_ulpi_ddr, int, 0444) | |
| MODULE_PARM_DESC (phy_ulpi_ddr,"ULPI at double or single data rate 0=Single 1=Double") | |
| module_param_named (phy_ulpi_ext_vbus, dwc_otg_module_params.phy_ulpi_ext_vbus, int, 0444) | |
| MODULE_PARM_DESC (phy_ulpi_ext_vbus,"ULPI PHY using internal or external vbus 0=Internal") | |
| module_param_named (i2c_enable, dwc_otg_module_params.i2c_enable, int, 0444) | |
| MODULE_PARM_DESC (i2c_enable,"FS PHY Interface") | |
| module_param_named (ulpi_fs_ls, dwc_otg_module_params.ulpi_fs_ls, int, 0444) | |
| MODULE_PARM_DESC (ulpi_fs_ls,"ULPI PHY FS/LS mode only") | |
| module_param_named (ts_dline, dwc_otg_module_params.ts_dline, int, 0444) | |
| MODULE_PARM_DESC (ts_dline,"Term select Dline pulsing for all PHYs") | |
| module_param_named (debug, g_dbg_lvl, int, 0444) | |
| MODULE_PARM_DESC (debug,"") | |
| module_param_named (en_multiple_tx_fifo, dwc_otg_module_params.en_multiple_tx_fifo, int, 0444) | |
| MODULE_PARM_DESC (en_multiple_tx_fifo,"Dedicated Non Periodic Tx FIFOs 0=disabled 1=enabled") | |
| module_param_named (dev_tx_fifo_size_1, dwc_otg_module_params.dev_tx_fifo_size[0], int, 0444) | |
| MODULE_PARM_DESC (dev_tx_fifo_size_1,"Number of words in the Tx FIFO 4-768") | |
| module_param_named (dev_tx_fifo_size_2, dwc_otg_module_params.dev_tx_fifo_size[1], int, 0444) | |
| MODULE_PARM_DESC (dev_tx_fifo_size_2,"Number of words in the Tx FIFO 4-768") | |
| module_param_named (dev_tx_fifo_size_3, dwc_otg_module_params.dev_tx_fifo_size[2], int, 0444) | |
| MODULE_PARM_DESC (dev_tx_fifo_size_3,"Number of words in the Tx FIFO 4-768") | |
| module_param_named (dev_tx_fifo_size_4, dwc_otg_module_params.dev_tx_fifo_size[3], int, 0444) | |
| MODULE_PARM_DESC (dev_tx_fifo_size_4,"Number of words in the Tx FIFO 4-768") | |
| module_param_named (dev_tx_fifo_size_5, dwc_otg_module_params.dev_tx_fifo_size[4], int, 0444) | |
| MODULE_PARM_DESC (dev_tx_fifo_size_5,"Number of words in the Tx FIFO 4-768") | |
| module_param_named (dev_tx_fifo_size_6, dwc_otg_module_params.dev_tx_fifo_size[5], int, 0444) | |
| MODULE_PARM_DESC (dev_tx_fifo_size_6,"Number of words in the Tx FIFO 4-768") | |
| module_param_named (dev_tx_fifo_size_7, dwc_otg_module_params.dev_tx_fifo_size[6], int, 0444) | |
| MODULE_PARM_DESC (dev_tx_fifo_size_7,"Number of words in the Tx FIFO 4-768") | |
| module_param_named (dev_tx_fifo_size_8, dwc_otg_module_params.dev_tx_fifo_size[7], int, 0444) | |
| MODULE_PARM_DESC (dev_tx_fifo_size_8,"Number of words in the Tx FIFO 4-768") | |
| module_param_named (dev_tx_fifo_size_9, dwc_otg_module_params.dev_tx_fifo_size[8], int, 0444) | |
| MODULE_PARM_DESC (dev_tx_fifo_size_9,"Number of words in the Tx FIFO 4-768") | |
| module_param_named (dev_tx_fifo_size_10, dwc_otg_module_params.dev_tx_fifo_size[9], int, 0444) | |
| module_param_named (dev_tx_fifo_size_11, dwc_otg_module_params.dev_tx_fifo_size[10], int, 0444) | |
| module_param_named (dev_tx_fifo_size_12, dwc_otg_module_params.dev_tx_fifo_size[11], int, 0444) | |
| module_param_named (dev_tx_fifo_size_13, dwc_otg_module_params.dev_tx_fifo_size[12], int, 0444) | |
| module_param_named (dev_tx_fifo_size_14, dwc_otg_module_params.dev_tx_fifo_size[13], int, 0444) | |
| module_param_named (dev_tx_fifo_size_15, dwc_otg_module_params.dev_tx_fifo_size[14], int, 0444) | |
| module_param_named (thr_ctl, dwc_otg_module_params.thr_ctl, int, 0444) | |
| MODULE_PARM_DESC (thr_ctl,"Thresholding enable flag bit 0 - non ISO Tx thr., 1 - ISO Tx thr., 2 - Rx thr.- bit 0=disabled 1=enabled") | |
| module_param_named (tx_thr_length, dwc_otg_module_params.tx_thr_length, int, 0444) | |
| MODULE_PARM_DESC (tx_thr_length,"Tx Threshold length in 32 bit DWORDs") | |
| module_param_named (rx_thr_length, dwc_otg_module_params.rx_thr_length, int, 0444) | |
| MODULE_PARM_DESC (rx_thr_length,"Rx Threshold length in 32 bit DWORDs") | |
| module_param_named (pti_enable, dwc_otg_module_params.pti_enable, int, 0444) | |
| module_param_named (mpi_enable, dwc_otg_module_params.mpi_enable, int, 0444) | |
| module_param_named (lpm_enable, dwc_otg_module_params.lpm_enable, int, 0444) | |
| MODULE_PARM_DESC (lpm_enable,"LPM Enable 0=LPM Disabled 1=LPM Enabled") | |
| module_param_named (ic_usb_cap, dwc_otg_module_params.ic_usb_cap, int, 0444) | |
| MODULE_PARM_DESC (ic_usb_cap,"IC_USB Capability 0=IC_USB Disabled 1=IC_USB Enabled") | |
| module_param_named (ahb_thr_ratio, dwc_otg_module_params.ahb_thr_ratio, int, 0444) | |
| MODULE_PARM_DESC (ahb_thr_ratio,"AHB Threshold Ratio") | |
| module_param_named (power_down, dwc_otg_module_params.power_down, int, 0444) | |
| MODULE_PARM_DESC (power_down,"Power Down Mode") | |
| module_param_named (reload_ctl, dwc_otg_module_params.reload_ctl, int, 0444) | |
| MODULE_PARM_DESC (reload_ctl,"HFIR Reload Control") | |
| module_param_named (dev_out_nak, dwc_otg_module_params.dev_out_nak, int, 0444) | |
| MODULE_PARM_DESC (dev_out_nak,"Enable Device OUT NAK") | |
| module_param_named (cont_on_bna, dwc_otg_module_params.cont_on_bna, int, 0444) | |
| MODULE_PARM_DESC (cont_on_bna,"Enable Enable Continue on BNA") | |
| module_param_named (ahb_single, dwc_otg_module_params.ahb_single, int, 0444) | |
| MODULE_PARM_DESC (ahb_single,"Enable AHB Single Support") | |
| module_param_named (adp_enable, dwc_otg_module_params.adp_enable, int, 0444) | |
| MODULE_PARM_DESC (adp_enable,"ADP Enable 0=ADP Disabled 1=ADP Enabled") | |
| module_param_named (otg_ver, dwc_otg_module_params.otg_ver, int, 0444) | |
| MODULE_PARM_DESC (otg_ver,"OTG revision supported 0=OTG 1.3 1=OTG 2.0") | |
Variables | |
| const char | dwc_driver_name [] = "dwc_otg" |
| dwc_otg_driver_module_params | dwc_otg_module_params |
| uint32_t | g_dbg_lvl = 0 |
| The Debug Level bit-mask variable. | |
This module will be dynamically installed after Linux is booted using the insmod command. When the module is installed, the dwc_otg_driver_init function is called. When the module is removed (using rmmod), the dwc_otg_driver_cleanup function is called.
This module also defines a data structure for the dwc_otg_driver, which is used in conjunction with the standard ARM lm_device structure. These structures allow the OTG driver to comply with the standard Linux driver model in which devices and drivers are registered with a bus driver. This has the benefit that Linux can expose attributes of the driver and device in its special sysfs file system. Users can then read or write files in this file system to perform diagnostics on the driver components or the device.
Definition in file dwc_otg_driver.c.
|
|
Initializes the HCD. This function allocates memory for and initializes the static parts of the usb_hcd and dwc_otg_hcd structures. It also registers the USB bus with the core and calls the hc_driver->start() function. It returns a negative error on failure. Definition at line 339 of file dwc_otg_hcd_linux.c. |
|
|
Removes the HCD. Frees memory and resources associated with the HCD and deregisters the bus. Definition at line 441 of file dwc_otg_hcd_linux.c. |
|
||||||||||||
|
Called right after driver is loaded to perform initial actions for ADP.
Definition at line 458 of file dwc_otg_adp.c. |
|
|
This function is called when a lm_device is unregistered with the dwc_otg_driver. This happens, for example, when the rmmod command is executed. The device may or may not be electrically present. If it is present, the driver stops device processing. Any resources used on behalf of this device are freed.
Definition at line 561 of file dwc_otg_driver.c. |
|
|
This function is called when an lm_device is bound to a dwc_otg_driver. It creates the driver components required to control the device (CIL, HCD, and PCD) and it initializes the device. The driver components are stored in a dwc_otg_device structure. A reference to the dwc_otg_device is saved in the lm_device. This allows the driver to access the dwc_otg_device structure on subsequent calls to driver methods for this device.
Definition at line 651 of file dwc_otg_driver.c. |
|
|
This function is called when the dwc_otg_driver is installed with the insmod command. It registers the dwc_otg_driver structure with the appropriate bus driver. This will cause the dwc_otg_driver_probe function to be called. In addition, the bus driver will automatically expose attributes defined for the device and driver in the special sysfs file system.
Definition at line 924 of file dwc_otg_driver.c. |
|
|
This function is called when the driver is removed from the kernel with the rmmod command. The driver unregisters itself with its bus driver. Definition at line 957 of file dwc_otg_driver.c. |
|
||||||||||||
|
|
1.3.9.1