From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: DT include files
Date: Mon, 13 Jan 2014 09:48:43 -0700 [thread overview]
Message-ID: <52D418EB.1040605@wwwdotorg.org> (raw)
In-Reply-To: <20140110170319.GC20094@book.gsilab.sittig.org>
On 01/10/2014 10:03 AM, Gerhard Sittig wrote:
> On Fri, Jan 10, 2014 at 09:30 -0600, Rob Herring wrote:
>>
>> As for *.h vs. *.dtsi naming, if the include is only pre-processor
>> defines, then I think using .h is the right way. Otherwise, if there
>> is any dts syntax, then .dtsi is the right name. It looks to me like
>> this style has been followed in both the imx and s3c64xx cases.
>>
>> On a side note, I'm not really a fan of this pattern:
>>
>> #define FOO1 1 2 3
>>
>> #define BAR FOO1 FOO2 FOO3
>>
>> While it definitely simplifies the dts files, it would never be used
>> in C and obfuscates what the actual property size is. Reading a dts
>> file, I would naturally assume the define was a single value while in
>> fact it could expand to a very large property size.
>
> For more complex yet tedious repetitive cases like GPIO banks and
> pins I've seen #define directives which introduce "functions"
> (macros with parameters). They appear to be rather useful, can
> reflect very well the essence of the information, don't
> necessarily pretend to be single values, but still may hide how
> many cells they expand to. For example:
>
> arch/arm/boot/dts/tegra30-cardhu.dtsi:
> interrupts = <TEGRA_GPIO(L, 0) IRQ_TYPE_LEVEL_HIGH>;
I'm not sure I entirely understand your point, but for the record, both
TEGRA_GPIO() and IRQ_TYPE_LEVEL_HIGH expand to a single cell, as I would
expect (almost?) any DT macro to do.
WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Gerhard Sittig <gsi-ynQEQJNshbs@public.gmane.org>,
Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Tomasz Figa <t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>,
Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
Linus Walleij
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Grant Likely
<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
"arm-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
<arm-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: DT include files
Date: Mon, 13 Jan 2014 09:48:43 -0700 [thread overview]
Message-ID: <52D418EB.1040605@wwwdotorg.org> (raw)
In-Reply-To: <20140110170319.GC20094-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
On 01/10/2014 10:03 AM, Gerhard Sittig wrote:
> On Fri, Jan 10, 2014 at 09:30 -0600, Rob Herring wrote:
>>
>> As for *.h vs. *.dtsi naming, if the include is only pre-processor
>> defines, then I think using .h is the right way. Otherwise, if there
>> is any dts syntax, then .dtsi is the right name. It looks to me like
>> this style has been followed in both the imx and s3c64xx cases.
>>
>> On a side note, I'm not really a fan of this pattern:
>>
>> #define FOO1 1 2 3
>>
>> #define BAR FOO1 FOO2 FOO3
>>
>> While it definitely simplifies the dts files, it would never be used
>> in C and obfuscates what the actual property size is. Reading a dts
>> file, I would naturally assume the define was a single value while in
>> fact it could expand to a very large property size.
>
> For more complex yet tedious repetitive cases like GPIO banks and
> pins I've seen #define directives which introduce "functions"
> (macros with parameters). They appear to be rather useful, can
> reflect very well the essence of the information, don't
> necessarily pretend to be single values, but still may hide how
> many cells they expand to. For example:
>
> arch/arm/boot/dts/tegra30-cardhu.dtsi:
> interrupts = <TEGRA_GPIO(L, 0) IRQ_TYPE_LEVEL_HIGH>;
I'm not sure I entirely understand your point, but for the record, both
TEGRA_GPIO() and IRQ_TYPE_LEVEL_HIGH expand to a single cell, as I would
expect (almost?) any DT macro to do.
--
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
next prev parent reply other threads:[~2014-01-13 16:48 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-31 5:44 [GIT PULL 2/2] ARM: imx: device tree changes for 3.14 Shawn Guo
2014-01-02 20:21 ` DT include files (was: [GIT PULL 2/2] ARM: imx: device tree changes for 3.14) Olof Johansson
2014-01-02 20:21 ` Olof Johansson
2014-01-03 2:32 ` Shawn Guo
2014-01-03 2:32 ` Shawn Guo
2014-01-03 2:41 ` Olof Johansson
2014-01-03 2:41 ` Olof Johansson
2014-01-03 3:04 ` Shawn Guo
2014-01-03 3:04 ` Shawn Guo
2014-01-03 19:29 ` Olof Johansson
2014-01-03 19:29 ` Olof Johansson
2014-01-04 1:10 ` Shawn Guo
2014-01-04 1:10 ` Shawn Guo
2014-01-10 2:41 ` Shawn Guo
2014-01-10 2:41 ` Shawn Guo
2014-01-10 2:41 ` Olof Johansson
2014-01-10 2:41 ` Olof Johansson
2014-01-10 13:28 ` DT include files Tomasz Figa
2014-01-10 13:28 ` Tomasz Figa
2014-01-10 15:30 ` Rob Herring
2014-01-10 15:30 ` Rob Herring
2014-01-10 17:03 ` Gerhard Sittig
2014-01-10 17:03 ` Gerhard Sittig
2014-01-13 16:48 ` Stephen Warren [this message]
2014-01-13 16:48 ` Stephen Warren
2014-01-13 18:10 ` Gerhard Sittig
2014-01-13 18:10 ` Gerhard Sittig
2014-01-10 18:37 ` Olof Johansson
2014-01-10 18:37 ` Olof Johansson
2014-01-11 3:12 ` Shawn Guo
2014-01-11 3:12 ` Shawn Guo
2014-01-11 13:15 ` Arnd Bergmann
2014-01-11 13:15 ` Arnd Bergmann
2014-01-12 3:25 ` Shawn Guo
2014-01-12 3:25 ` Shawn Guo
2014-01-12 20:21 ` Arnd Bergmann
2014-01-12 20:21 ` Arnd Bergmann
2014-01-12 23:16 ` Linus Walleij
2014-01-12 23:16 ` Linus Walleij
2014-01-13 2:31 ` Shawn Guo
2014-01-13 2:31 ` Shawn Guo
2014-01-13 2:19 ` Shawn Guo
2014-01-13 2:19 ` Shawn Guo
2014-01-24 8:02 ` Heiko Stübner
2014-01-24 8:02 ` Heiko Stübner
2014-01-25 2:25 ` Shawn Guo
2014-01-25 2:25 ` Shawn Guo
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=52D418EB.1040605@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=linux-arm-kernel@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.