Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp399346lqp; Tue, 11 Jun 2024 07:46:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVDIRCTr0YpfsVsAUVVvPMFHAcO8XArUMnOpiGnftsEKuN4Af7DNmeiGBDj37M9ZDUb59GRIzU1y611rgXz+3pFd2WbWQdkyMS03TY4nQ== X-Google-Smtp-Source: AGHT+IGNXQP7lavxoBlvfRSBwZGFrNth+AgZOCJJtbth6QKJWjddNrzSifbYRqaDsiTFTCSoLAAu X-Received: by 2002:a05:6218:260c:b0:19c:467b:13b6 with SMTP id e5c5f4694b2df-19f1fe51028mr1263387055d.12.1718117160344; Tue, 11 Jun 2024 07:46:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718117160; cv=pass; d=google.com; s=arc-20160816; b=im3aLgjc4I7nzIp2E9mmFduAEhkLoJ40urkxVHaztjKR5dPruKcV6DN+NaNaZFRGww adEtcKlLWeFCkNVyBFK0rK1/FXK3eiVa0F1EzAZwB8TaRF7wSeXB3pFgOZjU/xL4Thvx BxiZpsndCChmfaKVMy5DS3+LrPpSkEGrYjFw/bKzyyEh45H78EtKOptry/FFjEzNkOHL RyZmPFYoGLMYv1QYSCagD5E5LNVKSana9OCnbYVEsg5CgCHZ4VlpC4ZnkVlgm1Tnu7eB BvjzcethrqAIaIP0DD9xLgC4og5FygAq//klP2e8L9Ngqt7XV4zTyRcaxsqd1mjI6dnt yShA== 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=jAItP972cBaF8orZHtvNp8XWYDk+fjBGJJQ25H+XRys=; fh=NXidqp8uus9PdxdvvjHiqigdUoeTNaiKY3Jug2ZyEnM=; b=zXCKxyzNg5rwF9edZwRX2pHUfF6jwChVCebtaDpCuFpTrd/jjAaMLedmWRNaFpbcOO lhrk6PukKw/Vtu2/MtbIaUrpW7nTq2HFdsOSKwL3gFCBLfibam07tIj8kJRaI577q5Cz pHpqGYcw+ZqCBISDojmYXRMnTjQ6gmuWyof1lnxmDQl7zUa9wqCBsJNiscs45CexOuw1 tQq/JfJ49prM1uYOMpvjpJhfxOlv/cmvuPtK/u74P1wwnXui+ucO0ICSB/5aj8KcK3Ya pplJto6y7InHL8lKIyul1MyJxVOxcL6/ctEKBOo9FJHC3ic12BwssdzU9MG/pLzx0Gsf 4mWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=juGmJXBM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210079-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210079-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6ef2e603bbbsi3957521a12.680.2024.06.11.07.46.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 07:46:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210079-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=juGmJXBM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210079-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210079-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 5ACE9284BD2 for ; Tue, 11 Jun 2024 14:45:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CB32111A1; Tue, 11 Jun 2024 14:45:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="juGmJXBM" 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 1AD5BBA34; Tue, 11 Jun 2024 14:45:51 +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=1718117152; cv=none; b=Ks7u8N7Sa/lK1KpEpgYqpOXx4o3o2Zfsd4VXTyv1OtcxNyhZeW5za5Jp6l/DxzHYVExRFsLgqM4jCUQ1+EcXlWZ2ZOkQ71mEnUWRda3eUBkNV87PNaaDh3j5SFUidMhZpSxi+dXlY9+kjnh5HsYJp+6k3UW5P6+iKTEm0wSaoXE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718117152; c=relaxed/simple; bh=V3zghL8937UdbAnh4MFjMK3vjv6PMWnvoOCbMkWbe1s=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Ft1JKVL6Fw7lmRCC1NtnsdVw9gTAbvFPr/fY7tqYznwe4s2jYoBwSvxuBxSwEkSwJmjorXqds4UEXa0kJojE7+3biDyMx7objJeDbiszCZ134AHil5IA88qnGociHSQB5zX16D7VmTvQam0ekV/uXHRhYHuZetFjoYAxSSTe4tg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=juGmJXBM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A28F2C32789; Tue, 11 Jun 2024 14:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718117151; bh=V3zghL8937UdbAnh4MFjMK3vjv6PMWnvoOCbMkWbe1s=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=juGmJXBMyGZXQ/0x55ti+I4UYFcXSeLviZnT+ww10SZAgbmT19fchqxVRSvE7FWls aP3sH6FxjPUK+4byqsD5/Q0AVxPyNh4iwOq5XEaaJvXxzQuDvaJD0j85gWZR3zs5TS 8nJ9pQ3fclffSl7Fs1/bnQVtU+Qo+YaQysEF/buMn0y1xmPwhJ4mTnhKB9bBPhphq+ 36P2a7T6Z5qWl+jSnowHFjXd7ArbsfW+oxc6WG/iNzzCGfixmEnTUZlBAbzRdVvy1V 8rPKvQPoH9DoHRbwwfTp4LppIXFJtkr+A2vQDEfoBrT30HFa5PF0b6zslg53StQT/C OHmkDNMHh2JuA== Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-52c7f7fdd24so1506948e87.1; Tue, 11 Jun 2024 07:45:51 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXITQpUVLrF7Ln2FebfLlYIfaYX2ggv4pavUPGQOtBXmJ/GzLAWqX4fuxBSd9s54al/yePPQMWCCpsisimTNwWxgm399tT3NHJdrseVoWrItWy3kAw/4m4xF1/z+4liyoW37h4Wkt6ptFTgwVW2iNyMJQmB5iIo708VjW/6exJwa1MwpSYk9Q== X-Gm-Message-State: AOJu0Yw6ixV/mxozBrVH64jKT+2ZF9TtKEPyUW+5FdVVZe94tuTKCygE R2Ir/CdfE0HQzcVs66OYgM4Bsv6gwulQtM5Etj8aLWf//dSZt37hNMIj56hAlCTwRYT7v4giQov xPNPNOzMQW7rdAfrlJgIzYII3O7A= X-Received: by 2002:a19:5e44:0:b0:52b:796e:66a5 with SMTP id 2adb3069b0e04-52bb9fd281cmr6792120e87.66.1718117150327; Tue, 11 Jun 2024 07:45:50 -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: Masahiro Yamada Date: Tue, 11 Jun 2024 23:45:14 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] scripts/make_fit: Support decomposing DTBs To: Chen-Yu Tsai Cc: Simon Glass , 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, Jun 11, 2024 at 5:52=E2=80=AFPM Chen-Yu Tsai w= rote: > > 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. Some time ago, I asked a similar question with a similar motivation. https://lore.kernel.org/devicetree-compiler/CAK7LNARV8Bo-tBXMdOu55Wg9uZRXvN= iRdkDJ4LH8PwVMnMp4cA@mail.gmail.com/ > > > 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= @hu-eberman-lv.qualcomm.com/ > -- Best Regards Masahiro Yamada