From patchwork Sun Mar 7 19:31:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448725 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ea2WsslW; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dts7C1tKkz9sW5 for ; Mon, 8 Mar 2021 06:32:19 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 30525827AB; Sun, 7 Mar 2021 20:32:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="ea2WsslW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 015D782652; Sun, 7 Mar 2021 20:31:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) (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 987C182652 for ; Sun, 7 Mar 2021 20:31:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oi1-x230.google.com with SMTP id j1so8776895oiw.3 for ; Sun, 07 Mar 2021 11:31:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vZ6BcrzYmafk/kRBRbb1i758gHuu71l1dfSR9g0nVr8=; b=ea2WsslWhVmXyfyFWJA46u+olToygjh42iFJBiheS7xox3oFqodQwZBuvV7UJeD1TH b+v1RV97sjRjILD11yZeI7rabp7JJiT9Qrb5G/gqeCuJeaDHYKLEVb8zx/ZWOJcldK+N tZaK8NHHSMKJAyDM7oF+x4Y6X+Gt0jvRnxSAg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vZ6BcrzYmafk/kRBRbb1i758gHuu71l1dfSR9g0nVr8=; b=gd8Qo9xkOlDOy6Ps58uJqOVnZSSkgLpAMNGN/mbKDqUHE9Gq2POEW5r99bmUyofe+G LILAjgJwBVDc6hETi4C4eI5kMNXn6/Vc8HOgvS44imnyIeMV7jbJf1MIn6jV5mIgNgfi uYDmM2zKBvbI0Ut4VFRG5i8o+aava3WnYEFUo70Rab3nA93VSxtA05U+lyIoe3tELeto NIXvpV4WLyurJDnBx1iXfSxfmw/eLMvZLNFsXiS13mDsZH6Oy8Ad5TarDcUyyzpTzPvm Cpvpm1gOqjaq1SSrYututTJfotHB0uOEeuSHFS7fIfVee7GAZaXiranQe9s9jcFum42M jJ8A== X-Gm-Message-State: AOAM530GHQ0PD91MjEYpLxchgdXi1jTjKwxE2ASscmRasfIrMqLyz+co dOW86d3YBxySIrDpPmWXQrimwvKscctCNy7A X-Google-Smtp-Source: ABdhPJwqp5bASh7MpKYE9UwjA+Eof+ZDBaS7tkYmQgDxcyMjQlTWaWTtTR3gDIrPnqxHnqRJfq1O3A== X-Received: by 2002:aca:5f83:: with SMTP id t125mr15104898oib.114.1615145512954; Sun, 07 Mar 2021 11:31:52 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id z8sm891074otp.14.2021.03.07.11.31.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:31:52 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Alper Nebi Yasak , Andy Shevchenko , Bin Meng , Chee Hong Ang , =?utf-8?q?Fr=C3=A9d=C3=A9ric_Danis?= , Heinrich Schuchardt , Ilias Apalodimas , Jagan Teki , Masahiro Yamada , Masahiro Yamada , Michal Simek , =?utf-8?q?Pali_Roh=C3=A1r?= , Patrick Wildt , Samuel Holland Subject: [PATCH 00/20] binman: Support devicetree update in all entries Date: Sun, 7 Mar 2021 12:31:27 -0700 Message-Id: <20210307193148.1513733-1-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean U-Boot's various phase binaries actually comprise two or three pieces. For example, u-boot.bin has the executable followed by a devicetree. With binman we want to be able to update that devicetree with full image information so that it is accessible to the executable. This is tricky if it is not clear where the devicetree starts. At present this is handled manually, by creating two separate nodes in the binman definition, u-boot-nodtb and u-boot-dtb, so that binman sees them separately and can easily update the devicetree. But this is not very convenient. Of course we could try to detect the devicetree in the binary, which is easy enough for binman to do. But this approach rapidly gets out of hand. When listing an existing image, should we show the devicetree separately? If we don't then binman cannot extract it by itself, only the whole binary. With SPL and TPL we may have BSS padding and this is harder to detect reliably. Also, a design goal of binman is to provide full information about what is in the image. The detection approach goes against that. So instead it seems best to convert these multi-part binaries into a section with the component parts inside. We can do this automatically without affecting the operation of binman very much. One implementation option for this feature would be to update the entries to behave in two different ways, i.e. either to act as a section containing sub-entries, or as a simple blob. However this is tricky because each entry has to use a particular base class. It is not reasonably possible for an entry to choose between using one base class (e.g. blob) or another (e.g. section), depending on a flag. Instead, the approach taken in this series is to replace an entry type with an expanded version, so 'u-boot' becomes 'u-boot-expanded', for example. The new entry is a section containing two or three sub-entries. A similar approach could be take to reduce the complexity of the x86 binman definition. The microcode is either in TPL, SPL or U-Boot proper, so an entryarg could control which of those is expanded to include microcode. That possibility is left for future consideration. Simon Glass (20): binman: Allow extracting to current directory binman: Document ExpandEntries() in the base class binman: Update entry help for files-align binman: Tidy up underscores in entry documentation binman: Correct the documentation for u-boot-spl-bss-pad binman: Add support for u-boot-tpl-nodtb binman: Add support for u-boot-tpl-bss-bad binman: Allow using an an 'expanded' entry type binman: Allow a way to select expanded entries binman: Plumb expanded entries through fully binman: Automatically expand phase binaries into sections Makefile: Pass new entry args to binman x86: Make use of binman expanded entries x86: dts: Drop unused CONFIG_SPL doc: Move UEFI down a bit binman: doc: Add documentation to htmldocs binman: Rearrange documentation into headings binman: Incorporate entry documentation binman: Drop repetitive heading for each entry binman: Update various pieces of the documentation Makefile | 8 + arch/x86/dts/u-boot.dtsi | 17 +- doc/index.rst | 25 +- doc/package/binman | 1 + doc/package/fit.rst | 8 + doc/package/index.rst | 20 + tools/binman/{README => README.rst} | 955 ++++++++++--------- tools/binman/cmdline.py | 5 +- tools/binman/control.py | 28 +- tools/binman/{README.entries => entries.rst} | 318 ++++-- tools/binman/entry.py | 71 +- tools/binman/entry_test.py | 12 + tools/binman/etype/atf_bl31.py | 2 +- tools/binman/etype/blob.py | 4 +- tools/binman/etype/blob_ext.py | 2 +- tools/binman/etype/blob_phase.py | 51 + tools/binman/etype/cbfs.py | 12 +- tools/binman/etype/fdtmap.py | 30 +- tools/binman/etype/files.py | 2 +- tools/binman/etype/fit.py | 21 +- tools/binman/etype/intel_cmc.py | 2 +- tools/binman/etype/intel_fsp.py | 2 +- tools/binman/etype/intel_fsp_m.py | 2 +- tools/binman/etype/intel_fsp_s.py | 2 +- tools/binman/etype/intel_fsp_t.py | 2 +- tools/binman/etype/intel_ifwi.py | 10 +- tools/binman/etype/intel_me.py | 2 +- tools/binman/etype/intel_mrc.py | 2 +- tools/binman/etype/intel_refcode.py | 2 +- tools/binman/etype/intel_vbt.py | 2 +- tools/binman/etype/intel_vga.py | 2 +- tools/binman/etype/mkimage.py | 4 +- tools/binman/etype/scp.py | 2 +- tools/binman/etype/section.py | 15 +- tools/binman/etype/text.py | 6 +- tools/binman/etype/u_boot.py | 8 +- tools/binman/etype/u_boot_dtb_with_ucode.py | 4 +- tools/binman/etype/u_boot_expanded.py | 24 + tools/binman/etype/u_boot_nodtb.py | 8 +- tools/binman/etype/u_boot_spl.py | 3 + tools/binman/etype/u_boot_spl_bss_pad.py | 17 +- tools/binman/etype/u_boot_spl_expanded.py | 45 + tools/binman/etype/u_boot_spl_nodtb.py | 10 +- tools/binman/etype/u_boot_tpl.py | 3 + tools/binman/etype/u_boot_tpl_bss_pad.py | 44 + tools/binman/etype/u_boot_tpl_expanded.py | 45 + tools/binman/etype/u_boot_tpl_nodtb.py | 28 + tools/binman/etype/u_boot_with_ucode_ptr.py | 2 +- tools/binman/ftest.py | 219 ++++- tools/binman/image.py | 17 +- tools/binman/index.rst | 9 + tools/binman/setup.py | 2 +- tools/binman/state.py | 19 +- tools/binman/test/192_u_boot_tpl_nodtb.dts | 13 + tools/binman/test/193_tpl_bss_pad.dts | 19 + tools/binman/test/194_fdt_incl.dts | 17 + tools/binman/test/195_fdt_incl_tpl.dts | 13 + 57 files changed, 1547 insertions(+), 671 deletions(-) create mode 120000 doc/package/binman create mode 100644 doc/package/fit.rst create mode 100644 doc/package/index.rst rename tools/binman/{README => README.rst} (64%) rename tools/binman/{README.entries => entries.rst} (83%) create mode 100644 tools/binman/etype/blob_phase.py create mode 100644 tools/binman/etype/u_boot_expanded.py create mode 100644 tools/binman/etype/u_boot_spl_expanded.py create mode 100644 tools/binman/etype/u_boot_tpl_bss_pad.py create mode 100644 tools/binman/etype/u_boot_tpl_expanded.py create mode 100644 tools/binman/etype/u_boot_tpl_nodtb.py create mode 100644 tools/binman/index.rst create mode 100644 tools/binman/test/192_u_boot_tpl_nodtb.dts create mode 100644 tools/binman/test/193_tpl_bss_pad.dts create mode 100644 tools/binman/test/194_fdt_incl.dts create mode 100644 tools/binman/test/195_fdt_incl_tpl.dts