[Pdbg] [PATCH v3 00/22] Add system device tree to libpdbg
Amitay Isaacs
amitay at ozlabs.org
Mon Sep 23 18:48:19 AEST 2019
In the current design of libpdbg, there are multiple device trees for
a system depending on the backend. This means the same hardware unit
is represented with different device tree paths based on the backend.
It's a problem when trying to assign certain properties to hardware
units in a backend agnostic fashion.
These patches introduce a system device tree (view) which is overlaid on
top of the backend device trees using virtual nodes. The virtual nodes
are specified using "system-path" property (denoting the attachment
point in the system device tree view) or by adding nodes to backend
device tree without "compatible" property.
V2 changes:
- Fix dt_find_by_path()
- Rename argument virtual to system (avoid using reserved keywords)
- Fix __pdbg_next_targe() by adding system flag
- Fix pdbg_target_probe()
- Add more tests for probe, child traverse, parent traverse
- Do not drop argument to pdbg_targets_init()
V3 changes:
- Refactor dt_link_virtual()
- Simplify pdbg_targets_init_virtual()
- Add comments to child/parent traverse routines
- Rename pdbg_target_match_next() -> target_map_child()
- Move get_parent() to libpdbg.c
- Add more tree tests
- Fix copy-paste errors in dtb.c
Amitay Isaacs (22):
libpdbg: class name and name should be const
libpdbg: Drop const from pdbg_target_path() argument
libpdbg: Rename function to reflect the functionality
libpdbg: Add virtual node target
libpdbg: Support paths including virutal nodes
libpdbg: Construct unique path based on virtual nodes
libpdbg: Create virtual nodes based on system-path property
libpdbg: Child traversal should handle virtual nodes correctly
libpdbg: Parent retrieval should handle virtual nodes correctly
libpdbg: Probe should traverse virtual nodes also
main: Use dn_name for printing virtual nodes
fake: Add virtual nodes for pib targets
tests: Add device tree traversal tests
libpdbg: Pass root node to dt_expand
libpdbg: Return status from pdbg_targets_init()
libpdbg: Make pdbg_set_backend() return boolean
libpdbg: Do not make pdbg_default_dtb public
libpdbg: Add a structure to hold fdt pointer
libpdbg: Add parsing of backend device tree
dts: Split P8 device trees into system and backend trees
dts: Split P9 device trees into system and backend trees
libpdbg: Separate backend and system device trees
Makefile.am | 13 +-
fake.dts.m4 | 53 ++---
libpdbg/device.c | 156 +++++++++++--
libpdbg/dtb.c | 221 +++++++++++-------
libpdbg/libpdbg.c | 151 +++++++++++--
libpdbg/libpdbg.h | 27 ++-
libpdbg/target.c | 7 +-
libpdbg/target.h | 8 +
p8-cronus.dts.m4 | 64 ++----
p8-fsi.dts.m4 | 9 +-
p8-host.dts.m4 | 2 +-
p8-i2c.dts.m4 | 8 +-
p8-kernel.dts.m4 | 7 +-
p8-pib.dts.m4 | 1 +
p8.dts.m4 | 55 +++++
p9-cronus.dts.m4 | 50 ++---
p9-fsi.dtsi.m4 | 7 +-
p9-host.dts.m4 | 4 +-
p9-kernel.dts.m4 | 13 +-
p9-pib.dts.m4 | 5 +
p9.dts.m4 | 27 +++
src/main.c | 16 +-
src/scom.c | 2 +-
src/tests/libpdbg_dtree_test.c | 117 ++++++++++
src/tests/libpdbg_probe_test.c | 25 ++-
src/tests/libpdbg_target_test.c | 54 +++--
src/thread.c | 4 +-
tests/test_selection.sh | 98 +++++++-
tests/test_selection2.sh | 178 +++++++++++++--
tests/test_tree.sh | 387 ++++++++++++++++++++++++++++++++
30 files changed, 1457 insertions(+), 312 deletions(-)
create mode 100644 p8.dts.m4
create mode 100644 p9.dts.m4
create mode 100644 src/tests/libpdbg_dtree_test.c
create mode 100755 tests/test_tree.sh
--
2.21.0
More information about the Pdbg
mailing list