Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8249AC001B0 for ; Sun, 23 Jul 2023 03:44:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 727BB8664A; Sun, 23 Jul 2023 05:44:15 +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="aEQ+4ktW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2F5CD86625; Sun, 23 Jul 2023 05:44:14 +0200 (CEST) Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (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 C5F14863E7 for ; Sun, 23 Jul 2023 05:44:11 +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-io1-xd30.google.com with SMTP id ca18e2360f4ac-7835ffc53bfso79338039f.1 for ; Sat, 22 Jul 2023 20:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690083850; x=1690688650; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rpsCjwWoZUODlCHUA+tOmFGCAdZoIUkDPS7sVAyt9ao=; b=aEQ+4ktWQYq1A47Lf0BjgGHkd9jiCgOCHLOvppxAGM0UphyDteet6O5iwYcyfWUe7c XSoncgltHKhWvwlY1fXfqenMAt5p2sht80sgJStV9kqikefyodAHBaW+hauasZJplxK3 ED5rDP6UnmALkU3LBqDklfodu44SDOwAjjGjg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690083850; x=1690688650; 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=rpsCjwWoZUODlCHUA+tOmFGCAdZoIUkDPS7sVAyt9ao=; b=YGNc5w1J+jweUXJ3uvEUmlR7W79u3EjbfXQ+qB8BdFsj/ONALlAapxlTAv2vJhxf1+ CTe1Qe2qmkJdJnLEtxWR6QFWgA686KJ/qnlYNQMynscmYkf+rhFKEV1uE5nwSmMZs5VQ M2eykbj/r1AFofHMCXxGQ4RWkRqlxWKFy/2erdnXVoSmJRyj3WcZHnlP+S+0IUDqsOfJ zhTAapKZgLFUO+wv3NBNgdLSfEMuVQ3LKt4vK/chdrZ+DAHBrDbew9keN1mKXkdhOjgN Bonwm5gPgOxuV5jgFrELJUOjVrItkGsiX/WLlvoUgZEK3Jz0eAGv4K7dRDSlMR3XarM1 zS3w== X-Gm-Message-State: ABy/qLbQAk3J4TsloEydW6431Gsi04YI3fNQQKgKSwfmXmk7LMujyM0M iZajLB67r82hgUGXT1JFHn9tDoihXBgfHensEyU= X-Google-Smtp-Source: APBJJlHHKVEaRB6TOxHEokgJQH7+bpjf0+M+2IBcpS87CxJuoHLhvVDphWM9AUIKilPBT5ibaBw5XA== X-Received: by 2002:a05:6602:3585:b0:780:c872:5df7 with SMTP id bi5-20020a056602358500b00780c8725df7mr2468536iob.9.1690083850098; Sat, 22 Jul 2023 20:44:10 -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 a11-20020a056638018b00b0042b3e04510asm2077384jaq.98.2023.07.22.20.44.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jul 2023 20:44:09 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Alper Nebi Yasak , Neha Malcom Francis , Stefan Herbrechtsmeier , Philippe Reynes , Peng Fan , Simon Glass , Heinrich Schuchardt , Jerry Van Baren Subject: [PATCH v2 0/6] binman: Template fixes and improvements Date: Sat, 22 Jul 2023 21:43:51 -0600 Message-ID: <20230723034406.87673-1-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 With the basic template feature in place, some problems have come to light. Firstly, keeping the template around while processing entries seems unnecessary and perhaps confusing, so this is removed. Secondly this series aims to support phandles in a more intuitive way, rather than just ignoring them in templates. It includes an experimental patch to copy phandles from template so that it is possible to so something like: template { some_node: some-node { }; }; image { insert-template = <&template>; }; with the some_node phandle being copied to the 'image' node, to result in: image { insert-template = <&template>; some_node: some-node { }; }; Changes in v2: - Use a 'done' variable to reduce code duplication - Handle phandle copying property and report duplicates - Refine support for phandles to deal with duplicates - Add a test that deals with duplicate phandles Simon Glass (6): binman: Produce a template-file after processing dtoc: Make properties dirty when purging them dtoc: Add some debugging when copying nodes fdt: Allow copying phandles into templates binman: Remove templates after use binman: Support templates containing phandles tools/binman/binman.rst | 26 +++++++- tools/binman/control.py | 32 ++++++++- tools/binman/ftest.py | 43 ++++++++++++ tools/binman/test/291_template_phandle.dts | 51 +++++++++++++++ .../binman/test/292_template_phandle_dup.dts | 65 +++++++++++++++++++ tools/dtoc/fdt.py | 34 +++++++--- tools/dtoc/test/dtoc_test_copy.dts | 6 +- tools/dtoc/test_fdt.py | 40 +++++++++--- 8 files changed, 274 insertions(+), 23 deletions(-) create mode 100644 tools/binman/test/291_template_phandle.dts create mode 100644 tools/binman/test/292_template_phandle_dup.dts -- 2.41.0.487.g6d72f3e995-goog