Roverbook steel. Проект Debian вместо Android
$echo 1 > /sys/bus/platform/drivers/dwc_otg/force_usb_mode |
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 |
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 |
Example usage: To get the current mode:
cat /sys/devices/lm0/mode |
echo 0 > /sys/devices/lm0/buspower |