devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
To: Lina Iyer <lina.iyer-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Sudeep Holla <Sudeep.Holla-5wv7dgnIgG8@public.gmane.org>,
	Device Tree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: How-to: Uniquely identify a DT node in the driver?
Date: Thu, 30 Jul 2015 19:53:14 +0100	[thread overview]
Message-ID: <20150730185110.GA9328@leverpostej> (raw)
In-Reply-To: <20150729160120.GH51847-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

Hi,

Sorry for the corss-talk on my previous reply.

> I am trying to instantiate generic PM domains for different CPU clusters
> commonly. Individual platform code may have different actions for
> powering down/up the CPU domain. It could be different set of bucks that
> they need to talk to or bunch of devices. The common code would like to
> provide the opportunity for the platform code to perform their
> activities.
> 
> CPUs may be organized into 'n' clusters, the common code would create
> genpd for each of these clusters. In a multi machine image, to identify
> the right platform driver for the cluster, is a challenge. I am trying
> to solve it the same way as CPUidle - using __init section tables.  To
> uniquely identify a cluster in a SoC, I need a way to match the domain
> provider's DT node, with a callback in the driver. Like the 'method'
> attribute of the CPUIdle macros. The CPU compatibles are too generic and
> could duplicate across SoCs to be used for comparison. For e.g, you
> could have two clusters of A53 cores that could use the same compatible
> string. Distinguishing the domains for each of these clusters is a pain
> (but doable using phandles to the domain referenced by the CPU).
> 
> To make it easy for the driver, I could only think of adding an unique
> compatible string to the domain node and the platform driver would then
> be able to same compatible string to distinguish between domains for the
> different clusters.
> 
> Alternately, I was exploring a way to use phandles for the device nodes
> as unique comparison attributes, but that is more complex and doesnt
> provide any better benefit than the compatible.

I don't believe using compatible strings is the right thing to do. The
thing which varies per-domain is the relationships of various
components, which should be described with phandles. At the level of the
domain, the interface is identical, and thus they should have the same
compatible string.

Using different compatible strings implies that we have to add new
compatible strings for each new variation that appears, leaving us with
a completely arbitrary set of compatible strings with (likely)
ill-defined semantics. That makes it really difficult to reuse code, and
necessitates adding far more.

The inter-device relationships (and the attibutes of those devices)
should be explicit in the DT.

Thanks,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-07-30 18:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28 19:38 How-to: Uniquely identify a DT node in the driver? Lina Iyer
     [not found] ` <20150728193833.GC51847-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-07-28 19:56   ` Lina Iyer
2015-07-29  9:44   ` Sudeep Holla
     [not found]     ` <55B8A061.6060306-5wv7dgnIgG8@public.gmane.org>
2015-07-29 16:01       ` Lina Iyer
     [not found]         ` <20150729160120.GH51847-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-07-30 18:53           ` Mark Rutland [this message]
2015-07-31 15:57             ` Lina Iyer
2015-07-29 16:39   ` Mark Rutland
2015-07-30 15:33     ` Lina Iyer

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=20150730185110.GA9328@leverpostej \
    --to=mark.rutland-5wv7dgnigg8@public.gmane.org \
    --cc=Sudeep.Holla-5wv7dgnIgG8@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lina.iyer-QSEj5FYQhm4dnm+yROfE0A@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).