summaryrefslogtreecommitdiffstats
path: root/external
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2017-11-08 19:59:08 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-11-20 20:35:24 -0600
commit5d4241ddaf441bc357b4219154d3af1ff7c95cc9 (patch)
treed3b801104b34ac09ea8129775c0823e760a935b7 /external
parentbcb140d015eb2f9e6a8a74c0fbe3b8836ebf2cf9 (diff)
downloadblackbird-skiboot-5d4241ddaf441bc357b4219154d3af1ff7c95cc9.tar.gz
blackbird-skiboot-5d4241ddaf441bc357b4219154d3af1ff7c95cc9.zip
gard: Add P9 support
Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external')
-rw-r--r--external/gard/gard.c24
-rw-r--r--external/gard/test/files/data-p9.binbin0 -> 20480 bytes
-rw-r--r--external/gard/test/results/02-usage.err4
-rw-r--r--external/gard/test/results/03-show_1-p9.err0
-rw-r--r--external/gard/test/results/03-show_1-p9.out10
-rw-r--r--external/gard/test/tests/03-show_1-p910
6 files changed, 46 insertions, 2 deletions
diff --git a/external/gard/gard.c b/external/gard/gard.c
index 5d4e382b..9505293d 100644
--- a/external/gard/gard.c
+++ b/external/gard/gard.c
@@ -526,6 +526,8 @@ static void usage(const char *progname)
print_version();
fprintf(stderr, "Usage: %s [-a -e -f <file> -p] <command> [<args>]\n\n",
progname);
+ fprintf(stderr, "-8 --p8\n");
+ fprintf(stderr, "-9 --p9\n\tSet the processor generation\n\n");
fprintf(stderr, "-e --ecc\n\tForce reading/writing with ECC bytes.\n\n");
fprintf(stderr, "-f --file <file>\n\tDon't search for MTD device,"
" read from <file>.\n\n");
@@ -552,9 +554,11 @@ static struct option global_options[] = {
{ "file", required_argument, 0, 'f' },
{ "part", no_argument, 0, 'p' },
{ "ecc", no_argument, 0, 'e' },
+ { "p8", no_argument, 0, '8' },
+ { "p9", no_argument, 0, '9' },
{ 0 },
};
-static const char *global_optstring = "+ef:p";
+static const char *global_optstring = "+ef:p89";
int main(int argc, char **argv)
{
@@ -570,7 +574,6 @@ int main(int argc, char **argv)
ctx = &_ctx;
memset(ctx, 0, sizeof(*ctx));
- set_chip_gen(p8_chip_units);
if (is_fsp()) {
fprintf(stderr, "This is the OpenPower gard tool which does "
@@ -603,6 +606,12 @@ int main(int argc, char **argv)
case 'p':
part = true;
break;
+ case '8':
+ set_chip_gen(p8_chip_units);
+ break;
+ case '9':
+ set_chip_gen(p9_chip_units);
+ break;
case '?':
usage(progname);
rc = EXIT_FAILURE;
@@ -610,6 +619,8 @@ int main(int argc, char **argv)
}
}
+
+
/*
* It doesn't make sense to specify that we have the gard partition but
* read from flash
@@ -630,6 +641,15 @@ int main(int argc, char **argv)
argv += optind;
action = argv[0];
+ /* assume a P8 if we haven't been given any */
+ if (!chip_units) {
+#ifdef ASSUME_P9
+ set_chip_gen(p9_chip_units);
+#else
+ set_chip_gen(p8_chip_units);
+#endif
+ }
+
if (arch_flash_init(&(ctx->bl), filename, true)) {
/* Can fail for a few ways, most likely couldn't open MTD device */
fprintf(stderr, "Can't open %s\n", filename ? filename : "MTD Device. Are you root?");
diff --git a/external/gard/test/files/data-p9.bin b/external/gard/test/files/data-p9.bin
new file mode 100644
index 00000000..f2141657
--- /dev/null
+++ b/external/gard/test/files/data-p9.bin
Binary files differ
diff --git a/external/gard/test/results/02-usage.err b/external/gard/test/results/02-usage.err
index cfc9b4cd..ba3dc683 100644
--- a/external/gard/test/results/02-usage.err
+++ b/external/gard/test/results/02-usage.err
@@ -1,5 +1,9 @@
Usage: ./gard [-a -e -f <file> -p] <command> [<args>]
+-8 --p8
+-9 --p9
+ Set the processor generation
+
-e --ecc
Force reading/writing with ECC bytes.
diff --git a/external/gard/test/results/03-show_1-p9.err b/external/gard/test/results/03-show_1-p9.err
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/external/gard/test/results/03-show_1-p9.err
diff --git a/external/gard/test/results/03-show_1-p9.out b/external/gard/test/results/03-show_1-p9.out
new file mode 100644
index 00000000..bdcf4186
--- /dev/null
+++ b/external/gard/test/results/03-show_1-p9.out
@@ -0,0 +1,10 @@
+Record ID: 0x00000001
+========================
+Error ID: 0x90000007
+Error Type: 0xe3
+Path Type: physical
+>Sys, Instance #0
+ >Node, Instance #0
+ >Proc, Instance #0
+ >EQ, Instance #1
+ >EX, Instance #0
diff --git a/external/gard/test/tests/03-show_1-p9 b/external/gard/test/tests/03-show_1-p9
new file mode 100644
index 00000000..c9b06d15
--- /dev/null
+++ b/external/gard/test/tests/03-show_1-p9
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+run_binary "./gard" "-p -e -f test/files/data-p9.bin --p9 show 1"
+if [ "$?" -ne 0 ] ; then
+ fail_test
+fi
+
+diff_with_result
+
+pass_test
OpenPOWER on IntegriCloud