source: SVN/cambria/redboot/docs/redboot/html/persistent-state-flash.html @ 1

Last change on this file since 1 was 1, checked in by Tim Harvey, 2 years ago

restored latest version of files from server backup

Signed-off-by: Tim Harvey <tharvey@…>

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