From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mitch Bradley Subject: Re: [RFC] Device Tree Overlays Proposal (Was Re: capebus moving omap_devices to mach-omap2) Date: Tue, 13 Nov 2012 08:10:11 -1000 Message-ID: <50A28D03.7050002@firmworks.com> References: <50999145.2070306@wwwdotorg.org> <509D9089.7020407@wwwdotorg.org> <5B124797-6DFD-4C5E-90D7-665AFD4A7873@antoniou-consulting.com> <50A12950.6090808@wwwdotorg.org> <20121113072517.GE25915@truffula.fritz.box> <50A27BF1.4030502@wwwdotorg.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <50A27BF1.4030502-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Stephen Warren Cc: Kevin Hilman , Matt Porter , Koen Kooi , Pantelis Antoniou , linux-kernel , Felipe Balbi , Deepak Saxena , Russ Dill , Scott Wood , linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org List-Id: devicetree@vger.kernel.org It seems to me that this capebus discussion is missing an important point. The name capebus suggests that it is a bus, so there should be a parent node to represent that bus. It should have a driver whose API implements all of the system-interface functions a cape needs. If you look at the way that interrupt specifiers work, the default case is that a child device implicitly delegates the mapping to its parent. The use of phandles to break out of the tree structure was intended for use within the "hardwired motherboard domain", not for plug-in devices. The "new" phandle-based GPIO and clock mechanisms don't have that parent-delegation feature, but they should, because hierarchical hardware is a good thing when it exists. One fix would be to designate a reserved phandle value - for example 0 or -1 - to mean "my parent". t The parent node would contain some translator to resolve the actual target node, similarly to interrupts and addresses. If done correctly, capebus "overlays" would then just be proper child nodes of the capebus bus node and there would no need to refer to "global" information like non-parent phandles. If something about the design of capebus makes that impossible, I respectfully suggest that its design should be reviewed, taking into account the many years of industry experience about modularity. Mitch