/* ========================================================================== * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_attr.c $ * $Revision: #31 $ * $Date: 2008/07/15 $ * $Change: 1064918 $ * * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, * "Software") is an Unsupported proprietary work of Synopsys, Inc. unless * otherwise expressly agreed to in writing between Synopsys and you. * * The Software IS NOT an item of Licensed Software or Licensed Product under * any End User Software License Agreement or Agreement for Licensed Product * with Synopsys or any supplement thereto. You are permitted to use and * redistribute this Software in source and binary forms, with or without * modification, provided that redistributions of source code must retain this * notice. You may not view, use, disclose, copy or distribute this file or * any information contained herein except pursuant to this license grant from * Synopsys. If you do not agree with this notice, including the disclaimer * below, then you are not authorized to use the Software. * * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * ========================================================================== */ /** @file * * The diagnostic interface will provide access to the controller for * bringing up the hardware and testing. The Linux driver attributes * feature will be used to provide the Linux Diagnostic * Interface. These attributes are accessed through sysfs. */ /** @page "Linux Module Attributes" * * The Linux module attributes feature is used to provide the Linux * Diagnostic Interface. These attributes are accessed through sysfs. * The diagnostic interface will provide access to the controller for * bringing up the hardware and testing. The following table shows the attributes.
| Name | Description | Access |
| mode | Returns the current mode: 0 for device mode, 1 for host mode | Read |
| hnpcapable | Gets or sets the "HNP-capable" bit in the Core USB Configuraton Register. Read returns the current value. | Read/Write |
| srpcapable | Gets or sets the "SRP-capable" bit in the Core USB Configuraton Register. Read returns the current value. | Read/Write |
| hnp | Initiates the Host Negotiation Protocol. Read returns the status. | Read/Write |
| srp | Initiates the Session Request Protocol. Read returns the status. | Read/Write |
| buspower | Gets or sets the Power State of the bus (0 - Off or 1 - On) | Read/Write |
| bussuspend | Suspends the USB bus. | Read/Write |
| busconnected | Gets the connection status of the bus | Read |
| gotgctl | Gets or sets the Core Control Status Register. | Read/Write |
| gusbcfg | Gets or sets the Core USB Configuration Register | Read/Write |
| grxfsiz | Gets or sets the Receive FIFO Size Register | Read/Write |
| gnptxfsiz | Gets or sets the non-periodic Transmit Size Register | Read/Write |
| gpvndctl | Gets or sets the PHY Vendor Control Register | Read/Write |
| ggpio | Gets the value in the lower 16-bits of the General Purpose IO Register or sets the upper 16 bits. | Read/Write |
| guid | Gets or sets the value of the User ID Register | Read/Write |
| gsnpsid | Gets the value of the Synopsys ID Regester | Read |
| devspeed | Gets or sets the device speed setting in the DCFG register | Read/Write |
| enumspeed | Gets the device enumeration Speed. | Read |
| hptxfsiz | Gets the value of the Host Periodic Transmit FIFO | Read |
| hprt0 | Gets or sets the value in the Host Port Control and Status Register | Read/Write |
| regoffset | Sets the register offset for the next Register Access | Read/Write |
| regvalue | Gets or sets the value of the register at the offset in the regoffset attribute. | Read/Write |
| remote_wakeup | On read, shows the status of Remote Wakeup. On write, initiates a remote wakeup of the host. When bit 0 is 1 and Remote Wakeup is enabled, the Remote Wakeup signalling bit in the Device Control Register is set for 1 milli-second. | Read/Write |
| regdump | Dumps the contents of core registers. | Read |
| spramdump | Dumps the contents of core registers. | Read |
| hcddump | Dumps the current HCD state. | Read |
| hcd_frrem | Shows the average value of the Frame Remaining field in the Host Frame Number/Frame Remaining register when an SOF interrupt occurs. This can be used to determine the average interrupt latency. Also shows the average Frame Remaining value for start_transfer and the "a" and "b" sample points. The "a" and "b" sample points may be used during debugging bto determine how long it takes to execute a section of the HCD code. | Read |
| rd_reg_test | Displays the time required to read the GNPTXFSIZ register many times (the output shows the number of times the register is read). | Read |
| wr_reg_test | Displays the time required to write the GNPTXFSIZ register many times (the output shows the number of times the register is written). | Read |