devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Add support for phandle in symbols
@ 2024-09-02 12:17 Ayush Singh
  2024-09-02 12:17 ` [PATCH 1/2] libfdt: overlay: Allow resolving phandle symbols Ayush Singh
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Ayush Singh @ 2024-09-02 12:17 UTC (permalink / raw)
  To: d-gole, lorforlinux, jkridner, robertcnelson, nenad.marinkovic,
	Andrew Davis, Geert Uytterhoeven, Robert Nelson
  Cc: devicetree-compiler, Ayush Singh

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@ti.com/

Signed-off-by: Ayush Singh <ayush@beagleboard.org>

---
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@beagleboard.org>


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2024-11-13  9:46 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-02 12:17 [PATCH 0/2] Add support for phandle in symbols Ayush Singh
2024-09-02 12:17 ` [PATCH 1/2] libfdt: overlay: Allow resolving phandle symbols Ayush Singh
2024-09-09  5:03   ` David Gibson
2024-09-09  7:24     ` Ayush Singh
2024-09-12  3:38       ` David Gibson
2024-09-16  9:40         ` Ayush Singh
2024-09-18  2:36           ` David Gibson
2024-09-20 16:34             ` Ayush Singh
2024-09-23  3:41               ` David Gibson
2024-09-23  8:22                 ` Geert Uytterhoeven
2024-09-23  8:38                   ` David Gibson
2024-09-23  9:12                     ` Geert Uytterhoeven
2024-09-23  9:48                       ` David Gibson
2024-11-13  9:46                         ` Ayush Singh
2024-10-06  5:13                       ` Ayush Singh
2024-09-24  6:41                 ` Ayush Singh
2024-09-25  7:28                   ` David Gibson
2024-09-25  7:58                     ` Geert Uytterhoeven
2024-09-26  3:51                       ` David Gibson
2024-10-03  7:35                     ` Ayush Singh
2024-09-02 12:17 ` [PATCH 2/2] tests: Add test for symbol resolution Ayush Singh
2024-09-05 14:37   ` Andrew Davis
2024-09-05 14:35 ` [PATCH 0/2] Add support for phandle in symbols Andrew Davis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).