From 8e4bff4cab0ddac6060645b0715210484d02ff40 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Wed, 30 Aug 2017 08:25:59 +0000 Subject: Initial file dump from open source release --- drivers/usb/gadget/dwc_otg/dwc_otg_attr.c | 1156 +++++++++++++++++++++++++++++ 1 file changed, 1156 insertions(+) create mode 100644 drivers/usb/gadget/dwc_otg/dwc_otg_attr.c (limited to 'drivers/usb/gadget/dwc_otg/dwc_otg_attr.c') diff --git a/drivers/usb/gadget/dwc_otg/dwc_otg_attr.c b/drivers/usb/gadget/dwc_otg/dwc_otg_attr.c new file mode 100644 index 00000000..3b552ffa --- /dev/null +++ b/drivers/usb/gadget/dwc_otg/dwc_otg_attr.c @@ -0,0 +1,1156 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_attr.c $ + * $Revision: #34 $ + * $Date: 2008/12/24 $ + * $Change: 1158473 $ + * + * 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 | +
| hsic_connect | +Gets or sets the "HSIC-Connect" bit in the GLPMCFG Register. + Read returns the current value. | +Read/Write | +
| inv_sel_hsic | +Gets or sets the "Invert Select HSIC" bit in the GLPMFG 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 | +
| lpm_response | +Gets or sets lpm_response mode. Applicable only in device mode. + | Write | +
| sleep_local_dev | +Generetates sleep signaling. Applicable only in host mode. + | Write | +
| sleep_status | +Shows sleep status of device. + | Read | +