OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [ref/] [updating-redboot.html] - Blame information for rev 765

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 28 unneback
<!-- Copyright (C) 2003 Red Hat, Inc.                                -->
2
<!-- This material may be distributed only subject to the terms      -->
3
<!-- and conditions set forth in the Open Publication License, v1.0  -->
4
<!-- or later (the latest version is presently available at          -->
5
<!-- http://www.opencontent.org/openpub/).                           -->
6
<!-- Distribution of the work or derivative of the work in any       -->
7
<!-- standard (paper) book form is prohibited unless prior           -->
8
<!-- permission is obtained from the copyright holder.               -->
9
<HTML
10
><HEAD
11
><TITLE
12
>Updating RedBoot</TITLE
13
><meta name="MSSmartTagsPreventParsing" content="TRUE">
14
<META
15
NAME="GENERATOR"
16
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
17
"><LINK
18
REL="HOME"
19
TITLE="eCos Reference Manual"
20
HREF="ecos-ref.html"><LINK
21
REL="UP"
22
TITLE="RedBoot&#8482; User's Guide"
23
HREF="redboot.html"><LINK
24
REL="PREVIOUS"
25
TITLE="Rebuilding RedBoot"
26
HREF="rebuilding-redboot.html"><LINK
27
REL="NEXT"
28
TITLE="Installation and Testing"
29
HREF="installation-and-testing.html"></HEAD
30
><BODY
31
CLASS="CHAPTER"
32
BGCOLOR="#FFFFFF"
33
TEXT="#000000"
34
LINK="#0000FF"
35
VLINK="#840084"
36
ALINK="#0000FF"
37
><DIV
38
CLASS="NAVHEADER"
39
><TABLE
40
SUMMARY="Header navigation table"
41
WIDTH="100%"
42
BORDER="0"
43
CELLPADDING="0"
44
CELLSPACING="0"
45
><TR
46
><TH
47
COLSPAN="3"
48
ALIGN="center"
49
>eCos Reference Manual</TH
50
></TR
51
><TR
52
><TD
53
WIDTH="10%"
54
ALIGN="left"
55
VALIGN="bottom"
56
><A
57
HREF="rebuilding-redboot.html"
58
ACCESSKEY="P"
59
>Prev</A
60
></TD
61
><TD
62
WIDTH="80%"
63
ALIGN="center"
64
VALIGN="bottom"
65
></TD
66
><TD
67
WIDTH="10%"
68
ALIGN="right"
69
VALIGN="bottom"
70
><A
71
HREF="installation-and-testing.html"
72
ACCESSKEY="N"
73
>Next</A
74
></TD
75
></TR
76
></TABLE
77
><HR
78
ALIGN="LEFT"
79
WIDTH="100%"></DIV
80
><DIV
81
CLASS="CHAPTER"
82
><H1
83
><A
84
NAME="UPDATING-REDBOOT">Chapter 4. Updating RedBoot</H1
85
><DIV
86
CLASS="SECT1"
87
><H1
88
CLASS="SECT1"
89
><A
90
NAME="AEN4752">Introduction</H1
91
><P
92
>RedBoot
93
normally resides in an EPROM or, more common these days, a flash
94
on the board. In the former case, updating RedBoot necessitates
95
physically removing the part and
96
reprogramming a new RedBoot image into it using prommer hardware. In
97
the latter case, it is often possible to update RedBoot in situ using
98
Redboot's flash management commands.</P
99
><P
100
>The process of updating RedBoot in situ is documented in this
101
section. For this process, it is assumed that the target is connected
102
to a host system and that there is a serial connection giving access
103
to the RedBoot CLI. For platforms with a ROMRAM mode RedBoot, skip to
104
<A
105
HREF="updating-redboot.html#UPDATE-PRIMARY-IMAGE"
106
>the Section called <I
107
>Update the primary RedBoot flash image</I
108
></A
109
>.</P
110
><DIV
111
CLASS="NOTE"
112
><BLOCKQUOTE
113
CLASS="NOTE"
114
><P
115
><B
116
>Note: </B
117
>The addresses and sizes included in the below are examples
118
only, and will differ from those you will see. This is normal and
119
should not cause concern.</P
120
></BLOCKQUOTE
121
></DIV
122
><DIV
123
CLASS="SECT2"
124
><H2
125
CLASS="SECT2"
126
><A
127
NAME="DIFFERENT-VERSION-FROM-RAM">Load and start a RedBoot RAM instance</H2
128
><P
129
>There are a number of choices here. The basic case is where a RAM
130
mode image has been stored in the FIS (flash Image System). To load and
131
execute this image, use the commands: <TABLE
132
BORDER="5"
133
BGCOLOR="#E0E0F0"
134
WIDTH="70%"
135
><TR
136
><TD
137
><PRE
138
CLASS="SCREEN"
139
>RedBoot&#62; <TT
140
CLASS="USERINPUT"
141
><B
142
>fis load RedBoot[RAM]</B
143
></TT
144
>
145
RedBoot&#62; <TT
146
CLASS="USERINPUT"
147
><B
148
>go</B
149
></TT
150
></PRE
151
></TD
152
></TR
153
></TABLE
154
>
155
If this image is not available, or does not work,
156
then an alternate RAM mode image must be loaded:
157
<TABLE
158
BORDER="5"
159
BGCOLOR="#E0E0F0"
160
WIDTH="70%"
161
><TR
162
><TD
163
><PRE
164
CLASS="SCREEN"
165
>RedBoot&#62; <TT
166
CLASS="USERINPUT"
167
><B
168
>load redboot_RAM.img</B
169
></TT
170
>
171
Entry point: 0x060213c0, address range: 0x06020000-0x060369c8
172
RedBoot&#62; <TT
173
CLASS="USERINPUT"
174
><B
175
>go</B
176
></TT
177
></PRE
178
></TD
179
></TR
180
></TABLE
181
>
182
 
183
<DIV
184
CLASS="NOTE"
185
><BLOCKQUOTE
186
CLASS="NOTE"
187
><P
188
><B
189
>Note: </B
190
>This command loads the RedBoot image using the TFTP
191
protocol via a network connection. Other methods of loading are
192
available, refer to the <B
193
CLASS="COMMAND"
194
><A
195
HREF="download-command.html"
196
>load</A
197
></B
198
> command for more
199
details. </P
200
></BLOCKQUOTE
201
></DIV
202
>
203
 
204
<DIV
205
CLASS="NOTE"
206
><BLOCKQUOTE
207
CLASS="NOTE"
208
><P
209
><B
210
>Note: </B
211
>If you expect to be doing this more than once, it is a
212
good idea to program the RAM mode image into the flash. You do this
213
using the <B
214
CLASS="COMMAND"
215
>fis create</B
216
> command after having
217
downloaded the RAM mode image, but before you start it.</P
218
><P
219
>Some platforms support locking (write protecting) certain regions of
220
the flash, while others do not. If your platform does not support
221
locking, simply ignore the <B
222
CLASS="COMMAND"
223
>fis unlock</B
224
> and
225
<B
226
CLASS="COMMAND"
227
>fis lock</B
228
> steps (the commands will not be
229
recognized by RedBoot).</P
230
><P
231
><TABLE
232
BORDER="5"
233
BGCOLOR="#E0E0F0"
234
WIDTH="70%"
235
><TR
236
><TD
237
><PRE
238
CLASS="SCREEN"
239
>RedBoot&#62; <TT
240
CLASS="USERINPUT"
241
><B
242
>fis unlock RedBoot[RAM]</B
243
></TT
244
>
245
  ... Unlock from 0x00000000-0x00020000: ..
246
RedBoot&#62; <TT
247
CLASS="USERINPUT"
248
><B
249
>fis create RedBoot[RAM]</B
250
></TT
251
>
252
An image named 'RedBoot[RAM]' exists - continue (y/n)? <TT
253
CLASS="USERINPUT"
254
><B
255
>y</B
256
></TT
257
>
258
* CAUTION * about to program 'RedBoot[RAM]'
259
            at 0x00020000..0x000369c7 from 0x06020000 - continue (y/n)?<TT
260
CLASS="USERINPUT"
261
><B
262
>y</B
263
></TT
264
>
265
... Erase from 0x00020000-0x00040000: ..
266
... Program from 0x06020000-0x060369c8 at 0x00020000: ..
267
... Erase from 0x00070000-0x00080000: .
268
... Program from 0x0606f000-0x0607f000 at 0x00070000: .
269
RedBoot&#62; <TT
270
CLASS="USERINPUT"
271
><B
272
>fis lock RedBoot[RAM]</B
273
></TT
274
>
275
  ... Lock from 0x00000000-0x00020000: ..</PRE
276
></TD
277
></TR
278
></TABLE
279
></P
280
></BLOCKQUOTE
281
></DIV
282
></P
283
></DIV
284
><DIV
285
CLASS="SECT2"
286
><H2
287
CLASS="SECT2"
288
><A
289
NAME="UPDATE-PRIMARY-IMAGE">Update the primary RedBoot flash image</H2
290
><P
291
>An
292
instance of RedBoot should now be running on the target from RAM. This
293
can be verified by looking for the mode identifier in the banner. It
294
should be either [RAM] or [ROMRAM].</P
295
><P
296
>If this is the first time RedBoot is running on the board or if
297
the flash contents has been damaged, initialize the FIS directory:
298
<TABLE
299
BORDER="5"
300
BGCOLOR="#E0E0F0"
301
WIDTH="70%"
302
><TR
303
><TD
304
><PRE
305
CLASS="SCREEN"
306
>RedBoot&#62; <TT
307
CLASS="USERINPUT"
308
><B
309
>fis init -f</B
310
></TT
311
>
312
About to initialize [format] FLASH image system - continue (y/n)? <TT
313
CLASS="USERINPUT"
314
><B
315
>y</B
316
></TT
317
>
318
*** Initialize FLASH Image System
319
... Erase from 0x00020000-0x00070000: .....
320
... Erase from 0x00080000-0x00080000:
321
... Erase from 0x00070000-0x00080000: .
322
... Program from 0x0606f000-0x0607f000 at 0x00070000: .</PRE
323
></TD
324
></TR
325
></TABLE
326
></P
327
><P
328
>It is important to understand that the presence of a correctly
329
initialized FIS directory allows RedBoot to automatically determine
330
the flash parameters. Additionally, executing the steps below as
331
stated without loading other data or using other flash commands (than
332
possibly <B
333
CLASS="COMMAND"
334
>fis list</B
335
>) allows RedBoot to automatically
336
determine the image location and size parameters. This greatly reduces
337
the risk of potential critical mistakes due to typographical errors. It is
338
still always possible to explicitly specify parameters, and indeed
339
override these, but it is not advised.</P
340
><DIV
341
CLASS="NOTE"
342
><BLOCKQUOTE
343
CLASS="NOTE"
344
><P
345
><B
346
>Note: </B
347
>If the new RedBoot image has grown beyond the slot in
348
flash reserved for it, it is necessary to change the RedBoot
349
configuration option CYGBLD_REDBOOT_MIN_IMAGE_SIZE so the FIS is
350
created with adequate space reserved for RedBoot images. In this case,
351
it is necessary to re-initialize the FIS directory as described above,
352
using a RAM mode RedBoot compiled with the updated
353
configuration.</P
354
></BLOCKQUOTE
355
></DIV
356
><P
357
>Using the <B
358
CLASS="COMMAND"
359
>load</B
360
> command, download the
361
new flash based image from the host, relocating the image to RAM::
362
<TABLE
363
BORDER="5"
364
BGCOLOR="#E0E0F0"
365
WIDTH="70%"
366
><TR
367
><TD
368
><PRE
369
CLASS="SCREEN"
370
>RedBoot&#62; <TT
371
CLASS="USERINPUT"
372
><B
373
>load -r -b %{FREEMEMLO} redboot_ROM.bin</B
374
></TT
375
>
376
Raw file loaded 0x06046800-0x06062fe8, assumed entry at 0x06046800</PRE
377
></TD
378
></TR
379
></TABLE
380
>
381
 
382
<DIV
383
CLASS="NOTE"
384
><BLOCKQUOTE
385
CLASS="NOTE"
386
><P
387
><B
388
>Note: </B
389
>This command loads the RedBoot image using the TFTP
390
protocol via a network connection. Other methods of loading are
391
available, refer to the <A
392
HREF="download-command.html"
393
>load</A
394
> command for
395
more details. </P
396
></BLOCKQUOTE
397
></DIV
398
>
399
 
400
<DIV
401
CLASS="NOTE"
402
><BLOCKQUOTE
403
CLASS="NOTE"
404
><P
405
><B
406
>Note: </B
407
>Note that the binary version of the image is being
408
downloaded. This is to ensure that the memory after the image is
409
loaded should match the contents of the file on the host. Loading SREC
410
or ELF versions of the image does not guarantee this since these
411
formats may contain holes, leaving bytes in these holes in an unknown
412
state after the load, and thus causing a likely cksum difference. It
413
is possible to use these, but then the step verifying the cksum below
414
may fail.</P
415
></BLOCKQUOTE
416
></DIV
417
></P
418
><P
419
>Once the image is loaded into RAM, it should be checksummed,
420
thus verifying that the image on the target is indeed the image
421
intended to be loaded, and that no corruption of the image has
422
happened. This is done using the <A
423
HREF="cksum-command.html"
424
>cksum</A
425
>
426
command:
427
<TABLE
428
BORDER="5"
429
BGCOLOR="#E0E0F0"
430
WIDTH="70%"
431
><TR
432
><TD
433
><PRE
434
CLASS="SCREEN"
435
>RedBoot&#62; <TT
436
CLASS="USERINPUT"
437
><B
438
>cksum</B
439
></TT
440
>
441
Computing cksum for area 0x06046800-0x06062fe8
442
POSIX cksum = 2535322412 116712 (0x971df32c 0x0001c7e8)                         </PRE
443
></TD
444
></TR
445
></TABLE
446
>
447
Compare the numbers with those for the binary version of the image on
448
the host. If they do not match, try downloading the image again.</P
449
><P
450
>Assuming the cksum matches, the next step is programming the
451
image into flash using the FIS commands.</P
452
><P
453
>Some platforms support locking (write protecting) certain
454
regions of the flash, while others do not. If your platform does not
455
support locking, simply ignore the <B
456
CLASS="COMMAND"
457
>fis unlock</B
458
> and
459
<B
460
CLASS="COMMAND"
461
>fis lock</B
462
> steps (the commands will not be recognized
463
by RedBoot).</P
464
><TABLE
465
BORDER="5"
466
BGCOLOR="#E0E0F0"
467
WIDTH="70%"
468
><TR
469
><TD
470
><PRE
471
CLASS="SCREEN"
472
>RedBoot&#62; <TT
473
CLASS="USERINPUT"
474
><B
475
>fis unlock RedBoot</B
476
></TT
477
>
478
  ... Unlock from 0x00000000-0x00020000: ..
479
RedBoot&#62; <TT
480
CLASS="USERINPUT"
481
><B
482
>fis create RedBoot</B
483
></TT
484
>
485
An image named 'RedBoot' exists - continue (y/n)? <TT
486
CLASS="USERINPUT"
487
><B
488
>y</B
489
></TT
490
>
491
* CAUTION * about to program 'RedBoot'
492
            at 0x00000000..0x0001c7e7 from 0x06046800 - continue (y/n)? <TT
493
CLASS="USERINPUT"
494
><B
495
>y</B
496
></TT
497
>
498
... Erase from 0x00000000-0x00020000: ..
499
... Program from 0x06046800-0x06062fe8 at 0x00000000: ..
500
... Erase from 0x00070000-0x00080000: .
501
... Program from 0x0606f000-0x0607f000 at 0x00070000: .
502
RedBoot&#62; <TT
503
CLASS="USERINPUT"
504
><B
505
>fis lock RedBoot</B
506
></TT
507
>
508
  ... Lock from 0x00000000-0x00020000: ..</PRE
509
></TD
510
></TR
511
></TABLE
512
></DIV
513
><DIV
514
CLASS="SECT2"
515
><H2
516
CLASS="SECT2"
517
><A
518
NAME="AEN4824">Reboot; run the new RedBoot image</H2
519
><P
520
>Once the image has been successfully written into the flash, simply
521
reset the target and the new version of RedBoot should be running. </P
522
><P
523
>When installing RedBoot for the first time, or after updating to
524
a newer RedBoot with different configuration keys, it is necessary to
525
update the configuration directory in the flash using the
526
<B
527
CLASS="COMMAND"
528
>fconfig</B
529
> command. See <A
530
HREF="persistent-state-flash.html"
531
>the Section called <I
532
>Persistent State Flash-based Configuration and Control</I
533
> in Chapter 2</A
534
>.</P
535
></DIV
536
></DIV
537
></DIV
538
><DIV
539
CLASS="NAVFOOTER"
540
><HR
541
ALIGN="LEFT"
542
WIDTH="100%"><TABLE
543
SUMMARY="Footer navigation table"
544
WIDTH="100%"
545
BORDER="0"
546
CELLPADDING="0"
547
CELLSPACING="0"
548
><TR
549
><TD
550
WIDTH="33%"
551
ALIGN="left"
552
VALIGN="top"
553
><A
554
HREF="rebuilding-redboot.html"
555
ACCESSKEY="P"
556
>Prev</A
557
></TD
558
><TD
559
WIDTH="34%"
560
ALIGN="center"
561
VALIGN="top"
562
><A
563
HREF="ecos-ref.html"
564
ACCESSKEY="H"
565
>Home</A
566
></TD
567
><TD
568
WIDTH="33%"
569
ALIGN="right"
570
VALIGN="top"
571
><A
572
HREF="installation-and-testing.html"
573
ACCESSKEY="N"
574
>Next</A
575
></TD
576
></TR
577
><TR
578
><TD
579
WIDTH="33%"
580
ALIGN="left"
581
VALIGN="top"
582
>Rebuilding RedBoot</TD
583
><TD
584
WIDTH="34%"
585
ALIGN="center"
586
VALIGN="top"
587
><A
588
HREF="redboot.html"
589
ACCESSKEY="U"
590
>Up</A
591
></TD
592
><TD
593
WIDTH="33%"
594
ALIGN="right"
595
VALIGN="top"
596
>Installation and Testing</TD
597
></TR
598
></TABLE
599
></DIV
600
></BODY
601
></HTML
602
>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.