All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Mike Looijmans <mike.looijmans@topic.nl>,
	Jonathan Cameron <jic23@jic23.retrosnub.co.uk>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: "Generic" MMIO ADC
Date: Fri, 7 Jul 2017 15:44:48 +0800	[thread overview]
Message-ID: <20170707154448.00006dec@huawei.com> (raw)
In-Reply-To: <CACRpkdaZ=qSbdVxgw4DH_tOeZb0pZBYhhJJOozFn2pn25F_Kag@mail.gmail.com>

On Thu, 6 Jul 2017 23:37:04 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:

> On Mon, Jul 3, 2017 at 2:37 PM, Mike Looijmans <mike.looijmans@topic.nl> wrote:
> 
> > I was thinking along these lines:
> >
> > ... {
> >    compatible = "iio-adc-generic-mmio";
> >    reg = <0x43210000 4096>;
> >    interrupt = <&gic 42 0>;
> >    iio,start-sequence = <0x0 0x3> <0x4 0xff>;
> >    iio,stop-sequence = <0x0 0x0>;  
> 
> Nope. We are not going to invent scripting languages inside device tree.
> No sequences please. This is the start of what we call a jam table.
> 
> We had this discussion a long time ago when starting to convert all the ARM
> platforms to device tree: sequences should be expressed in code, not in
> the device tree. Because next thing that happens is that you want to encode
> a for() loop or if() or while().
> 
> The reason is that device tree is already part of open firmware, which already
> has a scripting language: FCode (based on forth). This is then used to create
> BIOS routines along the lines of what you're suggesting. So if you insist on
> writing a BIOS, by all means write a BIOS, but not inside DT, use FCode
> and figure out how to bridge that.
> 
> But I think it's easier to just write a normal driver really.
> 
> Compare to ACPI, which has AML, for the very same purpose, and DSDT
> for describing the hardware.
> 
> Since ACPI is now starting to share parts of the DT bindings), things would
> get very weird if we did things like this. Should they also implement a
> compatible interpreter, rather than call their (very much in-use) AML
> snippets?
Ah that was matching up with my gut feeling on the matter.  Thanks for the detailed
response Linus.   Anyhow, doesn't mean the concept of such a driver is bad, merely that
the tables should form part of the driver code (much like any other driver that supports
a number of different parts) and be selected by the compatible string.

Jonathan
> 
> Yours,
> Linus Walleij
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <Jonathan.Cameron-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Mike Looijmans <mike.looijmans-Oq418RWZeHk@public.gmane.org>,
	Jonathan Cameron
	<jic23-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org>,
	"linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: "Generic" MMIO ADC
Date: Fri, 7 Jul 2017 15:44:48 +0800	[thread overview]
Message-ID: <20170707154448.00006dec@huawei.com> (raw)
In-Reply-To: <CACRpkdaZ=qSbdVxgw4DH_tOeZb0pZBYhhJJOozFn2pn25F_Kag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, 6 Jul 2017 23:37:04 +0200
Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:

> On Mon, Jul 3, 2017 at 2:37 PM, Mike Looijmans <mike.looijmans-Oq418RWZeHk@public.gmane.org> wrote:
> 
> > I was thinking along these lines:
> >
> > ... {
> >    compatible = "iio-adc-generic-mmio";
> >    reg = <0x43210000 4096>;
> >    interrupt = <&gic 42 0>;
> >    iio,start-sequence = <0x0 0x3> <0x4 0xff>;
> >    iio,stop-sequence = <0x0 0x0>;  
> 
> Nope. We are not going to invent scripting languages inside device tree.
> No sequences please. This is the start of what we call a jam table.
> 
> We had this discussion a long time ago when starting to convert all the ARM
> platforms to device tree: sequences should be expressed in code, not in
> the device tree. Because next thing that happens is that you want to encode
> a for() loop or if() or while().
> 
> The reason is that device tree is already part of open firmware, which already
> has a scripting language: FCode (based on forth). This is then used to create
> BIOS routines along the lines of what you're suggesting. So if you insist on
> writing a BIOS, by all means write a BIOS, but not inside DT, use FCode
> and figure out how to bridge that.
> 
> But I think it's easier to just write a normal driver really.
> 
> Compare to ACPI, which has AML, for the very same purpose, and DSDT
> for describing the hardware.
> 
> Since ACPI is now starting to share parts of the DT bindings), things would
> get very weird if we did things like this. Should they also implement a
> compatible interpreter, rather than call their (very much in-use) AML
> snippets?
Ah that was matching up with my gut feeling on the matter.  Thanks for the detailed
response Linus.   Anyhow, doesn't mean the concept of such a driver is bad, merely that
the tables should form part of the driver code (much like any other driver that supports
a number of different parts) and be selected by the compatible string.

Jonathan
> 
> Yours,
> Linus Walleij
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-07-07  7:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-30  8:44 "Generic" MMIO ADC Mike Looijmans
2017-06-30 13:53 ` Jonathan Cameron
2017-06-30 13:53   ` Jonathan Cameron
2017-06-30 13:59   ` Linus Walleij
2017-06-30 13:59     ` Linus Walleij
2017-06-30 15:33   ` Rob Herring
2017-06-30 15:33     ` Rob Herring
2017-07-03 12:37   ` Mike Looijmans
2017-07-03 12:37     ` Mike Looijmans
2017-07-06 18:22     ` Jonathan Cameron
2017-07-06 18:22       ` Jonathan Cameron
2017-07-06 21:37     ` Linus Walleij
2017-07-06 21:37       ` Linus Walleij
2017-07-07  7:44       ` Jonathan Cameron [this message]
2017-07-07  7:44         ` Jonathan Cameron
2017-07-09  4:11         ` Linus Walleij
2017-07-09  4:11           ` Linus Walleij

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=20170707154448.00006dec@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@jic23.retrosnub.co.uk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mike.looijmans@topic.nl \
    --cc=robh+dt@kernel.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.