public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Andre Przywara <andre.przywara@arm.com>
Cc: Vladimir Murzin <vladimir.murzin@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	Jaxson Han <jaxson.han@arm.com>
Subject: Re: [boot-wrapper PATCH v2 9/9] avoid dtc warnings on re-compiling DTB
Date: Wed, 19 Jan 2022 12:02:38 +0000	[thread overview]
Message-ID: <Yef93qizlD6l/org@FVFF77S0Q05N> (raw)
In-Reply-To: <20220114120931.36488dfe@donnerap.cambridge.arm.com>

On Fri, Jan 14, 2022 at 12:09:31PM +0000, Andre Przywara wrote:
> On Fri, 14 Jan 2022 10:44:55 +0000
> Mark Rutland <mark.rutland@arm.com> 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 <vladimir.murzin@arm.com> 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:
> > > >>> =========
> > > >>> <stdin>: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 <andre.przywara@arm.com>
> > > >>> ---
> > > >>>  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 <david@gibson.dropbear.id.au>
> > > > 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 ;-)

FWIW, the feature test idea doesn't sound bad, though I beleive that for
licensing reasons we cannot take that from kvmtool and would have to grow our
own.

Another option would be to extend FDT.pm to do the manipulation and drop the
dtc dependency entirely. That would require more work, but might make it easier
to do other DTB manipulation in future.

For now I've applied a revert, with a link to this thread and some wording that
we can reconsider this in future.

Thanks,
Mark.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-01-19 12:04 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22 18:15 [boot-wrapper PATCH v2 0/9] Various (build system) fixes Andre Przywara
2021-12-22 18:15 ` [boot-wrapper PATCH v2 1/9] Makefile: Avoid .got section creation Andre Przywara
2022-01-07 13:49   ` Mark Rutland
2021-12-22 18:16 ` [boot-wrapper PATCH v2 2/9] Add standard headers Andre Przywara
2022-01-07 13:49   ` Mark Rutland
2022-01-07 14:31     ` Andre Przywara
2022-01-11 11:34       ` Mark Rutland
2021-12-22 18:16 ` [boot-wrapper PATCH v2 3/9] Makefile: Tell compiler to generate bare-metal code Andre Przywara
2022-01-07 13:53   ` Mark Rutland
2022-01-07 14:38     ` Andre Przywara
2022-01-11 11:30       ` Mark Rutland
2022-01-18 12:52         ` Andre Przywara
2022-01-18 14:10           ` Ard Biesheuvel
2021-12-22 18:16 ` [boot-wrapper PATCH v2 4/9] configure: Make PSCI the default boot method Andre Przywara
2022-01-07 14:12   ` Mark Rutland
2021-12-22 18:16 ` [boot-wrapper PATCH v2 5/9] configure: Fix default DTB Andre Przywara
2022-01-07 14:13   ` Mark Rutland
2021-12-22 18:16 ` [boot-wrapper PATCH v2 6/9] configure: Use earlycon instead of earlyprintk Andre Przywara
2022-01-07 14:01   ` Mark Rutland
2022-01-07 14:14     ` Mark Rutland
2022-01-07 14:47     ` Andre Przywara
2021-12-22 18:16 ` [boot-wrapper PATCH v2 7/9] pointer auth: Document CPU feature bit mask Andre Przywara
2022-01-07 14:15   ` Mark Rutland
2021-12-22 18:16 ` [boot-wrapper PATCH v2 8/9] configure: Autodetect GICv3 Andre Przywara
2022-01-07 14:19   ` Mark Rutland
2021-12-22 18:16 ` [boot-wrapper PATCH v2 9/9] avoid dtc warnings on re-compiling DTB Andre Przywara
2022-01-07 13:59   ` Mark Rutland
2022-01-13 18:42   ` Vladimir Murzin
2022-01-13 19:50     ` Andre Przywara
2022-01-14  8:35       ` Vladimir Murzin
2022-01-14 10:44         ` Mark Rutland
2022-01-14 12:09           ` Andre Przywara
2022-01-19 12:02             ` Mark Rutland [this message]
2022-01-07 14:25 ` [boot-wrapper PATCH v2 0/9] Various (build system) fixes Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yef93qizlD6l/org@FVFF77S0Q05N \
    --to=mark.rutland@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=jaxson.han@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=vladimir.murzin@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox