Project

General

Profile

NexusSI902xSerial » History » Version 20

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

1 18 Paul Kocialkowski
h1. Nexus S (I902x) serial
2 1 Paul Kocialkowski
3 20 Paul Kocialkowski
{{>toc}}
4
5 3 Paul Kocialkowski
The Nexus S (I902x) allows accessing an UART serial port through the USB connector. A FSA9480 switch is in charge of switching the USB connector between UART and USB (among other choices).
6 8 Paul Kocialkowski
The UART signal can itself be switched between the S5PC110 SoC UART and the XMM6160 modem UART by the MAX8998 PMIC. It is switched to the S5PC110 SoC UART by default.
7 3 Paul Kocialkowski
8
According to the Nexus S (I902x) Schematics:
9 4 Paul Kocialkowski
!crespo_fsa9480.jpg!
10 3 Paul Kocialkowski
11
Depending on the resistor value between the USB connector ID and GND pins, the FSA9480 will automatically switch the USB connector to the selected device, as mentioned on the FSA9480 datasheet. A resistor value of 150k Ohm will switch the USB connector to UART.
12 1 Paul Kocialkowski
13
h2. Hardware setup
14
15 19 Paul Kocialkowski
In order to switch the USB connector to UART, a *150 kOhm* resistor has to be placed between the *ID* and *GND* pins of the USB connector.
16 5 Paul Kocialkowski
17
According to the FSA9480 datasheet, table 3 (Accessory auto configuration table), *UART Rx* is routed to *USB DP (D+)* and *UART Tx* is routed to *USB DM (D-)*.
18
Hence, the *USB DP (D+)* has to be connected to the UART adapter's *Tx* pin and the *USB DM (D-)* has to be connected to the UART adapter's *Rx* pin.
19
*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.
20
21 11 Paul Kocialkowski
The USB connector can then be connected to the device at any time (the FSA9480 will automatically switch the USB connector to UART, even when the device is already on).
22 7 Paul Kocialkowski
23 1 Paul Kocialkowski
h2. Software setup
24 6 Paul Kocialkowski
25
h3. USB connector switch
26
27 9 Paul Kocialkowski
Alternatively, it is possible to switch the USB connector to UART at run-time, without using any resistor between the ID and GND pins (the *ID* pin can be left *open*).
28
Any USB cable has to be disconnected from the device before manually switching the USB connector to UART:
29
<pre>
30
# echo UART > /sys/devices/platform/i2c-gpio.7/i2c-7/7-0025/switch
31
</pre>
32
33
According to the FSA9480 datasheet, table 26 (Manual S/W 1), the USB connector's *VBUS* must be present (connected to a *5V* voltage source) for manual configuration to be taken in account.
34
35
The USB connector can then be connected to the device.
36 12 Paul Kocialkowski
37
h3. FIQ debugger
38
39
By default, the Linux console is set to the FIQ debugger.
40
41
h3. Kernel messages
42
43
Kernel messages can be displayed over UART by setting the cmdline console argument to *ttySAC2*. The cmdline console argument is set on the crespo device files:
44
<pre>
45
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
46
index 2892480..c3134b7 100755
47
--- a/BoardConfigCommon.mk
48
+++ b/BoardConfigCommon.mk
49
@@ -62,7 +62,7 @@ BOARD_NAND_SPARE_SIZE := 128
50
 
51
 BOARD_KERNEL_BASE := 0x30000000
52
 BOARD_KERNEL_PAGESIZE := 4096
53
-BOARD_KERNEL_CMDLINE := console=ttyFIQ0 no_console_suspend
54 16 Paul Kocialkowski
+BOARD_KERNEL_CMDLINE := console=ttySAC2,115200 no_console_suspend
55 12 Paul Kocialkowski
 
56
 TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888"
57
 TARGET_RECOVERY_UI_LIB := librecovery_ui_crespo
58
</pre>
59
60
The FIQ debugger has to be disabled in the kernel configuration:
61
<pre>
62
diff --git a/arch/arm/configs/crespo_defconfig b/arch/arm/configs/crespo_defconfig
63
index 4f3997b..c60ea92 100644
64
--- a/arch/arm/configs/crespo_defconfig
65
+++ b/arch/arm/configs/crespo_defconfig
66
@@ -406,10 +406,10 @@ CONFIG_ARM_VIC=y
67
 CONFIG_ARM_VIC_NR=4
68
 CONFIG_PL330=y
69
 CONFIG_FIQ_GLUE=y
70
-CONFIG_FIQ_DEBUGGER=y
71
+# CONFIG_FIQ_DEBUGGER is not set
72
 # CONFIG_FIQ_DEBUGGER_NO_SLEEP is not set
73
 # CONFIG_FIQ_DEBUGGER_WAKEUP_IRQ_ALWAYS_ON is not set
74
-CONFIG_FIQ_DEBUGGER_CONSOLE=y
75
+# CONFIG_FIQ_DEBUGGER_CONSOLE is not set
76
 # CONFIG_FIQ_DEBUGGER_CONSOLE_DEFAULT_ENABLE is not set
77
 
78
 #
79 13 Paul Kocialkowski
</pre>
80 14 Paul Kocialkowski
81
h2. References
82
83 17 Paul Kocialkowski
* Nexus S (I902x) Service Manual and Schematics: http://www.cpkb.org/wiki/Samsung_GT-i9023_Google_Nexus_S_service_manual
84
* S5PC110 User Manual: "S5PC110_EVT1_UM10.pdf":http://dl.project-voodoo.org/documentation/S5PC110_EVT1_UM10.pdf
85 14 Paul Kocialkowski
86
*These documents are the propriety of Samsung Electronics and are not hosted by the Replicant project.*
87 15 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.*
88 14 Paul Kocialkowski
89 17 Paul Kocialkowski
* FSA9480 datasheet: "FSA9480.pdf":http://pdf.datasheetcatalog.com/datasheet/fairchildsemiconductor/FSA9480.pdf