Hi fearless developers !
In the following I would like to summarize what is currently known about
the USB subsystem of the motorola linux phones. I have collected this information form reading this forum, studying the respective datasheets and schematics and by guesswork. Please correct me if I am wrong.
PXA270
The PXA270 processor (which runs linux in the motorola phones) USB subsystem has as fas as I know:
- USBC: a single USB client controller
- USBH1, USBH2, USBH3: USB host controllers.
USBH2 is special because it can be used together with the USBC to form a USB On The Go port.
- a USB physical transceiver for USBH1, with dedicated pins USBH_N & _P
- a USB On-The-Go physical transceiver for USBH2 and USBC,
with dedicated pins USBC_N & _P
- USB_P3: a sigle ended, logic level interface consisting of GPIO pins 30,31,90,91,56 and 113 to connect USBH3 to an external transceiver.
- USB_P2: a single ended logic level interface consisting of GPIO pins 34,25,26,39,40 and 53 to connect USBH2 and USBC to an external transceiver.
A logic level USB interface consists of 8 pins :
USB_P[2|3]_5 Positive Receiver Input
USB_P[2|3]_3 Negative Receiver Input
USB_P[2|3]_6 Positive Driver Output
USB_P[2|3]_4 Negative Driver Output
USB_P[2|3]_1 Differention Receiver Input
USB_P[2|3]_2 Transceiver Output Enable
USB_P[2|3]_7 Selects Speed (1 or 12 Mbit)
USB_P[2|3]_8 Power Enable (+5Volt for USB host port)
Motorola Phones
the wires on the pcb are such:
Code:
PIN Signalname Signalname
Schematics main alt_USB
J3 BUL_VPIN GPIO40 USB_P2_5 (in)
K19 BUL_VMIN GPIO53 USB_P2_3 (in)
D4 BUL_VPOUT GPIO39 USB_P2_6 (out)
G4 BUL_VMOUT GPIO36 USB_P2_4 (out)
F2 BUL_TXENB GPIO34 USB_P2_2 (out)
E3 BUL_XRXD GPIO35 USB_P2_1 (in)
A7 ICL_VPIN GPIO90 USB_P3_5 (in)
K4 ICL_VPMIN GPIO113 USB_P3_3 (in)
J4 ICL_VPOUT GPIO31 USB_P3_6 (out)
M18 ICL_VMOUT GPIO56 USB_P3_4 (out)
G6 ICL_TXENB GPIO30 USB_P3_2 (out)
C7 ICL_XRXD GPIO91 USB_P3_1 (in)
The build in transceivers are not used as far as I can tell.
There are indications in the schematics that test points might exist to accesss this signals.
USBH1 is not used.
USBH2 is not used.
USBH3 is configured to use the USB_P3 logic level interface which is wired internally to the Neptun LTE GMS chipset, which is a usb client.
They do not use transceivers, probably because of cost reasons, and the chips are very near one to the other anyway, so transceivers are not really needed. The signals for power_enable and speed detection are not used and their respective GPIO pins are used for other purposes.
USBC is configured to used the USB_P2 logic level interface which is wired to the PCAP chip. This chip contains the power regulators, vibration control, sound interface and you guess it: a USB Transceiver.
I think this transceiver is not capable of On-The-Go operation, as some needed signals are not present. There is however the needed pullup-resistor for signaling a fast 12Mbit USB client. This is even switchable from the PCAP chip (!)
An interesting side note. The USB_P2 GPIO pins's alternate function is the FFUART, a serial port. The processor can switch these pins, which are connected to the PCAP chip to be either a USB port or a serial port. I think there are multiplexors inside the PCAP chip that allow to bypass the USB trasceiver so that the FFUART is available on the MiniUSB plug.
there is also another wire connecting the RX and DTR signals to the neptun keypad interface, which is otherwhise unconnected. I belive this is a hack to be able to "reset" or "flash" the Neptune. Its to be able to put it into a defined condition from outside. under normal operation the USB or serial signals will probably be igored form the keypad controllers debouncing circuit...
When the usb logic level signals have been converted to differential signaling by the Transceiver in the PCAP, they leave the PCAP again and enter a maze of analog switches, until the signals finally get to the mini USB plug.
The pin 4 of the mini usb plug is connected to an ADC. Its used to detect the chargers and headsets from an ordinary USB host like a computer.
Wild Speculation & The Big Master Plan
I think they used the USB_P2 logic level interface for the external plug for a reason. Maybe a first draft of the e680/A780 included a USB-on-the-go functionality that didn't made it into the final drafts. The PSOC3 transceiver is definitely not capable of USB On-The-Go.
However its still possible to switch the USB_P2 logic level interface to connect to the USBH2 controller instead of the USBC by software. The USBH2 is not used nor configured by the default kernel. There is a pullup resistor that is in the way. Fortunately it can be switched off by some PCAP resgister hackery.
We would have to get all the analog switches right, have the transceivers of the PCAP connected to the mini USB Plug and no pullup resistor in the way. We would still need the two pulldown resistors to signal USB host. They are not included on the pcb and PCAP can not provide these.
But we could add these to an external cable which we would have to build anyway, because the plug in the phone is a B type, and there is no mini B to A cable.
Then we still have no power supply. There is one inside the phone, a switched power converter that can generate 5.5 volts. Its used by the internal charger circuit and i think it was included for the USB-On-The-Go feature that was cut. But this converter can only deliver about 10ma of spare current, we would need 500ma, which means we need to connect an etxernal battery.
So in order to get USB Host functionallity on a A780 / e680 we need:
- to find a resistor that is not used by any motorola accesoire.
- to hack the EMU code (EMU = enhanced mini usb), so that it recognizes
our resistor and connectes USBH2 to the mini plug, and deactivates the pullup.
- to build a special cable with a mini USB B Plug and two 15 koms resistors, a normal USB A female plug and the selected resistor on pin 4 to identify our accessory.
- An external battery capable of delivering 5volt @ 500ma
- Its not possible to switch off the power when the phone goes to standby mode, so we would need to provide an external switch aswell.
Thanks everybody for reading so far. I hope this reflects the actual state of knowledge on the subject.
greetz and a happy new year
thseiler