From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 66DDEBE4 for ; Fri, 20 Oct 2017 13:37:49 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D354BE0 for ; Fri, 20 Oct 2017 13:37:48 +0000 (UTC) Received: from mail-qt0-f182.google.com (mail-qt0-f182.google.com [209.85.216.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B6B421924 for ; Fri, 20 Oct 2017 13:37:48 +0000 (UTC) Received: by mail-qt0-f182.google.com with SMTP id j58so18472298qtj.0 for ; Fri, 20 Oct 2017 06:37:48 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20171017114823.58476908@bbrezillon> <20171018110958.mh76pngzluazmc7y@sirena.co.uk> <20171018175910.GP12015@bill-the-cat> <23a238d7-0b3d-8b46-b2fe-88b9d0841aa1@st.com> <59E8F2EC.5090602@gmail.com> From: Rob Herring Date: Fri, 20 Oct 2017 08:37:26 -0500 Message-ID: To: Alexandre Torgue Content-Type: text/plain; charset="UTF-8" Cc: Tom Rini , Kumar Gala , "ksummit-discuss@lists.linuxfoundation.org" , Rob Herring , "devicetree-spec@vger.kernel.org" , Pantelis Antoniou , Andrew Turner , Grant Likely , "devicetree@vger.kernel.org" , Andy Gross , David Gibson , Lucas Stach Subject: Re: [Ksummit-discuss] Devicetree Workshop at Kernel Summit Prague (26 Oct 2017) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, Oct 20, 2017 at 4:55 AM, Alexandre Torgue wrote: > Hi Frank, > > > On 10/19/2017 08:46 PM, Frank Rowand wrote: >> On 10/19/17 07:59, Rob Herring wrote: >>> On Thu, Oct 19, 2017 at 9:00 AM, Alexandre Torgue >>> wrote: >>>> >>>> Hi Rob, >>>> >>>> >>>> On 10/19/2017 01:53 AM, Rob Herring wrote: >>>>> On Wed, Oct 18, 2017 at 6:28 PM, Andrew Turner >>>>> wrote: >>> >>> >>> [...] >>>> -->For example, I want to use the same dtsi files between Linux >>>> and >>>> U-boot. If in u-boot dts file I overload several "status" entry by >>>> "disabled", is it possible that compiler doesn't build it ? And what >>>> about >>>> not used phandle ? >>> >>> >>> You certainly could remove disabled nodes in dtc. I'm not sure how >>> hard it would be to plumb into dtc. I think phandle properties are >>> already only created if there's a reference to them. If that is >> >> >> Yes, phandles are only created if referenced, unless compiled >> for loading overlays into: >> > > Are there DTC "extra" options to use to not build those useless phandles ? I > just tried to revert the dtb to dts (using following command: > ./scripts/dtc/dtc -I dtb -O dts -o stm32f469-disco-flat.dts > arch/arm/boot/dts/stm32f469-disco.dtb) > > I see that phandles not used are in the dts output file. It is especially an > issue for pinmux phandles. All pinmux groups possibilities are written > inside (in my case) stm32f4-pinctrl.dtsi. This file is included in each > stm32 board dts files, and in those stm32 board dts files only required node > are enabled. But I see that all pinmux definitions are embedded inside dtb > binary (even ones not used in board dts file). Ah, you mean removing nodes without a phandle reference, not phandles themselves. There's no way dtc could do that because no reference doesn't equate to unused. For example, there's no phandle reference to the /memory node, but that is for sure needed. We would have to add some annotation to nodes that could be removed if unused. This could be some source annotation (/delete-if-unused/), some extension to status property, or some new property. Another option would be just mark all those nodes disabled and then postprocess the dtb to mark them okay if they have a phandle property and delete the node if not. Rob From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Herring Subject: Re: [Ksummit-discuss] Devicetree Workshop at Kernel Summit Prague (26 Oct 2017) Date: Fri, 20 Oct 2017 08:37:26 -0500 Message-ID: References: <20171017114823.58476908@bbrezillon> <20171018110958.mh76pngzluazmc7y@sirena.co.uk> <20171018175910.GP12015@bill-the-cat> <23a238d7-0b3d-8b46-b2fe-88b9d0841aa1@st.com> <59E8F2EC.5090602@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Alexandre Torgue Cc: Frank Rowand , Tom Rini , Kumar Gala , "ksummit-discuss-cunTk1MwBs98uUxBSJOaYoYkZiVZrdSR2LY78lusg7I@public.gmane.org" , Rob Herring , "devicetree-spec-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Pantelis Antoniou , Andrew Turner , Andy Gross , Grant Likely , Lucas Stach , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , David Gibson List-Id: devicetree@vger.kernel.org On Fri, Oct 20, 2017 at 4:55 AM, Alexandre Torgue wrote: > Hi Frank, > > > On 10/19/2017 08:46 PM, Frank Rowand wrote: >> On 10/19/17 07:59, Rob Herring wrote: >>> On Thu, Oct 19, 2017 at 9:00 AM, Alexandre Torgue >>> wrote: >>>> >>>> Hi Rob, >>>> >>>> >>>> On 10/19/2017 01:53 AM, Rob Herring wrote: >>>>> On Wed, Oct 18, 2017 at 6:28 PM, Andrew Turner >>>>> wrote: >>> >>> >>> [...] >>>> -->For example, I want to use the same dtsi files between Linux >>>> and >>>> U-boot. If in u-boot dts file I overload several "status" entry by >>>> "disabled", is it possible that compiler doesn't build it ? And what >>>> about >>>> not used phandle ? >>> >>> >>> You certainly could remove disabled nodes in dtc. I'm not sure how >>> hard it would be to plumb into dtc. I think phandle properties are >>> already only created if there's a reference to them. If that is >> >> >> Yes, phandles are only created if referenced, unless compiled >> for loading overlays into: >> > > Are there DTC "extra" options to use to not build those useless phandles ? I > just tried to revert the dtb to dts (using following command: > ./scripts/dtc/dtc -I dtb -O dts -o stm32f469-disco-flat.dts > arch/arm/boot/dts/stm32f469-disco.dtb) > > I see that phandles not used are in the dts output file. It is especially an > issue for pinmux phandles. All pinmux groups possibilities are written > inside (in my case) stm32f4-pinctrl.dtsi. This file is included in each > stm32 board dts files, and in those stm32 board dts files only required node > are enabled. But I see that all pinmux definitions are embedded inside dtb > binary (even ones not used in board dts file). Ah, you mean removing nodes without a phandle reference, not phandles themselves. There's no way dtc could do that because no reference doesn't equate to unused. For example, there's no phandle reference to the /memory node, but that is for sure needed. We would have to add some annotation to nodes that could be removed if unused. This could be some source annotation (/delete-if-unused/), some extension to status property, or some new property. Another option would be just mark all those nodes disabled and then postprocess the dtb to mark them okay if they have a phandle property and delete the node if not. Rob -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html