From: Mitch Bradley <wmb-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
To: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Michal Marek <mmarek-AlSwsSmVLrQ@public.gmane.org>,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: dtc: import latest upstream dtc
Date: Wed, 10 Oct 2012 08:23:29 -1000 [thread overview]
Message-ID: <5075BD21.2070106@firmworks.com> (raw)
In-Reply-To: <5075ABB8.103-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 10/10/2012 7:09 AM, Rob Herring wrote:
> On 10/09/2012 04:16 PM, Stephen Warren wrote:
>> On 10/01/2012 12:39 PM, Jon Loeliger wrote:
>>>>
>>>> What more do you think needs discussion re: dtc+cpp?
>>>
>>> How not to abuse the ever-loving shit out of it? :-)
>>
>> Perhaps we can just handle this through the regular patch review
>> process; I think it may be difficult to define and agree upon exactly
>> what "abuse" means ahead of time, but it's probably going to be easy
>> enough to recognize it when one sees it?
>
> Rather than repeating things over and over in reviews, we should
> document at least rules we can easily agree on and then add to it when
> people get "creative." Also, I can't keep up with every single binding
> review as is, and this could just add another level of complexity to the
> review. A few off the top of my head and from the thread discussion:
>
> - Headers must be self contained with no outside (i.e. libc, kernel,
> etc.) header dependencies.
> - No kernel kconfig option usage
> - No gcc built-in define usage
> - No unused items (i.e. externs, structs, etc.)
> - No macro concatenation
> - No macros for strings or property names
Instead of making a bunch of rules about how you can only use a small
subset of cpp, why not just add a "define name value" command to DTC?
One of the things I like least about C is that the language itself is
incomplete; in order to actually program in C, you have to deal with not
only with the C syntactic structure, but also cpp, with its different
rules, and also make, with fundamentally different linguistic structure,
and then you end up wrapping that in something like KConfig, with yet
another linguistic framework, and the makefile contains embedded shell
commands, which is yet another syntax.
Rather than open Pandora's box by grafting on cpp, why not solve the
actual problem?
>
> Do we further restrict things to say defines are only numbers? One could
> start to define complex macros to build the nodes themselves. If each
> platform does this slightly differently, it will become difficult to
> review and maintain. Then we will be doing dts consolidation. The fact
> that we have some fixed structure and each SOC is not free to do things
> their own way makes things easier to maintain. You don't have that in
> the kernel across platforms. For example, look how register defines and
> static mappings or platform device creation are done. They are all
> similar, but yet slightly different. That makes doing changes across
> platforms more difficult.
>
>> I imagine the most common usage will simply be a bunch of:
>>
>> #define TEGRA_GPIO_PB0 32
>> #define TEGRA_GPIO_INT_LEVEL_LOW 8
>>
>> / {
>> xxx {
>> interrupts = <TEGRA_GPIO_PB0 TEGRA_GPIO_INT_LEVEL_LOW>;
>>
>> and similarly, simple math:
>>
>> something = <((FOO << XXX_SHIFT) | (BAR << YYY_SHIFT))>;
>>
>
> These are all perfectly fine and sane use, but if we don't restrict
> things then the next step is this:
>
> #define PROP_SOMETHING(v) (something = <(v)>)
>
> Rob
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
>
next prev parent reply other threads:[~2012-10-10 18:23 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-28 21:25 [PATCH] dtc: import latest upstream dtc Stephen Warren
2012-09-29 21:06 ` Jon Loeliger
2012-10-01 16:09 ` Rob Herring
[not found] ` <5069C042.40209-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-10-01 16:13 ` Stephen Warren
[not found] ` <5069C11C.6040505-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-10-01 17:56 ` Rob Herring
2012-10-01 18:33 ` Stephen Warren
[not found] ` <5069E1F0.5070902-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-10-01 18:39 ` Jon Loeliger
[not found] ` <E1TIktZ-0000U4-Qh-CYoMK+44s/E@public.gmane.org>
2012-10-09 21:16 ` Stephen Warren
[not found] ` <50749441.8030307-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-10-09 23:20 ` Mitch Bradley
2012-10-10 0:04 ` Scott Wood
2012-10-10 4:43 ` Warner Losh
2012-10-10 7:24 ` David Gibson
[not found] ` <20121010072401.GA28467-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
2012-10-10 14:41 ` Warner Losh
2012-10-10 23:06 ` David Gibson
2012-10-10 15:16 ` Stephen Warren
2012-10-10 15:33 ` Rob Herring
2012-10-10 16:19 ` Stephen Warren
2012-10-10 17:18 ` Rob Herring
2012-10-10 18:42 ` Stephen Warren
[not found] ` <5075954B.8030008-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-10-10 23:16 ` David Gibson
2012-10-11 1:42 ` Mitch Bradley
[not found] ` <50762409.5060105-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2012-10-11 5:11 ` David Gibson
[not found] ` <50759152.9050407-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-10-10 23:09 ` David Gibson
2012-10-10 15:15 ` Stephen Warren
2012-10-10 16:09 ` Scott Wood
2012-10-10 16:22 ` Stephen Warren
2012-10-10 23:18 ` David Gibson
2012-10-12 17:24 ` Stephen Warren
[not found] ` <5078525B.9030008-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-10-13 6:24 ` David Gibson
[not found] ` <20121013062453.GH4640-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
2012-10-13 13:42 ` Segher Boessenkool
[not found] ` <3C5DD611-6F36-4D13-9A88-377A8E30AAA5-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
2012-10-14 0:16 ` David Gibson
2012-10-10 17:09 ` Rob Herring
[not found] ` <5075ABB8.103-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-10-10 18:23 ` Mitch Bradley [this message]
[not found] ` <5075BD21.2070106-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2012-10-10 18:45 ` Stephen Warren
[not found] ` <5075C254.4040304-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-10-10 18:56 ` Mitch Bradley
2012-10-11 0:14 ` David Gibson
2012-10-10 23:54 ` David Gibson
2012-10-10 18:40 ` Stephen Warren
[not found] ` <5075C10C.1030205-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-10-10 18:52 ` Mitch Bradley
2012-10-01 18:02 ` Jon Loeliger
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=5075BD21.2070106@firmworks.com \
--to=wmb-d5eqfidgl7eakbo8gow8eq@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mmarek-AlSwsSmVLrQ@public.gmane.org \
--cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=swarren-DDmLM1+adcrQT0dZR+AlfA@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).