devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
Subject: Re: Pinmux with device tree
Date: Thu, 19 May 2011 11:42:26 -0600	[thread overview]
Message-ID: <BANLkTin-2y45WYaZpCEAFiSidCT0HvPjXw@mail.gmail.com> (raw)
In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF0498A47BFF-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>

On Thu, May 19, 2011 at 11:24 AM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
> Grant Likely wrote at Thursday, May 19, 2011 11:10 AM
>> On Thu, May 19, 2011 at 07:30:52PM +0800, Haojian Zhuang wrote:
>> > On Thu, May 19, 2011 at 3:33 AM, Mitch Bradley <wmb-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org> wrote:
>> > > On 5/18/2011 6:34 AM, Simon Glass wrote:
>> > >>
>> > >> Hi,
>> > >>
>> > >> I see a new pinmux system in the LKML. Has anyone looked at how to
>> > >> represent pinmux settings in the device tree?
>> > >>
>> > >> On a related topic, the examples that are used for GPIOs assume a
>> > >> flags word which describes things like pull-ups, direction, etc. This
>> > >> seems pretty cumbersome and gets worse with pinmuxes. People editing
>> > >> the device trees want to see symbolic information rather than a coded
>> > >> number, a bit like a #define. I can see this can be done with strings
>> > >> but this is inefficient in time and space, and is error-prone.  Is
>> > >> there support for this in device trees that I have missed?
>>
>> Why is it error prone?  It is probably less error prone than using
>> magic integer values.  :-)
>
> I think that comment was saying that if the FDT itself contains the strings,
> if there were a typo, it'd only be detected at run-time (well, admittedly
> just like a typo in a number).

We can (and do) implement semantic checks in dtc.

>
> However, if the DT compiler implemented something like the pre-processor,
> any typos in define usage would be detected at compile time due to referencing
> a non-existing define/variable, which is less error-prone.
>
> I must admit, when I first saw DT source files, my first though was to run
> CPP on them (or similar token->integer replacement utility, which also
> supported bitwise math e.g. for the GPIO flags stuff), and then pass the
> result to dtc, so that I could work with names instead of numbers.

There has been much talk over the years about how to make dtc better.
I did try at one point to use CPP, but unfortunately there were too
many C assumption in CPP that made the result... yucky.

g.

  parent reply	other threads:[~2011-05-19 17:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 16:34 Pinmux with device tree Simon Glass
     [not found] ` <BANLkTin5wBtR4zkgsQ6dw1jQP8yQGCDS2Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-18 19:33   ` Mitch Bradley
     [not found]     ` <4DD41F02.4050108-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2011-05-19 11:30       ` Haojian Zhuang
     [not found]         ` <BANLkTim94SKgWvUF6_PWb9O5YsuNk120Bw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-19 17:10           ` Grant Likely
     [not found]             ` <20110519171029.GH3085-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2011-05-19 17:24               ` Stephen Warren
     [not found]                 ` <74CDBE0F657A3D45AFBB94109FB122FF0498A47BFF-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-05-19 17:42                   ` Grant Likely [this message]
2011-05-19 19:59               ` Mitch Bradley
     [not found]                 ` <4DD576BD.7090307-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2011-05-19 20:36                   ` Nicolas Pitre
     [not found]                     ` <alpine.LFD.2.00.1105191625050.14430-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2011-05-19 20:54                       ` Mitch Bradley
     [not found]                         ` <4DD5839C.2020809-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2011-05-20  2:23                           ` Nicolas Pitre
     [not found]                             ` <alpine.LFD.2.00.1105192217350.14430-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2011-05-20  2:31                               ` Mitch Bradley
2011-05-26  3:43               ` Simon Glass

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=BANLkTin-2y45WYaZpCEAFiSidCT0HvPjXw@mail.gmail.com \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@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).