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