devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mitch Bradley <wmb-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
To: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
	"cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org"
	<cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>,
	Dong Aisheng <dongas86-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"Sascha Hauer (s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org)"
	<s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org"
	<rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	"kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org"
	<kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: An extremely simplified pinctrl bindings proposal
Date: Mon, 06 Feb 2012 11:24:20 -1000	[thread overview]
Message-ID: <4F304504.2050002@firmworks.com> (raw)
In-Reply-To: <CACRpkdYt-L+an5DTdYkS5Hi+18-rszAt7hXwZNUNVK-d0UaCWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 2/6/2012 9:26 AM, Linus Walleij wrote:
> On Mon, Feb 6, 2012 at 8:05 PM, Mitch Bradley<wmb-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>  wrote:
>
>> I like the general approach of simplifying the pinctrl thing, as the
>> previous approach did not appear to be converging.
>
> pinctrl as such is upstream, widely ACKed and quite converged I'd say.
>
> But the Device Tree bindings and general path to get data out of the drivers
> and board files are not (yet) converging...
>
>> Both Open Firmware and ACPI have addressed this general problem.  In
>> addition to a numeric identifier for the register, you need to specify the
>> access semantics.  It's difficult to finitely enumerate all possible cases,
>> but you can get to 99.9% with a modest number of access models, and then add
>> new models as needed.
>
> This is interesting. So are you referring to a piece of Open Firmware
> that is not in the Device Tree? Since this is all about device tree that
> comes from OF, we might be reinventing the wheel.

Open Firmware in general is a complete firmware system, with features 
for system initialization, bootloading, diagnostics (for factory, field 
service, and end users), system maintenance functions like OS upgrades, 
and debugging tools for hardware, the firmware itself, and the OS.  It 
exports a set of callbacks that OF-aware OSs (e.g. Solaris) can use to 
perform demand-loading of driver modules, even for core drivers like the 
filesystem root device.  It is fully programmable, including an 
interpreter, incremental compiler, decompiler, assembler, disassembler, 
and both source-level and assembly language debugging.  Modern 
implementations include complete network stacks and support for numerous 
filesystems.

Its device tree serves not only to communicate information to the OS, 
but also as the framework for OF's driver model.  In addition to the 
descriptive properties, device nodes contain executable methods that 
implement the device drivers that support the feature set listed above. 
  The device drivers can either be hard-compiled or demand-loaded from 
"option ROMs" on plug-in cards.  They are encoded using "FCode", a 
processor and platform neutral byte-coded representation of Forth source 
code.

The register access generalization that I was talking about is part of 
that driver model.  Each bus driver implements a set of register access 
methods that apply to its children.  The child drivers invoke those 
methods from the parent, without having to know any platform-specific 
details.

The register access model is based on executable methods rather than on 
descriptive data in properties.  In many cases, those methods use info 
in the properties, including "reg", "ranges" and "#address-cells", but 
the methods can also encode semantic requirements that are difficult to 
describe as pure data.

To fully solve all the problems that eventually arise, you end up 
needing a programming language, which is why Open Firmware was built 
from the ground up around a programming language core.

Of course, it's usually possible to solve a very large subset of 
problems with a sufficiently-elaborate data description.


> Can you give some pointers?

The definitive core document is IEEE 1275-1994, but that document is 18 
years old and is not really the best way to learn about Open Firmware. 
(The status of that document with respect to IEEE is "withdrawn".  What 
that really means is that we (the group that developed it) got fed up 
with the IEEE process and declined to spend the time, money, and effort 
necessary to comply with IEEE's public voting process for 
"reaffirmation" every N years.)

Here are some pointers to information about modern implementations and 
usage:

http://wiki.laptop.org/go/Open_Firmware
http://wiki.laptop.org/go/Forth_Lessons
http://www.openfirmware.info

One Laptop Per Child uses Open Firmware on both x86 and ARM systems.

>
> Indeed it seems related to ACPI or some BIOS stuff on
> non-embedded systems.
>
> Yours,
> Linus Walleij
>
>

  parent reply	other threads:[~2012-02-06 21:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-05  5:31 An extremely simplified pinctrl bindings proposal Stephen Warren
2012-02-05  6:07 ` Richard Zhao
2012-02-06  3:07 ` Thomas Abraham
2012-02-06  5:44   ` Stephen Warren
2012-02-06  4:20 ` Linus Walleij
     [not found]   ` <CACRpkdahin4srDh7dphgvq306gjz7CGP=h4dVkUY+w0z0wpXRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-06  5:53     ` Stephen Warren
2012-02-06 17:29       ` Linus Walleij
     [not found]         ` <CACRpkdbtTPSoX1x4aBtNVGZ2Qex9t77D09V9JgON_jfShQdx6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-06 19:03           ` Tony Lindgren
     [not found]             ` <20120206190315.GU1426-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2012-02-06 19:56               ` Linus Walleij
     [not found]                 ` <CACRpkdZthbejmTqRJAWHb8jU-p8LPT_+zj_CY1q0voMb4FKz2Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-06 21:04                   ` Tony Lindgren
2012-02-06 23:15                     ` Linus Walleij
     [not found]                       ` <CACRpkdYrbD3PpJ3wb69yb3Ya8SeZJnPpgJdtttjWTkS5xsD-4g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-06 23:57                         ` Tony Lindgren
     [not found]                           ` <20120206235733.GY1426-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2012-02-07  1:07                             ` Linus Walleij
2012-02-07  5:28             ` Stephen Warren
     [not found]       ` <4F2F6AE2.1040504-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-02-06 19:41         ` Mark Brown
     [not found] ` <74CDBE0F657A3D45AFBB94109FB122FF178E5D3160-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-02-06 18:57   ` Tony Lindgren
2012-02-06 19:05 ` Mitch Bradley
2012-02-06 19:26   ` Linus Walleij
     [not found]     ` <CACRpkdYt-L+an5DTdYkS5Hi+18-rszAt7hXwZNUNVK-d0UaCWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-06 21:24       ` Mitch Bradley [this message]
     [not found]   ` <4F302474.1020701-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2012-02-07  5:33     ` Stephen Warren
     [not found]       ` <4F30B79C.4030404-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-02-07  7:07         ` Mitch Bradley

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=4F304504.2050002@firmworks.com \
    --to=wmb-d5eqfidgl7eakbo8gow8eq@public.gmane.org \
    --cc=cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=dongas86-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@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).