diff mbox series

[v4,18/19] libpdbg: Enable sbefifo backend

Message ID 20200421041655.82856-19-amitay@ozlabs.org
State Superseded
Headers show
Series Add sbefifo backend | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (6ae2ba655ca5e24b403a33bf15dff7261d3e7052)
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master

Commit Message

Amitay Isaacs April 21, 2020, 4:16 a.m. UTC
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 libpdbg/dtb.c    | 19 +++++++++++++++++++
 libpdbg/hwunit.c |  2 ++
 2 files changed, 21 insertions(+)

Comments

Alistair Popple April 30, 2020, 1:45 a.m. UTC | #1
Reviewed-by: Alistair Popple <alistair@popple.id.au>

On Tuesday, 21 April 2020 2:16:54 PM AEST Amitay Isaacs wrote:
> Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
> ---
>  libpdbg/dtb.c    | 19 +++++++++++++++++++
>  libpdbg/hwunit.c |  2 ++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/libpdbg/dtb.c b/libpdbg/dtb.c
> index ef51718..1380ef4 100644
> --- a/libpdbg/dtb.c
> +++ b/libpdbg/dtb.c
> @@ -43,6 +43,7 @@
>  #include "p9-host.dt.h"
>  #include "p8-cronus.dt.h"
>  #include "p9-cronus.dt.h"
> +#include "p9-sbefifo.dt.h"
> 
>  #include "p8.dt.h"
>  #include "p9.dt.h"
> @@ -402,6 +403,24 @@ struct pdbg_dtb *pdbg_default_dtb(void *system_fdt)
>  		}
>  		break;
> 
> +	case PDBG_BACKEND_SBEFIFO:
> +		if (!pdbg_backend_option) {
> +			pdbg_log(PDBG_ERROR, "No system type specified\n");
> +			pdbg_log(PDBG_ERROR, "Use p9\n");
> +			return NULL;
> +		}
> +
> +		if (!strcmp(pdbg_backend_option, "p9")) {
> +			if (!dtb->backend.fdt)
> +				dtb->backend.fdt = &_binary_p9_sbefifo_dtb_o_start;
> +			if (!dtb->system.fdt)
> +				dtb->system.fdt = &_binary_p9_dtb_o_start;
> +		} else {
> +			pdbg_log(PDBG_ERROR, "Invalid system type %s\n", 
pdbg_backend_option);
> +			pdbg_log(PDBG_ERROR, "Use p9\n");
> +		}
> +		break;
> +
>  	default:
>  		pdbg_log(PDBG_WARNING, "Unable to determine a valid default backend,
> using fake backend for testing purposes\n"); /* Fall through */
> diff --git a/libpdbg/hwunit.c b/libpdbg/hwunit.c
> index 3d6a05d..7b16747 100644
> --- a/libpdbg/hwunit.c
> +++ b/libpdbg/hwunit.c
> @@ -90,6 +90,8 @@ static enum pdbg_backend get_backend_driver(void)
>  			backend = PDBG_BACKEND_HOST;
>  		else if (!strcmp(tmp, "cronus"))
>  			backend = PDBG_BACKEND_CRONUS;
> +		else if (!strcmp(tmp, "sbefifo"))
> +			backend = PDBG_BACKEND_SBEFIFO;
>  	}
> 
>  	return backend;
diff mbox series

Patch

diff --git a/libpdbg/dtb.c b/libpdbg/dtb.c
index ef51718..1380ef4 100644
--- a/libpdbg/dtb.c
+++ b/libpdbg/dtb.c
@@ -43,6 +43,7 @@ 
 #include "p9-host.dt.h"
 #include "p8-cronus.dt.h"
 #include "p9-cronus.dt.h"
+#include "p9-sbefifo.dt.h"
 
 #include "p8.dt.h"
 #include "p9.dt.h"
@@ -402,6 +403,24 @@  struct pdbg_dtb *pdbg_default_dtb(void *system_fdt)
 		}
 		break;
 
+	case PDBG_BACKEND_SBEFIFO:
+		if (!pdbg_backend_option) {
+			pdbg_log(PDBG_ERROR, "No system type specified\n");
+			pdbg_log(PDBG_ERROR, "Use p9\n");
+			return NULL;
+		}
+
+		if (!strcmp(pdbg_backend_option, "p9")) {
+			if (!dtb->backend.fdt)
+				dtb->backend.fdt = &_binary_p9_sbefifo_dtb_o_start;
+			if (!dtb->system.fdt)
+				dtb->system.fdt = &_binary_p9_dtb_o_start;
+		} else {
+			pdbg_log(PDBG_ERROR, "Invalid system type %s\n", pdbg_backend_option);
+			pdbg_log(PDBG_ERROR, "Use p9\n");
+		}
+		break;
+
 	default:
 		pdbg_log(PDBG_WARNING, "Unable to determine a valid default backend, using fake backend for testing purposes\n");
 		/* Fall through */
diff --git a/libpdbg/hwunit.c b/libpdbg/hwunit.c
index 3d6a05d..7b16747 100644
--- a/libpdbg/hwunit.c
+++ b/libpdbg/hwunit.c
@@ -90,6 +90,8 @@  static enum pdbg_backend get_backend_driver(void)
 			backend = PDBG_BACKEND_HOST;
 		else if (!strcmp(tmp, "cronus"))
 			backend = PDBG_BACKEND_CRONUS;
+		else if (!strcmp(tmp, "sbefifo"))
+			backend = PDBG_BACKEND_SBEFIFO;
 	}
 
 	return backend;