From patchwork Tue Jul 18 13:23:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1809272 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.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=m78le4Ea; 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R507M47yNz20Cs for ; Tue, 18 Jul 2023 23:25:17 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4CAD6866F2; Tue, 18 Jul 2023 15:25:05 +0200 (CEST) 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="m78le4Ea"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1B971866C5; Tue, 18 Jul 2023 15:25:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (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 1D2DB863A4 for ; Tue, 18 Jul 2023 15:24:58 +0200 (CEST) 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-il1-x136.google.com with SMTP id e9e14a558f8ab-34617b29276so15485195ab.0 for ; Tue, 18 Jul 2023 06:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689686696; x=1692278696; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hxNUx1lJosdl1bsI4MhsR4wqshD52gjgnZqtKiQcCRs=; b=m78le4Ea9W+3FAV/tive0u0ce+Ao3YyuRyU8AYUH4SrAFavCZN6/3LNEOaiEaHPOEM kkgLexobPUyOaJWUrXWjJ6mIWsa9W/m5bF4lpgdOeAjiu/LdpbmtYmfQWWXPuqAe6aDJ xCiCW6gAoOiaG53mvRqwCO+GkCQYCdA8YUJHc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689686696; x=1692278696; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hxNUx1lJosdl1bsI4MhsR4wqshD52gjgnZqtKiQcCRs=; b=GqanVGCYMsCk1c9kuZDXM6hbDOHRwLXih8wn5SLEgtM+DbTBJlbGqIs0NcltzANO8T w6h+V3Tv8qafWI9Vo7fZw/4iucjjy62zg3XGLXfQWGqm0ue1H8F9mJZ0E84eYmBP//cL Eu4ZaXLlu9k5Tgynq41Xjs2hLU7YwWEQVNcnLmv6OvNAbz52pX2UdwnP73ODdx9nyh0L iKr4iwgxcZovo2Jbb1cLSnX/mqt+N/zjlemGm2JuVL5enytCd9n0trTPm39HsdRTKdft 3Z4qnSuihMJPFtIskcxtnji1Q7AfuDlGImrmQ7mzI6lA4XTemhJWqsrWC3J0FRJENSpU adZA== X-Gm-Message-State: ABy/qLZZh49JkXiDbzA/aaC/6O3WTof+Fkw2zPH7lHfyEs59tiJo//Mo QEOr6H5//ruHFSnO8RBaYF8cxseflXAORbHbEcY= X-Google-Smtp-Source: APBJJlGr/Y2zDQ+k4QjSA4oUvAqBg59xEl6UjJVz+m2NeggcJLSQqNJAuTDgyoOxHAiLX4uN9UaLag== X-Received: by 2002:a92:d8c5:0:b0:348:8540:ede8 with SMTP id l5-20020a92d8c5000000b003488540ede8mr1429834ilo.7.1689686696666; Tue, 18 Jul 2023 06:24:56 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id z15-20020a92bf0f000000b00338a1272ce1sm697656ilh.52.2023.07.18.06.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 06:24:56 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Marek Vasut , Jan Kiszka , Simon Glass , Alper Nebi Yasak , Neha Malcom Francis , Peng Fan , Philippe Reynes , Stefan Herbrechtsmeier Subject: [PATCH v5 00/20] binman: Simple templating feature and mkimage conversion Date: Tue, 18 Jul 2023 07:23:49 -0600 Message-ID: <20230718132453.626947-1-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.455.g037347b96a-goog MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean This series converts the mkimage entry type to be a section, i.e. based on the entry_Section class. This makes it more consistent in its behaviour, e.g. allowing symbol writing and expanded entries. A simple templating feature is also introduced, to reduce duplication when a set of entries must be used in multiple images. In this version the nodes from the template are placed before any other nodes, meaning that the template sets the node order. This seems more consistent than other mechanisms. This series is available at u-boot-dm/mkim-working Changes in v5: - Drop method implementations for which the entry_Section one is enough Changes in v4: - Avoid copying phandle nodes - Support copying over properties from each template node - Make sure phandles are not copied - Copy over properties from the top-level template node - Add new patch to reduce state.SetInt and bintool cmd to debug level Changes in v3: - Add new patch for elf to return number of written symbols - Add new patch with more detail on how ObtainContents() works - Fix up some tests which now need SPL and TPL - Avoid calling ObtainContents() when not needed - Fix 'specific' typo - Add a new devicetree file especially for node copying - Correct logic for merging nodes in order - Tidy up some comments - Adjust to use the new example file - Drop duplicate dts-v1 header - Add new test case for templating in a FIT - Add new patch to support writing symbols inside a mkimage image Changes in v2: - Drop now-unnecessary methods in mkimage etype - Correct ordering of template nodes - Fix 'preseverd' and 'inserter' typos Marek Vasut (1): binman: Convert mkimage to Entry_section Simon Glass (19): binman: Correct coverage gap in control binman: Init align_default in entry_Section binman: Use GetEntries() to obtain section contents binman: Read _multiple_data_files in the correct place binman: Allow disabling symbol writing stm32mp15: Avoid writing symbols in SPL binman: Update elf to return number of written symbols binman: Add more detail on how ObtainContents() works binman: Provide a way to specify the fdt-list directly binman: Drop __bss_size variable in bss_data.c binman: Correct handling of zero bss size dtoc: Support copying the contents of a node into another dtoc: Allow inserting a list of nodes into another binman: Support simple templates binman: Support templating with multiple images binman: Add a test for templating in a FIT binman: Support templates at any level binman: Support writing symbols inside a mkimage image binman: Reduce state.SetInt and bintool cmd to debug level arch/arm/dts/stm32mp15-u-boot.dtsi | 1 + tools/binman/binman.rst | 94 +++++++++ tools/binman/bintool.py | 2 +- tools/binman/control.py | 34 +++- tools/binman/elf.py | 13 +- tools/binman/elf_test.py | 13 +- tools/binman/entries.rst | 6 + tools/binman/entry.py | 11 +- tools/binman/etype/blob_phase.py | 5 + tools/binman/etype/fit.py | 9 + tools/binman/etype/mkimage.py | 136 ++++++------- tools/binman/etype/section.py | 54 +++-- tools/binman/etype/u_boot_spl_bss_pad.py | 2 +- tools/binman/etype/u_boot_tpl_bss_pad.py | 2 +- tools/binman/etype/u_boot_vpl_bss_pad.py | 2 +- tools/binman/ftest.py | 218 ++++++++++++++++++++- tools/binman/state.py | 4 +- tools/binman/test/282_symbols_disable.dts | 25 +++ tools/binman/test/283_mkimage_special.dts | 24 +++ tools/binman/test/284_fit_fdt_list.dts | 58 ++++++ tools/binman/test/285_spl_expand.dts | 13 ++ tools/binman/test/286_template.dts | 42 ++++ tools/binman/test/287_template_multi.dts | 27 +++ tools/binman/test/288_template_fit.dts | 37 ++++ tools/binman/test/289_template_section.dts | 52 +++++ tools/binman/test/290_mkimage_sym.dts | 27 +++ tools/binman/test/Makefile | 5 +- tools/binman/test/bss_data.c | 3 +- tools/binman/test/bss_data_zero.c | 16 ++ tools/binman/test/bss_data_zero.lds | 15 ++ tools/binman/test/embed_data.lds | 1 + tools/dtoc/fdt.py | 141 ++++++++++++- tools/dtoc/test/dtoc_test_copy.dts | 88 +++++++++ tools/dtoc/test_fdt.py | 113 +++++++++++ 34 files changed, 1184 insertions(+), 109 deletions(-) create mode 100644 tools/binman/test/282_symbols_disable.dts create mode 100644 tools/binman/test/283_mkimage_special.dts create mode 100644 tools/binman/test/284_fit_fdt_list.dts create mode 100644 tools/binman/test/285_spl_expand.dts create mode 100644 tools/binman/test/286_template.dts create mode 100644 tools/binman/test/287_template_multi.dts create mode 100644 tools/binman/test/288_template_fit.dts create mode 100644 tools/binman/test/289_template_section.dts create mode 100644 tools/binman/test/290_mkimage_sym.dts create mode 100644 tools/binman/test/bss_data_zero.c create mode 100644 tools/binman/test/bss_data_zero.lds create mode 100644 tools/dtoc/test/dtoc_test_copy.dts