blob: d5363743459c422856b1520762358558492699b2 [file] [log] [blame]
Nico Huber8f7122c2023-02-11 18:28:33 +01001.\" Load the www device when using groff; provide a fallback for groff's MTO macro that formats email addresses.
2.ie \n[.g] \
3. mso www.tmac
4.el \{
5. de MTO
6 \\$2 \(la\\$1 \(ra\\$3 \
7. .
8.\}
9.\" Create wrappers for .MTO and .URL that print only text on systems w/o groff or if not outputting to a HTML
10.\" device. To that end we need to distinguish HTML output on groff from other configurations first.
11.nr groffhtml 0
12.if \n[.g] \
13. if "\*[.T]"html" \
14. nr groffhtml 1
15.\" For code reuse it would be nice to have a single wrapper that gets its target macro as parameter.
16.\" However, this did not work out with NetBSD's and OpenBSD's groff...
17.de URLB
18. ie (\n[groffhtml]==1) \{\
19. URL \\$@
20. \}
21. el \{\
22. ie "\\$2"" \{\
23. BR "\\$1" "\\$3"
24. \}
25. el \{\
26. RB "\\$2 \(la" "\\$1" "\(ra\\$3"
27. \}
28. \}
29..
30.de MTOB
31. ie (\n[groffhtml]==1) \{\
32. MTO \\$@
33. \}
34. el \{\
35. ie "\\$2"" \{\
36. BR "\\$1" "\\$3"
37. \}
38. el \{\
39. RB "\\$2 \(la" "\\$1" "\(ra\\$3"
40. \}
41. \}
42..
43.TH FLASHPROG-WRITE-PROTECT 8 "@MAN_DATE@" "flashprog-write-protect-@VERSION@" "@MAN_DATE@"
44
45.SH NAME
46flashprog-write-protect \- control write-protection settings of flash chips
47
48.SH SYNOPSIS
49.I flashprog write-protect \fR[\fIstatus\fR] <options>
50.br
51.I flashprog write-protect \ list \ \ \ \fR<options>
52.br
53.I flashprog write-protect \ disable \fR<options> [\fB\-\-temporary\fR]
54.br
55.I flashprog write-protect \ enable \ \fR<options> [\fB\-\-temporary\fR]
56.br
57.I flashprog write-protect \ range \ \ \fR<options> [\fB\-\-temporary\fR] <start>\fB,\fR<len>
58.br
59.I flashprog write-protect \ region \ \fR<options> [\fB\-\-temporary\fR] <region-name>
60.sp
61Where generic <options> are:
62.RS 4
63\fB\-p\fR <programmername>[:<parameters>] [\fB\-c\fR <chipname>]
64.br
65[\fB\-V\fR[\fBV\fR[\fBV\fR]]] [\fB-o\fR <logfile>] [\fB\-h\fR]
66.RE
67.sp
68and layout <options> are:
69.RS 4
70[(\fB-l\fR|\fB--layout\fR) <layout-file>|\fB--fmap\fR <fmap-file>|\fB--fmap\fR|\fB--ifd\fR]
71.RE
72
73.SH DESCRIPTION
74.B flashprog-write-protect
75is a utility for reading and writing the write-protection settings
76of flash chips. Currently, it supports only block protection of SPI NOR
77chips.
78
79.SH OPERATIONS
80You can specify one operation per call.
81.B status
82is the default operation.
83.PP
84.B status
85.RS 4
86Shows the write-protection state, including the currently
87programmed protection range.
88.RE
89.PP
90.B list
91.RS 4
92Prints a list of write-protection ranges supported for the
93flash chip.
94.RE
95.PP
96.B disable
97.RS 4
98Disables write protection locks. The configured range usually
99stays as is, but it will be possible to override it.
100.RE
101.PP
102.B enable
103.RS 4
104Enables write protection locks. The write-protection range
105should be set before running the enable operation.
106.RE
107.PP
108.BR range " <start>,<len>"
109.RS 4
110Configures the protected range.
111.BR start " and " length
112specify the range in decimal, octal (\fB0\fR prefix),
113or hexadecimal (\fB0x\fR prefix) numbers of bytes.
114Any zero-length range will unprotect the entire flash
115(e.g. \fBrange 0,0\fR).
116.RE
117.PP
118.BR region " <region-name>"
119.RS 4
120Configures the protected range, matching a region of the loaded
121layout (from a file or flash, see the respective option-descriptions in
122.MR flashprog 8
123for possible layout sources).
124.RE
125
126.SH OPTIONS
127All operations require the
128.B -p/--programmer
129option to be used (please see
130.MR flashprog 8
131for more information on programmer support and parameters).
132.PP
133.BR \-p ", " \-\-programmer " <name>[" : "<parameter>[" , "<parameter>]...]"
134.RS 4
135Specify the programmer device. This is mandatory for all operations.
136Please see the
137.MR flashprog 8
138manual for a list of currently supported programmers and their parameters.
139.RE
140.PP
141.BR \-c ", " \-\-chip " <chipname>"
142.RS 4
143Probe only for the specified flash ROM chip. This option takes the chip name as
144printed by
145.B "flashprog \-L"
146without the vendor name as parameter. Please note that the chip name is
147case sensitive.
148.RE
149.PP
150.BR \-V ", " \-\-verbose
151.RS 4
152More verbose output. This option can be supplied multiple times
153(max. 3 times, i.e.
154.BR \-VVV )
155for even more debug output.
156.RE
157.PP
158.BR \-o ", " \-\-output " <logfile>"
159.RS 4
160Save the full debug log to
161.BR <logfile> .
162If the file already exists, it will be overwritten. This is the recommended
163way to gather logs from flashprog because they will be verbose even if the
164on-screen messages are not verbose and don't require output redirection.
165.RE
166.PP
167.BR \-h ", " \-\-help
168.RS 4
169Show a help text and exit.
170.RE
171.PP
172.RB ( -l | --layout ") <layout-file>, " --fmap-file " <fmap-file>, " --fmap ", " --ifd
173.RS 4
174Please see the
175.MR flashrom 8
176manual for information about layout files and other layout sources.
177.RE
178.PP
179.B \-\-temporary
180.RS 4
181When the
182.B \-\-temporary
183option is provided for any operation that alters the flash chip's
184configuration, flashprog will attempt to write a temporary
185value that is not stored to flash. This requires special support
186by the flash chip for a volatile write status register command.
187The new value will be lost upon reset of the flash chip. Hence,
188it is futile to use this with external programmers that toggle
189power to the flash chip (e.g. Dediprog).
190.RE
191
192.SH EXAMPLES
193To just print the current write-protection state of the internal
194BIOS flash:
195.sp
196.RS 2
197.B flashprog write-protect -p internal
198.sp
199.RE
200or
201.sp
202.RS 2
203.B flashprog write-protect status -p internal
204.sp
205.RE
206To temporarily enable the currently configured range:
207.sp
208.RS 2
209.B flashprog write-protect enable -p internal --temporary
210.RE
211
212.SH EXIT STATUS
213flashprog exits with 0 on success, 1 on most failures but with 3 if a call to mmap() fails.
214
215.SH REQUIREMENTS
216flashprog needs different access permissions for different programmers.
217See this section in the
218.MR flashprog 8
219manual for details.
220
221.SH BUGS
222You can report bugs, ask us questions or send success reports
223via our communication channels listed here:
224.URLB "https://www.flashprog.org/Contact" "" .
225.sp
226
227.SH LICENSE
228.B flashprog
229is covered by the GNU General Public License (GPL), version 2. Some files are
230additionally available under any later version of the GPL.
231
232.SH COPYRIGHT
233.br
234Please see the individual files.
235.PP
236This manual page was written by Nico Huber and is derived from the
237flashprog(8) manual. It is licensed under the terms of the GNU GPL
238(version 2 or later).
239
240.SH SEE ALSO
241.MR flashprog 8