[Pdbg] [PATCH 00/13] Use fdt properties directly

Amitay Isaacs amitay at ozlabs.org
Wed Jan 15 16:18:48 AEDT 2020


Currently pdbg caches the properties in memory.  Any changes made
to the properties are stored only during runtime and do not persist.
Even though internal device trees cannot be modified, the external device
trees (specified via environmental variables) can be modified to store
the updates to the properties during runtime.

This patch set removes the caching of node properties in memory and
accesses the properties directly from device tree.  This allows properties
to be updated in the device trees which are externally specified.

Amitay Isaacs (13):
  libpdbg: Cache device tree pointer and offset for each node
  libpdbg: Map external device trees read-write by default
  Revert "libpdbg.h: Expose method to read fdt pointer"
  libpdbg: Cache device trees globally
  libpdbg: Add an api to get system device tree
  libpdbg: Restrict set_property to updating existing property
  libpdbg: Do not store properties in linked list
  libpdbg: Read/write properties directly from/to device tree
  libpdbg: Instead of dt_find_property(), use pdbg_target_property()
  libpdbg: Drop unused struct dt_property
  libpdbg: Properly close the mmaped files on exit
  libpdbg: Add a check if device tree is writeable
  tests: Add test for libpdbg property api

 Makefile.am                   |  10 +-
 fake.dts.m4                   |   2 +
 libpdbg/device.c              | 210 ++++++++++++-------------------
 libpdbg/dtb.c                 | 224 ++++++++++++++++++++++------------
 libpdbg/libpdbg.c             |   8 +-
 libpdbg/libpdbg.h             |  10 +-
 libpdbg/target.h              |  15 +++
 src/tests/libpdbg_prop_test.c | 120 ++++++++++++++++++
 tests/test_prop.sh            |  55 +++++++++
 9 files changed, 432 insertions(+), 222 deletions(-)
 create mode 100644 src/tests/libpdbg_prop_test.c
 create mode 100755 tests/test_prop.sh

-- 
2.21.1



More information about the Pdbg mailing list