FLASHPROG-WRITE-PROTECT(8) 2024-11-03 FLASHPROG-WRITE-PROTECT(8) NAME flashprog-write-protect - control write-protection settings of flash chips SYNOPSIS flashprog write-protect [status] flashprog write-protect list flashprog write-protect disable [--temporary] flashprog write-protect enable [--temporary] flashprog write-protect range [--temporary] , flashprog write-protect region [--temporary] Where generic are: -p [:] [-c ] [-V[V[V]]] [-o ] [-h] and layout are: [(-l|--layout) |--fmap |--fmap|--ifd] DESCRIPTION flashprog-write-protect is a utility for reading and writing the write- protection settings of flash chips. Currently, it supports only block protection of SPI NOR chips. OPERATIONS You can specify one operation per call. status is the default operation. status Shows the write-protection state, including the currently programmed protection range. list Prints a list of write-protection ranges supported for the flash chip. disable Disables write protection locks. The configured range usually stays as is, but it will be possible to override it. enable Enables write protection locks. The write-protection range should be set before running the enable operation. range , Configures the protected range. start and length specify the range in decimal, octal (0 prefix), or hexadecimal (0x prefix) numbers of bytes. Any zero-length range will unprotect the entire flash (e.g. range 0,0). region Configures the protected range, matching a region of the loaded layout (from a file or flash, see the respective option- descriptions in for possible layout sources). OPTIONS All operations require the -p/--programmer option to be used (please see for more information on programmer support and parameters). -p, --programmer [:[,]...] Specify the programmer device. This is mandatory for all operations. Please see the manual for a list of currently supported programmers and their parameters. -c, --chip Probe only for the specified flash ROM chip. This option takes the chip name as printed by flashprog -L without the vendor name as parameter. Please note that the chip name is case sensitive. -V, --verbose More verbose output. This option can be supplied multiple times (max. 3 times, i.e. -VVV) for even more debug output. -o, --output Save the full debug log to . If the file already exists, it will be overwritten. This is the recommended way to gather logs from flashprog because they will be verbose even if the on-screen messages are not verbose and don't require output redirection. -h, --help Show a help text and exit. (-l|--layout) , --fmap-file , --fmap, --ifd Please see the manual for information about layout files and other layout sources. --temporary When the --temporary option is provided for any operation that alters the flash chip's configuration, flashprog will attempt to write a temporary value that is not stored to flash. This requires special support by the flash chip for a volatile write status register command. The new value will be lost upon reset of the flash chip. Hence, it is futile to use this with external programmers that toggle power to the flash chip (e.g. Dediprog). EXAMPLES To just print the current write-protection state of the internal BIOS flash: flashprog write-protect -p internal or flashprog write-protect status -p internal To temporarily enable the currently configured range: flashprog write-protect enable -p internal --temporary EXIT STATUS flashprog exits with 0 on success, 1 on most failures but with 3 if a call to mmap() fails. REQUIREMENTS flashprog needs different access permissions for different programmers. See this section in the manual for details. BUGS You can report bugs, ask us questions or send success reports via our communication channels listed here: https://www.flashprog.org/Contact. LICENSE flashprog is covered by the GNU General Public License (GPL), version 2. Some files are additionally available under any later version of the GPL. COPYRIGHT Please see the individual files. This manual page was written by Nico Huber and is derived from the flashprog(8) manual. It is licensed under the terms of the GNU GPL (version 2 or later). SEE ALSO flashprog-write-protect-1.3 2024-11-03 FLASHPROG-WRITE-PROTECT(8)