[Pdbg] [PATCH v3 19/22] libpdbg: Add parsing of backend device tree

Amitay Isaacs amitay at ozlabs.org
Mon Sep 23 18:48:38 AEST 2019


Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
Reviewed-by: Alistair Popple <alistair at popple.id.au>
---
 libpdbg/device.c | 3 +++
 libpdbg/dtb.c    | 1 +
 libpdbg/target.h | 1 +
 3 files changed, 5 insertions(+)

diff --git a/libpdbg/device.c b/libpdbg/device.c
index d0ead27..250acc0 100644
--- a/libpdbg/device.c
+++ b/libpdbg/device.c
@@ -759,6 +759,9 @@ bool pdbg_targets_init(void *fdt)
 	if (!pdbg_dt_root)
 		return false;
 
+	if (dtb.backend)
+		dt_expand(pdbg_dt_root, dtb.backend);
+
 	dt_expand(pdbg_dt_root, dtb.system);
 
 	pdbg_targets_init_virtual(pdbg_dt_root, pdbg_dt_root);
diff --git a/libpdbg/dtb.c b/libpdbg/dtb.c
index e793cf2..f548816 100644
--- a/libpdbg/dtb.c
+++ b/libpdbg/dtb.c
@@ -232,6 +232,7 @@ void pdbg_default_dtb(struct pdbg_dtb *dtb)
 	char *fdt = getenv("PDBG_DTB");
 
 	*dtb = (struct pdbg_dtb) {
+		.backend = NULL,
 		.system = NULL,
 	};
 
diff --git a/libpdbg/target.h b/libpdbg/target.h
index dad8ee9..6def1c2 100644
--- a/libpdbg/target.h
+++ b/libpdbg/target.h
@@ -54,6 +54,7 @@ struct pdbg_target {
 };
 
 struct pdbg_dtb {
+	void *backend;
 	void *system;
 };
 
-- 
2.21.0



More information about the Pdbg mailing list