Re: [PATCH v3 07/15] devicetree: Add DeviceTree live tree representation

From: Doug Anderson

Date: Thu Nov 12 2026 - 14:53:05 EST


Hi,

On Wed, Nov 11, 2026 at 6:31 PM David Gibson
<david@xxxxxxxxxxxxxxxxxxxxx> wrote:
>
> > > > > > +++ b/devicetree.py
> > > > > > @@ -0,0 +1,226 @@
> > > > > > +# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
> > > > > > +"""devicetree - Non-flattened in-memory device tree representation in Python."""
> > > > >
> > > > > I'd forgotten about this but PyPI has Zephyr's python-devicetree
> > > > > [1][2], which installs a top-level 'devicetree' package.
> > > > >
> > > > > I'm not sure what to suggest. Would libfdt_devicetree be too awful?
> > > >
> > > > Right. I'm OK with libfdt_devicetree. David: do you have any
> > > > objections?
> > >
> > > Don't love it, but can't quickly think of a better option.
> >
> > Would libfdt_tree be better?
>
> Not really. The problem with all of the above is that they're making
> this library which is about managing a non-flattened device tree a
> part of the library/project/namespace that's explicitly about
> flattened device trees.

Personally, I kinda liked "libfdt.devicetree" that Simon suggested
(though my analysis says accomplishing that would be difficult).
...but I can also see David's objections to namespacing this under
"libfdt". Does this mean "libfdt_devicetree" is out, too?

One other option is "dt_livetree". That matches the "livetree.c" that
already exists in the source base. What do folks think about that? If
we switch to this, should I move the ".py" file? In my draft v4 I
still have it under "pylibfdt/", but I could move it to a
"pylivetree/" directory...

-Doug