Nico Huber | 8f7122c | 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-WRITE-PROTECT 8 "@MAN_DATE@" "flashprog-write-protect-@VERSION@" "@MAN_DATE@" |
| 44 | |
| 45 | .SH NAME |
| 46 | flashprog-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 |
| 61 | Where 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 |
| 68 | and 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 |
| 75 | is a utility for reading and writing the write-protection settings |
| 76 | of flash chips. Currently, it supports only block protection of SPI NOR |
| 77 | chips. |
| 78 | |
| 79 | .SH OPERATIONS |
| 80 | You can specify one operation per call. |
| 81 | .B status |
| 82 | is the default operation. |
| 83 | .PP |
| 84 | .B status |
| 85 | .RS 4 |
| 86 | Shows the write-protection state, including the currently |
| 87 | programmed protection range. |
| 88 | .RE |
| 89 | .PP |
| 90 | .B list |
| 91 | .RS 4 |
| 92 | Prints a list of write-protection ranges supported for the |
| 93 | flash chip. |
| 94 | .RE |
| 95 | .PP |
| 96 | .B disable |
| 97 | .RS 4 |
| 98 | Disables write protection locks. The configured range usually |
| 99 | stays as is, but it will be possible to override it. |
| 100 | .RE |
| 101 | .PP |
| 102 | .B enable |
| 103 | .RS 4 |
| 104 | Enables write protection locks. The write-protection range |
| 105 | should be set before running the enable operation. |
| 106 | .RE |
| 107 | .PP |
| 108 | .BR range " <start>,<len>" |
| 109 | .RS 4 |
| 110 | Configures the protected range. |
| 111 | .BR start " and " length |
| 112 | specify the range in decimal, octal (\fB0\fR prefix), |
| 113 | or hexadecimal (\fB0x\fR prefix) numbers of bytes. |
| 114 | Any 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 |
| 120 | Configures the protected range, matching a region of the loaded |
| 121 | layout (from a file or flash, see the respective option-descriptions in |
| 122 | .MR flashprog 8 |
| 123 | for possible layout sources). |
| 124 | .RE |
| 125 | |
| 126 | .SH OPTIONS |
| 127 | All operations require the |
| 128 | .B -p/--programmer |
| 129 | option to be used (please see |
| 130 | .MR flashprog 8 |
| 131 | for more information on programmer support and parameters). |
| 132 | .PP |
| 133 | .BR \-p ", " \-\-programmer " <name>[" : "<parameter>[" , "<parameter>]...]" |
| 134 | .RS 4 |
| 135 | Specify the programmer device. This is mandatory for all operations. |
| 136 | Please see the |
| 137 | .MR flashprog 8 |
| 138 | manual for a list of currently supported programmers and their parameters. |
| 139 | .RE |
| 140 | .PP |
| 141 | .BR \-c ", " \-\-chip " <chipname>" |
| 142 | .RS 4 |
| 143 | Probe only for the specified flash ROM chip. This option takes the chip name as |
| 144 | printed by |
| 145 | .B "flashprog \-L" |
| 146 | without the vendor name as parameter. Please note that the chip name is |
| 147 | case sensitive. |
| 148 | .RE |
| 149 | .PP |
| 150 | .BR \-V ", " \-\-verbose |
| 151 | .RS 4 |
| 152 | More verbose output. This option can be supplied multiple times |
| 153 | (max. 3 times, i.e. |
| 154 | .BR \-VVV ) |
| 155 | for even more debug output. |
| 156 | .RE |
| 157 | .PP |
| 158 | .BR \-o ", " \-\-output " <logfile>" |
| 159 | .RS 4 |
| 160 | Save the full debug log to |
| 161 | .BR <logfile> . |
| 162 | If the file already exists, it will be overwritten. This is the recommended |
| 163 | way to gather logs from flashprog because they will be verbose even if the |
| 164 | on-screen messages are not verbose and don't require output redirection. |
| 165 | .RE |
| 166 | .PP |
| 167 | .BR \-h ", " \-\-help |
| 168 | .RS 4 |
| 169 | Show a help text and exit. |
| 170 | .RE |
| 171 | .PP |
| 172 | .RB ( -l | --layout ") <layout-file>, " --fmap-file " <fmap-file>, " --fmap ", " --ifd |
| 173 | .RS 4 |
| 174 | Please see the |
| 175 | .MR flashrom 8 |
| 176 | manual for information about layout files and other layout sources. |
| 177 | .RE |
| 178 | .PP |
| 179 | .B \-\-temporary |
| 180 | .RS 4 |
| 181 | When the |
| 182 | .B \-\-temporary |
| 183 | option is provided for any operation that alters the flash chip's |
| 184 | configuration, flashprog will attempt to write a temporary |
| 185 | value that is not stored to flash. This requires special support |
| 186 | by the flash chip for a volatile write status register command. |
| 187 | The new value will be lost upon reset of the flash chip. Hence, |
| 188 | it is futile to use this with external programmers that toggle |
| 189 | power to the flash chip (e.g. Dediprog). |
| 190 | .RE |
| 191 | |
| 192 | .SH EXAMPLES |
| 193 | To just print the current write-protection state of the internal |
| 194 | BIOS flash: |
| 195 | .sp |
| 196 | .RS 2 |
| 197 | .B flashprog write-protect -p internal |
| 198 | .sp |
| 199 | .RE |
| 200 | or |
| 201 | .sp |
| 202 | .RS 2 |
| 203 | .B flashprog write-protect status -p internal |
| 204 | .sp |
| 205 | .RE |
| 206 | To 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 |
| 213 | flashprog exits with 0 on success, 1 on most failures but with 3 if a call to mmap() fails. |
| 214 | |
| 215 | .SH REQUIREMENTS |
| 216 | flashprog needs different access permissions for different programmers. |
| 217 | See this section in the |
| 218 | .MR flashprog 8 |
| 219 | manual for details. |
| 220 | |
| 221 | .SH BUGS |
| 222 | You can report bugs, ask us questions or send success reports |
| 223 | via our communication channels listed here: |
| 224 | .URLB "https://www.flashprog.org/Contact" "" . |
| 225 | .sp |
| 226 | |
| 227 | .SH LICENSE |
| 228 | .B flashprog |
| 229 | is covered by the GNU General Public License (GPL), version 2. Some files are |
| 230 | additionally available under any later version of the GPL. |
| 231 | |
| 232 | .SH COPYRIGHT |
| 233 | .br |
| 234 | Please see the individual files. |
| 235 | .PP |
| 236 | This manual page was written by Nico Huber and is derived from the |
| 237 | flashprog(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 |