diff options
author | Claire Wolf <claire@symbioticeda.com> | 2020-04-22 18:06:59 +0200 |
---|---|---|
committer | Claire Wolf <claire@symbioticeda.com> | 2020-04-22 18:06:59 +0200 |
commit | 56a688fb8f0ade63710f155ea662994709ce3fbd (patch) | |
tree | 70a481d7662f812e614a892e13e908ca2a0a4e24 /iceprog | |
parent | df59d5997cb38a646e96f984bc222ec607e2c00f (diff) | |
parent | dcda69d9f06b123b9a491de512d8204ceadf2377 (diff) | |
download | icestorm-56a688fb8f0ade63710f155ea662994709ce3fbd.tar.gz icestorm-56a688fb8f0ade63710f155ea662994709ce3fbd.tar.bz2 icestorm-56a688fb8f0ade63710f155ea662994709ce3fbd.zip |
Merge branch 'opt_skip_powerdown' of https://github.com/smunaut/icestorm
Diffstat (limited to 'iceprog')
-rw-r--r-- | iceprog/iceprog.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/iceprog/iceprog.c b/iceprog/iceprog.c index da54d59..b04fe65 100644 --- a/iceprog/iceprog.c +++ b/iceprog/iceprog.c @@ -470,6 +470,7 @@ static void help(const char *progname) fprintf(stderr, " (append 'k' to the argument for size in kilobytes,\n"); fprintf(stderr, " or 'M' for size in megabytes)\n"); fprintf(stderr, " -s slow SPI (50 kHz instead of 6 MHz)\n"); + fprintf(stderr, " -k keep flash in powered up state (i.e. skip power down command)\n"); fprintf(stderr, " -v verbose output\n"); fprintf(stderr, " -i [4,32,64] select erase block size [default: 64k]\n"); fprintf(stderr, "\n"); @@ -546,6 +547,7 @@ int main(int argc, char **argv) bool slow_clock = false; bool disable_protect = false; bool disable_verify = false; + bool disable_powerdown = false; const char *filename = NULL; const char *devstr = NULL; int ifnum = 0; @@ -563,7 +565,7 @@ int main(int argc, char **argv) /* Decode command line parameters */ int opt; char *endptr; - while ((opt = getopt_long(argc, argv, "d:i:I:rR:e:o:cbnStvspX", long_options, NULL)) != -1) { + while ((opt = getopt_long(argc, argv, "d:i:I:rR:e:o:cbnStvspXk", long_options, NULL)) != -1) { switch (opt) { case 'd': /* device string */ devstr = optarg; @@ -665,6 +667,9 @@ int main(int argc, char **argv) case 'X': /* disable verification */ disable_verify = true; break; + case 'k': /* disable power down command */ + disable_powerdown = true; + break; case -2: help(argv[0]); return EXIT_SUCCESS; @@ -1004,7 +1009,8 @@ int main(int argc, char **argv) // Reset // --------------------------------------------------------- - flash_power_down(); + if (!disable_powerdown) + flash_power_down(); set_cs_creset(1, 1); usleep(250000); |