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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DF52AC433EF for ; Sun, 10 Jul 2022 13:43:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7DCBE845EF; Sun, 10 Jul 2022 15:43:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com 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; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="HCduNBVW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D1638845FA; Sun, 10 Jul 2022 15:43:39 +0200 (CEST) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 CD16A845E3 for ; Sun, 10 Jul 2022 15:43:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x836.google.com with SMTP id g6so4325586qtu.2 for ; Sun, 10 Jul 2022 06:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=2IVhl3js66l/rLQot/1RILi3XIhHsMRA4wB6ol7VOBM=; b=HCduNBVWJRJ4/XDEsixAmUOp433ueTxA0ccTn/ULhDYOeiHpuh7+vP8RHPmr6ejXn9 NE1qq3BlIjKTl1E7h6aesd6fBymHYgRO/7AFrqxQnrp+vZ5KpbyaGCD/2PW/SEP9BpP2 v6pBMI5BZfjD//hMZJzSrFCHFBtwQG58VEfIo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=2IVhl3js66l/rLQot/1RILi3XIhHsMRA4wB6ol7VOBM=; b=asdxlFQNiOvf7QzAH/ZPUTquePduryj3DMUFAnHS/+NjGfnLnyMfi1VRmRWhtDyAC/ R9web36VkdTrZL9B1MqSFPY6oshqfbvRAoC80A6jrqN4ONAihtCYtQI3/5RODpMVCvJ2 waBCoZSb/kxM5OSVEeVYkenZacCXz2plqRzAt/xF4kt6fQBDoXZ1vLQaMRmXzTj3Mgj8 LN/zwe8vUtm+sjSb2nLz+DV0sbF6wCweO6he0MF+bD1dwWY6bCKQmcHkX9BsNc+FnqtB ZjD+J1kgTHL3iNUzQ9YawiKWpBBVXZnF1S2X7djYXMZApXljOmk475moaaACQ/15YdYr hTHg== X-Gm-Message-State: AJIora8oNKvWdcgYWq/sYLpEl5IpqgcQ07/i3ubTrAOxSdp7TfkqJEdE kthvTr6Iei2AJmXb8F1GywTlxj77cw334A== X-Google-Smtp-Source: AGRyM1vrO4pDHabXIGKz7eAahd0Km1rR7XlOKxfafhZePVC/pIAK5QJ4FBoIiggyxKsazu7OMHjASg== X-Received: by 2002:a05:622a:209:b0:31e:8253:b3c5 with SMTP id b9-20020a05622a020900b0031e8253b3c5mr10440849qtx.436.1657460615312; Sun, 10 Jul 2022 06:43:35 -0700 (PDT) Received: from bill-the-cat (cpe-65-184-195-139.ec.res.rr.com. [65.184.195.139]) by smtp.gmail.com with ESMTPSA id u36-20020a05622a19a400b003196e8eda26sm3379306qtc.69.2022.07.10.06.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jul 2022 06:43:34 -0700 (PDT) Date: Sun, 10 Jul 2022 09:43:32 -0400 From: Tom Rini To: Heinrich Schuchardt Cc: u-boot@lists.denx.de, Simon Glass Subject: Re: [PATCH 2/3] doc: environment: Expand on fdt_addr, initrd_addr and loadaddr Message-ID: <20220710134332.GL1146598@bill-the-cat> References: <20220620143129.1772880-1-trini@konsulko.com> <20220620143129.1772880-2-trini@konsulko.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="g0lpIlwrK/PIMw3J" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean --g0lpIlwrK/PIMw3J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 10, 2022 at 01:02:28PM +0200, Heinrich Schuchardt wrote: > On 6/20/22 16:31, Tom Rini wrote: > > - Explain why fdt_addr and initrd_addr should not be set to disable > > relocation normally. > > - Provide some advice on the typical loadaddr default value. > >=20 > > Signed-off-by: Tom Rini > > --- > > doc/usage/environment.rst | 15 ++++++++++++--- > > 1 file changed, 12 insertions(+), 3 deletions(-) > >=20 > > diff --git a/doc/usage/environment.rst b/doc/usage/environment.rst > > index a3f23d4e4e22..a9a4702632d2 100644 > > --- a/doc/usage/environment.rst > > +++ b/doc/usage/environment.rst > > @@ -204,7 +204,9 @@ fdt_high > > to work it must reside in writable memory, have > > sufficient padding on the end of it for u-boot to > > add the information it needs into it, and the memory > > - must be accessible by the kernel. > > + must be accessible by the kernel. This usage is strongly discoura= ged > > + however as it also stops U-Boot from ensuring the device tree star= ting > > + address is properly aligned and a misaligned tree will cause OS fa= ilures. >=20 > fdt_addr_r is typically 4 byte aligned. Is there a bug in some part of > the code? It must be 8 byte aligned. And we don't know the alignment inside of FIT images. Do not disable device tree relocation except under the most calculated of circumstances. > > fdtcontroladdr > > if set this is the address of the control flattened > > @@ -240,14 +242,21 @@ initrd_high > > memory. In this case U-Boot will NOT COPY the > > ramdisk at all. This may be useful to reduce the > > boot time on your system, but requires that this > > - feature is supported by your Linux kernel. > > + feature is supported by your Linux kernel. This usage however req= uires > > + that the user ensure that there will be no overlap with other part= s of the >=20 > It is not the user but the developer who define $kernel_addr_r, > $initr_addr_r, and $fdt_addr_r. No, it can be either. See stackoverflow and assorted blog posts. Person who picked up an SBC and just wants the thing to work will find various posts saying to do ... something ... here. > Relocating initrd does not stop the user from loading the kernel to > initrd_high. The user is always responsible for avoiding overlap. In > this regard there is nothing special about initrd_high=3D~0UL. And we're responsible for providing reasonable defaults. Do not disable initrd relocation by default as it gains little and can break the OS. > > + iamge such as the Linux kernel BSS. It should not be enabled by d= efault >=20 > %s/iamge/image Please fix when applying. > > + and only done as part of optimizing a deployment. >=20 > Relocating initrd and fdt is using boot time. On many boards it is > simply superfluous. On these boards I cannot see any reason not to > disable it by default. The way to avoid "superfluous" time here is to set reasonable default locations, not disabling relocation. Please note this is what the policy is, not something new. --=20 Tom --g0lpIlwrK/PIMw3J Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmLK14EACgkQFHw5/5Y0 tyw4EQwAo17HHBk2n0Ul3jKsgmUBqw2743pok9sMpEF+VuHEDr1lu7R6p6E2xSoS VedBb67k7r44U6e36+fr2qE7Obj08Tc7IkyWW8cHm54EEOPxwjeFrOIh4RQeaKIP kvpsadxAlh3JhGp/FutkvDrcqRsLQVgMzxIH/Gz94Kn9n8ACXz1F5Btm6y0DpElN 6hGzOSjmRPhqnr3A8FuKTuVHZiLfTf1RKuKkonqc14lSRtZACFjLisjIVORSQvcJ Hk7qkyGM7KJj+VPuch0Uq7K63PnDiUJf/LJ+kw7G1i/DO7rgCcDj6OIcnLrdDbXa EjpAlD0NTxibNUxSbPl4e+y7AGZMLYs0nFvoZenzYGax/vIOiBGsikQ5+E3RGJ7n 43EuPc47YCU+LkQY+R2E40e8TCzh6q/Ow0v9H5H+S5vxeUdJndn/LU5zuHqga8ZT nnFcSjv96Gqqfogbvh9jXwstvu6+Obnw6ciPbJaEzOZZ777MtSly2VZuhNjNTG+5 Mub8xn5R =+MXq -----END PGP SIGNATURE----- --g0lpIlwrK/PIMw3J--