Project

General

Profile

OptimusBlackSerial » History » Version 12

Paul Kocialkowski, 02/07/2016 05:05 PM

1 10 Paul Kocialkowski
h1. Optimus Black serial
2 1 Paul Kocialkowski
3 12 Paul Kocialkowski
{{>toc}}
4
5 10 Paul Kocialkowski
The Optimus Black allows accessing an UART serial port through the USB connector. A MAX14526 MUIC is in charge of switching between the USB and UART lines. The UART line can be muxed either to the main processor's debug UART (*UART3*), to the modem's UART or to the modem's USB lines via a FSUSB63 DP3T switch. The modem's UART line can also be switched directly to the main processor via an analog switch.
6 1 Paul Kocialkowski
7
Thus, a working configuration to access the serial port through the USB connector is to route the USB connector to the UART line with the MAX14526 MUIC and to route the UART line to the main processor's debug UART (UART3) with the FSUSB63 DP3T switch.
8 2 Paul Kocialkowski
9 6 Paul Kocialkowski
Block diagram of the USB and UART connection, according to the Optimus Black (P970) service manual:
10 1 Paul Kocialkowski
!p970_usb_mux.jpg!
11 4 Paul Kocialkowski
12 8 Paul Kocialkowski
On the other hand, the main processor's debug UART (*UART3*) can be accessed directly on the board, via the pins of the debug connector or via the pins of the FSUSB63 DP3T switch.
13
14
h2. Hardware setup
15
16
h3. USB connector
17
18 11 Paul Kocialkowski
According to the FSUSB63 DP3T switch datasheet and the Optimus Black (P970) service manual, *UART Rx* is routed to *USB DM (D-)* and *UART Tx* is routed to *USB DP (D+)*.
19 8 Paul Kocialkowski
20
Hence, the *USB DM (D-)* has to be connected to the UART adapter's *Tx* pin and the *USB DP (D+)* has to be connected to the UART adapter's *Rx* pin.
21
*GND* has to be made common between the USB connector and the UART adapter. There is no need to connect the USB connector's VBUS to a positive voltage.
22 1 Paul Kocialkowski
23 11 Paul Kocialkowski
Note that there is no automatic software switching (yet) with [[OptimusBlackU-Boot|U-Boot]], so make sure that *the FSUSB63 DP3T switch is switched to the main processor's UART* and that *the MAX14526 MUIC is switched to UART* before connecting the UART receiver to the USB connector.
24
25
h4. FSUSB63 DP3T switch
26
27
The FSUSB63 DP3T switch can be switched to the main processor's UART by setting the OMAP_UART_SW GPIO (161) high and the IFX_UART_SW GPIO (162) low.
28
29
h4. MAX14526 MUIC
30
31
The MAX14526 MUIC can be switched to UART by writing *0x09* to register *0x03* on device address *0x44* on I2C bus *1*. It can be switched back to USB by writing *0x00* at the same address.
32 8 Paul Kocialkowski
33
h3. UART to USB converters
34
35
It appears that UART to USB converters using the *PL2303* chip don't work properly with the device's UART. On the other hand, converters based on the *CP210x* chip were tested to work properly.
36
37
h2. Software setup
38
39
h3. Bootloader
40
41 10 Paul Kocialkowski
Some development versions of [[OptimusBlackU-Boot|U-Boot]] allow switching the USB connector to UART by pressing the *G* key (on the side) at boot.
42 8 Paul Kocialkowski
43 9 Paul Kocialkowski
LG's downstream version of U-Boot, that ships with Android version prior to 4.0, allows switching the USB connector to UART by placing a *56 kOhm* resistor between the *ID* and *GND* pins of the connector and pressing the *volume down* key at boot.
44 8 Paul Kocialkowski
45 9 Paul Kocialkowski
LG's downstream version of LK, that ships with Android 4.0, may behave the same.
46 8 Paul Kocialkowski
47
h3. Kernel
48
49 4 Paul Kocialkowski
h3. References
50
51 10 Paul Kocialkowski
* "Optimus Black (P970) Service Manual and Schematics":http://www.cpkb.org/wiki/LG_P970_Optimus_Black_service_manual
52
* "OMAP36xx Technical Reference Manual":http://www.ti.com/lit/pdf/swpu177
53 4 Paul Kocialkowski
54
*These documents are the propriety of LG Electronics and Texas Instruments and are not hosted by the Replicant project.*
55 7 Paul Kocialkowski
*However, some excerpts from these documents are provided, for the purpose of providing technical evidence of the facts that are mentioned in this page. We believe that this particular use of the copyrighted work is fair use.*