[Pdbg] [PATCH v2 05/11] pdbg: Fix using FSI backend on palmetto
Amitay Isaacs
amitay at ozlabs.org
Thu Apr 12 16:01:54 AEST 2018
From: Cyril Bur <cyrilbur at gmail.com>
Signed-off-by: Cyril Bur <cyrilbur at gmail.com>
---
src/main.c | 2 +-
src/options_arm.c | 26 +++++++++++++++++---------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/main.c b/src/main.c
index 121e4ad..c6b645e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -470,7 +470,7 @@ int main(int argc, char *argv[])
return 1;
if (!backend_is_possible(backend)) {
- fprintf(stderr, "Backend not possible\n");
+ fprintf(stderr, "Backend not possible\nUse: ");
print_backends(stderr);
print_usage(argv[0]);
return 1;
diff --git a/src/options_arm.c b/src/options_arm.c
index c37d8d0..1b9032e 100644
--- a/src/options_arm.c
+++ b/src/options_arm.c
@@ -25,6 +25,7 @@
static const char witherspoon[] = "p9w";
static const char romulus[] = "p9r";
static const char zaius[] = "p9z";
+static const char p8[] = "p8";
enum backend default_backend(void)
{
@@ -37,20 +38,24 @@ enum backend default_backend(void)
if (rc == 0) /* Kernel interface. OpenBMC */
return KERNEL;
- /*
- * "This should never be the default" - Apopple 2017
- */
- fprintf(stderr, "Couldn't locate a good backend.\n");
- fprintf(stderr, "It is possible that the FSI backend will work.\n");
- fprintf(stderr, "You will need to select this along with the correct\n");
- fprintf(stderr, "target yourself on the commandline\n");
- fprintf(stderr, "`pdbg -b fsi -d [p8 | p9w | p9r | p9z] ...`\n");
return FAKE;
}
void print_backends(FILE *stream)
{
- fprintf(stream, "I2C KERNEL FSI");
+ /*
+ * "This should never be the default" - Apopple 2017
+ */
+ fprintf(stream, "I2C KERNEL FSI\n");
+
+ if (default_backend() == FAKE) {
+ fprintf(stderr, "Couldn't locate a good backend.\n");
+ fprintf(stderr, "It is possible that the FSI backend will work.\n");
+ fprintf(stderr, "You will need to select this along with the correct\n");
+ fprintf(stderr, "target yourself on the commandline\n");
+ fprintf(stderr, "`pdbg -b fsi -d [p8 | p9w | p9r | p9z] ...`\n");
+ }
+
}
bool backend_is_possible(enum backend backend)
@@ -97,6 +102,9 @@ const char *default_target(enum backend backend)
if (strstr(line, "zaius"))
return zaius;
+ if (strstr(line, "palmetto"))
+ return p8;
+
return NULL;
}
--
2.14.3
More information about the Pdbg
mailing list