blob: 9fcb1ad3464a165e690791b65691a829d6d4f306 [file] [log] [blame]
Nico Huber1f693db2023-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-CONFIG 8 "@MAN_DATE@" "flashprog-config-@VERSION@" "@MAN_DATE@"
44.SH NAME
45flashprog-config \- read and write status and configuration registers of flash chips
46.SH SYNOPSIS
47.I flashprog config \fR[\fIget\fR] <options> <setting>
48.br
49.I flashprog config \ set \ \fR<options> [\fB\-\-temporary\fR] <setting> <value>
50.sp
51Where generic <options> are:
52.RS 4
53\fB\-p\fR <programmername>[:<parameters>] [\fB\-c\fR <chipname>]
54.br
55[\fB\-V\fR[\fBV\fR[\fBV\fR]]] [\fB-o\fR <logfile>] [\fB\-h\fR]
56.RE
57
58.SH DESCRIPTION
59.B flashprog-config
60is a utility for reading and writing status and configuration register
61bits of flash chips. Currently, it supports only SPI NOR chips.
62
63.SH OPERATIONS
64You can specify one of
65.BR get " or " set ", "
66or no operation which defaults to reading a setting.
67.PP
68.BR get " <setting>"
69.RS 4
70Read and print the value of the given setting. See
71.BR SETTINGS " below."
72.RE
73.PP
74.BR set " [" \-\-temporary "] <setting> <value>"
75.RS 4
76Write the given value to the setting. See
77.BR SETTINGS " and " VALUES " below."
78.sp
79When the
80.B \-\-temporary
81option is provided, flashprog will attempt to write a temporary
82value that is not stored to flash. This requires special support
83by the flash chip for a volatile write status register command.
84The new value will be lost upon reset of the flash chip. Hence,
85it is futile to use this with external programmers that toggle
86power to the flash chip (e.g. Dediprog).
87.RE
88
89.SH SETTINGS
90.PP
91.B qe, quad-enable
92.RS 4
93SPI NOR flash chips often support muxing some of their pins (usually
94/WP and /HOLD) with additional i/o lines. This enables them to transfer
95four bits at once when the
96.B quad-enable
97bit is set.
98.RE
99
100.SH VALUES
101.PP
102.BR false ", " true
103.RS 4
104The values
105.BR false " and " true
106will be converted to
107.BR 0 " and " 1
108respectively.
109.RE
110.PP
111.RB "natural numbers: " 0 ", " 1 ", ..."
112.RS 4
113When natural numbers are given, the least-significant bits of their
114binary representation will be written to a setting.
115.RE
116
117.SH OPTIONS
118All operations require the
119.B -p/--programmer
120option to be used (please see
121.MR flashprog 8
122for more information on programmer support and parameters).
123.PP
124.BR \-p ", " \-\-programmer " <name>[" : "<parameter>[" , "<parameter>]...]"
125.RS 4
126Specify the programmer device. This is mandatory for all operations.
127Please see the
128.MR flashprog 8
129manual for a list of currently supported programmers and their parameters.
130.RE
131.PP
132.BR \-c ", " \-\-chip " <chipname>"
133.RS 4
134Probe only for the specified flash ROM chip. This option takes the chip name as
135printed by
136.B "flashprog \-L"
137without the vendor name as parameter. Please note that the chip name is
138case sensitive.
139.RE
140.PP
141.BR \-V ", " \-\-verbose
142.RS 4
143More verbose output. This option can be supplied multiple times
144(max. 3 times, i.e.
145.BR \-VVV )
146for even more debug output.
147.RE
148.PP
149.BR \-o ", " \-\-output " <logfile>"
150.RS 4
151Save the full debug log to
152.BR <logfile> .
153If the file already exists, it will be overwritten. This is the recommended
154way to gather logs from flashprog because they will be verbose even if the
155on-screen messages are not verbose and don't require output redirection.
156.RE
157.PP
158.BR \-h ", " \-\-help
159.RS 4
160Show a help text and exit.
161.RE
162.PP
163.BR \-\-temporary
164.RS 4
165Try to use a volatile write status register command. See
166.BR set " under " OPERATIONS " above."
167.RE
168
169.SH EXAMPLES
170To read the
171.B quad-enable
172setting of the internal BIOS flash:
173.sp
174.RS 2
175.B flashprog config -p internal quad-enable
176.sp
177.RE
178or
179.sp
180.RS 2
181.B flashprog config get -p internal quad-enable
182.sp
183.RE
184To temporarily set the
185.B quad-enable
186bit of a chip connected to an FT4222H:
187.sp
188.RS 2
189.B flashprog config set -p ft4222_spi --temporary quad-enable 1
190.RE
191
192.SH EXIT STATUS
193flashprog exits with 0 on success, 1 on most failures but with 3 if a call to mmap() fails.
194
195.SH REQUIREMENTS
196flashprog needs different access permissions for different programmers.
197See this section in the
198.MR flashprog 8
199manual for details.
200
201.SH BUGS
202You can report bugs, ask us questions or send success reports
203via our communication channels listed here:
204.URLB "https://www.flashprog.org/Contact" "" .
205.sp
206
207.SH LICENSE
208.B flashprog
209is covered by the GNU General Public License (GPL), version 2. Some files are
210additionally available under any later version of the GPL.
211
212.SH COPYRIGHT
213.br
214Please see the individual files.
215.PP
216This manual page was written by Nico Huber and is derived from the
217.MR flashprog 8
218manual. It is licensed under the terms of the GNU GPL (version 2 or later).
219
220.SH SEE ALSO
221.MR flashprog 8