USB on Blaze Tablet with ICS

From OMAPpedia

(Redirected from USB Testing)
Jump to: navigation, search


There are two USB controllers on OMAP4: Mentor USB (MUSB) and Synopsis EHCI/OHCI.

Contents

[edit] MUSB

MUSB - Mentor USB controller in OMAP is associated with the the Micro-USB OTG port on the Blaze tablet board (the micro-usb port next to mini-usb Debug port). MUSB can act as a HOST or a DEVICE depending on the type of Micro USB cable that is plugged into the OTG port. This is called cable based switching.

[edit] Device Mode

When a Micro-B type plug is plugged into the OTG port, MUSB will act as a Device. This is mainly used to connect the tablet board to a Computer or connecting a Dedicated USB wall charger to the board.

In device mode, Android ICS supports the following differnt types of Android gadgets:

[edit] MTP/PTP:

Using this Gadget you can mount the /data/media partition of eMMC or an external SD card on a HOST machine and can transfer data files to-and-fro.

Windows Host: For mounting it on a Windows machine you need the following .inf file.

Linux Host: MTP by default is not supported on a Linux machine and will not work out of the box. You need to install 'mtpfs' filesystem. Follow the steps for Throughput measurement to get this mounted. PTP will by default work on Linux Machine and the device will be auto-mounted once you connect.

By Default, MTP/ADB is enabled. When you connect a Micro-USB cable to the Blaze_tablet and the other end to a computer, you will see a USB connected notification on the bottom right corner. Click on the usb icon, then click 'connected as a media device'. This will open up the Storage settings page. You cans elect PTP by selecting 'Camera(PTP)' option here.

[edit] Throughput Measurement using MTP with a Linux Host

[NOTE] For now we will measure tput only with emmc. It seems using mtpfs and having multiple mtps drives (emmc, external SD mounted together) it mounts everything into the same folder and hence we don't have a way for transferring data only to one, so don't use an external SD card.


sudo apt-get install mtpfs
$ sudo su (be root)
$ vim /etc/udev/rules.d/51-android.rules
  Add these lines:
  SUBSYSTEM=="usb", SYSFS{idVendor}=="0451", SYMLINK+="libmtp-%k", MODE="0666"
$ /etc/init.d/udev restart
$ mkdir ~/Desktop/mtp
$ mtpfs ~/Desktop/mtp/
$ cd ~/Desktop/mtp/
$ time -p cp ../Write/test32.bin . ; time -p ls;
[use the time from cp command for Asynchronous write, Add the times form both the cp and ls to get the synchronous tput]
$ cd ..
$ fusermount -u ~/Desktop/mtp/
[disconnect cable, connect again]
$ mtpfs ~/Desktop/mtp/
$ cd ~/Desktop/mtp/
$ time -p cp test32.bin ../Read/;
[ use the time for tput calculation]

[edit] ADB:

This is the Android Debugger and is used for various debugging purposes. To enable adb, make sure the following is selected: Settings -> Developer options -> USB Debugging Now, when you connect a Micro-usb cable to blaze and the other end to a Host machine, you can execute the following:

$ ./adb kill-server
$ ./adb start-server
$ ./adb devices
[output should be something like this]
List of devices attached 
[serial number]   device
$ ./adb shell
[This should take you to the console prompt of the board]
to quit, type exit.
Write a file in to the FS on board:
$ ./adb push <path>/file ./
[This will transfer 'file' in to the / of the FS on the board, check using 'ls' on the console prompt of the board]
Read a file from the FS on board into the Host machine
$ ./adb pull ./file <path>/dir/
[This will copy 'file' from the FS into the Host machine]

[edit] RNDIS:

This is used for USB tethering. To Enbale USB Tethering, connect the micro-usb cable to a Host PC (Disconnect the Ethernet cable from your Host machine and also Disable the Wireless Interface) and on the Blaze Tablet select the following: Settings -> Wireless & Networks -> More -> Tethering and Portable Hotspot -> USB Tethering Now, On the HOST PC you can access internet using the usb tethering from tablet board's ethernet connection.

Note: If you are behind a firewall, android doesn't support proxy server. In that case, you can browse websites internal to your network to test this.

[edit] HOST Mode

When a Micro-A type plug is plugged into the OTG port, MUSB will act as a HOST. This is mainly used to connect Devices like Mouse, Keyboard, USB stick, camera etc to the Blaze Tablet Board. Note, musb OTG port can suplly a maximum of 200 mA current, so any device consuming more than this will not be enumerated and needs to connected using a self powered HUB.

If you connect a camera to this port, you can browse the pics on the SD card in camera in the gallery using the PTP daemon in ICS.


[edit] USB Certification

The Test report of the USB Peripheral and Embedded Host Pre-certification testing (for MUSB) performed on OMAP4460 / Tablet2 /Android ICS. Please contact your TI representative to get a copy

All tests results are PASS!

[edit] EHCI

EHCI - Enhanced Host Controller Interface. The two HS USB ports on the Tablet board (in between the Ethernet Port an dthe SD/MMMC slot) are associated with the EHCI IP. These are the standard High Speed Host ports and are used for connecting devices like Mouse, Keyboard, USB stick, Camera, USB audio Headset/speakers etc. Also, many customers use the EHCI interface for Modem Connection. If you connect a camera to this port, you can browse the pics on the SD card in camera in the gallery using the PTP daemon in ICS. Also, you can connect USB Headset or speakers and play audio over USB.

On a Tablet2 board there are some devices that are connected to the EHCI bus:

EHCI -> USB3320c ULPI PHY -> PID:2640 HUB chip
This 2640 HUB chip has a 'PID:4050-Fast Media Card Reader' and is further connected to 'PID:2412 HUB chip' that is connected to the 2 HS USB ports.

It is observed that 'PID:4050-Fast Media Card Reader' device does not auto-suspend and hence will keep the EHCI bus always active thereby preventing idle path L3_INIT/CORE hitting RET. Moreover, this device is not getting used today and there is no way of removing this device in HW (since its a part of the PID:2640 HUB chip). As a workaround, we remove this device in software in init.rc immediately after boot.

[edit] HMMOD for EHCI on Blaze Tablet2

1. For any Power measurements, remove Resistor R145 that disconnects the UPLI PHY and all other devices from the EHCI bus.

2. There is a known Port Resume failure, If OMAP EHCI goes into a bad state while going to suspend, its observed that PORTSC.RESUME bit does not clear. The only resort we have is to soft reset the LINK(ehci) and also the PHY. Now, on Tablet2 board there is no GPIO connection to the PHY so in-order for this workaround to work, the following modification is needed to hook up GPIO 171 to the RESETB pin of the ULPI PHY.

[Note] Whenever you hit this Bug you will see the following re-enumeration log on the Console:

[  214.378570] ehci-omap ehci-omap.0: port 1 resume error -110
[  214.450622] ehci: omap_ehci_ulpi_write: Error
[  214.711914] usb 1-1: reset high speed USB device number 2 using ehci-omap
[  215.094696] usb 1-1: USB disconnect, device number 2
[  215.100097] usb 1-1.2: USB disconnect, device number 4
[  215.243103] usb 1-1: new high speed USB device number 11 using ehci-omap
[  215.410949] usb 1-1: New USB device found, idVendor=0424, idProduct=2640
[  215.418273] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[  215.436340] hub 1-1:1.0: USB hub found
[  215.440826] hub 1-1:1.0: 3 ports detected
[  215.736572] usb 1-1.1: new high speed USB device number 12 using ehci-omap
[  215.869964] usb 1-1.1: New USB device found, idVendor=0424, idProduct=4050
[  215.877471] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  215.885467] usb 1-1.1: Product: Ultra Fast Media Reader
[  215.891174] usb 1-1.1: Manufacturer: Generic
[  215.895812] usb 1-1.1: SerialNumber: 000000264001
[  215.907440] scsi1 : usb-storage 1-1.1:1.0
[  216.002227] usb 1-1.2: new high speed USB device number 13 using ehci-omap
[  216.129699] usb 1-1.2: New USB device found, idVendor=0424, idProduct=2412
[  216.137237] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[  216.151123] hub 1-1.2:1.0: USB hub found
[  216.155609] hub 1-1.2:1.0: 2 ports detected
[  216.447570] usb 1-1.2.2: new low speed USB device number 14 using ehci-omap
[  216.580657] usb 1-1.2.2: New USB device found, idVendor=046d, idProduct=c00c
[  216.588348] usb 1-1.2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  216.596527] usb 1-1.2.2: Product: USB Optical Mouse
[  216.601806] usb 1-1.2.2: Manufacturer: Logitech
[  216.624114] input: Logitech USB Optical Mouse as /devices/platform/omap/usbhs_omap/ehci-omap.0/usb1/1-1/1-1.2/1-1.2.2/1-1.2.2:1.0/input/input16
[  216.643341] generic-usb 0003:046D:C00C.0007: input: USB HID v1.10 Mouse [Logitech USB Optical Mouse] on usb-ehci-omap.0-1.2.2/input0
[  216.920471] scsi 1:0:0:0: Direct-Access     Generic  Ultra HS-SD/MMC  1.76 PQ: 0 ANSI: 0
[  216.940582] sd 1:0:0:0: Attached scsi generic sg0 type 0
[  216.940917] sd 1:0:0:0: [sda] Attached SCSI removable disk

With this re-enumeration, we need to remove to remove the Media card reader manually, inorder for idle path L3_INIT/CORE RET to work. So execute the following command whenever you see the above log:

# echo 1 > /sys/bus/usb/devices/1-1.1/remove
# echo enabled > /sys/bus/usb/devices/1-1/power/wakeup
# echo enabled > /sys/bus/usb/devices/1-1.2/power/wakeup
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox