cli: Add new `config' CLI for status/config registers

Add a new CLI mode to query and update status and configuration
registers of SPI NOR chips.  Programmer initialization and chip
initialization works the same as with the classic CLI (`-p' and
`-c' options). There are two commands `get' and `set' where the
former is implied if no command is given. For a start, only the
`quad-enable' bit can be accessed  (for chips that advertise it
in the database).

The `--temporary' option  allows to use a volatile write status
register command if the flash chip supports it. So changes made
with this option will not be written to flash and are lost when
the chip is reset.

For instance, the quad-enable bit can then be queried like this

  $ flashprog config get -p ch341a_spi quad-enable

or written with

  $ flashprog config set -p ch341a_spi quad-enable 1

or

  $ flashprog config set -p ch341a_spi --temporary quad-enable 1

Change-Id: I6b9d26c67e6ad65be5df367d2db7942bb98f27ac
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/195
diff --git a/include/cli.h b/include/cli.h
index 06cd517..69b0146 100644
--- a/include/cli.h
+++ b/include/cli.h
@@ -32,6 +32,9 @@
 	OPTION_FLASH_NAME,
 	OPTION_FLASH_SIZE,
 	OPTION_PROGRESS,
+	OPTION_CONFIG_GET,
+	OPTION_CONFIG_SET,
+	OPTION_CONFIG_VOLATILE,
 };
 
 struct log_args {
@@ -63,6 +66,7 @@
 int cli_init(void);
 
 int flashprog_classic_main(int argc, char *argv[]);
+int flashprog_config_main(int argc, char *argv[]);
 
 extern enum flashprog_log_level verbose_screen;
 extern enum flashprog_log_level verbose_logfile;