devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Martin <dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: David Daney <david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Cc: "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
Subject: Re: [PATCH] of/flattree: Early "find node by alias" function
Date: Wed, 26 Oct 2011 10:29:37 +0100	[thread overview]
Message-ID: <20111026092937.GA2042@localhost.localdomain> (raw)
In-Reply-To: <4EA1A1A9.2090403-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>

On Fri, Oct 21, 2011 at 09:45:29AM -0700, David Daney wrote:
> On 10/21/2011 08:16 AM, Pawel Moll wrote:
> >This patch adds a function for finding a node in flat tree
> >based on an alias name. It can be used in early boot code.
> >
> >Typical use case is a situation when early code needs data
> >from a arbitrary tree node, eg. base address of "serial0" to
> >initialise debug output or some sort of ID register to
> >probe hardware.
> >
> >The tree source could look like that:
> >
> >/ {
> >	aliases {
> >		serial0 =&uart0;
> >	};
> >
> >	uart0: uart@f0001000 {
> >		reg =<0xf0001000 0x1000>;
> >	};
> >}
> >
> >Signed-off-by: Pawel Moll<pawel.moll-5wv7dgnIgG8@public.gmane.org>
> 
> How is this patch different/better than:
> 
> 
> http://lists.ozlabs.org/pipermail/devicetree-discuss/2011-June/005819.html

Note that unless we have reasonably standard alias names, finding nodes
by alias may recreate the same problem that it attempts to solve.

For example, how do I know which alias among serial0, serial1 etc.
should be used as the debug UART?

It feels like we either need well-defined conventions, or proper
symbolic names for aliases.  Or alternatively, the meanings of aliases
need to be documented somewhere just like the real bindings.

Of course, some alises can have board-specific meanings, but if all
alises are board-specific they become less useful.  If some alises are
board-specific and some are not, then we really need some namespacing
convention, just as for the real bindings.

Of course, this may all have been discussed before and dismissed as
overkill...

Cheers
---Dave

  parent reply	other threads:[~2011-10-26  9:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-21 15:16 [PATCH] of/flattree: Early "find node by alias" function Pawel Moll
     [not found] ` <1319210219-10707-1-git-send-email-pawel.moll-5wv7dgnIgG8@public.gmane.org>
2011-10-21 16:45   ` David Daney
     [not found]     ` <4EA1A1A9.2090403-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
2011-10-21 17:08       ` Pawel Moll
2011-10-21 20:04       ` Grant Likely
2011-10-26  9:29       ` Dave Martin [this message]
2011-11-08 11:57   ` Pawel Moll

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=20111026092937.GA2042@localhost.localdomain \
    --to=dave.martin-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    /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).