bring-up-sw.html
13.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.72 [en] (X11; U; Linux 2.4.18-14 i686) [Netscape]">
<title>Bring-up SW</title>
</head>
<body>
<center>
<h1>
Bring-up SW</h1></center>
<center><b><font size=+2>Plan Summary</font></b></center>
<h2>
Reference</h2>
<ol>
<li>
<a href="http://intwww/bb/rf/doc/hw/devsys.html">Bring Up/Development System</a></li>
</ol>
<!--
This is a comment.
-->
<h2>
Contents</h2>
<ul>
<li>
<a href="#Background">Background</a></li>
<li>
<a href="#Linux_JTAG_Library_Tools">Linux JTAG Library and Tools</a></li>
<li>
<a href="#diag_script">Diagnostic shell script</a></li>
<li>
<a href="#Linux_debug_printf_server">Linux debug printf server</a></li>
<li>
<a href="#Linux_debug_port_flash_programmer">Linux debug port flash programmer</a></li>
<li>
<a href="#Linux_debug_board_pp_lib">Linux lib to support debug board parallel
port</a></li>
<li>
<a href="#JTAG_diags_for_first_boards">JTAG based diags for first boards
before delivery to Palo Alto</a></li>
</ul>
<h2>
<a NAME="Background" </a></a>Background</h2>
As quickly as possible, get ability to::
<ol>
<li>
Load sk and app on a flash module and use normal boot sequence to load
and run the app/test.</li>
<li>
printf debugging via debug port.</li>
<li>
gdb available for debugging.</li>
</ol>
To account for the possibility that some hw/sw will not work initially,
we need to have a fallback plan for other methods of performing tests.
<p>Some alternate test methods:
<ol>
<li>
Tests performed using JTAG write/read with cpu held in reset. Similar to
iosim tests.</li>
<li>
Load a test program into boot sram via JTAG and boot it. Results checked
via JTAG reads, CRT, audio. Data and/or code can be loaded into other mem
via JTAG as desired.</li>
<li>
Use PC host to put sk and app onto flash module. Use JTAG to load boot
code that boots and loads the sk to run the app. Use osSyncPrintf for debug.</li>
</ol>
If we do not initially have the ability to program flash from a PC host,
we can program flash via JTAG read/write to BB address space (like iosim
tests). For faster flash programming via the debug port:
<ol>
<li>
Use JTAG to load and boot a small program that provides a debug port monitor
with the ability to read/write to BB address space.</li>
<li>
Switch out of JTAG mode</li>
<li>
Use debug port read/writes to BB address space to program flash.</li>
</ol>
<h2>
<a NAME="Linux_JTAG_Library_Tools" </a></a>Linux JTAG Library and Tools</h2>
<dl>Linux JTAG Library
<dd>
Ported from JTAG IOSIM tests</dd>
<br>Provides low level jtag functions and write_bcp(), read_bcp()
<br>Callbacks for read,write,wait so can be used with debug board, iosim,
or cpusim.
<p>Linux JTAG Tools
<dd>
Comand line app "jtag" provides BB space read/write and program load/boot.</dd>
<br>Uses debug board parallel port. Must be root user or set rw permission
to parport device(under /dev).
<dl>Usage:
<dd>
<b>jtag</b> [options] <b>jtag_cmd</b> [options] <b>args</b></dd>
<dl>Examples:
<dd>
jtag wd_write 0x0000a830 0xdeadbeef</dd>
<dd>
jtag blk_load -o 0x400
myfile.dat</dd>
<dd>
jtag sram_boot myprog.dat</dd>
<p><br>jtag options:
<br> -i use
ipc( sim.cpu.ipc or sim.ipc ) simulator instead
<br> -n does not
pursuit jtag sanity check
<br> -S sleep given
clocks, then run the command
<br> -r does not call reset-tap
<br> -D Turn off debug path when done
<br> -R Reset tap when done
-v verbose
output
<br> -h usage
<p>jtag_cmds and args:
<dl>
<dt>
<b>wd_write</b> addr word</dt>
<dd>
write 32 bit word to BB addr</dd>
<dt>
<b>wd_read</b> addr</dt>
<dd>
read 32 bit word from BB addr</dd>
<br>Result written to stdout.
<dt>
<b>sram_boot</b> [file]</dt>
<dd>
Load code from file into SRAM and boot.</dd>
<br>Default file is stdin.
<dt>
<b>blk_load</b> [-a addr_space | -b addr_base] [-o offset] [file]</dt>
<dd>
Load words from an ascii hex file to bb starting at</dd>
<br>addr_space + offset or addr_base + offest. Default file is stdin.
<br>Default addr_space is bb (i.e. addr_base=0). Default offset is 0.
<br>Addr_space can be bb, dmem, or imem.
<dl>
<dt>
Examples:</dt>
<dd>
jtag blk_load -o 0x400 myfile.dat</dd>
<dd>
jtag blk_load -a imem myfile.dat</dd>
<dd>
jtag blk_load -b 0x04610000 -o 512 myfile.dat</dd>
</dl>
<dt>
<b>blk_dump</b> [-a addr_space | -b addr_base] [-o offset] num_words [file]</dt>
<dd>
Dump num_wds to ascii hex file starting from addr_space + offset or</dd>
<br>addr_base + offest. Default file is stdout.
<br>Default addr_space is bb (i.e. addr_base=0). Default offset is 0.
<br>Addr_space can be bb, dmem, or imem.
<dl>
<dt>
Examples:</dt>
<dd>
jtag blk_dump -o 0x400 1024 myfile.dat</dd>
<dd>
jtag blk_dump -a imem 0x20 myfile.dat</dd>
<dd>
jtag blk_dump -b 0x04610000 -o 512 16 myfile.dat</dd>
</dl>
<dt>
<b>cpu_reset</b></dt>
<dd>
Reset cpu by using reset_en, reset_dis.</dd>
<dt>
<b>cpu_stop</b></dt>
<dd>
Stop the cpu using reset_en</dd>
<dt>
<b>cpu_start</b></dt>
<dd>
Start the cpu using reset_dis</dd>
<dt>
<b>sram_boot_en</b></dt>
<dd>
Enable booting from sram when cpu_start issued</dd>
<dt>
<b>rom_boot_en</b></dt>
<dd>
Enable booting from rom when cpu_start issued</dd>
</dl>
<dd>
<b>dbg_off</b></dd>
<dl>
<dd>
Turn off jtag debug path</dd>
</dl>
<dd>
<b>virage_store -s 0|1|2 binary_data_file</b></dd>
<dl>
<dd>
Store given binary file(big-endian) into virage flash(NOVeA).</dd>
<dd>
(There is a tool under PR/diag/jtag/hex2dat to convert hex data into
binary)</dd>
</dl>
<dd>
<b>virage_recall -s 0|1|2 binary_data_file</b></dd>
<dl>
<dd>
Recall the data from virage flash and write to given binary file.</dd>
</dl>
<dd>
<b>init_ddr [-m memclk(MHz)] [-d 32/16] [-p]</b></dd>
<dl>
<dd>
Initialize DDR by given parameters.</dd>
<dd>
-m specified mem clock (in Mhz, default is 192)</dd>
<dd>
-d specified which ddr parts are used. (default is 32)</dd>
<dd>
-p pll bypass</dd>
</dl>
</dl>
</dl>
</dl>
<h2>
<a NAME="diag_script"></a>Diagnostic shell scripts</h2>
<blockquote>Those scripts called jtag tools to achieve more complex jobs
or tests, and they are put in PR/diag/jtag. All of them have the
option -i, which means run it via RTL simulator.
<p><b>ddr_param</b>
<br> Initialize DDR by given parameters.
<br> Options:
<br>
-c tcl in mode register
<br>
-n refresh count
<br>
-s strobe reversal
<br>
-a auto precharge
<br>
-x 16bits ddr parts
<br>
-l trdel
<br>
-w twdel
<br>
-r tras
<br>
-p trp
<br>
-d trcd
<br>
-f trfc
<br>
-t tcl in parameter register
<br>
-h help
<p>ddr
<br> Simple DDR test, (toggle
all address/data lines)
<br> Options:
<br>
-i use RTL simulator
<p>ddr_init
<br> Initialize ddr by using
jtag init_ddr command.
<br> Options:
<br>
-i RTL simulator
<br>
-m memory-clock
<p>flash
<br> Simple flash erase/write/read
test
<p>jtat_test
<br> Jtag sanity check test
<p>lctrl
<br> local controller test
<p>vi
<br> Simple vi test
<p>ai
<br> Simple ai test
<p>ide
<br> Simple ide test
<p>bsram
<br> Boot sram tests(David's
cpu tests).
<p>usb
<br> Pull up/down usb resistor
lines.
<br> Options:
<br>
-c 0/1 which controller
<br>
-p pull up d+ line
<br>
-m pull up d- line
<br>
-d pull down d+ line
<br>
-l pull down d- line
<br>
-v turn on vbus (default is off)
<br>
<br>jboot
<br> Run single-segment rom(loaded
in ddr) via boot sram.
<br> Options:
<br>
-b sram boot code. (default: PR/tools/jtag/bootrom/bootrom.dat)
<br>
-r rom file.
<br>
-s signature which will be replaced with target adddress.
<br>
-j jumping to where. default is "entry 2" in rom file.</blockquote>
<h2>
<a NAME="Linux_debug_printf_server" </a></a>Linux debug printf server</h2>
<ul>
<li>
User space app.</li>
<li>
Uses n64 debug board 32bit message packet format and message types.</li>
<dl>
<dd>
6 bit msg type, 2 bit size, 3 bytes data</dd>
</dl>
<li>
Receives packets xmitted by rmon via BB debug board parallel port.</li>
<li>
Parses message packets for processing based on message type.</li>
<li>
Processes printf messages originated by osSyncPrintf()</li>
<li>
printf output sent to stdout.</li>
<li>
Can be expanded to process other rmon messages</li>
<dl>
<dd>
osLogEvent.</dd>
<br>__rmonSendFault on OS_EVENT_FAULT.</dl>
<li>
Can be expanded or code can be reused to provide processing of debug packets
for gdb interface</li>
</ul>
<h2>
<a NAME="Linux_debug_port_flash_programmer" </a></a>Linux debug port flash
programmer</h2>
<ul>
<li>
Small program loaded into boot ram via JTAG to provide BB debug port monitor
with BB addr space read/write ability.</li>
<li>
Manually switch from JTAG mode to normal debug port mode.</li>
<li>
Linux app communicates with BB monitor to do BB addr space read/writes
to program flash similar to IOSIM tests.</li>
<li>
Option to have Linux app read/write via JTAG instead of BB monitor.</li>
</ul>
<h2>
<a NAME="Linux_debug_board_pp_lib" </a></a>Linux lib to support debug board
parallel port</h2>
<ul>
<li>
Used by JTAG tools, debug printf server, and flash programmer.</li>
<li>
Encapsulates initialization, closing, setting protocol, and read/write
routines</li>
<li>
Uses Linux ppdev device driver which allows access to IEEE 1284 parallel
port functionality from user level app using ioctl commands in addition
to open, close, read, and write.</li>
</ul>
<h2>
<a NAME="JTAG_diags_for_first_boards" </a></a>JTAG based diags for first
boards before delivery to Palo Alto</h2>
Goal is to find out if interfaces are working so boards can be sent to
BroadOn Palo Alto for testing; or if fixes need to be made before that
can happen.
<p>The plan is to have simple tests that are performed in a simple manner
with minimal dependencies. More thorough tests will be done once
the boards are in Palo Alto.
<p>Therefore, do initial tests with write/read via jtag with cpu held in
reset.
<p>Prioritized list of tests.
<ol>
<li>
Test jtag</li>
<ol>
<li>
jtag state test</li>
<li>
jtag id test</li>
<li>
jtag bybass test</li>
</ol>
<li>
Test DDR SDRAM</li>
<br>
<li>
Display pattern on CRT</li>
<br>
<li>
Play some audio</li>
<br>
<li>
Test access to flash module</li>
<br>Want to make this simple. but not sure how much we need to do.
Simplest test would be to read device ids. If we can have a flash module
with known content, we could just read a page and verify content is as
expected. A more complete test would be to erase/write/read/verify.</ol>
Include at least one optional test that uses jtag to load and boot a program
that does at least a memory test.
<p>Controller and other tests are not required at this phase.
</body>
<END>
</html>