Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754583Ab2KIX1Z (ORCPT ); Fri, 9 Nov 2012 18:27:25 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:36778 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751779Ab2KIX1W (ORCPT ); Fri, 9 Nov 2012 18:27:22 -0500 MIME-Version: 1.0 In-Reply-To: <509D8A62.1080102@wwwdotorg.org> References: <20121109022624.GI23553@truffula.fritz.box> <509D8A62.1080102@wwwdotorg.org> From: Grant Likely Date: Fri, 9 Nov 2012 23:27:01 +0000 X-Google-Sender-Auth: ighzWRAABjuwXzQ_J3LVrjWLjfY Message-ID: Subject: Re: [RFC] Device Tree Overlays Proposal (Was Re: capebus moving omap_devices to mach-omap2) To: Stephen Warren Cc: David Gibson , Kevin Hilman , Matt Porter , Koen Kooi , Pantelis Antoniou , linux-kernel , Felipe Balbi , Deepak Saxena , Scott Wood , Russ Dill , linux-omap@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2762 Lines: 59 On Fri, Nov 9, 2012 at 10:57 PM, Stephen Warren wrote: > On 11/08/2012 07:26 PM, David Gibson wrote: > ... >> I also think graft will handle most of your use cases, although as I >> said I don't fully understand the implications of some of them, so I >> could be wrong. So, the actual insertion of the subtree is pretty >> trivial to implement. phandles are the obvious other matter to be >> dealt with. I haven't found the right thread where what you've >> envisaged so far is discussed, so here are things I can see: >> >> 1) Avoiding phandle collisions between main tree and subtree (or >> between subtrees). >> >> I'm hopeful that this can be resolved just by establishing some >> conventions about the ranges of phandles to be used for various >> components. I'd certainly be happy to add a directive to dtc which >> enforces allocation of phandles within a specified range. > > One case I wonder about is: > > Base board A that's split into two .dts files e.g. due to there being > two versions of the base board which are 90% identical, yet there being > a few differences between them. > > Base board B that's just a single .dts file. > > We might allocate phandle range 0..999 for the base board. > > Child board X plugs into either, so the two base boards need to "export" > the same set of phandle IDs to the child board to allow it to reference > them. It's more than just that. The boards really need to be equivalent since the irq specifiers and gpio specifiers need to match the gpio and irq controllers provided by the board. So a simple overlay design won't cover the case of a single file that will work generically on any board. > If base board A version 2 comes along after the phandle IDs that the > child board uses are defined, then how do we handle assigning a specific > phandle ID range to each of base board A's two version-specific > overlays, when the version-specific changes might affect arbitrary > phandle IDs within the range, and require some to be moved into the base > board version-specific overlays and some to stay in the common base > board .dts? With the design I'm currently considering, at the dts level the overlay could be compiled against any base boards if the specifiers are equivalent and the labels match up as indicated above. The compiled dtb could also be somewhat portable, but only if care is taken to make sure the phandles match too; possibly by explicitly specifying them instead of letting them be generated by a hash. g. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/