Project

General

Profile

OptimusBlackSerial » History » Version 24

Paul Kocialkowski, 02/08/2016 07:53 PM

1 10 Paul Kocialkowski
h1. Optimus Black serial
2 1 Paul Kocialkowski
3 12 Paul Kocialkowski
{{>toc}}
4
5 18 Paul Kocialkowski
The Optimus Black allows accessing an UART serial port through the USB connector, the dummy interface debug connector (only on P970 devices) or the MAX14526 MUIC pins.
6 1 Paul Kocialkowski
7 18 Paul Kocialkowski
The MAX14526 MUIC is in charge of switching the USB connector 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.
8
9 1 Paul Kocialkowski
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.
10 2 Paul Kocialkowski
11 6 Paul Kocialkowski
Block diagram of the USB and UART connection, according to the Optimus Black (P970) service manual:
12 1 Paul Kocialkowski
!p970_usb_mux.jpg!
13 4 Paul Kocialkowski
14 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.
15
16
h2. Hardware setup
17
18
h3. USB connector
19
20 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+)*.
21 8 Paul Kocialkowski
22
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.
23
*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.
24 11 Paul Kocialkowski
25 1 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.
26
27 18 Paul Kocialkowski
h3. Dummy interface connector
28 1 Paul Kocialkowski
29 18 Paul Kocialkowski
The dummy interface connector (found only on P970 devices) is likely a debug connector that was used by LG for bringing up the device. On production devices, there is no connector there and only pins are exposed. *It is highly unrecommended to solder wires to those pins* as their size and location make it very inconvenient to come up with a reliable setup.
30 1 Paul Kocialkowski
31 18 Paul Kocialkowski
According to the Optimus Black (P970) service manual:
32
!p970_dummy_interface.png!
33 11 Paul Kocialkowski
34 18 Paul Kocialkowski
The pins are located on the board as shown:
35 19 Paul Kocialkowski
!p970_board_dummy_interface.jpg!
36 8 Paul Kocialkowski
37 20 Paul Kocialkowski
h3. MAX14526 MUIC pins
38
39
The MAX14526 MUIC exposes the main processor's UART serial on its pins.
40
41
On P970 devices, the pins are placed as follows:
42
!p970_muic_uart.jpg!
43
44
On KU5900 devices, the pins are placed as follows:
45
!ku5900_muic_uart.jpg!
46
47 1 Paul Kocialkowski
h3. Logic level voltage
48
49
The main processor's debug UART is using a *1.8V* logic level. Most UART adapters expect 3.3V, so a logic level shifter has to be used between the device and the adapter to convert between 1.8V and 3.3V.
50
51
h2. Software setup
52 18 Paul Kocialkowski
53
h3. USB connector
54
55
To access the main processor's debug UART serial port, the FSUSB63 DP3T switch has to be switched to the main processor's UART and the MAX14526 MUIC has to be switched to UART.
56
57
h4. FSUSB63 DP3T switch
58
59
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*.
60
61
h4. MAX14526 MUIC
62
63
The MAX14526 MUIC can be switched to UART by writing *0x09* to register *0x03* on device address *0x44* on I2C bus *1* (I2C2). It can be switched back to USB by writing *0x00* at the same address.
64 8 Paul Kocialkowski
65
h3. Bootloader
66
67 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.
68 8 Paul Kocialkowski
69 16 Paul Kocialkowski
LG's downstream version of U-Boot, that ships with Android version prior to 4.0, should allow 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. LG's downstream version of LK, that ships with Android 4.0, may behave the same. This feature was not tested at this time.
70 8 Paul Kocialkowski
71
h3. Kernel
72
73 21 Paul Kocialkowski
LG's downstream version of Linux provides an interface for changing the USB connector muxing. It can be accessed through the @/proc/driver/hmuic@ file.
74
ASCII values can be written to the file, using e.g. @echo@. Numerical values have the following meaning:
75
76
|_. Value (ASCII) |_. Muxing |
77 23 Paul Kocialkowski
| 3 | Modem USB (download mode) |
78
| 6 | Main processor's debug UART |
79
| 7 | Modem UART |
80
| 8 | Main processor's USB |
81
| 9 | Modem USB |
82 21 Paul Kocialkowski
83 24 Paul Kocialkowski
h2. References
84 4 Paul Kocialkowski
85 10 Paul Kocialkowski
* "Optimus Black (P970) Service Manual and Schematics":http://www.cpkb.org/wiki/LG_P970_Optimus_Black_service_manual
86
* "OMAP36xx Technical Reference Manual":http://www.ti.com/lit/pdf/swpu177
87 4 Paul Kocialkowski
88
*These documents are the propriety of LG Electronics and Texas Instruments and are not hosted by the Replicant project.*
89 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.*