Project

General

Profile

NexusSI902xBootloader » History » Version 4

Paul Kocialkowski, 02/08/2015 02:59 PM

1 1 Paul Kocialkowski
h1. Nexus S (I902x) Bootloader
2
3 3 Paul Kocialkowski
The Nexus S (I902x) comes with a bootrom and a set of two proprietary bootloaders. The bootrom: internal ROM (iROM) is stored read-only on the S5PC110 SoC chip. It loads the first bootloader: Samsung Primitive Bootloader (PBL), which loads the Samsung Secondary Bootloader (SBL). These bootloaders are proprietary software.
4 1 Paul Kocialkowski
5 3 Paul Kocialkowski
More information on the booting sequence is available on the S5PC110 User Manual, section 2 (system), part 6 (booting sequence).
6
7
h2. Boot device priority
8
9
The S5PC110 bootrom (iROM) allows booting from various devices such as NAND, MMC, eMMC, UART and USB. The boot device priority is selected using the Operating Mode (OM) pins. Boolean values for each pin depend on the voltage applied to the pin: a positive voltage represents a logical 1 while ground represents a logical 0.
10
11
h3. On-board resistors
12
13 4 Paul Kocialkowski
OM pins are set to boolean values using pull-up (logical 1) and pull-down (logical 0) resistors. The Nexus S (I902x) schematics show all the possible resistors connected to the pins.
14 1 Paul Kocialkowski
15 4 Paul Kocialkowski
!crespo_om_schematics.jpg!
16
17
Only a few are actually populated on the board:
18
19
!{width: 50%}crespo_om_board.jpg!
20
!{width: 50%}crespo_om_components.jpg!
21
22 3 Paul Kocialkowski
Resistors highlighted in green are not populated on the board. Hence, the actual layout is the following:
23
24
| |_. XOM5 |_. XOM4 |_. XOM3 |_. XOM2 |_. XOM1 |_. XOM0 |
25
| Pull-up resistor | N/A | N/A | R429 | N/A | N/A | R435 |
26
| Pull-down resistor | R448 | R447 | N/A | R445 | R444 | N/A |
27
| Boolean value | 0 | 0 | 1 | 0 | 0 | 1 |
28
29
According to the S5PC110 User Manual, section 2 (system), part 6.2.4 (OM pin configuration), table 6-3, this indicates OnenandMux as first boot device.
30
31 1 Paul Kocialkowski
h2. Secure boot
32
33 3 Paul Kocialkowski
According to the S5PC110 User Manual
34
35 1 Paul Kocialkowski
The bootrom and the bootloaders appear to be implementing secure boot mechanisms that enforce signature checks on each bootloader.
36
However, there is no signature check enforced regarding the Linux kernel.
37
38
Changing a single byte on the first bootloader ended up in the system refusing to boot. In addition, a few messages from the bootloaders output suggest that such signature checks are enforced: @IROM e-fused - Secure Boot Version@.
39
40
Since signature checks are enforced by the bootrom and provided that there is apparently no easy way of replacing the public key the signatures are checked against, running a free software bootloader on the Nexus S (I902x) seems impossible.
41 3 Paul Kocialkowski
42
// mention that it will jump to the next one
43 1 Paul Kocialkowski
44
h2. Stock bootloaders output
45
46
<pre>
47
-----------------------------------------------------------
48
   Samsung Primitive Bootloader (PBL) v3.0
49
   Copyright (C) Samsung Electronics Co., Ltd. 2006-2010
50
-----------------------------------------------------------
51
52
Muxed [[OneNAND]] 512MB (0x50) Sync
53
Scanning Bad Block .......
54
Bad Block 77 (5)
55
Bad Block 295 (5)
56
Bad Block 1232 (5)
57
Bad Block 1646 (5)
58
Bad Block 1831 (5)
59
Bad Block 2047 (0)
60
SBL loadding success
61
62
Set cpu clk. from 400MHz to 800MHz.
63
OM=0x9, device=OnenandMux(Audi)
64
IROM e-fused - Secure Boot Version.
65
66
-----------------------------------------------------------
67
   Samsung Secondary Bootloader (SBL) v3.0
68
   Copyright (C) Samsung Electronics Co., Ltd. 2006-2010
69
70
   Board Name: HERRING REV 52
71
   Build On: Jan 20 2011 17:19:41
72
-----------------------------------------------------------
73
74
MMC SEM16G 15188 MB
75
Re_partition: magic code(0x0)
76
Muxed [[OneNAND]] 512MB (0x50) Sync
77
Scanning Bad Block .......
78
Bad Block 77 (5)
79
Bad Block 295 (5)
80
Bad Block 1232 (5)
81
Bad Block 1646 (5)
82
Bad Block 1831 (5)
83
Bad Block 2047 (0)
84
Partitions loading success
85
Read image(PARAM) from flash .......
86
Done
87
init_fuel_gauge: vcell = 4083mV, soc = 94
88
PMIC_IRQ1    = 0xc0 
89
PMIC_IRQ2    = 0x0 
90
PMIC_IRQ3    = 0x0 
91
PMIC_IRQ4    = 0x0 
92
PMIC_STATUS1 = 0x0 
93
PMIC_STATUS2 = 0x0 
94
PMIC_STATUS3 = 0x0 
95
PMIC_STATUS4 = 0x0 
96
PMIC_STATUS5 = 0x0 
97
PMIC_SMPL    = 0x0 
98
Key scan = 0x0
99
message.command = 
100
message.status = 
101
message.recovery = 
102
103
BOOT_MODE_NORMAL (SW_RST(0x00000004), INFORM(0x000000ee))
104
LCD ID = 0x0060a953
105
Done
106
Kernel(boot.img) read success from partition no.5
107
Setting param.serialnr = 0x3733bab6 0x6de200ec
108
Setting param.board_rev = 0x34
109
Setting param.cmdline = console=ttyFIQ0 no_console_suspend androidboot.serialno=3733BAB66DE200EC androidboot.bootloader=I9020XXKA3 androidboot.baseband=I9020XXKB3 androidboot.info=0x4,0xee,1 androidboot.carrier=EUR gain_code=3 s3cfb.bootloaderfb=0x34a00000 mach-herring.lcd_type=0x00000000 oem_state=unlocked 
110
Setting param.initrd_start = 0x31000000, param.initrd_size = 0x23265
111
112
Starting kernel at 0x30008000...
113
114
Uncompressing Linux... done, booting the kernel.
115
</pre>
116 4 Paul Kocialkowski
117
h2. References
118
119
* S5PC110 User Manual: http://dl.project-voodoo.org/documentation/S5PC110_EVT1_UM10.pdf
120
* Nexus S (I902x) Schematics: http://mobilcoms.ru/load/1-1-0-4499
121
122
*These documents are the propriety of Samsung Electronics and are not hosted by the Replicant project. 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.*