[PATCH 0/2] Add support for phandle in symbols

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Add ability to resolve symbols pointing to phandles instead of strings.

Combining this with existing fixups infrastructure allows creating
symbols in overlays that refer to undefined phandles. This is planned to
be used for addon board chaining [1].

Patch 2 containing tests demonstrates how this looks in practice.

Open Items:

1. Phandle vs String identification:
   I am not sure how to distinguish between symbols that are paths and
   phandles. Currently I am checking the proplen and if the first byte
   is '/'. However, this can cause problems if the number of phandles in
   dt exceed 0x2f000000 or 788,529,152.

   Alternatively, if we can be sure that there will be no node whose
   path is of length = 4, i.e. a node name of 2 characters ('\' and NULL
   already take up 2 characters), we can avoid the '/' check.

[1]: https://lore.kernel.org/linux-arm-kernel/20240702164403.29067-1-afd@xxxxxx/

Signed-off-by: Ayush Singh <ayush@xxxxxxxxxxxxxxx>

---
Ayush Singh (2):
      libfdt: overlay: Allow resolving phandle symbols
      tests: Add test for symbol resolution

 libfdt/fdt_overlay.c                   | 16 ++++++++++------
 tests/overlay_overlay_symbols1.dts     | 12 ++++++++++++
 tests/overlay_overlay_symbols2.dts     |  9 +++++++++
 tests/overlay_overlay_symbols_user.dts | 26 ++++++++++++++++++++++++++
 tests/run_tests.sh                     | 19 +++++++++++++++++++
 5 files changed, 76 insertions(+), 6 deletions(-)
---
base-commit: 99031e3a4a6e479466ae795790b44727434ca27d
change-id: 20240829-symbol-phandle-9d1e0489c32a

Best regards,
-- 
Ayush Singh <ayush@xxxxxxxxxxxxxxx>





[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux