From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 99DBFC433F5 for ; Fri, 14 Jan 2022 12:11:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=InlCeyVZh5ILWe1l82vQ5J9Yh1mAW/MjsbEZ982crBc=; b=Wd3IvMMW3yJtf3 w1lIjhzGRlOXclCZl4ri+ikKZzC/Pnz3RmR/VeJFy85jcNuKVdtEtl87aAd7nwOLepefMzGFbm++N 4yoQaVqUaXdapb+SXec/arJUJgHTTkW/sqFwlZFAMW8bhFizmdCMAxgzVxQnRbtr0CHpHc7IS+ccD NgtoYaiJg/8hkOCFl3fzdvXBm6SC48iQ663KwlYtnBqwiBxbZu8u1XrVC6jTUdfikllFSCUGc1ww9 KKz+2uhzoP0iBPh5gV+1zBy2GZJB7qsbD+y9EfKiOmJkjSY0Rx9kFgzvcwJo/HNIkJYd587AXCrSi u+XQl90nZ08WjP9pVNew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n8LOo-0093SM-3Y; Fri, 14 Jan 2022 12:09:42 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n8LOj-0093RE-HV for linux-arm-kernel@lists.infradead.org; Fri, 14 Jan 2022 12:09:39 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D783FED1; Fri, 14 Jan 2022 04:09:34 -0800 (PST) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 19D883F774; Fri, 14 Jan 2022 04:09:33 -0800 (PST) Date: Fri, 14 Jan 2022 12:09:31 +0000 From: Andre Przywara To: Mark Rutland Cc: Vladimir Murzin , linux-arm-kernel@lists.infradead.org, Jaxson Han Subject: Re: [boot-wrapper PATCH v2 9/9] avoid dtc warnings on re-compiling DTB Message-ID: <20220114120931.36488dfe@donnerap.cambridge.arm.com> In-Reply-To: References: <20211222181607.1203191-1-andre.przywara@arm.com> <20211222181607.1203191-10-andre.przywara@arm.com> <706471d8-a0fd-35fb-4fa0-380bfb1b78e7@arm.com> <20220113195051.7100b066@slackpad.fritz.box> <9eb63797-b313-a39a-6b9c-0f8ac447b85a@arm.com> Organization: ARM X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220114_040937_717439_665ED81B X-CRM114-Status: GOOD ( 38.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 14 Jan 2022 10:44:55 +0000 Mark Rutland wrote: > On Fri, Jan 14, 2022 at 08:35:06AM +0000, Vladimir Murzin wrote: > > Hi Andre, > > > > On 1/13/22 7:50 PM, Andre Przywara wrote: > > > On Thu, 13 Jan 2022 18:42:50 +0000 > > > Vladimir Murzin wrote: > > > > > > Hi Vladimir, > > > > > >> On 12/22/21 6:16 PM, Andre Przywara wrote: > > >>> When we add the PSCI nodes to the provided DTB, we use dtc to de-compile > > >>> the blob first, then re-compile it with our nodes and properties added. > > >>> > > >>> In our input DTB the proper phandle references have already been lost, > > >>> all we see in the DTB is phandle properties in the target node, and some > > >>> numbers in the clocks and gpios properties: > > >>> =========== > > >>> clk24mhz { > > >>> compatible = "fixed-clock"; > > >>> #clock-cells = <0x00>; > > >>> clock-frequency = <0x16e3600>; > > >>> clock-output-names = "v2m:clk24mhz"; > > >>> -> phandle = <0x05>; > > >>> }; > > >>> ... > > >>> serial@90000 { > > >>> compatible = "arm,pl011", "arm,primecell"; > > >>> reg = <0x90000 0x1000>; > > >>> interrupts = <0x05>; > > >>> -> clocks = <0x05 0x05>; > > >>> clock-names = "uartclk", "apb_pclk"; > > >>> }; > > >>> =========== > > >>> dtc warns that those numbers might be wrong: > > >>> ========= > > >>> :177.6-27: Warning (clocks_property): > > >>> /bus@8000000/motherboard-bus@8000000/iofpga-bus@300000000/serial@90000: > > >>> clocks: cell 0 is not a phandle reference > > >>> .... > > >>> ========= > > >>> The proper solution would be to use references (&v2m_clk24mhz) instead, > > >>> as there are in the source .dts file, but we don't have that information > > >>> anymore, and cannot easily recover it. > > >>> > > >>> To avoid the lengthy list of warnings, just drop those checks from the > > >>> dtc compilation run. This disables more checks than we want or need, but > > >>> we somewhat trust in the original DTB to be sane, so that should be > > >>> fine. > > >>> > > >>> Signed-off-by: Andre Przywara > > >>> --- > > >>> Makefile.am | 2 +- > > >>> 1 file changed, 1 insertion(+), 1 deletion(-) > > >>> > > >>> diff --git a/Makefile.am b/Makefile.am > > >>> index 3d8128f..430b4a9 100644 > > >>> --- a/Makefile.am > > >>> +++ b/Makefile.am > > >>> @@ -160,7 +160,7 @@ model.lds: $(LD_SCRIPT) Makefile > > >>> $(CPP) $(CPPFLAGS) -ansi -DPHYS_OFFSET=$(PHYS_OFFSET) -DMBOX_OFFSET=$(MBOX_OFFSET) -DKERNEL_OFFSET=$(KERNEL_OFFSET) -DFDT_OFFSET=$(FDT_OFFSET) -DFS_OFFSET=$(FS_OFFSET) $(XEN) -DXEN_OFFSET=$(XEN_OFFSET) -DKERNEL=$(KERNEL_IMAGE) -DFILESYSTEM=$(FILESYSTEM) -DTEXT_LIMIT=$(TEXT_LIMIT) -P -C -o $@ $< > > >>> > > >>> fdt.dtb: $(KERNEL_DTB) Makefile > > >>> - ( $(DTC) -O dts -I dtb $(KERNEL_DTB) ; echo "/ { $(CHOSEN_NODE) $(PSCI_NODE) }; $(CPU_NODES)" ) | $(DTC) -O dtb -o $@ - > > >>> + ( $(DTC) -O dts -I dtb $(KERNEL_DTB) ; echo "/ { $(CHOSEN_NODE) $(PSCI_NODE) }; $(CPU_NODES)" ) | $(DTC) -O dtb -o $@ -Wno-clocks_property -Wno-gpios_property - > > >>> > > >>> # The filesystem archive might not exist if INITRD is not being used > > >>> .PHONY: all clean $(FILESYSTEM) > > >>> > > >> > > >> dtc 1.4.1 complains > > > > > > Which distro ships this version? (distrowatch doesn't list dtc) > > > > > > tag v1.4.1 > > > Tagger: David Gibson > > > Date: Wed Nov 12 14:31:44 2014 +1100 > > > > > > Any chance it's just you and you can update this? It looks like the > > > first version to support it is 1.4.5, as shipped for instance with > > > Ubuntu 18.04. > > > > It is shipped as LSF module. I can try to ask for an update, but I thought > > that other people may run into it as well... > > > > > > > >> FATAL ERROR: Unrecognized check name "clocks_property" > > > > > > Sigh, thanks for the heads up. I don't know if we want to blow up the > > > Makefile with a feature test? > > > > I dunno, TBH. It look like warning used to be less evil than error... Yeah, that's what I meant: Either revert it or extend the Makefile. > I agree. > > My preference would be to revert that for now, and consider the problem afresh. > Andre, are you ok with that? Sure, I don't want to break the build for people. I think kvmtool has some lightweight feature tests in its Makefile, I can try to steal some of it, and see how evil it looks. Or wait for half a year to see those older dtcs flushed out and try it again ;-) Cheers, Andre _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel