SamsungSerial » History » Version 16
Paul Kocialkowski, 09/30/2011 08:34 PM
1 | 16 | Paul Kocialkowski | |
---|---|---|---|
2 | h2. Introduction |
||
3 | |||
4 | 1 | Denis 'GNUtoo' Carikli | This page contains information on how to work on a bootloader replacement. |
5 | |||
6 | |||
7 | 16 | Paul Kocialkowski | h2. Informations |
8 | 1 | Denis 'GNUtoo' Carikli | |
9 | 16 | Paul Kocialkowski | * The "official u-boot source code":http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=summary already has support for the S5PC110 SOC(system on a chip) that the Nexus S uses |
10 | * The S5PC110 has a bootrom |
||
11 | * The Nexus S has an usb port with an FSA9480 behind it |
||
12 | 1 | Denis 'GNUtoo' Carikli | |
13 | |||
14 | 16 | Paul Kocialkowski | h2. Links of interest |
15 | |||
16 | |||
17 | * "Create your own I9000/S8500 (& all S5PC110 based devices) bootloader&ultimate unbrick - XDA-Developers Forums":http://forum.xda-developers.com/showthread.php?t=1233273 |
||
18 | * "HOW-TO [[UnBrick]] the [[UnBrickable]] Vibrant - xda-developers":http://forum.xda-developers.com/showthread.php?t=1277056 |
||
19 | * "Boot sequence interception/redirection for Hummingbird processors":http://code.google.com/p/hummingbird-hibl/ |
||
20 | * "source code for hummingbird-hibl":http://code.google.com/p/hummingbird-hibl/source/browse/trunk/HummingBirdInterceptorBootloader/ |
||
21 | |||
22 | |||
23 | h3. Partitioning informations |
||
24 | |||
25 | |||
26 | <pre> |
||
27 | <pre> |
||
28 | 8 | Paul Kocialkowski | Entry Count: 16 |
29 | Unknown 1: 0 |
||
30 | Unknown 2: 0 |
||
31 | Unknown 3: 0 |
||
32 | Unknown 4: 0 |
||
33 | Unknown 5: 0 |
||
34 | Unknown 6: 0 |
||
35 | Unknown 7: 0 |
||
36 | Unknown 8: 0 |
||
37 | |||
38 | |||
39 | --- Entry #0 --- |
||
40 | Unused: No |
||
41 | Partition Type: 0 (RFS) |
||
42 | Partition Identifier: 0 |
||
43 | Partition Flags: 0 (R) |
||
44 | Unknown 1: 0 |
||
45 | Partition Block Size: 256 |
||
46 | Partition Block Count: 1 |
||
47 | Unknown 2: 0 |
||
48 | Unknown 3: 0 |
||
49 | Partition Name: IPBL |
||
50 | Filename: bootloader.img |
||
51 | |||
52 | |||
53 | --- Entry #1 --- |
||
54 | Unused: No |
||
55 | Partition Type: 0 (RFS) |
||
56 | Partition Identifier: 1 |
||
57 | Partition Flags: 0 (R) |
||
58 | Unknown 1: 0 |
||
59 | Partition Block Size: 256 |
||
60 | Partition Block Count: 7 |
||
61 | Unknown 2: 0 |
||
62 | Unknown 3: 0 |
||
63 | Partition Name: SBL |
||
64 | Filename: |
||
65 | |||
66 | |||
67 | --- Entry #2 --- |
||
68 | Unused: No |
||
69 | Partition Type: 0 (RFS) |
||
70 | Partition Identifier: 2 |
||
71 | Partition Flags: 0 (R) |
||
72 | Unknown 1: 0 |
||
73 | Partition Block Size: 256 |
||
74 | Partition Block Count: 7 |
||
75 | Unknown 2: 0 |
||
76 | Unknown 3: 0 |
||
77 | Partition Name: SBL2 |
||
78 | Filename: |
||
79 | |||
80 | |||
81 | --- Entry #3 --- |
||
82 | Unused: No |
||
83 | Partition Type: 0 (RFS) |
||
84 | Partition Identifier: 3 |
||
85 | Partition Flags: 0 (R) |
||
86 | Unknown 1: 0 |
||
87 | Partition Block Size: 256 |
||
88 | Partition Block Count: 4 |
||
89 | Unknown 2: 0 |
||
90 | Unknown 3: 0 |
||
91 | Partition Name: PARAM |
||
92 | Filename: |
||
93 | |||
94 | |||
95 | --- Entry #4 --- |
||
96 | Unused: No |
||
97 | Partition Type: 0 (RFS) |
||
98 | Partition Identifier: 4 |
||
99 | Partition Flags: 0 (R) |
||
100 | Unknown 1: 0 |
||
101 | Partition Block Size: 256 |
||
102 | Partition Block Count: 5 |
||
103 | Unknown 2: 0 |
||
104 | Unknown 3: 0 |
||
105 | Partition Name: MISC |
||
106 | Filename: |
||
107 | |||
108 | |||
109 | --- Entry #5 --- |
||
110 | Unused: No |
||
111 | Partition Type: 0 (RFS) |
||
112 | Partition Identifier: 5 |
||
113 | Partition Flags: 0 (R) |
||
114 | Unknown 1: 0 |
||
115 | Partition Block Size: 256 |
||
116 | Partition Block Count: 32 |
||
117 | Unknown 2: 0 |
||
118 | Unknown 3: 0 |
||
119 | Partition Name: BOOT |
||
120 | Filename: boot.img |
||
121 | |||
122 | |||
123 | --- Entry #6 --- |
||
124 | Unused: No |
||
125 | Partition Type: 0 (RFS) |
||
126 | Partition Identifier: 6 |
||
127 | Partition Flags: 0 (R) |
||
128 | Unknown 1: 0 |
||
129 | Partition Block Size: 256 |
||
130 | Partition Block Count: 32 |
||
131 | Unknown 2: 0 |
||
132 | Unknown 3: 0 |
||
133 | Partition Name: RECOVERY |
||
134 | Filename: recovery.img |
||
135 | |||
136 | |||
137 | --- Entry #7 --- |
||
138 | Unused: No |
||
139 | Partition Type: 0 (RFS) |
||
140 | Partition Identifier: 7 |
||
141 | Partition Flags: 1 (R) |
||
142 | Unknown 1: 0 |
||
143 | Partition Block Size: 256 |
||
144 | Partition Block Count: 1878 |
||
145 | Unknown 2: 0 |
||
146 | Unknown 3: 0 |
||
147 | Partition Name: CACHE |
||
148 | Filename: cache.img |
||
149 | |||
150 | |||
151 | --- Entry #8 --- |
||
152 | Unused: Yes |
||
153 | Partition Type: 0 (RFS) |
||
154 | Partition Identifier: 8 |
||
155 | Partition Flags: 0 (R) |
||
156 | Unknown 1: 0 |
||
157 | Partition Block Size: 256 |
||
158 | Partition Block Count: 54 |
||
159 | Unknown 2: 0 |
||
160 | Unknown 3: 0 |
||
161 | Partition Name: RADIO |
||
162 | Filename: radio.img |
||
163 | |||
164 | |||
165 | --- Entry #9 --- |
||
166 | Unused: No |
||
167 | Partition Type: 0 (RFS) |
||
168 | Partition Identifier: 9 |
||
169 | Partition Flags: 1 (R) |
||
170 | Unknown 1: 0 |
||
171 | Partition Block Size: 256 |
||
172 | Partition Block Count: 27 |
||
173 | Unknown 2: 0 |
||
174 | Unknown 3: 0 |
||
175 | Partition Name: EFS |
||
176 | Filename: |
||
177 | |||
178 | |||
179 | --- Entry #10 --- |
||
180 | Unused: No |
||
181 | Partition Type: 0 (RFS) |
||
182 | Partition Identifier: 10 |
||
183 | Partition Flags: 0 (R) |
||
184 | Unknown 1: 0 |
||
185 | Partition Block Size: 256 |
||
186 | Partition Block Count: 1 |
||
187 | Unknown 2: 0 |
||
188 | Unknown 3: 0 |
||
189 | Partition Name: DGS |
||
190 | Filename: dgs.img |
||
191 | |||
192 | |||
193 | --- Entry #11 --- |
||
194 | Unused: No |
||
195 | Partition Type: 2 (EXT4) |
||
196 | Partition Identifier: 0 |
||
197 | Partition Flags: 2 (R/W) |
||
198 | Unknown 1: 0 |
||
199 | Partition Block Size: 512 |
||
200 | Partition Block Count: 2048 |
||
201 | Unknown 2: 0 |
||
202 | Unknown 3: 0 |
||
203 | Partition Name: PGPT |
||
204 | Filename: emmc.img |
||
205 | |||
206 | |||
207 | --- Entry #12 --- |
||
208 | Unused: No |
||
209 | Partition Type: 2 (EXT4) |
||
210 | Partition Identifier: 1 |
||
211 | Partition Flags: 2 (R/W) |
||
212 | Unknown 1: 0 |
||
213 | Partition Block Size: 512 |
||
214 | Partition Block Count: 1048576 |
||
215 | Unknown 2: 0 |
||
216 | Unknown 3: 0 |
||
217 | Partition Name: SYSTEM |
||
218 | Filename: system.img |
||
219 | |||
220 | |||
221 | --- Entry #13 --- |
||
222 | Unused: No |
||
223 | Partition Type: 2 (EXT4) |
||
224 | Partition Identifier: 2 |
||
225 | Partition Flags: 2 (R/W) |
||
226 | Unknown 1: 0 |
||
227 | Partition Block Size: 512 |
||
228 | Partition Block Count: 2097152 |
||
229 | Unknown 2: 0 |
||
230 | Unknown 3: 0 |
||
231 | Partition Name: USERDATA |
||
232 | Filename: userdata.img |
||
233 | |||
234 | |||
235 | --- Entry #14 --- |
||
236 | Unused: No |
||
237 | Partition Type: 2 (EXT4) |
||
238 | Partition Identifier: 3 |
||
239 | Partition Flags: 2 (R/W) |
||
240 | Unknown 1: 0 |
||
241 | Partition Block Size: 512 |
||
242 | Partition Block Count: 33554432 |
||
243 | Unknown 2: 0 |
||
244 | Unknown 3: 0 |
||
245 | Partition Name: MEDIA |
||
246 | Filename: media.img |
||
247 | 1 | Denis 'GNUtoo' Carikli | |
248 | |||
249 | --- Entry #15 --- |
||
250 | Unused: No |
||
251 | Partition Type: 2 (EXT4) |
||
252 | Partition Identifier: 4 |
||
253 | Partition Flags: 2 (R/W) |
||
254 | Unknown 1: 0 |
||
255 | Partition Block Size: 512 |
||
256 | Partition Block Count: 33 |
||
257 | 9 | Paul Kocialkowski | Unknown 2: 0 |
258 | Unknown 3: 0 |
||
259 | Partition Name: SGPT |
||
260 | 10 | Paul Kocialkowski | Filename: |
261 | 16 | Paul Kocialkowski | </pre> |
262 | 10 | Paul Kocialkowski | |
263 | 1 | Denis 'GNUtoo' Carikli | |
264 | 16 | Paul Kocialkowski | h2. Serial Console |
265 | |||
266 | |||
267 | 10 | Paul Kocialkowski | It is possible to setup a serial console on the Nexus S. It will show: |
268 | 16 | Paul Kocialkowski | * the 1st bootloader output |
269 | * the 2nd bootloader output |
||
270 | * the 2nd bootloader #2 output |
||
271 | * the fiq debugger |
||
272 | * (the kernel output if enabled) |
||
273 | 10 | Paul Kocialkowski | |
274 | 9 | Paul Kocialkowski | |
275 | 16 | Paul Kocialkowski | h3. How to enable serial console |
276 | |||
277 | |||
278 | * completely turn off the Nexus S |
||
279 | * attach the microUSB connector to the Nexus S |
||
280 | * wire GND and ID (from the microUSB connector) to a 150K resistor |
||
281 | * get an UART to USB module like this one: http://www.dealextreme.com/p/usb-to-uart-5-pin-cp2102-module-serial-converter-81872 |
||
282 | * wire it following this table: |
||
283 | 11 | Paul Kocialkowski | || UART to USB board output || resistor || microUSB connector(s) name(s) || microUSB wire color || |
284 | 9 | Paul Kocialkowski | || N/A || 150K Ohm || ID and GND || ID not wired (the 5th connector that is unused), GND is black || |
285 | 1 | Denis 'GNUtoo' Carikli | || 3.3V || N/A || V+ || red || |
286 | 9 | Paul Kocialkowski | || GND || N/A || GND || black || |
287 | 1 | Denis 'GNUtoo' Carikli | || Rx || N/A || D- || white || |
288 | || Tx || N/A || D+ || green || |
||
289 | |||
290 | 16 | Paul Kocialkowski | *Warning: the voltage to use is 3.3V and not 5V! Using 5V can cause serious damages to the UART component.* |
291 | 13 | Paul Kocialkowski | |
292 | 16 | Paul Kocialkowski | <pre> |
293 | 13 | Paul Kocialkowski | To read/write on the serial, you can use screen (or picocomm, or any other software that deals with serial consoles): |
294 | 16 | Paul Kocialkowski | <pre> |
295 | 1 | Denis 'GNUtoo' Carikli | 115200 is the baud rate to use (certainly with most UART to USB board). |
296 | 13 | Paul Kocialkowski | |
297 | Then, do a regular boot. You should see the second bootloader #2 output. To get the 1st and 2nd bootloaders output, press <enter> to get in fiq debugger and write "reboot" then <enter>. |
||
298 | |||
299 | |||
300 | Photos: here's what it looks like when all setup: |
||
301 | |||
302 | [[Image(http://download.paulk.fr/replicant/crespo/uart/uart_board.jpg)]] |
||
303 | |||
304 | The UART to USB board. USB is connected to the host PC, UART pins to the microUSB connector. |
||
305 | |||
306 | [[Image(http://download.paulk.fr/replicant/crespo/uart/nexuss_resistor.jpg)]] |
||
307 | 1 | Denis 'GNUtoo' Carikli | |
308 | 14 | Paul Kocialkowski | The 150K resistor (two resistors here that make 150K together) soldered to the microUSB connector, that is attached to the Nexus S. |
309 | 1 | Denis 'GNUtoo' Carikli | |
310 | 16 | Paul Kocialkowski | _Note: it was done the quick and dirty way here, it's better to use a protoboard (prototyping board)._ |
311 | 9 | Paul Kocialkowski | |
312 | [[Image(http://download.paulk.fr/replicant/crespo/uart/nexuss_global_text.jpg)]] |
||
313 | |||
314 | The USB cable that is connected to the Nexus S ends on the connectors attached to the UART to USB board. |
||
315 | |||
316 | 16 | Paul Kocialkowski | _Note: it was done the quick and dirty way here, it's better to use a protoboard (prototyping board)._ |
317 | 9 | Paul Kocialkowski | |
318 | |||
319 | 16 | Paul Kocialkowski | h3. Bootloaders outputs |
320 | |||
321 | |||
322 | 9 | Paul Kocialkowski | first bootloader: |
323 | 16 | Paul Kocialkowski | <pre> |
324 | 9 | Paul Kocialkowski | ----------------------------------------------------------- |
325 | Samsung Primitive Bootloader (PBL) v3.0 |
||
326 | Copyright (C) Samsung Electronics Co., Ltd. 2006-2010 |
||
327 | ----------------------------------------------------------- |
||
328 | |||
329 | 16 | Paul Kocialkowski | Muxed [[OneNAND]] 512MB (0x50) Sync |
330 | 9 | Paul Kocialkowski | Scanning Bad Block ....... |
331 | Bad Block 77 (5) |
||
332 | Bad Block 295 (5) |
||
333 | Bad Block 1232 (5) |
||
334 | Bad Block 1646 (5) |
||
335 | Bad Block 1831 (5) |
||
336 | Bad Block 2047 (0) |
||
337 | SBL loadding success |
||
338 | |||
339 | Set cpu clk. from 400MHz to 800MHz. |
||
340 | OM=0x9, device=OnenandMux(Audi) |
||
341 | IROM e-fused - Secure Boot Version. |
||
342 | 16 | Paul Kocialkowski | </pre> |
343 | 9 | Paul Kocialkowski | |
344 | 1 | Denis 'GNUtoo' Carikli | second bootloader: |
345 | 16 | Paul Kocialkowski | <pre> |
346 | 1 | Denis 'GNUtoo' Carikli | ----------------------------------------------------------- |
347 | 9 | Paul Kocialkowski | Samsung Secondary Bootloader (SBL) v3.0 |
348 | Copyright (C) Samsung Electronics Co., Ltd. 2006-2010 |
||
349 | |||
350 | Board Name: HERRING REV 52 |
||
351 | Build On: Jan 20 2011 17:19:41 |
||
352 | ----------------------------------------------------------- |
||
353 | 1 | Denis 'GNUtoo' Carikli | |
354 | MMC SEM16G 15188 MB |
||
355 | Re_partition: magic code(0x0) |
||
356 | 16 | Paul Kocialkowski | Muxed [[OneNAND]] 512MB (0x50) Sync |
357 | 1 | Denis 'GNUtoo' Carikli | Scanning Bad Block ....... |
358 | Bad Block 77 (5) |
||
359 | Bad Block 295 (5) |
||
360 | Bad Block 1232 (5) |
||
361 | Bad Block 1646 (5) |
||
362 | Bad Block 1831 (5) |
||
363 | Bad Block 2047 (0) |
||
364 | Partitions loading success |
||
365 | 9 | Paul Kocialkowski | Read image(PARAM) from flash ....... |
366 | Done |
||
367 | init_fuel_gauge: vcell = 4083mV, soc = 94 |
||
368 | PMIC_IRQ1 = 0xc0 |
||
369 | PMIC_IRQ2 = 0x0 |
||
370 | PMIC_IRQ3 = 0x0 |
||
371 | PMIC_IRQ4 = 0x0 |
||
372 | PMIC_STATUS1 = 0x0 |
||
373 | PMIC_STATUS2 = 0x0 |
||
374 | PMIC_STATUS3 = 0x0 |
||
375 | PMIC_STATUS4 = 0x0 |
||
376 | PMIC_STATUS5 = 0x0 |
||
377 | PMIC_SMPL = 0x0 |
||
378 | Key scan = 0x0 |
||
379 | message.command = |
||
380 | message.status = |
||
381 | message.recovery = |
||
382 | 16 | Paul Kocialkowski | </pre> |
383 | 9 | Paul Kocialkowski | |
384 | second bootloader #2: |
||
385 | 16 | Paul Kocialkowski | <pre> |
386 | 9 | Paul Kocialkowski | BOOT_MODE_NORMAL (SW_RST(0x00000004), INFORM(0x000000ee)) |
387 | LCD ID = 0x0060a953 |
||
388 | Done |
||
389 | Kernel(boot.img) read success from partition no.5 |
||
390 | Setting param.serialnr = 0x3733bab6 0x6de200ec |
||
391 | Setting param.board_rev = 0x34 |
||
392 | 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 |
||
393 | Setting param.initrd_start = 0x31000000, param.initrd_size = 0x23265 |
||
394 | |||
395 | Starting kernel at 0x30008000... |
||
396 | |||
397 | 4 | Denis 'GNUtoo' Carikli | Uncompressing Linux... done, booting the kernel. |
398 | 16 | Paul Kocialkowski | </pre> |
399 | 4 | Denis 'GNUtoo' Carikli | |
400 | kernel |
||
401 | 16 | Paul Kocialkowski | <pre> |
402 | 4 | Denis 'GNUtoo' Carikli | <hit enter to activate fiq debugger> |
403 | 16 | Paul Kocialkowski | </pre> |
404 | 4 | Denis 'GNUtoo' Carikli | |
405 | 16 | Paul Kocialkowski | |
406 | h2. TODO |
||
407 | |||
408 | * Look if "Heimdall":http://www.glassechidna.com.au/products/heimdall/ can talk to the bootrom |
||
409 | * Serial console: |
||
410 | ** Use the correct resistors enabling the serial console on the FSA9480 |
||
411 | ** Mesure the voltage of the Nexus S serial port |
||
412 | ** Make a level shifter to shift the serial port levels |
||
413 | ** Cross compile microcom or picocom |
||
414 | ** get a serial console |
||
415 | * Find the JTAG |
||
416 | * look if the first stage bootloader(after the bootrom) is signed |