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 20E1CC433F5 for ; Tue, 8 Feb 2022 18:52:39 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 532B083DDF; Tue, 8 Feb 2022 19:51:07 +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="Eo+enVvm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5866983DC4; Tue, 8 Feb 2022 19:50:45 +0100 (CET) Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (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 A1CF783DAB for ; Tue, 8 Feb 2022 19:50:39 +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-il1-x129.google.com with SMTP id o10so14823591ilh.0 for ; Tue, 08 Feb 2022 10:50:39 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=nHx0qWpob9zL3QFk8g+M8m3Tc6EJ26Glw4CrR0PRNmg=; b=Eo+enVvmGmP3GHTswFmynM7D4CAWPsO+l7LiIvtZR5thFS+4DfPZz4yBTgV5G/rZdg IPicIHnpzfrzVhfam+FaXjLr65FvxXSeRClOrmBU28Up6NOrUrV8Wx8ucmbkyC+udnTM kY/by+dpzz0Oyd41r2Hf4T+8swIdG5pHN0Cx4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nHx0qWpob9zL3QFk8g+M8m3Tc6EJ26Glw4CrR0PRNmg=; b=dudnnEC1kVGF3cUkxVzgYPms3enK43+V/adKtEinJw7jB+jiKwnBI7NQGBDGN6qpXl /CiRDWsk65fmDoda9Qw/dqs7wfS/NqcjDN9DKo6J5yiMEwlh5XQap1IzJSK92ZkKy53b NEIYRJNF7JKyMbeHUuPMufTD3Vv+sacLdILYpAcC+yN3PwLssJ74cJVNFy2JgT8V3Esf BzXwTiGFyX4CCGsdDFizzDEp1zobc7JPiql4eLKD46IOAe5smV0SGqFdRVul7079FIsG kRaJ/mlxfwohWf82n5idrOZlVh9Tgm3j0t1CrL2k0rpB7WqU2A4FThLHJ1d9sHHVWcx+ y7cg== X-Gm-Message-State: AOAM533WUtQYslFmfLpWhaT8bislhYiMjD5h2C+0u2ZEzgKfoDfxHrEB uzlcYMhaWv9kLtfCoT0xzDdy/SNv1BV5Tg== X-Google-Smtp-Source: ABdhPJw2w8RJ3GPEZlD/1NnZc9GMmY37XrqQInDlQdILwtrE3w6V6qcK70ZfTP14bvoWkqEiBNzCGQ== X-Received: by 2002:a05:6e02:152c:: with SMTP id i12mr2879896ilu.215.1644346238257; Tue, 08 Feb 2022 10:50:38 -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 q2sm2911844ilt.33.2022.02.08.10.50.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 10:50:37 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: huang lin , Jeffy Chen , Simon Glass , Kever Yang , Philipp Tomsich , Alper Nebi Yasak , Tom Rini , Roger Quadros , Philippe Reynes , Ivan Mikhaylov , Heiko Thiery Subject: [PATCH 14/24] binman: Support a list of strings with the mkimage etype Date: Tue, 8 Feb 2022 11:49:58 -0700 Message-Id: <20220208185008.35843-13-sjg@chromium.org> X-Mailer: git-send-email 2.35.0.263.gb82422642f-goog In-Reply-To: <20220208185008.35843-1-sjg@chromium.org> References: <20220208185008.35843-1-sjg@chromium.org> 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.5 at phobos.denx.de X-Virus-Status: Clean At present the 'args' property of the mkimage entry type is a string. This makes it difficult to include CONFIG options in that property. In particular, this does not work: args = "-n CONFIG_SYS_SOC -E" since the preprocessor does not operate within strings, nor does this: args = "-n" CONFIG_SYS_SOC" "-E" since the device tree compiler does not understand string concatenation. With this new feature, we can do: args = "-n", CONFIG_SYS_SOC, "-E"; Signed-off-by: Simon Glass --- tools/binman/entries.rst | 11 +++++++++++ tools/binman/etype/mkimage.py | 13 ++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst index 0fb6d56296..b32dc58933 100644 --- a/tools/binman/entries.rst +++ b/tools/binman/entries.rst @@ -931,6 +931,17 @@ This calls mkimage to create an imximage with u-boot-spl.bin as the input file. The output from mkimage then becomes part of the image produced by binman. +To use CONFIG options in the arguments, use a string list instead, as in +this example which also produces four arguments:: + + mkimage { + args = "-n", CONFIG_SYS_SOC, "-T imximage"; + + u-boot-spl { + }; + }; + + Entry: op-tee: Open Portable Trusted Execution Environment (OP-TEE) blob diff --git a/tools/binman/etype/mkimage.py b/tools/binman/etype/mkimage.py index 201ee4b569..9ecd1c2548 100644 --- a/tools/binman/etype/mkimage.py +++ b/tools/binman/etype/mkimage.py @@ -31,10 +31,21 @@ class Entry_mkimage(Entry): This calls mkimage to create an imximage with u-boot-spl.bin as the input file. The output from mkimage then becomes part of the image produced by binman. + + To use CONFIG options in the arguments, use a string list instead, as in + this example which also produces four arguments:: + + mkimage { + args = "-n", CONFIG_SYS_SOC, "-T imximage"; + + u-boot-spl { + }; + }; + """ def __init__(self, section, etype, node): super().__init__(section, etype, node) - self._args = fdt_util.GetString(self._node, 'args').split(' ') + self._args = fdt_util.GetArgs(self._node, 'args') self._mkimage_entries = OrderedDict() self.align_default = None self.ReadEntries() -- 2.35.0.263.gb82422642f-goog