From: arnd@arndb.de (Arnd Bergmann)
To: linux-snps-arc@lists.infradead.org
Subject: "compatible" and "model" properties in .dts for ARC boards
Date: Fri, 06 Nov 2015 09:59:46 +0100 [thread overview]
Message-ID: <82634871.ymdF4uL7TN@wuerfel> (raw)
In-Reply-To: <C2D7FE5348E1B147BCA15975FBA23075F44D0C84@IN01WEMBXA.internal.synopsys.com>
On Friday 06 November 2015 04:45:24 Vineet Gupta wrote:
> >
> > During OpenWRT upsreaming process one interesting topic was raised.
> > See in the middle of https://lists.openwrt.org/pipermail/openwrt-devel/2015-November/036959.html
> >
> > In Device Tree descriptions for our boards we don't use "model" property
> > even though it is a required one as specified by ePAPR, see
> > http://free-electrons.com/~thomas/pub/Power_ePAPR_APPROVED_v1.0.pdf,
> > page 39 "Table 3-1 Root node properties".
> >
> > Instead we put 2 items in "compatible" property.
> >
> > For example:
> > ------------------->8----------------
> > compatible = "snps,axs101", "snps,arc-sdp";
> > ------------------->8----------------
> >
> > And from ePAPR standpoint it makes sense to split contents of that "compatible"
> > property in 2:
> > ------------------->8----------------
> > compatible = "snps,arc-sdp";
> > model = "snps,axs101";
> > ------------------->8----------------
>
> It seems model is just a descriptive label and we can surely add them to existing DT.
> compatible on the other hand is more fundamental used for exact comparisons etc
> and follows the vendor,device convention.
> It is pretty common for compatible to have multiple strings for exactly the same
> reason as I have them here. Both axs101 and axs103 are based on sdp thus we want
> the ability to have both pieces of information and use as needed.
Correct.
The model should also be a human readable name of the machine, just one
string like "Synapsys AXS101 Development Board" (or whatever that is called).
> > But I do see problems with implementation of that thing.
> > Today we have a luxury of selection of AXS init functionality
> > based on that compatible value and if "snps,axs101" goes in
> > "model" then we'll need to add some more code in
> > arch/arc/plat-axs10x/axs10x.c that reads "model" value with
> > of_get_property() and then compare to "axs10{1|3}".
> >
> > Any thoughts?
That should use the of_machine_is_compatible() helper. The model string
is for printing in dmesg or /proc/cpuinfo.
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com>,
"linux-snps-arc@lists.infradead.org"
<linux-snps-arc@lists.infradead.org>,
"jogo@openwrt.org" <jogo@openwrt.org>,
lkml <linux-kernel@vger.kernel.org>,
Rob Herring <robh@kernel.org>
Subject: Re: "compatible" and "model" properties in .dts for ARC boards
Date: Fri, 06 Nov 2015 09:59:46 +0100 [thread overview]
Message-ID: <82634871.ymdF4uL7TN@wuerfel> (raw)
In-Reply-To: <C2D7FE5348E1B147BCA15975FBA23075F44D0C84@IN01WEMBXA.internal.synopsys.com>
On Friday 06 November 2015 04:45:24 Vineet Gupta wrote:
> >
> > During OpenWRT upsreaming process one interesting topic was raised.
> > See in the middle of https://lists.openwrt.org/pipermail/openwrt-devel/2015-November/036959.html
> >
> > In Device Tree descriptions for our boards we don't use "model" property
> > even though it is a required one as specified by ePAPR, see
> > http://free-electrons.com/~thomas/pub/Power_ePAPR_APPROVED_v1.0.pdf,
> > page 39 "Table 3-1 Root node properties".
> >
> > Instead we put 2 items in "compatible" property.
> >
> > For example:
> > ------------------->8----------------
> > compatible = "snps,axs101", "snps,arc-sdp";
> > ------------------->8----------------
> >
> > And from ePAPR standpoint it makes sense to split contents of that "compatible"
> > property in 2:
> > ------------------->8----------------
> > compatible = "snps,arc-sdp";
> > model = "snps,axs101";
> > ------------------->8----------------
>
> It seems model is just a descriptive label and we can surely add them to existing DT.
> compatible on the other hand is more fundamental used for exact comparisons etc
> and follows the vendor,device convention.
> It is pretty common for compatible to have multiple strings for exactly the same
> reason as I have them here. Both axs101 and axs103 are based on sdp thus we want
> the ability to have both pieces of information and use as needed.
Correct.
The model should also be a human readable name of the machine, just one
string like "Synapsys AXS101 Development Board" (or whatever that is called).
> > But I do see problems with implementation of that thing.
> > Today we have a luxury of selection of AXS init functionality
> > based on that compatible value and if "snps,axs101" goes in
> > "model" then we'll need to add some more code in
> > arch/arc/plat-axs10x/axs10x.c that reads "model" value with
> > of_get_property() and then compare to "axs10{1|3}".
> >
> > Any thoughts?
That should use the of_machine_is_compatible() helper. The model string
is for printing in dmesg or /proc/cpuinfo.
Arnd
next prev parent reply other threads:[~2015-11-06 8:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-05 18:50 "compatible" and "model" properties in .dts for ARC boards Alexey Brodkin
2015-11-06 4:45 ` Vineet Gupta
2015-11-06 4:45 ` Vineet Gupta
2015-11-06 8:59 ` Arnd Bergmann [this message]
2015-11-06 8:59 ` Arnd Bergmann
2015-11-06 10:57 ` Jonas Gorski
2015-11-06 10:57 ` Jonas Gorski
2015-11-17 12:18 ` Vineet Gupta
2015-11-17 12:18 ` Vineet Gupta
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=82634871.ymdF4uL7TN@wuerfel \
--to=arnd@arndb.de \
--cc=linux-snps-arc@lists.infradead.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 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.