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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [ref/] [persistent-state-flash.html] - Blame information for rev 588

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
>Persistent State Flash-based Configuration and Control</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 Commands and Examples"
23
HREF="redboot-commands-and-examples.html"><LINK
24
REL="PREVIOUS"
25
TITLE="fis write"
26
HREF="fis-write-command.html"><LINK
27
REL="NEXT"
28
TITLE="Executing Programs from RedBoot"
29
HREF="executing-programs.html"></HEAD
30
><BODY
31
CLASS="SECT1"
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="fis-write-command.html"
58
ACCESSKEY="P"
59
>Prev</A
60
></TD
61
><TD
62
WIDTH="80%"
63
ALIGN="center"
64
VALIGN="bottom"
65
>Chapter 2. RedBoot Commands and Examples</TD
66
><TD
67
WIDTH="10%"
68
ALIGN="right"
69
VALIGN="bottom"
70
><A
71
HREF="executing-programs.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="SECT1"
82
><H1
83
CLASS="SECT1"
84
><A
85
NAME="PERSISTENT-STATE-FLASH">Persistent State Flash-based Configuration and Control</H1
86
><P
87
></P
88
><P
89
>RedBoot provides flash management support for storage in the flash memory
90
of multiple executable images and of non-volatile information such as IP addresses
91
and other network information.</P
92
><P
93
>RedBoot on platforms that support flash based configuration information
94
will report the following message the first time that RedBoot is booted on
95
the target:</P
96
><TABLE
97
BORDER="5"
98
BGCOLOR="#E0E0F0"
99
WIDTH="70%"
100
><TR
101
><TD
102
><PRE
103
CLASS="SCREEN"
104
>flash configuration checksum error or invalid key</PRE
105
></TD
106
></TR
107
></TABLE
108
><P
109
>This error can be ignored if no flash based configuration is desired,
110
or can be silenced by running the <B
111
CLASS="COMMAND"
112
>fconfig</B
113
>
114
command as described below. At this point you may also wish to run the <B
115
CLASS="COMMAND"
116
>fis init</B
117
> command. See other fis commands in <A
118
HREF="flash-image-system.html"
119
>the Section called <I
120
>Flash Image System (FIS)</I
121
></A
122
>.</P
123
><P
124
>Certain control and configuration information used by RedBoot can be
125
stored in flash. </P
126
><P
127
>The details of what information is maintained in flash differ, based
128
on the platform and the configuration. However, the basic operation used to
129
maintain this information is the same. Using the <B
130
CLASS="COMMAND"
131
>fconfig -l</B
132
> command, the information may be displayed and/or changed.</P
133
><P
134
>If the optional flag <TT
135
CLASS="COMPUTEROUTPUT"
136
>-i</TT
137
> is specified,
138
then the configuration database will be reset to its default
139
state. This is also needed the first time RedBoot is installed on the
140
target, or when updating to a newer RedBoot with different
141
configuration keys.</P
142
><P
143
>If the optional flag <TT
144
CLASS="COMPUTEROUTPUT"
145
>-l</TT
146
> is specified,
147
the configuration data is simply listed. Otherwise, each configuration parameter
148
will be displayed and you are given a chance to change it. The entire value
149
must be typed - typing just carriage return will leave a value unchanged.
150
Boolean values may be entered using the first letter (<TT
151
CLASS="COMPUTEROUTPUT"
152
>t</TT
153
>
154
for true, <TT
155
CLASS="COMPUTEROUTPUT"
156
>f</TT
157
> for false). At any time the editing
158
process may be stopped simply by entering a period (.) on the line. Entering
159
the caret (^) moves the editing back to the previous item. See &#8220;RedBoot
160
Editing Commands&#8221;, <A
161
HREF="redboot-editing-commands.html"
162
>the Section called <I
163
>RedBoot Editing Commands</I
164
> in Chapter 1</A
165
>. </P
166
><P
167
>If any changes are made in the configuration, then the updated data
168
will be written back to flash after getting acknowledgment from the user.</P
169
><P
170
>If the optional flag <TT
171
CLASS="COMPUTEROUTPUT"
172
>-n</TT
173
> is specified
174
(with or without <TT
175
CLASS="COMPUTEROUTPUT"
176
>-l</TT
177
>) then &#8220;nicknames&#8221;
178
of the entries are used.  These are shorter and less descriptive than
179
&#8220;full&#8221; names.  The full name may also be displayed by adding the
180
<TT
181
CLASS="COMPUTEROUTPUT"
182
>-f</TT
183
> flag.</P
184
><P
185
>The reason for telling you nicknames is that a quick way to set a single
186
entry is provided, using the format
187
<TABLE
188
BORDER="5"
189
BGCOLOR="#E0E0F0"
190
WIDTH="70%"
191
><TR
192
><TD
193
><PRE
194
CLASS="SCREEN"
195
>  RedBoot&#62; <TT
196
CLASS="USERINPUT"
197
><B
198
>fconfig <TT
199
CLASS="REPLACEABLE"
200
><I
201
>nickname</I
202
></TT
203
> <TT
204
CLASS="REPLACEABLE"
205
><I
206
>value</I
207
></TT
208
></B
209
></TT
210
></PRE
211
></TD
212
></TR
213
></TABLE
214
>
215
If no
216
value is supplied, the command will list and prompt for only that entry.
217
If a value is supplied, then the entry will be set to that value.  You will
218
be prompted whether to write the new information into flash if any change
219
was made.  For example
220
<TABLE
221
BORDER="5"
222
BGCOLOR="#E0E0F0"
223
WIDTH="70%"
224
><TR
225
><TD
226
><PRE
227
CLASS="SCREEN"
228
>  RedBoot&#62; <TT
229
CLASS="USERINPUT"
230
><B
231
>fconfig -l -n</B
232
></TT
233
>
234
  boot_script: false
235
  bootp: false
236
  bootp_my_ip: 10.16.19.176
237
  bootp_server_ip: 10.16.19.66
238
  dns_ip: 10.16.19.1
239
  gdb_port: 9000
240
  net_debug: false
241
  RedBoot&#62; <TT
242
CLASS="USERINPUT"
243
><B
244
>fconfig bootp_my_ip 10.16.19.177</B
245
></TT
246
>
247
  bootp_my_ip: 10.16.19.176 Setting to 10.16.19.177
248
  Update RedBoot non-volatile configuration - continue (y/n)? <TT
249
CLASS="USERINPUT"
250
><B
251
>y</B
252
></TT
253
>
254
  ... Unlock from 0x507c0000-0x507e0000: .
255
  ... Erase from 0x507c0000-0x507e0000: .
256
  ... Program from 0x0000a8d0-0x0000acd0 at 0x507c0000: .
257
  ... Lock from 0x507c0000-0x507e0000: .
258
  RedBoot&#62;</PRE
259
></TD
260
></TR
261
></TABLE
262
></P
263
><P
264
>Additionally, nicknames can be used like aliases via the format %{nickname}.
265
This allows the values stored by <TT
266
CLASS="USERINPUT"
267
><B
268
>fconfig</B
269
></TT
270
> to be used
271
directly by scripts and commands.</P
272
><P
273
>Depending on how your terminal program is connected and its
274
capabilities, you might find that you are unable to use line-editing to
275
delete the &#8216;old&#8217; value when using the default behaviour of
276
<B
277
CLASS="COMMAND"
278
>fconfig <TT
279
CLASS="REPLACEABLE"
280
><I
281
>nickname</I
282
></TT
283
></B
284
> or just
285
plain <B
286
CLASS="COMMAND"
287
>fconfig</B
288
>, as shown in this example:
289
<TABLE
290
BORDER="5"
291
BGCOLOR="#E0E0F0"
292
WIDTH="70%"
293
><TR
294
><TD
295
><PRE
296
CLASS="SCREEN"
297
>RedBoot&#62; <TT
298
CLASS="USERINPUT"
299
><B
300
>fco bootp</B
301
></TT
302
>
303
bootp: false&#0095;</PRE
304
></TD
305
></TR
306
></TABLE
307
>
308
The user deletes the word &#8220;false;&#8221; and enters &#8220;true&#8221;
309
so the display looks like this:
310
<TABLE
311
BORDER="5"
312
BGCOLOR="#E0E0F0"
313
WIDTH="70%"
314
><TR
315
><TD
316
><PRE
317
CLASS="SCREEN"
318
>RedBoot&#62; <TT
319
CLASS="USERINPUT"
320
><B
321
>fco bootp</B
322
></TT
323
>
324
bootp: <TT
325
CLASS="USERINPUT"
326
><B
327
>true</B
328
></TT
329
>
330
Update RedBoot non-volatile configuration - continue (y/n)? y
331
... Unlock from ...
332
RedBoot&#62; &#0095;</PRE
333
></TD
334
></TR
335
></TABLE
336
></P
337
><P
338
>To edit when you cannot backspace, use the optional flag
339
<TT
340
CLASS="COMPUTEROUTPUT"
341
>-d</TT
342
> (for &#8220;dumb terminal&#8221;)
343
to provide a simpler interface thus:
344
<TABLE
345
BORDER="5"
346
BGCOLOR="#E0E0F0"
347
WIDTH="70%"
348
><TR
349
><TD
350
><PRE
351
CLASS="SCREEN"
352
>RedBoot&#62; <TT
353
CLASS="USERINPUT"
354
><B
355
>fco -d bootp</B
356
></TT
357
>
358
bootp: false ? &#0095;</PRE
359
></TD
360
></TR
361
></TABLE
362
>
363
and you enter the value in the obvious manner thus:
364
<TABLE
365
BORDER="5"
366
BGCOLOR="#E0E0F0"
367
WIDTH="70%"
368
><TR
369
><TD
370
><PRE
371
CLASS="SCREEN"
372
>RedBoot&#62; <TT
373
CLASS="USERINPUT"
374
><B
375
>fco -d bootp</B
376
></TT
377
>
378
bootp: false ? <TT
379
CLASS="USERINPUT"
380
><B
381
>true</B
382
></TT
383
>
384
Update RedBoot non-volatile configuration - continue (y/n)? y
385
... Unlock from ...
386
RedBoot&#62; &#0095;</PRE
387
></TD
388
></TR
389
></TABLE
390
></P
391
><P
392
>One item which is always present in the configuration data is the ability
393
to execute a script at boot time. A sequence of RedBoot commands can be entered
394
which will be executed when the system starts up. Optionally, a time-out period
395
can be provided which allows the user to abort the startup script and proceed
396
with normal command processing from the console.     </P
397
><P
398
><TABLE
399
BORDER="5"
400
BGCOLOR="#E0E0F0"
401
WIDTH="70%"
402
><TR
403
><TD
404
><PRE
405
CLASS="SCREEN"
406
>RedBoot&#62; <TT
407
CLASS="USERINPUT"
408
><B
409
>fconfig -l</B
410
></TT
411
>
412
Run script at boot: false
413
Use BOOTP for network configuration: false
414
Local IP address: 192.168.1.29
415
Default server IP address: 192.168.1.101
416
DNS server IP address: 192.168.1.1
417
GDB connection port: 9000
418
Network debug at boot time: false</PRE
419
></TD
420
></TR
421
></TABLE
422
></P
423
><P
424
>The following example sets a boot script and then shows it running.
425
    </P
426
><P
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
>fconfig</B
439
></TT
440
>
441
Run script at boot: false <TT
442
CLASS="USERINPUT"
443
><B
444
>t</B
445
></TT
446
>
447
      Boot script:
448
Enter script, terminate with empty line
449
&#62;&#62; <TT
450
CLASS="USERINPUT"
451
><B
452
>fi li</B
453
></TT
454
>
455
    Boot script timeout: 0 <TT
456
CLASS="USERINPUT"
457
><B
458
>10</B
459
></TT
460
>
461
Use BOOTP for network configuration: false .
462
Update RedBoot non-volatile configuration - continue (y/n)? <TT
463
CLASS="USERINPUT"
464
><B
465
>y</B
466
></TT
467
>
468
... Erase from 0xa0fc0000-0xa0fe0000: .
469
... Program from 0x8c021f60-0x8c022360 at 0xa0fc0000: .
470
RedBoot&#62;
471
RedBoot(tm) debug environment - built 08:22:24, Aug 23 2000
472
Copyright (C) 2000, Red Hat, Inc.
473
 
474
 
475
RAM: 0x8c000000-0x8c800000
476
flash: 0xa0000000 - 0xa1000000, 128 blocks of 0x00020000 bytes ea.
477
Socket Communications, Inc: Low Power Ethernet CF Revision C \
478
5V/3.3V 08/27/98 IP: 192.168.1.29, Default server: 192.168.1.101 \
479
== Executing boot script in 10 seconds - enter ^C to abort
480
RedBoot&#62; <TT
481
CLASS="USERINPUT"
482
><B
483
>fi li</B
484
></TT
485
>
486
Name              flash addr   Mem addr    Length    Entry point
487
RedBoot          0xA0000000   0xA0000000  0x020000  0x80000000
488
RedBoot config   0xA0FC0000   0xA0FC0000  0x020000  0x00000000
489
FIS directory    0xA0FE0000   0xA0FE0000  0x020000  0x00000000
490
RedBoot&#62;</PRE
491
></TD
492
></TR
493
></TABLE
494
></P
495
><DIV
496
CLASS="NOTE"
497
><BLOCKQUOTE
498
CLASS="NOTE"
499
><P
500
><B
501
>NOTE: </B
502
>The bold characters above indicate where something was entered on the
503
console. As you can see, the <B
504
CLASS="COMMAND"
505
>fi li</B
506
> command
507
at the end came from the script,
508
not the console. Once the script is executed, command processing reverts to
509
the console. </P
510
></BLOCKQUOTE
511
></DIV
512
><P
513
><DIV
514
CLASS="NOTE"
515
><BLOCKQUOTE
516
CLASS="NOTE"
517
><P
518
><B
519
>NOTE: </B
520
>RedBoot supports the notion of a boot script timeout, i.e. a period of
521
time that RedBoot waits before executing the boot time script.  This period
522
is primarily to allow the possibility of canceling the script.  Since
523
a timeout value of zero (0) seconds would never allow the script to
524
be aborted or canceled, this value is not allowed.  If the timeout
525
value is zero, then RedBoot will abort the script execution immediately.</P
526
></BLOCKQUOTE
527
></DIV
528
>
529
On many targets, RedBoot may be configured to run from ROM or it may be
530
configured to run from RAM. Other configurations are also possible. All
531
RedBoot configurations will execute the boot script, but in certain cases
532
it may be desirable to limit the execution of certain script commands to
533
one RedBoot configuration or the other. This can be accomplished by
534
prepending <TT
535
CLASS="COMPUTEROUTPUT"
536
>{&lt;startup type&#62;}</TT
537
> to the
538
commands which should be executed only by the RedBoot configured for the
539
specified startup type. The following boot script illustrates this concept
540
by having the ROM based RedBoot load and run the RAM based RedBoot. The RAM
541
based RedBoot will then list flash images.</P
542
><P
543
><TABLE
544
BORDER="5"
545
BGCOLOR="#E0E0F0"
546
WIDTH="70%"
547
><TR
548
><TD
549
><PRE
550
CLASS="SCREEN"
551
>RedBoot&#62; <TT
552
CLASS="USERINPUT"
553
><B
554
>fco</B
555
></TT
556
>
557
Run script at boot: false <TT
558
CLASS="USERINPUT"
559
><B
560
>t</B
561
></TT
562
>
563
Boot script:
564
Enter script, terminate with empty line
565
&#62;&#62; <TT
566
CLASS="USERINPUT"
567
><B
568
>{ROM}fis load RedBoot[RAM]</B
569
></TT
570
>
571
&#62;&#62; <TT
572
CLASS="USERINPUT"
573
><B
574
>{ROM}go</B
575
></TT
576
>
577
&#62;&#62; <TT
578
CLASS="USERINPUT"
579
><B
580
>{RAM}fis li</B
581
></TT
582
>
583
&#62;&#62;
584
Boot script timeout (1000ms resolution): <TT
585
CLASS="USERINPUT"
586
><B
587
>2</B
588
></TT
589
>
590
Use BOOTP for network configuration: <TT
591
CLASS="USERINPUT"
592
><B
593
>false</B
594
></TT
595
>
596
 ...
597
Update RedBoot non-volatile configuration - continue (y/n)? <TT
598
CLASS="USERINPUT"
599
><B
600
>y</B
601
></TT
602
>
603
... Unlock from 0x007c0000-0x007e0000: .
604
... Erase from 0x007c0000-0x007e0000: .
605
... Program from 0xa0015030-0xa0016030 at 0x007df000: .
606
... Lock from 0x007c0000-0x007e0000: .
607
RedBoot&#62; <TT
608
CLASS="USERINPUT"
609
><B
610
>reset</B
611
></TT
612
>
613
... Resetting.
614
+Ethernet eth0: MAC address 00:80:4d:46:01:05
615
IP: 192.168.1.153, Default server: 192.168.1.10
616
 
617
RedBoot(tm) bootstrap and debug environment [ROM]
618
Red Hat certified release, version R1.xx - built 17:37:36, Aug 14 2001
619
 
620
Platform: IQ80310 (XScale)
621
Copyright (C) 2000, 2001, Red Hat, Inc.
622
 
623
RAM: 0xa0000000-0xa2000000, 0xa001b088-0xa1fdf000 available
624
FLASH: 0x00000000 - 0x00800000, 64 blocks of 0x00020000 bytes each.
625
== Executing boot script in 2.000 seconds - enter ^C to abort
626
RedBoot&#62; <TT
627
CLASS="USERINPUT"
628
><B
629
>fis load RedBoot[RAM]</B
630
></TT
631
>
632
RedBoot&#62; <TT
633
CLASS="USERINPUT"
634
><B
635
>go</B
636
></TT
637
>
638
+Ethernet eth0: MAC address 00:80:4d:46:01:05
639
IP: 192.168.1.153, Default server: 192.168.1.10
640
 
641
RedBoot(tm) bootstrap and debug environment [RAM]
642
Red Hat certified release, version R1.xx - built 13:03:47, Aug 14 2001
643
 
644
Platform: IQ80310 (XScale)
645
Copyright (C) 2000, 2001, Red Hat, Inc.
646
 
647
RAM: 0xa0000000-0xa2000000, 0xa0057fe8-0xa1fdf000 available
648
FLASH: 0x00000000 - 0x00800000, 64 blocks of 0x00020000 bytes each.
649
== Executing boot script in 2.000 seconds - enter ^C to abort
650
RedBoot&#62; <TT
651
CLASS="USERINPUT"
652
><B
653
>fis li</B
654
></TT
655
>
656
Name              FLASH addr  Mem addr    Length      Entry point
657
RedBoot           0x00000000  0x00000000  0x00040000  0x00002000
658
RedBoot config    0x007DF000  0x007DF000  0x00001000  0x00000000
659
FIS directory     0x007E0000  0x007E0000  0x00020000  0x00000000
660
RedBoot&#62;</PRE
661
></TD
662
></TR
663
></TABLE
664
></P
665
></DIV
666
><DIV
667
CLASS="NAVFOOTER"
668
><HR
669
ALIGN="LEFT"
670
WIDTH="100%"><TABLE
671
SUMMARY="Footer navigation table"
672
WIDTH="100%"
673
BORDER="0"
674
CELLPADDING="0"
675
CELLSPACING="0"
676
><TR
677
><TD
678
WIDTH="33%"
679
ALIGN="left"
680
VALIGN="top"
681
><A
682
HREF="fis-write-command.html"
683
ACCESSKEY="P"
684
>Prev</A
685
></TD
686
><TD
687
WIDTH="34%"
688
ALIGN="center"
689
VALIGN="top"
690
><A
691
HREF="ecos-ref.html"
692
ACCESSKEY="H"
693
>Home</A
694
></TD
695
><TD
696
WIDTH="33%"
697
ALIGN="right"
698
VALIGN="top"
699
><A
700
HREF="executing-programs.html"
701
ACCESSKEY="N"
702
>Next</A
703
></TD
704
></TR
705
><TR
706
><TD
707
WIDTH="33%"
708
ALIGN="left"
709
VALIGN="top"
710
>fis write</TD
711
><TD
712
WIDTH="34%"
713
ALIGN="center"
714
VALIGN="top"
715
><A
716
HREF="redboot-commands-and-examples.html"
717
ACCESSKEY="U"
718
>Up</A
719
></TD
720
><TD
721
WIDTH="33%"
722
ALIGN="right"
723
VALIGN="top"
724
>Executing Programs from RedBoot</TD
725
></TR
726
></TABLE
727
></DIV
728
></BODY
729
></HTML
730
>

powered by: WebSVN 2.1.0

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