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 X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 82078C4338F for ; Mon, 16 Aug 2021 01:34: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 961E861406 for ; Mon, 16 Aug 2021 01:34:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 961E861406 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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 7C1B682DA7; Mon, 16 Aug 2021 03:34:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="KnkN5UmC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3AC5282DA7; Mon, 16 Aug 2021 03:34:32 +0200 (CEST) Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 49DFB82051 for ; Mon, 16 Aug 2021 03:34:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pj1-x102a.google.com with SMTP id mq2-20020a17090b3802b0290178911d298bso24917796pjb.1 for ; Sun, 15 Aug 2021 18:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=gorcRudPAHoe2DBObQW86QtbvPYRtEzBUJR8dU21Q6E=; b=KnkN5UmCbHDyRZ8QOkz/Bj8fM6x53F8ytG6aloBGAFIRurWWSF0DKFHOsXGxuAMPB+ skbE5ecTBAfBQPyuOwJGWC5p6wFOKF7emUzKLe8GMGw6Lb9ssDK2s6nCa0AT6AUCS+gv inDlmLP2U0yRh1WbgP7nJ6StOuM79yJ1JrOnJBDHjWDjrU1o41hqx3zzz99prdpiKVA4 sBWe5krmtFNsSpoqIEztsZIELadz9f4bMwGCH+eoxQ+q4p9PznPMi6uWVGO0HHeQ9sym Zq9Y5vrRRdaHxRLPi92j5hjns/QGtJXOw9LisAaGfhpZpJZNjK41nDRrmxDyfpUrnVdS ONGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=gorcRudPAHoe2DBObQW86QtbvPYRtEzBUJR8dU21Q6E=; b=bueOEo8tS+VEajjTD3hagPdV9O/cSoT56vKiLDSefev/akzP6ig605J+P9pSaHPgsK jRNyhASwcRUjfoywElVgs5ZuwyDk+ud6mGT9njEYwPkMBUEdJfK6eT5eXTm6vCVXtLtB 2xgqBbhpWrmdd7zvwwmbW+WQ/QmPI8XMLnTMLGWQgt1uxlOoIrzd415O6Xr05SyTkE8N k1E5fPt8MJOo7yyf5C5tz8zpB4rXfjok7e9QYAtqxqpZ0jA7wiXgcZL6X7ZmK8exTyHP RRywzgsqDQc+72CdjprokHe9w/3S1VB8+7iu73DMOvLcEbvB6lAE+I5/YMQLY2ITO1ku NV8Q== X-Gm-Message-State: AOAM533iDlOYhY1/mu6pn3AmPj/zYvxUFhq1Fn1q0xjArA7MEasFq8Pm CEbzZAb+XVPNYMaIfMGDgA4L7g== X-Google-Smtp-Source: ABdhPJxGdxsiZQVuUBQIyNXAs98SvA9r9sgGPz6Nd3qfpM5fmic78S+3tY4ZS+dmNL2524342DuQWg== X-Received: by 2002:a17:90a:ee91:: with SMTP id i17mr14523232pjz.67.1629077665558; Sun, 15 Aug 2021 18:34:25 -0700 (PDT) Received: from laputa (pdb6272e8.tkyea130.ap.so-net.ne.jp. [219.98.114.232]) by smtp.gmail.com with ESMTPSA id v5sm7753522pjs.45.2021.08.15.18.34.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Aug 2021 18:34:24 -0700 (PDT) Date: Mon, 16 Aug 2021 10:34:17 +0900 From: AKASHI Takahiro To: Heinrich Schuchardt Cc: Simon Glass , Tom Rini , U-Boot Mailing List Subject: Re: [PATCH v2 3/3] doc: Add a note about why devicetree is used Message-ID: <20210816013417.GA42921@laputa> Mail-Followup-To: AKASHI Takahiro , Heinrich Schuchardt , Simon Glass , Tom Rini , U-Boot Mailing List References: <20210802005713.2268145-1-sjg@chromium.org> <20210802005713.2268145-3-sjg@chromium.org> <8ceaa2e4-58bf-09ba-45e8-dfed9d5cb442@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ceaa2e4-58bf-09ba-45e8-dfed9d5cb442@gmx.de> 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 Heinrich, On Sat, Aug 14, 2021 at 09:21:25AM +0200, Heinrich Schuchardt wrote: > 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 If I correctly understand here, Simon's intent is to reassure his opinion that a public key for capsule authentication should be stored in a device tree, not be embedded in U-Boot binary. So at the end, do you agree to reverting[1] Ilias' patch? -Takahiro Akashi [1] https://lists.denx.de/pipermail/u-boot/2021-August/456968.html > > --- > > > > 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= > > > > > > +.. _dttweaks: > > + > > Adding tweaks for U-Boot > > ------------------------ > > > > diff --git a/doc/develop/devicetree/intro.rst b/doc/develop/devicetree/intro.rst > > index 344851327c7..36e8cc0d440 100644 > > --- a/doc/develop/devicetree/intro.rst > > +++ b/doc/develop/devicetree/intro.rst > > @@ -2,3 +2,43 @@ > > > > Devicetree Introduction > > ======================= > > + > > +U-Boot uses a devicetree for configuration. This includes the devices used by > > +the board, the format of the image created with binman, which UART to use 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 those coming > > +from Linux who are used to quite strict rules about what can go into the > > +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 out 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 devicetreee in > > +SPL. But of-platdata is the modern way of avoiding devicetree overhead, so > > +please use that instead. > > >