[Pdbg] [PATCH v5 27/30] libpdbg: Add parsing of backend device tree

Amitay Isaacs amitay at ozlabs.org
Mon Oct 14 16:17:45 AEDT 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 06bbeaf..54a1d1d 100644
--- a/libpdbg/device.c
+++ b/libpdbg/device.c
@@ -766,6 +766,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 3d0f9b4..b85cba2 100644
--- a/libpdbg/dtb.c
+++ b/libpdbg/dtb.c
@@ -241,6 +241,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 c8839a9..35e822b 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