Since some people disapprove of white space cleanups mixed in regular commits
[coreboot.git] / util / nvramtool / nvramtool.8
1 .\"***************************************************************************\
2 .\" nvramtool.8
3 .\"***************************************************************************
4 .\"  Copyright (C) 2002, 2003 The Regents of the University of California.
5 .\"  Produced at the Lawrence Livermore National Laboratory.
6 .\"  Written by David S. Peterson <dsp@llnl.gov> <dave_peterson@pobox.com>.
7 .\"  UCRL-CODE-2003-012
8 .\"  All rights reserved.
9 .\"
10 .\"  This file is part of nvramtool, a utility for reading/writing coreboot
11 .\"  parameters and displaying information from the coreboot table.
12 .\"  For details, see http://coreboot.org/nvramtool.
13 .\"
14 .\"  Please also read the file DISCLAIMER which is included in this software
15 .\"  distribution.
16 .\"
17 .\"  This program is free software; you can redistribute it and/or modify it
18 .\"  under the terms of the GNU General Public License (as published by the
19 .\"  Free Software Foundation) version 2, dated June 1991.
20 .\"
21 .\"  This program is distributed in the hope that it will be useful, but
22 .\"  WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
23 .\"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the terms and
24 .\"  conditions of the GNU General Public License for more details.
25 .\"
26 .\"  You should have received a copy of the GNU General Public License along
27 .\"  with this program; if not, write to the Free Software Foundation, Inc.,
28 .\"  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
29 .\"***************************************************************************/
30 .TH NVRAMTOOL 8 "September 2008"
31 .SH NAME
32 nvramtool \- read/write coreboot-related information
33 .SH SYNOPSIS
34 .B "nvramtool [OPTS] [-n] -r NAME"
35 .br
36 .B "nvramtool [OPTS] -e NAME"
37 .br
38 .B "nvramtool [OPTS] -a"
39 .br
40 .B "nvramtool [OPTS] -w NAME=VALUE"
41 .br
42 .B "nvramtool [OPTS] -p INPUT_FILE"
43 .br
44 .B "nvramtool [OPTS] -i"
45 .br
46 .B "nvramtool [OPTS] -c [VALUE]"
47 .br
48 .B "nvramtool [OPTS] -l [ARG]"
49 .br
50 .B "nvramtool [OPTS] -d"
51 .br
52 .B "nvramtool [OPTS] -Y"
53 .br
54 .B "nvramtool [OPTS] -b OUTPUT_FILE"
55 .br
56 .B "nvramtool [OPTS] -B INPUT_FILE"
57 .br
58 .B "nvramtool [OPTS] -x"
59 .br
60 .B "nvramtool [OPTS] -X DUMPFILE"
61 .br
62 .B "nvramtool [OPTS] -v"
63 .br
64 .B "nvramtool [OPTS] -h"
65 .SH DESCRIPTION
66 .B "nvramtool"
67 is a utility for reading/writing coreboot parameters and displaying
68 information from the coreboot table.
69
70 The coreboot table resides in low physical memory.  It is created at boot
71 time by coreboot, and contains various system information such as the type
72 of mainboard in use.  It specifies locations in the CMOS (nonvolatile RAM)
73 where the coreboot parameters are stored.
74
75 This program is intended for (x86-based) systems that use coreboot.  For
76 information about coreboot, see
77 .br
78 http://www.coreboot.org/.
79 .SH PARAMETERS
80 .TP
81 .B "[-n] -r NAME"
82 Show the value of the coreboot parameter given by
83 .B "NAME."
84 If
85 .B "-n"
86 is specified, show only the value.  Otherwise show both parameter name and
87 value.
88 .TP
89 .B "-e NAME"
90 Show all possible values for parameter given by
91 .B "NAME."
92 .TP
93 .B "-a"
94 Show the names and values for all coreboot parameters.
95 .TP
96 .B "-w NAME=VALUE"
97 Assign
98 .B "VALUE"
99 to coreboot parameter given by
100 .B "NAME."
101 .TP
102 .B "-p INPUT_FILE"
103 Assign values to coreboot parameters according to the contents of
104 .B "INPUT_FILE."
105 The format of this file is described below.
106 .TP
107 .B "-i"
108 This is similar to the
109 .B "-p"
110 option, except that the contents of the input file are taken from standard
111 input.
112 .TP
113 .B "-c [VALUE]"
114 If
115 .B "VALUE"
116 is present then set the CMOS checksum for the coreboot parameters to
117 .B "VALUE."
118 Otherwise, show the checksum value.
119 .TP
120 .B "-l [ARG]"
121 If
122 .B "ARG"
123 is present then show information from the coreboot table as specified by
124 .B "ARG."
125 Otherwise show all possible values for
126 .B "ARG."
127 .TP
128 .B "-d"
129 Do a low-level dump of the coreboot table.
130 .TP
131 .B "-Y"
132 Write CMOS layout information to standard output.  If redirected to a file,
133 the layout information may be used as input for the
134 .B "'-y LAYOUT_FILE'"
135 option (see below).
136 .TP
137 .B "-b OUTPUT_FILE"
138 Write the contents of CMOS memory to the binary file
139 .B "OUTPUT_FILE."
140 The first 14 bytes of
141 .B "OUTPUT_FILE"
142 do not contain actual CMOS data, and are always written as zeros.  This is
143 because the first 14 bytes of the CMOS area do not contain CMOS memory.  These
144 bytes are involved with the functioning of the real time clock.
145 .TP
146 .B "-B INPUT_FILE"
147 Read binary data from
148 .B "INPUT_FILE"
149 and write the data to CMOS memory.  The first 14 bytes of
150 .B "INPUT_FILE"
151 are skipped and data is written to CMOS starting at the 15th byte of the CMOS
152 area.  This is because the first 14 bytes of the CMOS area do not contain CMOS
153 memory.  These bytes are involved with the functioning of the real time clock.
154 .TP
155 .B "-x"
156 Show a hex dump of all CMOS data.  The first 14 bytes of the dump do not
157 contain actual CMOS data, and are always shown as zeros.  This is because the
158 first 14 bytes of the CMOS area do not contain CMOS memory.  These bytes are
159 involved with the functioning of the real time clock.
160 .TP
161 .B "-X DUMPFILE"
162 Read binary data from
163 .B "DUMPFILE"
164 (presumably a CMOS dumpfile created using the
165 .B "-b OUTPUT_FILE"
166 option) and show a hex dump of the data.
167 .TP
168 .B "-v"
169 Show version information for this program.
170 .TP
171 .B "-h"
172 Show a help message for this program.
173 .SH "OPTIONS"
174 In all cases above,
175 .B "[OPTS]"
176 evaluates to the following:
177
178 .B "    [-y LAYOUT_FILE | -t]"
179
180 The
181 .B "'-y LAYOUT_FILE'"
182 option tells nvramtool to obtain CMOS layout information from the contents of
183 .B "LAYOUT_FILE."
184 Likewise, the
185 .B "'-t'"
186 option tells nvramtool to obtain CMOS layout information from the CMOS option
187 table (contained within the coreboot table).  If neither option is
188 specified, the CMOS option table is used by default.
189 .B "LAYOUT_FILE"
190 follows the format of the
191 .B "cmos.layout"
192 files provided by coreboot.
193
194 If the coreboot installed on your system was built without specifying
195 .B "CONFIG_HAVE_OPTION_TABLE,"
196 then the coreboot table will not contain a CMOS option table.  In this case,
197 the
198 .B "'-y LAYOUT_FILE'"
199 option must be used.
200
201 These two options are silently ignored when used in combination with other
202 options (such as
203 .B "-h,"
204 for instance) for which they are not applicable.
205 .SH FILE FORMAT
206 For the
207 .B "-p"
208 option,
209 .B "INPUT_FILE"
210 must consist of a sequence of lines such that each line is either a blank
211 line, a comment, or an assignment.  A blank line consists only of zero or
212 more whitespace characters (spaces and tabs).  A comment is constructed as
213 follows:
214
215 .B "    [ws]#[text]"
216
217 Here,
218 .B "[ws]"
219 indicates optional whitespace characters and
220 .B "[text]"
221 indicates optional text.  Blank lines and comments are both ignored.  An
222 assignment is constructed as follows:
223
224 .B "    [ws]NAME[ws]=[ws]VALUE[ws]"
225
226 Here,
227 .B "NAME"
228 is the name of a coreboot parameter and
229 .B "VALUE"
230 is the value that will be assigned to
231 .B "NAME."
232 .B "VALUE"
233 is allowed to contain whitespace characters, but it must begin and end with
234 nonwhitespace characters.  Note that each comment must appear on a line by
235 itself.  If you attempt to add a comment to the end of an assignment, then the
236 comment will be interpreted as part of
237 .B "VALUE."
238 It is useful to observe that the output produced by both the
239 .B "-a"
240 and the
241 .B "'[-n] NAME'"
242 options (without
243 .B "-n"
244 specified) adheres to this file format.
245 .SH BUGS
246 This program does not implement any type of synchronization to ensure that
247 different processes don't stomp on each other when trying to access the
248 nonvolatile RAM simultaneously.  Therefore, corruption of the BIOS parameter
249 values may occur if multiple instances of this program are executed
250 concurrently.
251 .SH AUTHORS
252 David S. Peterson <dsp@llnl.gov> <dave_peterson@pobox.com>
253 .br
254 Stefan Reinauer <stepan@coresystems.de>