Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CBAFC4338F for ; Sat, 14 Aug 2021 07:21:38 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC26B60F51 for ; Sat, 14 Aug 2021 07:21:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BC26B60F51 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4BC3982DE4; Sat, 14 Aug 2021 09:21:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="QEKTlkCt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4D0DD82E00; Sat, 14 Aug 2021 09:21:33 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E96C482DE4 for ; Sat, 14 Aug 2021 09:21:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1628925686; bh=OpTOwfj2ZNsTUnOtsUUdjE+vORIA0VmhpjVZrZ1orxE=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=QEKTlkCtHxSk6nUHyHmLwGavN/inOW0/PoQNWoVyVOsbhqA2kUrvlbgpa7A0YayRs pWJSciGpdvLCTL5K8XbIRinCff7/qOEwuNaR7GY2K5I3RxFZ5JRGyMeR3g7qxa9jNR jY/hOl/AMpEK5IUq+GQ/58+2/JzrfXSHeO7hdJDQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.35] ([88.152.144.157]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mf078-1mlOdo1xBC-00gcZm; Sat, 14 Aug 2021 09:21:26 +0200 Subject: Re: [PATCH v2 3/3] doc: Add a note about why devicetree is used To: Simon Glass Cc: Tom Rini , U-Boot Mailing List References: <20210802005713.2268145-1-sjg@chromium.org> <20210802005713.2268145-3-sjg@chromium.org> From: Heinrich Schuchardt Message-ID: <8ceaa2e4-58bf-09ba-45e8-dfed9d5cb442@gmx.de> Date: Sat, 14 Aug 2021 09:21:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210802005713.2268145-3-sjg@chromium.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding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XnO94gmSpgSsy9z2fgiWXwsw HNBLCJuaZPuIBjdgLw95OHl5+aqZLEz8NZLkUpuF9olHYSS09Emxmj/BSfsuJj5UGUaV56lsW nid7nMjkZJseGO8MpEuo5yPSNwcsoIYexiI/9TTVoJ2mfoA+cxi+UmKv/XjWOPEGEr3QPDJhN 81lRA3ZcrtZkIepOGujT9Y485nSWGhVvOYuIMq8iUGz44wXiQnjYRpE41IGfMIkQPrNcqHddQ 0m4VODIbDJlXklqUsUId+5bIO+WHkQrnLCpv9+Goq3HemPraY+tj1Hq+HJO6ZUOoJ3g01de9Q uy+RQuvLAdu/CqMA4NKx6ES4nC4PyYGrPYXi3HtvBt6bBolUz96HcAgTA== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 8/2/21 2:57 AM, Simon Glass wrote: > This question comes up every now and then with people coming from Linux. > Add some notes about it so we can point to it in the mailing list. > > Signed-off-by: Simon Glass Reviewed-by: Heinrich Schuchardt > --- > > Changes in v2: > - Updates based on suggestions from Heinrich > > doc/develop/devicetree/control.rst | 2 ++ > doc/develop/devicetree/intro.rst | 40 ++++++++++++++++++++++++++++++ > 2 files changed, 42 insertions(+) > > diff --git a/doc/develop/devicetree/control.rst b/doc/develop/devicetree= /control.rst > index 9f2c21034d0..b33e2a7ead6 100644 > --- a/doc/develop/devicetree/control.rst > +++ b/doc/develop/devicetree/control.rst > @@ -152,6 +152,8 @@ ways: > $ make DEVICE_TREE=3D > > > +.. _dttweaks: > + > Adding tweaks for U-Boot > ------------------------ > > diff --git a/doc/develop/devicetree/intro.rst b/doc/develop/devicetree/i= ntro.rst > index 344851327c7..36e8cc0d440 100644 > --- a/doc/develop/devicetree/intro.rst > +++ b/doc/develop/devicetree/intro.rst > @@ -2,3 +2,43 @@ > > Devicetree Introduction > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +U-Boot uses a devicetree for configuration. This includes the devices u= sed by > +the board, the format of the image created with binman, which UART to u= se for > +the console, public keys used for secure boot and many other things. > + > +See :doc:`control` for more information. > + > +Why does U-Boot put in the devicetree? > +---------------------------------------------- > + > +This question comes up a lot with people new to U-Boot, particular thos= e coming > +from Linux who are used to quite strict rules about what can go into th= e > +devicetree. > + > +U-Boot uses the same devicetree as Linux but adds more things necessary= for the > +bootloader environment (see :ref:`dttweaks`). > + > +U-Boot does not have a user space to provide policy and configuration. = It cannot > +do what Linux does and run programs and look up filesystems to figure o= ut how to > +boot. So configuration and runtime information goes into the devicetree= in > +U-Boot. > + > +Of course it is possible to: > + > +- add tables into the rodata section of the U-Boot binary > +- append some info to the end of U-Boot in a different format > +- modify the linker script to bring in a file with some info in it > +- put things in ACPI tables > +- link in a UEFI hand-off block structure and put things in there > + > +but *please don't*. In general, devicetree is the sane place to hold U-= Boot's > +configuration. > + > +So, please, do NOT ask why U-Boot puts in the devicetree. It is= the only > +place it can go. It is a highly suitable data structure for just about = anything > +that U-Boot needs to know at runtime. > + > +Note, it is possible to use platdata directly so drivers avoid devicetr= eee in > +SPL. But of-platdata is the modern way of avoiding devicetree overhead,= so > +please use that instead. >