Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp523804lqs; Tue, 5 Mar 2024 08:31:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUXKdnvo/mpfN+FTvqFlsPaGQOmQYz3/VLJSrgLDc/Fgrqby87cNWk6y5wgvs2mNAaX11vkcE5BiKeG4KnO0QEXb0LO7bv2mWQX6wHyZQ== X-Google-Smtp-Source: AGHT+IF6btww3sBt6lXD0xU+cdI+xx/BBP6t2l3EX12qw8Mrfu4Gl7zr56jTs1NSeB+/6Yb2W3mT X-Received: by 2002:a17:903:1c7:b0:1dc:a60a:a7c7 with SMTP id e7-20020a17090301c700b001dca60aa7c7mr2735068plh.25.1709656306056; Tue, 05 Mar 2024 08:31:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709656306; cv=pass; d=google.com; s=arc-20160816; b=GmUHdqKWvNHOrAhv2Zj47ajethz/mY8iN922ujDSVd70N5ozeM7oLO90bORuWeohVU LYwvdv2gW5F6hOX58UXYmUhXuznsPN0pusjIHyIiIqC/wG5hrAtMrtWkGMrN6I5N5HA0 RN3epsqLXp1ACi2QurkgsYKSmRUnsrS5QbMxzM7ZPfeBw8MUMOUDbfnrieqr4OMxQUNb 7k9dop3658rDCdgHhwZ0bRi91cA43Es4xTdHKdoBreSbekBusTBLMEIVWmf4sHqqmcPV 2Kez773aht7Gg/ZvRiMzoXC1vKEpz867meuYsF5mvWcjM5yEEAsTAGVuWviKWqasn8lj Zr4g== 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=0zIU85yxo6NaXI4+wLoqyaS3FkkUT3472WtpRMLF8Io=; fh=sH+QD9DWtKjZI3nqtZwoKbUezA3vgzncLSbEqI8UqSc=; b=B8W/H+RPSj29VqUC9iSlHBV3CeowlQ4YrgfT/oxbYtgcHLT2mu6m1scwm0lqLg/VjC wJw5a6mbyyIgJSH9udPq4CavqRCinLUdpzwBEslfND0CAaCub4kWQu1eUxPt9TKS9TJF QPM6iLGSXlLj0ZOjXRmiHWIqy3oEH12Lamojad9pNVjPKvhbigw8iL+4zno5GOvoHi6c rBzGIS4ENL3F78x6EbBNpMMdnSdJn54sY4FPs95saGsiiqAvrZXHAHsulgFylUbkwwGM DGQXyZg+E0xpzt45tT21PjDfiVKqX8bp+KKwZFTSrTAbHP8AF8fvFrAHpRyCGupi9JjM HEIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SWK5eHJ4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-92685-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92685-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u4-20020a17090282c400b001dbad3d9ca4si9819315plz.648.2024.03.05.08.31.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 08:31:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92685-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SWK5eHJ4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-92685-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92685-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 828CD285668 for ; Tue, 5 Mar 2024 16:31:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92C278F55; Tue, 5 Mar 2024 16:30:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SWK5eHJ4" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A253F10F7; Tue, 5 Mar 2024 16:30:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709656257; cv=none; b=PsuN09kEtIzsXCcCD702/Lq45LW8YKt58Ru9D6ZpooJz2hYbsaUKbNs1BmLNAxyUzU2/vmVw3HV4bq8jkla28DwnrPsc1psOongHwinzB4c9OEvF/27FVumMfbpaMvzkBpPvJccCbRPeDo9jfD89UAP+U1uTR6/Y+bjtMoFwJvk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709656257; c=relaxed/simple; bh=UjBEAVMdzvLalmwGNh/rQJ83m5pRMJtn7UmSXJVcmGI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=LmUV+xMkShm0Ti8MN5K2XnfUCWLX+2eYVhFxQTy+3FgtKfeSjnVNA8YviMYxh4NLcqFEp5krekmoX9IVq0GqIroMmVt6VfetLHGv/JQcUwpfYS9gFkHehTmWTB2yB1Nr6PELQS15vQkKdvAAERt7Z5J5TnuQI7iLw++zZMaiDlk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SWK5eHJ4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28259C43390; Tue, 5 Mar 2024 16:30:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709656257; bh=UjBEAVMdzvLalmwGNh/rQJ83m5pRMJtn7UmSXJVcmGI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SWK5eHJ4KFwRb8vJnqk+5C4fZJ3mEn28cZBqaF1lX37hvkVB3K3d0X3piXIm0dyzr eML+41LdnPvg8nEuDVfF2xQP5UijhgpSzK7hh7EPOmUcf264YABeq3gT4YfUj4z2pz sI9UYi5rVd3MkthV8G5cQnsf9FYfzEBxsGVEucCMEkXiNYYxOfUoHkRmvn6x1sjEMl zHsW3c39Ig2Q9cY20bU8AvDAyQPLVnhmA/Xiem9LSJDdg31Cb459NBi09tBqSuyY6C 7YB068rgyNLcITfhtt6TYwmvkCnn8Uxurec6M4Jmkub6RXrkpsmylXcF2dE4JhCCXE rvEK9l6L/igDQ== Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-513173e8191so7355317e87.1; Tue, 05 Mar 2024 08:30:57 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV+NCS9XUXUj0JW+6IWTg+MDWsWHMLMtdX3ANslDs+Ty6njAU+2/3AVNfNVYjcQp3P/Hw3ygrAiDADCuqihcWxZX+zsb5HwR8lz52fkg6P+YR1A+eNh0SVWaoHqCpZ+tbF4kUOQhAAxdOGr X-Gm-Message-State: AOJu0YzJ77Q6iBjmd/kOo+UPiZ5z3H7BokFDku+3AiEQHLifVol9CGmi hx3n3ODFb/SUG/2Deopvuxzn1rluaSXnrXY/xhYZzEqqZHcgEXCfLAjT/OK2HGj3unG/zm8hCj8 qYGrk9OPrl+wm6D+PGUTuQriGmrI= X-Received: by 2002:a05:6512:219:b0:513:2caf:15ee with SMTP id a25-20020a056512021900b005132caf15eemr1652548lfo.28.1709656255566; Tue, 05 Mar 2024 08:30:55 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240223092338.2433632-1-wenst@chromium.org> In-Reply-To: From: Masahiro Yamada Date: Wed, 6 Mar 2024 01:30:18 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC] kbuild: create a list of all built DTB files To: Chen-Yu Tsai Cc: Nathan Chancellor , Nicolas Schier , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Simon Glass Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 4, 2024 at 1:37=E2=80=AFPM Chen-Yu Tsai wr= ote: > > On Thu, Feb 29, 2024 at 11:35=E2=80=AFPM Masahiro Yamada wrote: > > > > On Thu, Feb 29, 2024 at 11:38=E2=80=AFAM Chen-Yu Tsai wrote: > > > > > > On Sun, Feb 25, 2024 at 4:21=E2=80=AFPM Masahiro Yamada wrote: > > > > > > > > On Fri, Feb 23, 2024 at 6:23=E2=80=AFPM Chen-Yu Tsai wrote: > > > > > > > > > > It is useful to have a list of all composite *.dtb files, along w= ith > > > > > their individual components, generated from the current build. > > > > > > > > > > With this commit, 'make dtbs' creates arch/*/boot/dts/dtbs-compon= ents, > > > > > which lists the composite dtb files created in the current build.= It > > > > > maintains the order of the dtb-y additions in Makefiles although = the > > > > > order is not important for DTBs. > > > > > > > > > > This compliments the list of all *.dtb and *.dtbo files in dtbs-l= ist, > > > > > which only includes the files directly added to dtb-y. > > > > > > > > > > For example, consider this case: > > > > > > > > > > foo-dtbs :=3D foo_base.dtb foo_overlay.dtbo > > > > > dtb-y :=3D bar.dtb foo.dtb > > > > > > > > > > In this example, the new list will include foo.dtb with foo_base.= dtb and > > > > > foo_overlay.dtbo on the same line, but not bar.dtb. > > > > > > > > > > Signed-off-by: Chen-Yu Tsai > > > > > --- > > > > > Hi, > > > > > > > > > > I hacked up this new thing to list out the individual components = of each > > > > > composite dtb. I think this information would be useful for FIT i= mage > > > > > generation or other toolchains to consume. For example, instead o= f > > > > > including each dtb, a toolchain could realize that some are put t= ogether > > > > > using others, and if the bootloader supports it, put together com= mands > > > > > to reassemble the end result from the original parts. > > > > > > > > > > This is based on and complements Masahiro-san's recent dtbs-list = work. > > > > > > > > > > > > > > > > This is another format of my previous per-dtb "*.dtlst" > > > > (but I did not pick up 3/4, 4/4 because I did not know what we need= after all). > > > > > > > > This should be discussed together with how Simon's script will look= like. > > > > > > > > I can understand your Makefile code, but I still do not know > > > > how the entire overlay stuff will work in a big picture. > > > > > > How would you like to proceed? I can through together some changes on= top > > > of Simon's patches as an initial proposal if that helps? > > > > > > I can use your format if you prefer. > > > > > > How would you select base+addonX among > > other base+addonY or base+addonZ configurations? > > I assume you are alluding to the existing in-tree composite DTs that > share the same board compatible strings? Yes. It is possible to implement it, but I do not see a point to implement what we do not know how to use. > > Under the current FIT image design with compatible strings populated from > the FDTs, I don't think there's any way to automatically select among the= m. > The FIT image simply does not have the information available. Nor do the > overlays themselves. The toolchain can only either include all of them > and let the bootloader figure things out, or filter out all the duplicate= s. > With the composite list, at least it will be able to consistently keep > only the base DT and drop the ones with the addons. It makes the purpose of this work even more obscure. For the purpose of avoiding duplication, we can take the first DTB (or the smallest size) when we encounter a duplicated compatible string. > > In one of my previous replies to v9 I mentioned adding a user provided > mapping between "configuration" compatible string and FDT filename. The > mapping could be maintained in-tree for those base+addonXYZ FDTs if > desired. That is one way, but I do not think such a configuration file is maintainable. Rob suggested overwriting the compatible string, but I do not think we got consensus. > Also, Simon's FIT image "extensions" proposal [1] adds more metadata to > the FIT image to cover these addons that currently don't have distinct > compatible strings. I think this is yet another way, but I am not sure how to derive the extension compatible string. Even if we decide to implement base/overlay split, we may not need to add anything to Makefile. We already have .*.cmd files, and we can know if it is a combined DTB or not, by parsing the .*.cmd from the python script. It might be a bit messy, but it is what we do in scripts/clang-tools/gen_compile_commands.py > > > ChenYu > > [1] https://lore.kernel.org/u-boot/CAPnjgZ06s64C2ux1rABNAnMv3q4W++sjhNGCO= _uPMH_9sTF7Mw@mail.gmail.com/ -- Best Regards Masahiro Yamada