📄 dwc_otg_driver.c
字号:
MODULE_PARM_DESC(dev_perio_tx_fifo_size_11, "Number of words in the periodic Tx FIFO 4-768");module_param_named(dev_perio_tx_fifo_size_12, dwc_otg_module_params.dev_perio_tx_fifo_size[11], int, 0444);MODULE_PARM_DESC(dev_perio_tx_fifo_size_12, "Number of words in the periodic Tx FIFO 4-768");module_param_named(dev_perio_tx_fifo_size_13, dwc_otg_module_params.dev_perio_tx_fifo_size[12], int, 0444);MODULE_PARM_DESC(dev_perio_tx_fifo_size_13, "Number of words in the periodic Tx FIFO 4-768");module_param_named(dev_perio_tx_fifo_size_14, dwc_otg_module_params.dev_perio_tx_fifo_size[13], int, 0444);MODULE_PARM_DESC(dev_perio_tx_fifo_size_14, "Number of words in the periodic Tx FIFO 4-768");module_param_named(dev_perio_tx_fifo_size_15, dwc_otg_module_params.dev_perio_tx_fifo_size[14], int, 0444);MODULE_PARM_DESC(dev_perio_tx_fifo_size_15, "Number of words in the periodic Tx FIFO 4-768");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);/** @todo Set the max to 512K, modify checks */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_PARM_DESC(dev_tx_fifo_size_10, "Number of words in the Tx FIFO 4-768");module_param_named(dev_tx_fifo_size_11, dwc_otg_module_params.dev_tx_fifo_size[10], int, 0444);MODULE_PARM_DESC(dev_tx_fifo_size_11, "Number of words in the Tx FIFO 4-768");module_param_named(dev_tx_fifo_size_12, dwc_otg_module_params.dev_tx_fifo_size[11], int, 0444);MODULE_PARM_DESC(dev_tx_fifo_size_12, "Number of words in the Tx FIFO 4-768");module_param_named(dev_tx_fifo_size_13, dwc_otg_module_params.dev_tx_fifo_size[12], int, 0444);MODULE_PARM_DESC(dev_tx_fifo_size_13, "Number of words in the Tx FIFO 4-768");module_param_named(dev_tx_fifo_size_14, dwc_otg_module_params.dev_tx_fifo_size[13], int, 0444);MODULE_PARM_DESC(dev_tx_fifo_size_14, "Number of words in the Tx FIFO 4-768");module_param_named(dev_tx_fifo_size_15, dwc_otg_module_params.dev_tx_fifo_size[14], int, 0444);MODULE_PARM_DESC(dev_tx_fifo_size_15, "Number of words in the Tx FIFO 4-768");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");static int usb_otg_proc_read ( char *buffer, char **buffer_location, off_t offset, int buffer_length, int *zero, void *ptr){ int i;#if 0 printk("irq pattern\n"); for (i=0; i<10; i++) printk("\t%d, %d\n", i, core_if_global->irq_pat[i]); printk("\n\n\nirq host\n"); for (i=0; i<12; i++) printk("\t%d, %d\n", i, core_if_global->irq_hcd[i]); printk("\n\n\nirq hlt\n"); for (i=0; i<12; i++) printk("\t%d, %d\n", i, core_if_global->irq_hlt[i]); printk("\n\n\nxfr done\n"); for (i=0; i<12; i++) printk("\t%d, %d\n", i, core_if_global->xfr_done[i]);#endif printk("\n\n\nsplit\n"); for (i=0; i<2; i++) printk("\t%d, %d\n", i, core_if_global->split[i]); return 0;}static int usb_otg_proc_write ( struct file *file, const char *buffer, unsigned long count, void *data){ return 0;}static struct proc_dir_entry *evb_resource_dump;int __init usb_otg_rw_proc (void){ evb_resource_dump = create_proc_entry("usb_otg", 0666, &proc_root); evb_resource_dump->read_proc = usb_otg_proc_read; evb_resource_dump->write_proc = usb_otg_proc_write; evb_resource_dump->nlink = 1; return 0;}module_init(usb_otg_rw_proc);/** @page "Module Parameters" * * The following parameters may be specified when starting the module. * These parameters define how the DWC_otg controller should be * configured. Parameter values are passed to the CIL initialization * function dwc_otg_cil_init * * Example: <code>modprobe dwc_otg speed=1 otg_cap=1</code> * <table> <tr><td>Parameter Name</td><td>Meaning</td></tr> <tr> <td>otg_cap</td> <td>Specifies the OTG capabilities. The driver will automatically detect the value for this parameter if none is specified. - 0: HNP and SRP capable (default, if available) - 1: SRP Only capable - 2: No HNP/SRP capable </td></tr> <tr> <td>dma_enable</td> <td>Specifies whether to use slave or DMA mode for accessing the data FIFOs. The driver will automatically detect the value for this parameter if none is specified. - 0: Slave - 1: DMA (default, if available) </td></tr> <tr> <td>dma_burst_size</td> <td>The DMA Burst size (applicable only for External DMA Mode). - Values: 1, 4, 8 16, 32, 64, 128, 256 (default 32) </td></tr> <tr> <td>speed</td> <td>Specifies the maximum speed of operation in host and device mode. The actual speed depends on the speed of the attached device and the value of phy_type. - 0: High Speed (default) - 1: Full Speed </td></tr> <tr> <td>host_support_fs_ls_low_power</td> <td>Specifies whether low power mode is supported when attached to a Full Speed or Low Speed device in host mode. - 0: Don't support low power mode (default) - 1: Support low power mode </td></tr> <tr> <td>host_ls_low_power_phy_clk</td> <td>Specifies the PHY clock rate in low power mode when connected to a Low Speed device in host mode. This parameter is applicable only if HOST_SUPPORT_FS_LS_LOW_POWER is enabled. - 0: 48 MHz (default) - 1: 6 MHz </td></tr> <tr> <td>enable_dynamic_fifo</td> <td> Specifies whether FIFOs may be resized by the driver software. - 0: Use cC FIFO size parameters - 1: Allow dynamic FIFO sizing (default) </td></tr> <tr> <td>data_fifo_size</td> <td>Total number of 4-byte words in the data FIFO memory. This memory includes the Rx FIFO, non-periodic Tx FIFO, and periodic Tx FIFOs. - Values: 32 to 32768 (default 8192) Note: The total FIFO memory depth in the FPGA configuration is 8192. </td></tr> <tr> <td>dev_rx_fifo_size</td> <td>Number of 4-byte words in the Rx FIFO in device mode when dynamic FIFO sizing is enabled. - Values: 16 to 32768 (default 1064) </td></tr> <tr> <td>dev_nperio_tx_fifo_size</td> <td>Number of 4-byte words in the non-periodic Tx FIFO in device mode when dynamic FIFO sizing is enabled. - Values: 16 to 32768 (default 1024) </td></tr> <tr> <td>dev_perio_tx_fifo_size_n (n = 1 to 15)</td> <td>Number of 4-byte words in each of the periodic Tx FIFOs in device mode when dynamic FIFO sizing is enabled. - Values: 4 to 768 (default 256) </td></tr> <tr> <td>host_rx_fifo_size</td> <td>Number of 4-byte words in the Rx FIFO in host mode when dynamic FIFO sizing is enabled. - Values: 16 to 32768 (default 1024) </td></tr> <tr> <td>host_nperio_tx_fifo_size</td> <td>Number of 4-byte words in the non-periodic Tx FIFO in host mode when dynamic FIFO sizing is enabled in the core. - Values: 16 to 32768 (default 1024) </td></tr> <tr> <td>host_perio_tx_fifo_size</td> <td>Number of 4-byte words in the host periodic Tx FIFO when dynamic FIFO sizing is enabled. - Values: 16 to 32768 (default 1024) </td></tr> <tr> <td>max_transfer_size</td> <td>The maximum transfer size supported in bytes. - Values: 2047 to 65,535 (default 65,535) </td></tr> <tr> <td>max_packet_count</td> <td>The maximum number of packets in a transfer. - Values: 15 to 511 (default 511) </td></tr> <tr> <td>host_channels</td> <td>The number of host channel registers to use. - Values: 1 to 16 (default 12) Note: The FPGA configuration supports a maximum of 12 host channels. </td></tr> <tr> <td>dev_endpoints</td> <td>The number of endpoints in addition to EP0 available for device mode operations. - Values: 1 to 15 (default 6 IN and OUT) Note: The FPGA configuration supports a maximum of 6 IN and OUT endpoints in addition to EP0. </td></tr> <tr> <td>phy_type</td> <td>Specifies the type of PHY interface to use. By default, the driver will automatically detect the phy_type. - 0: Full Speed - 1: UTMI+ (default, if available) - 2: ULPI </td></tr> <tr> <td>phy_utmi_width</td> <td>Specifies the UTMI+ Data Width. This parameter is applicable for a phy_type of UTMI+. Also, this parameter is applicable only if the OTG_HSPHY_WIDTH cC parameter was set to "8 and 16 bits", meaning that the core has been configured to work at either data path width. - Values: 8 or 16 bits (default 16) </td></tr> <tr> <td>phy_ulpi_ddr</td> <td>Specifies whether the ULPI operates at double or single data rate. This parameter is only applicable if phy_type is ULPI. - 0: single data rate ULPI interface with 8 bit wide data bus (default) - 1: double data rate ULPI interface with 4 bit wide data bus </td></tr> <tr> <td>i2c_enable</td> <td>Specifies whether to use the I2C interface for full speed PHY. This parameter is only applicable if PHY_TYPE is FS. - 0: Disabled (default) - 1: Enabled </td></tr> <tr> <td>otg_en_multiple_tx_fifo</td> <td>Specifies whether dedicatedto tx fifos are enabled for non periodic IN EPs. The driver will automatically detect the value for this parameter if none is specified. - 0: Disabled - 1: Enabled (default, if available) </td></tr> <tr> <td>dev_tx_fifo_size_n (n = 1 to 15)</td> <td>Number of 4-byte words in each of the Tx FIFOs in device mode when dynamic FIFO sizing is enabled. - Values: 4 to 768 (default 256) </td></tr>*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -