linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Dave Martin <dave.martin@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [ARM] Use AT() in the linker script to create correct program headers
Date: Tue, 9 Oct 2012 12:25:14 -0600	[thread overview]
Message-ID: <20121009182514.GF4124@obsidianresearch.com> (raw)
In-Reply-To: <20121008104649.GD2302@linaro.org>

On Mon, Oct 08, 2012 at 11:46:49AM +0100, Dave Martin wrote:

> > Yes, but we still need rely on complex code like I2C/MTD to create a
> > correct DTB, which again puts us back to patching the kernel for that
> > functionality.
> 
> I'm still confused as to where this complexity is coming from.
> 
> If you need to run some complex I2C and MTD code to generate the DT, what
> is that code doing?  If it is probing to get the information, then can you
> avoid putting the info in the DT at all?  Primarily the DT is to describe
> those aspects of the hardware which can't be probed.

At manufacturing the unit is programmed with a small datastructure that
contains all the unique ID's (MAC addresses, etc), manufacturing
variations (ie vendor A or B was used for a socket) and other
ancillary data.

So a fair amount of I2C and MTD stack is required just to fetch this
structure - a full CFI probe, for instance, is needed in the NOR flash
case just to locate the structure.

Once read, things like MAC addresses are copied into the DTB, and
certain sections of the DTB are NOP'd out - we have stanzas for chip
vendor A and vendor B, the one that was not put on the board is
replaced with NOP.

Similar to the A/B fix, a further fixup is done based on a runtime
probe of the programmable devices to learn their current
configuration/memory map.

It seems desirable to present a complete/correct DTB to the kernel,
it doesn't seem there are great places to hook in custom discovery
procedures.

>From a maintenance perspective we already have to test/etc the kernel
code for all of this, we don't want to do that twice by duplicating
this stuff outside the kernel.

> Otherwise, you that have a few static configurations: you could have one
> pre-baked DT per hardware platform, and choose the correct one once you
> have detected the platform.

We do that too, for instance the PPC kernel we build supports 4
different circuit boards, each served by a separate DTB, that needs a
fixup pass.

I think the biggest DTB describes about 49 devices..
  
> > Where the 'dev tree provider' would use the stored bootloader
> > registers and any other information to return the proper DTB. 
> 
> It would need developing a bit, but something like that might be
> possible -- it should probably be discussed via devicetree-discuss.
> 
> If it is doing anything less trivial than picking a pre-baked DT, the
> rationale would need to be carefully argued.

I'm not sure there is a great interest in this? What are other folks
working on production embedded stuff doing? I suppose that will be
more clear as device tree is rolled out.

Jason

  reply	other threads:[~2012-10-09 18:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-30 23:21 [PATCH] [ARM] Use AT() in the linker script to create correct program headers Jason Gunthorpe
2012-10-01 15:39 ` Dave Martin
2012-10-01 16:06   ` Jason Gunthorpe
2012-10-01 17:56     ` Dave Martin
2012-10-01 18:35       ` Jason Gunthorpe
2012-10-02 10:23         ` Dave Martin
2012-10-02 17:47           ` Jason Gunthorpe
2012-10-03 10:43             ` Dave Martin
2012-10-03 18:44               ` Jason Gunthorpe
2012-10-04 11:36                 ` Dave Martin
2012-10-04 17:59                   ` Jason Gunthorpe
2012-10-08 10:46                     ` Dave Martin
2012-10-09 18:25                       ` Jason Gunthorpe [this message]
2012-10-10  9:55                         ` Dave Martin
2012-10-12 21:24                           ` Jason Gunthorpe
2012-10-05  8:45     ` Russell King - ARM Linux
2012-10-08 10:24       ` Dave Martin
2012-10-09 17:37         ` Jason Gunthorpe
2012-10-10  9:18           ` Dave Martin

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=20121009182514.GF4124@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.com \
    --cc=dave.martin@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.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 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).