devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ayush Singh <ayush@beagleboard.org>
To: lorforlinux@beagleboard.org, jkridner@beagleboard.org,
	 robertcnelson@beagleboard.org, nenad.marinkovic@mikroe.com,
	 Andrew Davis <afd@ti.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	 Robert Nelson <robertcnelson@gmail.com>
Cc: devicetree-compiler@vger.kernel.org,
	 Ayush Singh <ayush@beagleboard.org>
Subject: [PATCH 0/2] Add capability to append to property
Date: Tue, 27 Aug 2024 23:24:23 +0530	[thread overview]
Message-ID: <20240827-append-v1-0-d7a126ef1be3@beagleboard.org> (raw)

Allow appending values to a property instead of overriding the previous
values of property.

Currently, we have /delete-node/ and /delete-property/, but lack
/append-property/. Hence we end up having to repeat all existing values
when appending to a property (e.g. see [1] appending to clocks from
[2]).

This functionality is also important for creating a device tree based
implementation to support different types of addon-boards such as
mikroBUS, Grove [3], etc.

Open items
- Better tests: I only started the work today, so well, I still don't
  have a good picture of how to properly write tests.

- Appending to non-existent property: Currently am just adding a new
  property if not found. Not sure if this is the desired behaviour.

- Incompatible values: Not sure how to handle when trying to append
  incompatible values.

[3] https://lore.kernel.org/linux-arm-kernel/20240702164403.29067-1-afd@ti.com/
[2] https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts#L39
[1] https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/renesas/r8a77951.dtsi#L3334

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

---
Ayush Singh (2):
      dtc: Add /append-property/
      tests: Add test for append-property

 dtc-lexer.l                 |  7 +++++++
 dtc-parser.y                |  6 ++++++
 dtc.h                       |  3 +++
 livetree.c                  | 30 +++++++++++++++++++++++++-----
 tests/run_tests.sh          |  3 +++
 tests/test_tree1_append.dts | 21 +++++++++++++++++++++
 6 files changed, 65 insertions(+), 5 deletions(-)
---
base-commit: 99031e3a4a6e479466ae795790b44727434ca27d
change-id: 20240827-append-f614fe3261f9

Best regards,
-- 
Ayush Singh <ayush@beagleboard.org>


             reply	other threads:[~2024-08-27 17:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 17:54 Ayush Singh [this message]
2024-08-27 17:54 ` [PATCH 1/2] dtc: Add /append-property/ Ayush Singh
2024-08-29 14:04   ` Simon Glass
2024-08-27 17:54 ` [PATCH 2/2] tests: Add test for append-property Ayush Singh
2024-08-29 14:04   ` Simon Glass
2024-08-29 14:17     ` Ayush Singh
2024-08-29 15:00       ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240827-append-v1-0-d7a126ef1be3@beagleboard.org \
    --to=ayush@beagleboard.org \
    --cc=afd@ti.com \
    --cc=devicetree-compiler@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=jkridner@beagleboard.org \
    --cc=lorforlinux@beagleboard.org \
    --cc=nenad.marinkovic@mikroe.com \
    --cc=robertcnelson@beagleboard.org \
    --cc=robertcnelson@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).