[Skiboot] [PATCH v2 12/19] external/pflash: Update the code pathes for "--tune"
Cyril Bur
cyril.bur at au1.ibm.com
Fri Jul 28 16:46:30 AEST 2017
It doesn't make sense for --tune to do anything unless --direct was
passed.
Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
external/pflash/pflash.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/external/pflash/pflash.c b/external/pflash/pflash.c
index 064b5a9c..c0d96863 100644
--- a/external/pflash/pflash.c
+++ b/external/pflash/pflash.c
@@ -592,6 +592,7 @@ static void print_help(const char *pname)
printf("\t\ttake place first.\n\n");
printf("\t-t, --tune\n");
printf("\t\tJust tune the flash controller & access size\n");
+ printf("\t\tMust be used in conjuction with --direct\n");
printf("\t\t(Implicit for all other operations)\n\n");
printf("\t-c --clear\n");
printf("\t\tUsed to ECC clear a partition of the flash\n");
@@ -896,7 +897,17 @@ int main(int argc, char *argv[])
write_size = stbuf.st_size;
}
+ if (tune && !direct) {
+ fprintf(stderr, "It doesn't make sense to --tune without --direct\n");
+ rc = 1;
+ goto out;
+ }
+
if (direct) {
+ /* If -t is passed, then print a nice message */
+ if (tune)
+ printf("Flash and controller tuned\n");
+
if (arch_flash_access(NULL, bmc_flash ? BMC_DIRECT : PNOR_DIRECT) == ACCESS_INVAL) {
fprintf(stderr, "Can't access %s flash directly on this architecture\n",
bmc_flash ? "BMC" : "PNOR");
@@ -926,9 +937,6 @@ int main(int argc, char *argv[])
goto out;
}
- /* If -t is passed, then print a nice message */
- if (tune)
- printf("Flash and controller tuned\n");
/* If read specified and no read_size, use flash size */
if (do_read && !read_size && !part_name)
--
2.13.3
More information about the Skiboot
mailing list