Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp16014lqp; Tue, 11 Jun 2024 12:56:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWUMrq1pFxSqd4xdg3F0kZwVH++cpDRJ4L2a0PBlYXV2Ucj1lwPYpbSHkGTUYcDObazJmGzPiC4kHzVv/wLEWdYL5WR+BM7XZ6h29T8zg== X-Google-Smtp-Source: AGHT+IHodrZITwV7pe3e92Vt1dBWCqJzzMeG5AMqCBeJfiDQa1U8D/QGoaUnbrXL2Cr+OnewLzTb X-Received: by 2002:a17:906:528f:b0:a6f:1f66:833e with SMTP id a640c23a62f3a-a6f1f668436mr396244066b.10.1718135777282; Tue, 11 Jun 2024 12:56:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718135777; cv=pass; d=google.com; s=arc-20160816; b=Y+k8m4OVP/kc14U3v1N1yMkD9Rns48gXTnusZltp7lC4Rr2B8esSZxYTDD8f/6S2du IhomwNqo3M0PFfLdcGtQnwD7Bs9nX7ufto+QygWe4n0B4ecuoMYourEszIHuPsdwBgD+ +g810slZj+CKc+R2+F0vEkjL2S8B8hm9P91+8cmdC5VuFVG8YZP4dajSjUskqEwYzd2p N/Kp/z60eQ/djqpixgii+w5OtZl6dMdK3tvcVD/iJpv24CQKt9DbIEBS8V7HaA3k+h20 KpWq04l950YCpO1IqdJT+2O+4I7mW2/Kc0BDL8ZnbcN2wu8tzpxbPIuig/KpE7biMPgr CSXA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=RNrWLh5pDrgjmfiNgHyxdrCGyjR6btn9eS9/sI9Y3EA=; fh=aIa4Evf9iboVsE10fU1bYP2nTc3Q+4lMPI/tIz5zyCk=; b=KsYMcjtuupj5PQRyyVhwnZ02J+WponbP2UVQ7ZoiiPlgz8eCfqnn7TXE42wHSxppOo sx6QeEvhEOeHwNyD/0qBSksJLFvup9kTxY+NAOC741efrJJVDKFQf3r+jI9Gm1eBJvc7 eoOZHd7Y+WUkgGYnTQQN7m5q9FPBfMg+8trw6o3cBTAwskguvvnpRrt33f/NuGm38peY K3XgEqlkbWHh+UAzJu/LyoCEnDQwdGjVR6A0mtAqbHNBieO5FDmCzeu6lEOk8DU7SPPL LlhQTt1TCTEiL5V1TpCSryM7nciEcjtBwjcymcYYZodmTYUy4BRKSZ/mOEqz2vn6z/pk BOgQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PnXcY8us; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-210545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210545-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f10c7af9dsi323437966b.774.2024.06.11.12.56.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 12:56:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PnXcY8us; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-210545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210545-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 05ED01F22D93 for ; Tue, 11 Jun 2024 19:56:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 21E46147C86; Tue, 11 Jun 2024 19:54:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="PnXcY8us" Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0730F6EB68 for ; Tue, 11 Jun 2024 19:54:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718135690; cv=none; b=lL1fgDMnIu5QcOnUxUmHvU1+aqu39YO65iQZecniYed+qJRqfhGZAnEyTa7BpWlpk00nIs77b669i4uVjtudAxuVn2gFwuSrFgJZ7DE2INQsTkNl55aeedMKm+bttqlrOztzusHhnQLEKmZxI+abzOgNPN81ng5gX2Jl/zyWo/s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718135690; c=relaxed/simple; bh=O3S4SqxKJuq65ixR6NFs+aq0BeZOfIVXLriWHF/QL8E=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=rwlV2Zqz2b6JV48OLjoI5pKOFa5cY0prOVIQA+y1o136QFnDLW/TJYiqjIxi9wjOiVLAl74KCqJuKcge3hXdpE85FezIEFwy1T8EhDDP5Lp5/RKnCylgqtje7kb6SAJeuqlZNdco5OOANom+2/f5xokJ2HFrxuma5+87TTQM588= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=PnXcY8us; arc=none smtp.client-ip=209.85.219.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-6adc63c2ee0so7078296d6.3 for ; Tue, 11 Jun 2024 12:54:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718135687; x=1718740487; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=RNrWLh5pDrgjmfiNgHyxdrCGyjR6btn9eS9/sI9Y3EA=; b=PnXcY8us7rbvdHKo3AZYi20OjRrkhe/lIoXZpgCZCJcQ31DYXm30yT9sBbKpTB2glf 1m6sstLQ4HinncYkm9JZ+ZYSMKQqM8x+YvxLzeSuSmgoDTaa4Nhvu2zRFNdT84ELVa3N rjDikk8NPGQi2GpL+Eodj9rtYTJuDA38fqk3k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718135687; x=1718740487; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RNrWLh5pDrgjmfiNgHyxdrCGyjR6btn9eS9/sI9Y3EA=; b=xLkkIYWiI9xEpwqKjOgSpJzgwMODCIG61733hoQehMtIEsef1oV0AhQrbHZuZitUqh 5spX7JIPhlw5RBGAi6d6tT51dZfoBGN+NI4RGCjnL7x4hPY+DNJzC41tdBKVHwXbeuCh 8Y78ASP0gfIGVFURlakx2PfvO7xfC68imD0vtYiudcBuITw1I4nAO69DuSv5MfzCTCTp KLwcOEMolIOrQcJixdVjlJVthbtcFBDUS+QBz2vqaOIhvZtr8IuVgp7AxZ5B3eqp4D2x hwI3drcrL5nUBRIa4mViknU2mvH3OT30/ftXE6M8u1bpQXMFDIUrwm+30/AXsGAkDtAw Cblw== X-Forwarded-Encrypted: i=1; AJvYcCUQiX9hU1Tv/7K6tcqFoRjOEmIjMLLufET4k5IlJm3JIfMI1YgNDgYxw+WFfoJQ+IPhEW+cFDam9M++7N5aZZEtf/TpMTy1ypS/8WLP X-Gm-Message-State: AOJu0Yx1leTUCLVU6o55LH1rhZvDC5zCXRaeCdL5jtwhk0vydiuZhi1M t272kt7zKzEMSPUkNuKWGHjCeQe5r5NNC1Hyh5Ku9VSuIUkOb47DbHmDx+5KTE2HsANMi82k3lu h4H/bxQtbx9jm4i3I61anM50EMzHLcKvX0MjzFZmQSuo5LSY= X-Received: by 2002:ad4:42cc:0:b0:6b0:8b48:f7e5 with SMTP id 6a1803df08f44-6b08b48f99bmr33081746d6.3.1718135686798; Tue, 11 Jun 2024 12:54:46 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240605094843.4141730-1-wenst@chromium.org> In-Reply-To: From: Simon Glass Date: Tue, 11 Jun 2024 13:54:35 -0600 Message-ID: Subject: Re: [PATCH] scripts/make_fit: Support decomposing DTBs To: Chen-Yu Tsai Cc: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Elliot Berman , Devicetree List , Rob Herring , Krzysztof Kozlowski , Conor Dooley Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 11 Jun 2024 at 02:52, Chen-Yu Tsai wrote: > > On Mon, Jun 10, 2024 at 11:16=E2=80=AFPM Simon Glass w= rote: > > > > Hi Chen-Yu, > > > > On Wed, 5 Jun 2024 at 03:48, Chen-Yu Tsai wrote: > > > > > > The kernel tree builds some "composite" DTBs, where the final DTB is = the > > > result of applying one or more DTB overlays on top of a base DTB with > > > fdtoverlay. > > > > > > The FIT image specification already supports configurations having on= e > > > base DTB and overlays applied on top. It is then up to the bootloader= to > > > apply said overlays and either use or pass on the final result. This > > > allows the FIT image builder to reuse the same FDT images for multipl= e > > > configurations, if such cases exist. > > > > > > The decomposition function depends on the kernel build system, readin= g > > > back the .cmd files for the to-be-packaged DTB files to check for the > > > fdtoverlay command being called. This will not work outside the kerne= l > > > tree. The function is off by default to keep compatibility with possi= ble > > > existing users. > > > > > > To facilitate the decomposition and keep the code clean, the model an= d > > > compatitble string extraction have been moved out of the output_dtb > > > function. The FDT image description is replaced with the base file na= me > > > of the included image. > > > > > > Signed-off-by: Chen-Yu Tsai > > > --- > > > This is a feature I alluded to in my replies to Simon's original > > > submission of the make_fit.py script [1]. > > > > > > This is again made a runtime argument as not all firmware out there > > > that boot FIT images support applying overlays. Like my previous > > > submission for disabling compression for included FDT images, the > > > bootloader found in RK3399 and MT8173 Chromebooks do not support > > > applying overlays. Another case of this is U-boot shipped by developm= ent > > > board vendors in binary form (without upstream) in an image or in > > > SPI flash on the board that were built with OF_LIBFDT_OVERLAY=3Dn. > > > These would fail to boot FIT images with DT overlays. One such > > > example is my Hummingboard Pulse. In these cases the firmware is > > > either not upgradable or very hard to upgrade. > > > > > > I believe there is value in supporting these cases. A common script > > > shipped with the kernel source that can be shared by distros means > > > the distro people don't have to reimplement this in their downstream > > > repos or meta-packages. For ChromeOS this means reducing the amount > > > of package code we have in shell script. > > > > > > [1] https://lore.kernel.org/linux-kbuild/20231207142723.GA3187877@goo= gle.com/ > > > [2] > > > > > > scripts/Makefile.lib | 1 + > > > scripts/make_fit.py | 70 ++++++++++++++++++++++++++++++------------= -- > > > 2 files changed, 49 insertions(+), 22 deletions(-) > > > > This is a clever way to discover the included files. Does it need to > > rely on the Linux build information, or could this information somehow > > be in the .dtb files? I had expected some sort of overlay scheme in > > (+CC DT folks and mailing list) > > I suppose we could make the `fdtoverlay` program embed this data during > the kernel build. That would keep the information together, while also > having one source of truth (the kernel Makefiles). Whether it belongs > in the DTB or not is a separate matter. OK, well we can always look at that later. > > > the source, but perhaps people have given up on that? > > I wouldn't say given up, since we haven't agreed on anything either. > Elliot had some concerns when I brought this up earlier [1] though. OK. Regards, Simon > > ChenYu > > [1] https://lore.kernel.org/linux-mediatek/20240314113908471-0700.eberman= @hu-eberman-lv.qualcomm.com/