Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp207987lqp; Tue, 11 Jun 2024 01:52:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZ/qy4AOrVg9f56DRXeb5NRoICBkUCKrQViztC91BuY1k/A18nCsI7Tps8sgiMAj6KZt+gvD1t9ucK2u9H1ZYgeMvJhgW3W85hdpCl9A== X-Google-Smtp-Source: AGHT+IEQ3mJEXc8tYUD8cWTHiTB7NOU/cZ7Un2DOeDf1SDIz6Ez1Q0hqPWL10I0wiKLRJmoG1li1 X-Received: by 2002:a05:620a:3712:b0:795:494f:f6e3 with SMTP id af79cd13be357-797c2d7f7a0mr336326185a.12.1718095934783; Tue, 11 Jun 2024 01:52:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718095934; cv=pass; d=google.com; s=arc-20160816; b=bZxyFJyCfJjgglv5vD26lLQ9x4lsDs2Cmm88mUkOMawjWhTn7bVuyg7tafnKPbkY/W A5DKgWxLGsDpDR9saDTk/27KTihCwLynQvosvKEmssSIcHRY/RCCaE5QNHJyL60M81D+ iCD2FWMSIITVvoSigqSCBsyWGcH/WBQ2L8ZEFdPd6lGax5iU0P0LakEBu6AozqJx8kgk YZR0spoAjNl2IsY1AK8/FBRYKN4jlesTWOafYgskdoSAbG8N+OYIFdbkFLh5bDAUhmwk jtW27wc//L4q4BVXZCL4NQLEBRZg0Z+JRtYwKHq08euPsSNp5iHRcQT3R8kf9ueAHXco 1cQQ== 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=vXby5sEGwA50yL3eB9wTqqKrctF2MCwrds0R1QAOu3M=; fh=mbDrTvNIjfP+MPN9xf3wBy/alu9+d0LUc9myEM7XgCA=; b=yrhMrsM24ha3G8lqXxCqlIC0ldwxQjFDCYZUJ1zSSMjw3TBN4I81hnZLl5tM7M/AGT xJM3A+O8iSghnzJYEX2k9Cqi8iDqBIYxLoe68ERM4eY4N5o1XWz0t5M14HhUnU0b/YVh 3tTk7pmu1Au/VvbEqzsGXfzriMzPkbhVLbZWDS9HzdZQAuFEg/L6cE9tbbsI7cC0xLcR hruJ7r/FEVgZGv4Ft+Dd22+CLoCKPpt6piYLytj+gt2r0GV/5EMQey6DBfbz+lYuCArZ Lm6CCCZuZacFrMRemFr2b1zz7PrUSkAWGO2En0ySxrypbQ+czXlO0Ec2tjouNZi2j9zC 24FQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZxDRYcU2; 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-209514-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209514-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-797ee4a76e8si20349485a.292.2024.06.11.01.52.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 01:52:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209514-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZxDRYcU2; 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-209514-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209514-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7256F1C220F4 for ; Tue, 11 Jun 2024 08:52:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1704D176228; Tue, 11 Jun 2024 08:52:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ZxDRYcU2" Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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 7D976174EEB for ; Tue, 11 Jun 2024 08:52:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095927; cv=none; b=DIq0dHNdyinGm45omQXgRsVYTbe0jtrHki8rubtLKfdKN21m5GkMznixLFo/u8SMPu7Lv0AjmEXq+JV6wDFl94cGZMhuRA5cDDhSpMIYEDPW9twdBEGxtNZHaXP2CrFWLS3PjL5TA18ppu8KTMyGTLdrTDHVBe1xHKMMc5lQ0do= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095927; c=relaxed/simple; bh=UjgjmN27tt3nv48wIRQoWCn7PMmqaFPrHmBXuiyw5aY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=tVzE3jIQx1bWVsFUbKFm5j+chOlvkhiSjLzEShqQ8x9oaDpFx/okRPbXKEUuhBGjV6Y/SJ4HpbY4aWnYX4IMdaCfGcGGoZQSYOm/WGrqMcd7o0mvFNJ08EMeKahFtydYtIXOhZADOVvN+4weBidcqR7lMhqJzu37neR+F8fXWc0= 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=ZxDRYcU2; arc=none smtp.client-ip=209.85.167.48 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-lf1-f48.google.com with SMTP id 2adb3069b0e04-52c9034860dso1598126e87.2 for ; Tue, 11 Jun 2024 01:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718095924; x=1718700724; 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=vXby5sEGwA50yL3eB9wTqqKrctF2MCwrds0R1QAOu3M=; b=ZxDRYcU2CkNzT40Zdb4slamu0BLit6AUEuExyhcJevVrynilKB250GKUyOmMrJ2ced oaGa2ic9eucO02HDGBeJ6HnRxWDjm8ovj+rGR9Q5jxmztaqbx9rLQCz6hD9FdyitzWiQ 0JtZhn2xo8PYa7UHIiEk/Q4qWZC2ErbxVGVOI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718095924; x=1718700724; 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=vXby5sEGwA50yL3eB9wTqqKrctF2MCwrds0R1QAOu3M=; b=BK5qI7P+18vIu+wp6iVOgNSERWH9yvlmx2vIBGQOOnn+3ri7H6WhV1inpPKtoUSHLN fInmtmurHO3tACChEyhG8xgieGR+PSrigWhl0VfjY2QEXcMDcSR73gMeheq4Lv4gFmP5 LsJSPbASmmo0p1SrPzmgVKuouk4hMQP+TQfdOeaUu6YpOExorueTBsz+4/GNhbLDH+30 q+7zLyNSxJU5e5sBpUrmONuvWy8IaeM7w5cAmC3RPl3eMVyHYKNwhwUIURKaPs5DeajW LMalpeJ91bsg2WVyno+o6fMcOV3DLvLiJTym291geZmjIaAu5XgYpQ25Qv7WPwHYz3K/ s0Sw== X-Forwarded-Encrypted: i=1; AJvYcCUxPehco32o4Zn7MaqexWI3gZg3EF4n3yg3CZqZZ4E10jCORRdSntUInFXPv0C1vacYZ/wy5Hezg5Sa+A0T5o/EwJnqgqXOaoIg/66m X-Gm-Message-State: AOJu0YwkVEHKoRBObs3YsKPL5Rc+iigI+AudtviVz+QaJO4SyWbnU04I RAJ+C2bJ31qpBGP7c3Owe1kCCMPagAxOtGfXfKITnVtNRHffQ0Mq1iRKB/YtwRok1eNkyjbFOEl fAWIOSXs5lFw9wvTXnSOE2TeHmkcE6iT7M1Ss X-Received: by 2002:ac2:4a69:0:b0:52b:bfa7:66a1 with SMTP id 2adb3069b0e04-52bbfa766f7mr7667867e87.5.1718095923707; Tue, 11 Jun 2024 01:52:03 -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: Chen-Yu Tsai Date: Tue, 11 Jun 2024 16:51:52 +0800 Message-ID: Subject: Re: [PATCH] scripts/make_fit: Support decomposing DTBs To: Simon Glass 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 Mon, Jun 10, 2024 at 11:16=E2=80=AFPM Simon Glass wro= te: > > 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 th= e > > result of applying one or more DTB overlays on top of a base DTB with > > fdtoverlay. > > > > The FIT image specification already supports configurations having one > > base DTB and overlays applied on top. It is then up to the bootloader t= o > > 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 multiple > > configurations, if such cases exist. > > > > The decomposition function depends on the kernel build system, reading > > 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 kernel > > tree. The function is off by default to keep compatibility with possibl= e > > existing users. > > > > To facilitate the decomposition and keep the code clean, the model and > > compatitble string extraction have been moved out of the output_dtb > > function. The FDT image description is replaced with the base file name > > 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 developmen= t > > 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@googl= e.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. > 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. ChenYu [1] https://lore.kernel.org/linux-mediatek/20240314113908471-0700.eberman@h= u-eberman-lv.qualcomm.com/