All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: "Marek Behún" <marek.behun@nic.cz>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: difference between fdtdec and fdt_support ?
Date: Thu, 6 Jan 2022 09:15:17 -0700	[thread overview]
Message-ID: <CAPnjgZ30jyL-42RCt-MAnK2BLzOXyvyfrYEBvyv9M7Xeg3EJbg@mail.gmail.com> (raw)
In-Reply-To: <20220106171007.7f39094c@thinkpad>

Hi Marek,

On Thu, 6 Jan 2022 at 09:10, Marek Behún <marek.behun@nic.cz> wrote:
>
> On Thu, 6 Jan 2022 08:48:48 -0700
> Simon Glass <sjg@chromium.org> wrote:
>
> > Hi Marek,
> >
> > On Thu, 6 Jan 2022 at 05:21, Marek Behún <marek.behun@nic.cz> wrote:
> > >
> > > Hi Simon,
> > >
> > > I am a little confused.
> > >
> > > We have
> > >   common/fdt_support.c
> > > and
> > >   lib/fdtdec.c
> > >
> > > The second one implements for example fdtdec_get_is_enabled(), which I
> > > would rather expect in fdt_support by name fdt_node_is_available(), or
> > > something like that.
> >
> > Should be moved to ofnode
>
> ?? But this function is needed for example when fixing device tree for
> Linux.
>
> > >
> > > Also fdtdec does a strange thing with compatible strings: it declares
> > > an enum for compatible strings and then a map which maps this enum
> > > values to compatible strings... Why not just use the compatible strings?
> >
> > Did you see the comment?
> >
> >  * NOTE: This list is basically a TODO list for things that need to be
> >  * converted to driver model. So don't add new things here unless there is a
> >  * good reason why driver-model conversion is infeasible. Examples include
> >  * things which are used before driver model is available.
> >
> > This is effectively a list of things that should be converted to
> > driver model. The list should then go away.
>
> Hmm. But can't that be simply made into a list in a comment? Because
> currently this is compiled in for every board that uses any such
> function from fdtdec, even if they don't use any string from those
> compatible strings.

Well another option would be to delete the boards that need it, since
no one has seen fit to resolve this all these years. Or create some
drivers for them.

>
> > >
> > > What is the purpose of having two files implementing fdt stuff?
> >
> > fdtdec - for reading from the DT. Should go away and be replaced with
> > the ofnode API, and fdtaddr.c
> > fdt_support - for updating the DT, e.g. for fixups before booting an OS
>
> Thanks! Okay that makes sense. This means that we should also have
> fdt_node_is_available() in fdt_support.c which does the same thing.
> (For now this can be made a static inline function that calls
>  fdtdec_get_is_enabled().)

OK.

BTW fdt_support.c should really move to use ofnode. There are few
ofnode 'write' functions at present, but we should fill those out so
we don't need to use flattree for anything, with OF_LIVE is enabled.

Regards,
Simon

  reply	other threads:[~2022-01-06 16:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 12:21 difference between fdtdec and fdt_support ? Marek Behún
2022-01-06 14:37 ` Rasmus Villemoes
2022-01-06 15:48 ` Simon Glass
2022-01-06 16:10   ` Marek Behún
2022-01-06 16:15     ` Simon Glass [this message]
2022-01-06 16:55       ` Marek Behún
2022-01-27 15:05         ` 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=CAPnjgZ30jyL-42RCt-MAnK2BLzOXyvyfrYEBvyv9M7Xeg3EJbg@mail.gmail.com \
    --to=sjg@chromium.org \
    --cc=marek.behun@nic.cz \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.