From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1947234Ab3BHWmv (ORCPT ); Fri, 8 Feb 2013 17:42:51 -0500 Received: from avon.wwwdotorg.org ([70.85.31.133]:32782 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760359Ab3BHWmu (ORCPT ); Fri, 8 Feb 2013 17:42:50 -0500 Message-ID: <51157F65.2050309@wwwdotorg.org> Date: Fri, 08 Feb 2013 15:42:45 -0700 From: Stephen Warren User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: Grant Likely CC: Rob Herring , Michal Marek , Grant Likely , Srinivas KANDAGATLA , Mark Brown , Scott Wood , Sam Ravnborg , linux-kernel@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, Stephen Warren Subject: Re: [PATCH V8] kbuild: create a rule to run the pre-processor on *.dts files References: <1360091188-24063-1-git-send-email-swarren@wwwdotorg.org> <20130208144527.0D8DD3E2C01@localhost> <51156D09.7060401@gmail.com> <20130208220448.EDA773E2C27@localhost> In-Reply-To: <20130208220448.EDA773E2C27@localhost> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/08/2013 03:04 PM, Grant Likely wrote: > On Fri, 08 Feb 2013 15:24:25 -0600, Rob Herring wrote: >> On 02/08/2013 08:45 AM, Grant Likely wrote: >>> On Tue, 5 Feb 2013 12:06:28 -0700, Stephen Warren wrote: >>>> From: Stephen Warren >>>> >>>> Create cmd_dtc_cpp to run the C pre-processor on *.dts file before >>>> passing them to dtc for final compilation. This allows the use of #define >>>> and #include within the .dts file. >>>> >>>> Acked-by: Simon Glass >>>> Acked-by: Jean-Christophe PLAGNIOL-VILLARD >>>> Acked-by: Michal Marek >>>> Acked-by: Srinivas Kandagatla >>>> Signed-off-by: Stephen Warren >>> >>> I've applied this and was going to push it out, but I've just thought of >>> a problem that could be a show stopper. Once a dtsp file includes a C >>> header, the contents of that header become part of the Device Tree ABI. >>> If someone changes that file (ie. to renumber a series of #defines) then >>> that will break the binding. We need a way to protect against that. >>> Someone changing a .h file may make the assumption that it is only >>> kernel internal and won't realize that it has external implications. >>> >>> I'm thinking that any dts includes need to be treated in the same way as >>> userspace headers. We could put them into include/uapi and piggy back on >>> the protection already afforded by that directory, or come up with >>> something new. Any thoughts? >> >> Also, we would never be able to separate the dts files from the kernel >> tree without some separation. > > Good point. They better be in a completely separate directory then. How about arch/*/include/dts/. Both *.dts and kernel code will need to include those headers (so that the kernel can parse the DTB using the same values), so putting the headers right into arch/*/boot/dts/ or arch/*/boot/dts/include/ might not make sense, since then that directory would still have to exist even if/when the .dts files are separated from the kernel.