From patchwork Sun Mar 7 19:31:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448726 X-Patchwork-Delegate: sjg@chromium.org 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=BuGOH5Z8; 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 4Dts7D0pn9z9sWQ for ; Mon, 8 Mar 2021 06:32:17 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 29DEE827BC; Sun, 7 Mar 2021 20:32:00 +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="BuGOH5Z8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 25087826B2; Sun, 7 Mar 2021 20:31:58 +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-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) (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 6B852826B2 for ; Sun, 7 Mar 2021 20:31:55 +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-x234.google.com with SMTP id x135so4266696oia.9 for ; Sun, 07 Mar 2021 11:31:55 -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=sHeOZGsxnTOO/mHJkymzAFrFlpgBHutF0WMp8MMmhtc=; b=BuGOH5Z8Gz9cILVdyyqSTQotNR8jbtnqieiQO5C0fB/HH6ZAGxqYAv4a0SKjB1jsxf Pw+GzK2H4/bM6Zyos8BCj8S39wU3lX7npuM50JsDFz6/kL4J9qn+ozO0TEZzbqqrp/7t yLFB3OSJakt63BhWMfir6L0ahmsP9g1Svp9UE= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=sHeOZGsxnTOO/mHJkymzAFrFlpgBHutF0WMp8MMmhtc=; b=bqqt56qQw7PF3ZjyWjIxgyYasyWZxOvNMofw8pmvunb9anmio9vDnqr6X4itUXCQkC h+rXC/qw79KK9Trrhkdrry73LtK273N9dh+B4bvz/aqXmIgL3QZ2A1oCUqElHpkLwf08 q7yGYhTDUuzG4hlnzXxmH0Bfhrh8zOBM8N9grfAC2bQSxv36/Quy93IZ2w5bfCr6gkUu uEMZlkHhMS6YTwV5GsPc07MbXu7OJvokn1Uhma9nwgI/DOtw1tsEWOncg9wit9Mpwkff ufq73rbxefbpKSWfuU9jpWG5M8LxzhpguiRg0bdwK9c96q9RXRkDzZJr2bF00c62UunE v4Rw== X-Gm-Message-State: AOAM532UnYpZffaqCnUlzl1hEGFLbCo9586prn5nQV24CxAC27iiHsDi QToW7Q84EUNUNztvVG2X/GWXxO2+MbCpjScm X-Google-Smtp-Source: ABdhPJwnIkDGp8mvoNW+R1d5l42SCzf7QN9QOCOBL3OQ+NPqVTBL49v0KnEPMzbHUL1UL8VzQ492LQ== X-Received: by 2002:aca:b646:: with SMTP id g67mr14694581oif.130.1615145513887; Sun, 07 Mar 2021 11:31:53 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:31:53 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH 01/20] binman: Allow extracting to current directory Date: Sun, 7 Mar 2021 12:31:28 -0700 Message-Id: <20210307193148.1513733-2-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 Extracting files to the current directory is not normally a very friendly thing to do, but it can be warranted, e.g. in a new temporary dir. At present binman reports an error when such an attempt is made. Fix it. Signed-off-by: Simon Glass --- tools/binman/control.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/binman/control.py b/tools/binman/control.py index 1952b2abf48..9c0cafeafc4 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -241,7 +241,7 @@ def ExtractEntries(image_fname, output_fname, outdir, entry_paths, # If this entry has children, create a directory for it and put its # data in a file called 'root' in that directory if entry.GetEntries(): - if not os.path.exists(fname): + if fname and not os.path.exists(fname): os.makedirs(fname) fname = os.path.join(fname, 'root') tout.Notice("Write entry '%s' size %x to '%s'" % From patchwork Sun Mar 7 19:31:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448730 X-Patchwork-Delegate: sjg@chromium.org 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=ZjTqImQ6; 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 4Dts8044LGz9sW5 for ; Mon, 8 Mar 2021 06:33:04 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A742582817; Sun, 7 Mar 2021 20:32:16 +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="ZjTqImQ6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B980E827DE; Sun, 7 Mar 2021 20:32:04 +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-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) (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 34EAF826CA for ; Sun, 7 Mar 2021 20:31:56 +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-ot1-x331.google.com with SMTP id h22so7162604otr.6 for ; Sun, 07 Mar 2021 11:31:56 -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=ai1ii170pyAO3PTmjHpj794+6p4DQdEUzDHEEqi3Fr4=; b=ZjTqImQ6184j7DqLhg19T9ggaZqjYo74LxlNSi4oF1YpGqxuIQHDKpgZk8fyZMn9HC rB6RjINckcGvPS+q2BstGY1RaxvJjDxiJzfTnLk0CevpVKcfI+XOlUTGxKEL/ddjHkH8 3PG+vMPM46i2NgdVkv3oE53qUMXTo8su3InIA= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ai1ii170pyAO3PTmjHpj794+6p4DQdEUzDHEEqi3Fr4=; b=HJrh8v6OBIuICX/w1rPeXvr6tQPPVSJk5dr1KXINErmuXGC/Wh33uGT+9jDBYGeFg1 YKkiHN7MbJXBrpBtSteSDWPMmMUGL4BMo9I+w7YLHK+UJUYYdKbq3vhJbIc4sILLo+8C 0IDuRtOyh5yw8NqgEw/Na2+gtCQZnRwyG3rH96MrjUd92rvEh1aJ7wM6HD+StZr5095+ S8eebGw2xznLwFJ7TkMSuUCWwkXp7+1LdA4VeB4e5dHZPiG9UFnCFZPp/5SRiZRa05ly 5rqJ3gXjIElloVNyVgBNygvs4CRk/Ne1g9be7B+d9mJtdxYZvPmzDfrhZPsB7kwyfXWo EN5w== X-Gm-Message-State: AOAM533mNSNDGEapJjil2dkE7ieDV5g74XOvsL2h1YmiZlhDMcHcUJda 3sca0oTCWYug015xZ9TJHYwHkvGbXMd7pJwn X-Google-Smtp-Source: ABdhPJzfQNkClxIfxC/1+WjCaUdUq96Z5dyBprQG2JcWBQgU/O5F9W1HdUnhAzfbPURcHTTAOyM21g== X-Received: by 2002:a05:6830:1c6e:: with SMTP id s14mr1385912otg.17.1615145514644; Sun, 07 Mar 2021 11:31:54 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:31:54 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Alper Nebi Yasak , Bin Meng Subject: [PATCH 02/20] binman: Document ExpandEntries() in the base class Date: Sun, 7 Mar 2021 12:31:29 -0700 Message-Id: <20210307193148.1513733-3-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 Move the documentation to the base method as it is with other methods. Also update it a little while we are here. Signed-off-by: Simon Glass --- tools/binman/entry.py | 11 +++++++++++ tools/binman/etype/section.py | 6 ------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/binman/entry.py b/tools/binman/entry.py index d58a730f3d5..507760e2a86 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -211,6 +211,17 @@ class Entry(object): return {} def ExpandEntries(self): + """Expand out entries which produce other entries + + Some entries generate subnodes automatically, from which sub-entries + are then created. This method allows those to be added to the binman + definition for the current image. An entry which implements this method + should call state.AddSubnode() to add a subnode and can add properties + with state.AddString(), etc. + + An example is 'files', which produces a section containing a list of + files. + """ pass def AddMissingProperties(self, have_image_pos): diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index 1ceadef13f3..2103919b0c3 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -126,12 +126,6 @@ class Entry_section(Entry): return True def ExpandEntries(self): - """Expand out any entries which have calculated sub-entries - - Some entries are expanded out at runtime, e.g. 'files', which produces - a section containing a list of files. Process these entries so that - this information is added to the device tree. - """ super().ExpandEntries() for entry in self._entries.values(): entry.ExpandEntries() From patchwork Sun Mar 7 19:31:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448727 X-Patchwork-Delegate: sjg@chromium.org 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=85.214.62.61; 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=YpYh8Nif; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dts7M5KnMz9sW5 for ; Mon, 8 Mar 2021 06:32:31 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BD559826B2; Sun, 7 Mar 2021 20:32: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="YpYh8Nif"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DB761827D2; Sun, 7 Mar 2021 20:32:00 +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-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) (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 C51B382797 for ; Sun, 7 Mar 2021 20:31:56 +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-ot1-x32f.google.com with SMTP id a17so7181802oto.5 for ; Sun, 07 Mar 2021 11:31:56 -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=8CTHKRF7e/66Eh+PbYpEdiD0Z7n98kKQSTbg6ItWjMs=; b=YpYh8Nif1L+Jodts2Sb6TwKlA9ufoKFRT/R0pqEdmdA7OnlGjUFncw4/snYNQ5l/LK suUC/oIUCFOHQO7OHZ6DHXoI3laJm4KKhJr6gGlo20WvicHDRnYMr4DxCpVrf+PdOVmL PNHwR0jnsYJCC4Y5sosZtVpFVeDJFmwfgpefs= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=8CTHKRF7e/66Eh+PbYpEdiD0Z7n98kKQSTbg6ItWjMs=; b=tzJva5OIDyU3sdOmunK4oe2uLA3CPl0vSrln0bk+Uy/Qa0otpKMzeTjS/V2w1AyPT7 3pfPSSnKHtghxYZleJj2uC+VfN4NF4/VXXtewb2CbQ1DXvxfsXoHhqo+pzidPRFqi+vU VB1sLYtpO0dXCjnU+8akOTnhFRXX0uQoHNmQyBrRB7siWr5d8bi1flKHz9EuuxTdg+E0 9kF5hXsVQ8XYjS6xw3WcvIbNnAI2opqRvIyzwYjUNqNuQ4NzcQDKHKghIaaOfEy9+W8g 2Zl50CkuO6t2Y1Oiz4t9iKVrUQcoQUlbTrnp0OyovnaOoG0/F+uOqJI/ASoSJcKBmYDL LaqQ== X-Gm-Message-State: AOAM5324RLeXYM6bvwcGbJiSN4itr5rVdP0HBFDc1ZTYjcHsigYR84DU FxFSey9S7dKxtkhowkiHpOFw6d8P6KazjqT7 X-Google-Smtp-Source: ABdhPJxi4kMVT8ClOFkyc1DObzwpVz+BVrJSzZCdtDDKIJuIm4Bl2Zh6hz3vKy+NdpQZbI/AkRAxqA== X-Received: by 2002:a05:6830:238c:: with SMTP id l12mr11832080ots.276.1615145515438; Sun, 07 Mar 2021 11:31:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:31:55 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH 03/20] binman: Update entry help for files-align Date: Sun, 7 Mar 2021 12:31:30 -0700 Message-Id: <20210307193148.1513733-4-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 Regenerate the entry documentation, which step was missed when the files-align feature was added. Fixes: 6eb9932668f ("binman: Support alignment of files") Signed-off-by: Simon Glass --- tools/binman/README.entries | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/binman/README.entries b/tools/binman/README.entries index 999b77690f0..7cca030409e 100644 --- a/tools/binman/README.entries +++ b/tools/binman/README.entries @@ -302,6 +302,7 @@ Properties / Entry arguments: - files-compress: Compression algorithm to use: none: No compression lz4: Use lz4 compression (via 'lz4' command-line utility) + - files-align: Align each file to the given alignment This entry reads a number of files and places each in a separate sub-entry within this entry. To access these you need to enable device-tree updates From patchwork Sun Mar 7 19:31:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448729 X-Patchwork-Delegate: sjg@chromium.org 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=BRfFY+G6; 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 4Dts7n69rNz9sW5 for ; Mon, 8 Mar 2021 06:32:53 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E3FB382829; Sun, 7 Mar 2021 20:32:13 +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="BRfFY+G6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BFD17827D3; Sun, 7 Mar 2021 20:32:03 +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-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) (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 BB537827AB for ; Sun, 7 Mar 2021 20:31:57 +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-ot1-x32a.google.com with SMTP id t16so7159792ott.3 for ; Sun, 07 Mar 2021 11:31:57 -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=KWV5XvYyPt9jNfJ2rMZY5gvI/S78gb6wH5rPPPq6xjs=; b=BRfFY+G6qKXQXFhKgcEsfsczIal+T1D5iE2F4dHZq9m7+K69RkovTrjbsYZlG/WAYO HIyqpInnf1Z/+M+3z+donNf1DdrSAB+9+zbFyWqCUlm0lMzuYQfB3uwc2GChFeBVH4o6 wbCn6TZzuR7ZFoxkM+/mlHL/hloLXEuV7jwi8= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=KWV5XvYyPt9jNfJ2rMZY5gvI/S78gb6wH5rPPPq6xjs=; b=lHUno/WKmvr3LVSXNM7+gVQxBypki4G9Vd0rmaJ23VGV6zYdzOmGM6iAFx+F2ifPM3 YrMXUAX2CxHp1gulr59L3VA3vYKnxh55DPcGkOENSyuENp+rlOCjzpaOgBKTez5nEuLO OXlEvLPyiImgG8WbJLcnh7/o1etCkQ9Yud712U6Moo79M7pYE2zaiXTnjwfs6CjB9hyT 3n6p2ysdLUR/VB+anUnUG26f1ZnCF+YMMdlD5YGwXD7SaqnGp/HfmtTxZz0e06jO8A5x sX0pYsk4x37ksMZuAyRaLLzrj8X6hR00LzViSN6xHRRhFm9kTNmha9Zcf+9DHVH9Bk/J S4nQ== X-Gm-Message-State: AOAM531Iqpwf7/7XK1Z5Xp6fzuAgqL6K/uRQHBaOlbVqMdtxhgLU5uPJ 0p4AeOvQGPRtGv1mploV+DEHhn+5O/ZZzdUh X-Google-Smtp-Source: ABdhPJyoWrSwkoBlIaEAB9q5wz0syYfnwFQAWLZgWcN8w6sK+0R6dwl2dVHVnLZZo0C0RC8IR33llA== X-Received: by 2002:a9d:7617:: with SMTP id k23mr16224096otl.142.1615145516235; Sun, 07 Mar 2021 11:31:56 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:31:55 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Andy Shevchenko , Bin Meng Subject: [PATCH 04/20] binman: Tidy up underscores in entry documentation Date: Sun, 7 Mar 2021 12:31:31 -0700 Message-Id: <20210307193148.1513733-5-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 Several entries currently use an underscore in the entry-type name, but in fact a hyphen is used. Update the docs to fix this as it might be confusing. Also simplify the 'filename' comment and fix the 'operation' typo. Signed-off-by: Simon Glass --- tools/binman/README.entries | 23 ++++++++++----------- tools/binman/etype/blob.py | 2 +- tools/binman/etype/u_boot.py | 2 +- tools/binman/etype/u_boot_dtb_with_ucode.py | 4 ++-- tools/binman/etype/u_boot_nodtb.py | 6 +++--- tools/binman/etype/u_boot_spl_nodtb.py | 7 +++---- tools/binman/etype/u_boot_with_ucode_ptr.py | 2 +- 7 files changed, 22 insertions(+), 24 deletions(-) diff --git a/tools/binman/README.entries b/tools/binman/README.entries index 7cca030409e..3fbc06d9264 100644 --- a/tools/binman/README.entries +++ b/tools/binman/README.entries @@ -39,7 +39,7 @@ Properties / Entry arguments: This entry reads data from a file and places it in the entry. The default filename is often specified specified by the subclass. See for -example the 'u_boot' entry which provides the filename 'u-boot.bin'. +example the 'u-boot' entry which provides the filename 'u-boot.bin'. If compression is enabled, an extra 'uncomp-size' property is written to the node (if enabled with -u) which provides the uncompressed size of the @@ -840,7 +840,7 @@ Properties / Entry arguments: This is the U-Boot binary, containing relocation information to allow it to relocate itself at runtime. The binary typically includes a device tree -blob at the end of it. Use u_boot_nodtb if you want to package the device +blob at the end of it. Use u-boot-nodtb if you want to package the device tree separately. U-Boot can access binman symbols at runtime. See: @@ -876,9 +876,9 @@ See Entry_u_boot_ucode for full details of the three entries involved in this process. This entry provides the U-Boot device-tree file, which contains the microcode. If the microcode is not being collated into one place then the offset and size of the microcode is recorded by this entry, -for use by u_boot_with_ucode_ptr. If it is being collated, then this +for use by u-boot-with-ucode_ptr. If it is being collated, then this entry deletes the microcode from the device tree (to save space) and makes -it available to u_boot_ucode. +it available to u-boot-ucode. @@ -920,12 +920,12 @@ Entry: u-boot-nodtb: U-Boot flat binary without device tree appended -------------------------------------------------------------------- Properties / Entry arguments: - - filename: Filename of u-boot.bin (default 'u-boot-nodtb.bin') + - filename: Filename to include (default 'u-boot-nodtb.bin') This is the U-Boot binary, containing relocation information to allow it to relocate itself at runtime. It does not include a device tree blob at -the end of it so normally cannot work without it. You can add a u_boot_dtb -entry after this one, or use a u_boot entry instead (which contains both +the end of it so normally cannot work without it. You can add a u-boot-dtb +entry after this one, or use a u-boot entry instead (which contains both U-Boot and the device tree). @@ -1000,13 +1000,12 @@ Entry: u-boot-spl-nodtb: SPL binary without device tree appended ---------------------------------------------------------------- Properties / Entry arguments: - - filename: Filename of spl/u-boot-spl-nodtb.bin (default - 'spl/u-boot-spl-nodtb.bin') + - filename: Filename to include (default 'spl/u-boot-spl-nodtb.bin') This is the U-Boot SPL binary, It does not include a device tree blob at the end of it so may not be able to work without it, assuming SPL needs -a device tree to operation on your platform. You can add a u_boot_spl_dtb -entry after this one, or use a u_boot_spl entry instead (which contains +a device tree to operate on your platform. You can add a u-boot-spl-dtb +entry after this one, or use a u-boot-spl entry instead (which contains both SPL and the device tree). @@ -1148,7 +1147,7 @@ Properties / Entry arguments: See Entry_u_boot_ucode for full details of the three entries involved in this process. This entry updates U-Boot with the offset and size of the microcode, to allow early x86 boot code to find it without doing anything -complicated. Otherwise it is the same as the u_boot entry. +complicated. Otherwise it is the same as the u-boot entry. diff --git a/tools/binman/etype/blob.py b/tools/binman/etype/blob.py index 81756c326d9..e609a8b253f 100644 --- a/tools/binman/etype/blob.py +++ b/tools/binman/etype/blob.py @@ -24,7 +24,7 @@ class Entry_blob(Entry): This entry reads data from a file and places it in the entry. The default filename is often specified specified by the subclass. See for - example the 'u_boot' entry which provides the filename 'u-boot.bin'. + example the 'u-boot' entry which provides the filename 'u-boot.bin'. If compression is enabled, an extra 'uncomp-size' property is written to the node (if enabled with -u) which provides the uncompressed size of the diff --git a/tools/binman/etype/u_boot.py b/tools/binman/etype/u_boot.py index 4767197e13a..de783b26772 100644 --- a/tools/binman/etype/u_boot.py +++ b/tools/binman/etype/u_boot.py @@ -16,7 +16,7 @@ class Entry_u_boot(Entry_blob): This is the U-Boot binary, containing relocation information to allow it to relocate itself at runtime. The binary typically includes a device tree - blob at the end of it. Use u_boot_nodtb if you want to package the device + blob at the end of it. Use u-boot-nodtb if you want to package the device tree separately. U-Boot can access binman symbols at runtime. See: diff --git a/tools/binman/etype/u_boot_dtb_with_ucode.py b/tools/binman/etype/u_boot_dtb_with_ucode.py index 66a9db55cad..554b3b2e008 100644 --- a/tools/binman/etype/u_boot_dtb_with_ucode.py +++ b/tools/binman/etype/u_boot_dtb_with_ucode.py @@ -19,9 +19,9 @@ class Entry_u_boot_dtb_with_ucode(Entry_blob_dtb): this process. This entry provides the U-Boot device-tree file, which contains the microcode. If the microcode is not being collated into one place then the offset and size of the microcode is recorded by this entry, - for use by u_boot_with_ucode_ptr. If it is being collated, then this + for use by u-boot-with-ucode_ptr. If it is being collated, then this entry deletes the microcode from the device tree (to save space) and makes - it available to u_boot_ucode. + it available to u-boot-ucode. """ def __init__(self, section, etype, node): # Put this here to allow entry-docs and help to work without libfdt diff --git a/tools/binman/etype/u_boot_nodtb.py b/tools/binman/etype/u_boot_nodtb.py index e84df490f65..289b24fa6c6 100644 --- a/tools/binman/etype/u_boot_nodtb.py +++ b/tools/binman/etype/u_boot_nodtb.py @@ -12,12 +12,12 @@ class Entry_u_boot_nodtb(Entry_blob): """U-Boot flat binary without device tree appended Properties / Entry arguments: - - filename: Filename of u-boot.bin (default 'u-boot-nodtb.bin') + - filename: Filename to include (default 'u-boot-nodtb.bin') This is the U-Boot binary, containing relocation information to allow it to relocate itself at runtime. It does not include a device tree blob at - the end of it so normally cannot work without it. You can add a u_boot_dtb - entry after this one, or use a u_boot entry instead (which contains both + the end of it so normally cannot work without it. You can add a u-boot-dtb + entry after this one, or use a u-boot entry instead (which contains both U-Boot and the device tree). """ def __init__(self, section, etype, node): diff --git a/tools/binman/etype/u_boot_spl_nodtb.py b/tools/binman/etype/u_boot_spl_nodtb.py index c154cfde57b..41d75054910 100644 --- a/tools/binman/etype/u_boot_spl_nodtb.py +++ b/tools/binman/etype/u_boot_spl_nodtb.py @@ -12,13 +12,12 @@ class Entry_u_boot_spl_nodtb(Entry_blob): """SPL binary without device tree appended Properties / Entry arguments: - - filename: Filename of spl/u-boot-spl-nodtb.bin (default - 'spl/u-boot-spl-nodtb.bin') + - filename: Filename to include (default 'spl/u-boot-spl-nodtb.bin') This is the U-Boot SPL binary, It does not include a device tree blob at the end of it so may not be able to work without it, assuming SPL needs - a device tree to operation on your platform. You can add a u_boot_spl_dtb - entry after this one, or use a u_boot_spl entry instead (which contains + a device tree to operate on your platform. You can add a u-boot-spl-dtb + entry after this one, or use a u-boot-spl entry instead (which contains both SPL and the device tree). """ def __init__(self, section, etype, node): diff --git a/tools/binman/etype/u_boot_with_ucode_ptr.py b/tools/binman/etype/u_boot_with_ucode_ptr.py index 92d2fc68538..20be22a1fd2 100644 --- a/tools/binman/etype/u_boot_with_ucode_ptr.py +++ b/tools/binman/etype/u_boot_with_ucode_ptr.py @@ -26,7 +26,7 @@ class Entry_u_boot_with_ucode_ptr(Entry_blob): See Entry_u_boot_ucode for full details of the three entries involved in this process. This entry updates U-Boot with the offset and size of the microcode, to allow early x86 boot code to find it without doing anything - complicated. Otherwise it is the same as the u_boot entry. + complicated. Otherwise it is the same as the u-boot entry. """ def __init__(self, section, etype, node): super().__init__(section, etype, node) From patchwork Sun Mar 7 19:31:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448728 X-Patchwork-Delegate: sjg@chromium.org 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=f34smetc; 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 4Dts7Y4w1Bz9sW5 for ; Mon, 8 Mar 2021 06:32:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2A958827D3; Sun, 7 Mar 2021 20:32:11 +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="f34smetc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 997C0827FA; Sun, 7 Mar 2021 20:32:03 +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-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) (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 8C51282652 for ; Sun, 7 Mar 2021 20:31:58 +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-x22e.google.com with SMTP id w195so2116056oif.11 for ; Sun, 07 Mar 2021 11:31:58 -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=YLI2rckgHL3/lYAde1Z4+rEQ8asoDjdX4baBAB+y/Ls=; b=f34smetcRob04xdZhc3idAbVbQq4uohf6CZEfOf3DSLA75zqmDzdNc2CtEqHVT448t K/bQ/e5kPIZaoB/16T30GpavS/uBXIMeP1Ftdn/Dw/Wmi2jxwt0X659MavWrcGnWucrc 6SAACeACpysRMVknAqZWSoy4GEsGdxXRujDoQ= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=YLI2rckgHL3/lYAde1Z4+rEQ8asoDjdX4baBAB+y/Ls=; b=rYxMDOgl9C1SOqdZnpcKJQDwWdXZst6nMClJT8SpABHcJyIrRz0RsiVXi2EV750yKn GrEA/mSNvVVp/5g3TfrE4D1Q58/KLJXn66zpJ1opop8IiWooa2W+0B9yWfta6jmaTo2o nVvzqTZSsBds6TGXonokqho37H4t8od4/cLjKFTaSjxK3fn9DFeX04B+lV7LjkEcnIdB p0GmXytdrn51DzazgezTAkQ+pejG/bWatqqJ4vqkHcmMfdnpBmd9O8XfP62g+MqP7BGW Nm/gZm01gvZw4WXET0CZBYUtTVQXI5U/5qVTK1pyAnOZe0yv8CsWv/fiOQTMxLhrGvlc obfQ== X-Gm-Message-State: AOAM532WrAahOb5Z7Z//Yxid6nrD+G7ykiGLgaT4CbDQzSRt6AMU11zb Ql9MsCRW9A1YT81+uVIt3+63zbXFxLPa4jB0 X-Google-Smtp-Source: ABdhPJx65GLgpa0JHsHyeoPV7xGrZVKKKgC6jEdO+1JkfDnTVcJAA/XJoJtN294tysVfAs0wwPv4QQ== X-Received: by 2002:a05:6808:140e:: with SMTP id w14mr14837387oiv.176.1615145517130; Sun, 07 Mar 2021 11:31:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:31:56 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Bin Meng Subject: [PATCH 05/20] binman: Correct the documentation for u-boot-spl-bss-pad Date: Sun, 7 Mar 2021 12:31:32 -0700 Message-Id: <20210307193148.1513733-6-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 The documentation for this entry indicates that the SPL binary is included along with the padding. It is not, so update it to correct the error. Signed-off-by: Simon Glass --- tools/binman/README.entries | 17 ++++++++++------- tools/binman/etype/u_boot_spl_bss_pad.py | 17 ++++++++++------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/tools/binman/README.entries b/tools/binman/README.entries index 3fbc06d9264..5c6663e2c7c 100644 --- a/tools/binman/README.entries +++ b/tools/binman/README.entries @@ -960,13 +960,16 @@ Entry: u-boot-spl-bss-pad: U-Boot SPL binary padded with a BSS region Properties / Entry arguments: None -This is similar to u_boot_spl except that padding is added after the SPL -binary to cover the BSS (Block Started by Symbol) region. This region holds -the various used by SPL. It is set to 0 by SPL when it starts up. If you -want to append data to the SPL image (such as a device tree file), you must -pad out the BSS region to avoid the data overlapping with U-Boot variables. -This entry is useful in that case. It automatically pads out the entry size -to cover both the code, data and BSS. +This holds the padding added after the SPL binary to cover the BSS (Block +Started by Symbol) region. This region holds the various variables used by +SPL. It is set to 0 by SPL when it starts up. If you want to append data to +the SPL image (such as a device tree file), you must pad out the BSS region +to avoid the data overlapping with U-Boot variables. This entry is useful in +that case. It automatically pads out the entry size to cover both the code, +data and BSS. + +The contents of this entry will a certain number of zero bytes, determined +by __bss_size The ELF file 'spl/u-boot-spl' must also be available for this to work, since binman uses that to look up the BSS address. diff --git a/tools/binman/etype/u_boot_spl_bss_pad.py b/tools/binman/etype/u_boot_spl_bss_pad.py index df15cd24ce7..18c5596bd35 100644 --- a/tools/binman/etype/u_boot_spl_bss_pad.py +++ b/tools/binman/etype/u_boot_spl_bss_pad.py @@ -18,13 +18,16 @@ class Entry_u_boot_spl_bss_pad(Entry_blob): Properties / Entry arguments: None - This is similar to u_boot_spl except that padding is added after the SPL - binary to cover the BSS (Block Started by Symbol) region. This region holds - the various used by SPL. It is set to 0 by SPL when it starts up. If you - want to append data to the SPL image (such as a device tree file), you must - pad out the BSS region to avoid the data overlapping with U-Boot variables. - This entry is useful in that case. It automatically pads out the entry size - to cover both the code, data and BSS. + This holds the padding added after the SPL binary to cover the BSS (Block + Started by Symbol) region. This region holds the various variables used by + SPL. It is set to 0 by SPL when it starts up. If you want to append data to + the SPL image (such as a device tree file), you must pad out the BSS region + to avoid the data overlapping with U-Boot variables. This entry is useful in + that case. It automatically pads out the entry size to cover both the code, + data and BSS. + + The contents of this entry will a certain number of zero bytes, determined + by __bss_size The ELF file 'spl/u-boot-spl' must also be available for this to work, since binman uses that to look up the BSS address. From patchwork Sun Mar 7 19:31:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448732 X-Patchwork-Delegate: sjg@chromium.org 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=85.214.62.61; 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=flTXicSo; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4Dts8R2QsLz9sW5 for ; Mon, 8 Mar 2021 06:33:27 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C1FD782842; Sun, 7 Mar 2021 20:32:21 +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="flTXicSo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 72A19827FA; Sun, 7 Mar 2021 20:32:07 +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-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) (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 3751A826B2 for ; Sun, 7 Mar 2021 20:31:59 +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-x232.google.com with SMTP id v192so1193109oia.5 for ; Sun, 07 Mar 2021 11:31:59 -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=kPzmExWzGxdaCpxcaUKdCjTuow1fuLiAy++dSgWkGFg=; b=flTXicSoGUlktttZriBG7dt6hBmtsbljC55a8EG6SAARispVMJlWEvAw5hM047iCNZ qnz2uFF+yIxiN/LmJoAC5hV2kLx0Nwy78t83XgH3JQJeWd8pVzl2Z0QlNhd4QZog7UCh CshZlWug4H2Ln5tYW0Q4CO9tA0gkFOmdCmnWY= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=kPzmExWzGxdaCpxcaUKdCjTuow1fuLiAy++dSgWkGFg=; b=MhptR20l+jO4PoKiR6eHGP5SRcJs+PycKRhM4GglrnFHQS0iwQJmJtcvUVSlqqMZNf MXTaLW+q3B9iQJ4w8u3F4lyvuMJXwv0dWmpKAEAWCWl3mLLPZgWjcDGQPc9Y/ygZeXka zY2/pFbytxBCbmr2W6SEpLpV20NVtz7M/rFrVwfCeYCrTrO5jPr0h2ipBOxkdPGQ92Va vUm1jC977bfcKfih1ll+CO1HK6W2zEeDVKfjxOGKYj9WJh3sFj5ix5PGwExbUoSkGVMu clGJXQCwy8g9lcdMtz5+ESQUGXSjUXqOBkzbOG6viuvi5ULhOPy7BUevjh1YHmx31dm8 JRjw== X-Gm-Message-State: AOAM531S/eoOnd19OqAEyp8UtnGoSQPCEAZlmIA1Wdzh8C2Zj53aFudO 5Ci+TuIL60cKjxbYGTfS8iBigzQjhxf8uoxp X-Google-Smtp-Source: ABdhPJzB59yzwRBoWsOa8rZin6x26kAVjUsnKa3SGF9yLpJoJvCIOFULEb1IpbrhzjJGfsTUgkZy+w== X-Received: by 2002:aca:530c:: with SMTP id h12mr7502298oib.172.1615145517908; Sun, 07 Mar 2021 11:31:57 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:31:57 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Bin Meng Subject: [PATCH 06/20] binman: Add support for u-boot-tpl-nodtb Date: Sun, 7 Mar 2021 12:31:33 -0700 Message-Id: <20210307193148.1513733-7-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 Allow this entry type to be placed in an image. This is the TPL binary, without a devicetree appended. Signed-off-by: Simon Glass --- tools/binman/README.entries | 14 +++++++++++ tools/binman/etype/u_boot_tpl_nodtb.py | 27 ++++++++++++++++++++++ tools/binman/ftest.py | 6 +++++ tools/binman/test/192_u_boot_tpl_nodtb.dts | 13 +++++++++++ 4 files changed, 60 insertions(+) create mode 100644 tools/binman/etype/u_boot_tpl_nodtb.py create mode 100644 tools/binman/test/192_u_boot_tpl_nodtb.dts diff --git a/tools/binman/README.entries b/tools/binman/README.entries index 5c6663e2c7c..253c579a62d 100644 --- a/tools/binman/README.entries +++ b/tools/binman/README.entries @@ -1080,6 +1080,20 @@ be relocated to any address for execution. +Entry: u-boot-tpl-nodtb: TPL binary without device tree appended +---------------------------------------------------------------- + +Properties / Entry arguments: + - filename: Filename to include (default 'tpl/u-boot-tpl-nodtb.bin') + +This is the U-Boot TPL binary, It does not include a device tree blob at +the end of it so may not be able to work without it, assuming TPL needs +a device tree to operate on your platform. You can add a u-boot-tpl-dtb +entry after this one, or use a u-boot-tpl entry instead (which contains +both TPL and the device tree). + + + Entry: u-boot-tpl-with-ucode-ptr: U-Boot TPL with embedded microcode pointer ---------------------------------------------------------------------------- diff --git a/tools/binman/etype/u_boot_tpl_nodtb.py b/tools/binman/etype/u_boot_tpl_nodtb.py new file mode 100644 index 00000000000..eaeebcadf77 --- /dev/null +++ b/tools/binman/etype/u_boot_tpl_nodtb.py @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright 2021 Google LLC +# Written by Simon Glass +# +# Entry-type module for 'u-boot-tpl-nodtb.bin' +# + +from binman.entry import Entry +from binman.etype.blob import Entry_blob + +class Entry_u_boot_tpl_nodtb(Entry_blob): + """TPL binary without device tree appended + + Properties / Entry arguments: + - filename: Filename to include (default 'tpl/u-boot-tpl-nodtb.bin') + + This is the U-Boot TPL binary, It does not include a device tree blob at + the end of it so may not be able to work without it, assuming TPL needs + a device tree to operate on your platform. You can add a u-boot-tpl-dtb + entry after this one, or use a u-boot-tpl entry instead (which contains + both TPL and the device tree). + """ + def __init__(self, section, etype, node): + super().__init__(section, etype, node) + + def GetDefaultFilename(self): + return 'tpl/u-boot-tpl-nodtb.bin' diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 814e91d42e9..b989dd46caf 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -4245,6 +4245,12 @@ class TestFunctional(unittest.TestCase): self.assertEquals(U_BOOT_DATA, u_boot.ReadData()) + def testTplNoDtb(self): + """Test that an image with tpl/u-boot-tpl-nodtb.bin can be created""" + data = self._DoReadFile('192_u_boot_tpl_nodtb.dts') + self.assertEqual(U_BOOT_TPL_NODTB_DATA, + data[:len(U_BOOT_TPL_NODTB_DATA)]) + if __name__ == "__main__": unittest.main() diff --git a/tools/binman/test/192_u_boot_tpl_nodtb.dts b/tools/binman/test/192_u_boot_tpl_nodtb.dts new file mode 100644 index 00000000000..94cef395e89 --- /dev/null +++ b/tools/binman/test/192_u_boot_tpl_nodtb.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + u-boot-tpl-nodtb { + }; + }; +}; From patchwork Sun Mar 7 19:31:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448731 X-Patchwork-Delegate: sjg@chromium.org 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=85.214.62.61; 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=b/G0dz8S; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4Dts8C5t5Gz9sW5 for ; Mon, 8 Mar 2021 06:33:15 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 46235827F9; Sun, 7 Mar 2021 20:32:19 +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="b/G0dz8S"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 42539827DE; Sun, 7 Mar 2021 20:32:06 +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-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) (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 24713827B1 for ; Sun, 7 Mar 2021 20:32:00 +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-ot1-x32d.google.com with SMTP id 75so3902028otn.4 for ; Sun, 07 Mar 2021 11:32:00 -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=2iB7A/eO8V0BFSTnTM3zRLoji+AE5E5NpaxlIYkpfO0=; b=b/G0dz8SMe5FWXkbF9tdOgnySWB7s/LS+9JmUYKZocqNOK8nFD8QiNmluFWMDjVD6h A0S3UdrBtmxaYvCh5oQ2FrAP75mZ97zf4/Q0j8UUV0rRm4c5HhLko7w+f9V0l5A76ygZ jDjf6R1AAbLiLLutbQPWEKLeBxezcy2fbtHAw= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=2iB7A/eO8V0BFSTnTM3zRLoji+AE5E5NpaxlIYkpfO0=; b=FY8d3u9PNe6fR+UALcDthA7rUlZO5SnkChuzm5zZSFf2m4mn6ew5URLkqDqMYoQutj sHz6ULFoWN63CwOkHB0OiDHwjFk1qvGoia7K80IrlznFVUI6fK9t+ifcLUzRiD/xQl+6 tO2NL8qZSkbU10k/GcnObLRTQ/+RBzLOC4dN0cFypD260dN7FEn8u3AlAYfr7OqkvG4y DUlSNiEmdgumTv4gdsgHd7khEn76LNaGzHugw3yG5QhLiEQFbr624+IGgYIMKLZt5MRK YeSnJHTIVjcz4RK1PmTg/zTLsgbXO5tDL5bQjJ6xyufq/kY2Lu7CshGUuYXTfgyUHtIa 8I/Q== X-Gm-Message-State: AOAM533VvGDUlcl3POruCeqR5Cv4wfLo9kqhIKf3xz/qgLT8xJywP5mp 91OHmu3Kc8YcFGOV5tSd3TckmOnuLbN8+l/l X-Google-Smtp-Source: ABdhPJyleD6TRb6ihMY+IrfBcYWE+PH6zpBE7f1LI5IRq6dyQFxRWY1DBbKDWJkuT+e9C7hn4q0wkQ== X-Received: by 2002:a9d:881:: with SMTP id 1mr14420677otf.329.1615145518728; Sun, 07 Mar 2021 11:31:58 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:31:58 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Bin Meng Subject: [PATCH 07/20] binman: Add support for u-boot-tpl-bss-bad Date: Sun, 7 Mar 2021 12:31:34 -0700 Message-Id: <20210307193148.1513733-8-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 This entry holds the padding between the end of of TPL binary and the end of BSS. This region must be left empty so that the devicetree can be appended correctly and remain accessible without interfering with BSS. Signed-off-by: Simon Glass --- tools/binman/README.entries | 22 ++++++++++++ tools/binman/etype/u_boot_tpl_bss_pad.py | 44 ++++++++++++++++++++++++ tools/binman/ftest.py | 16 +++++++++ tools/binman/test/193_tpl_bss_pad.dts | 19 ++++++++++ 4 files changed, 101 insertions(+) create mode 100644 tools/binman/etype/u_boot_tpl_bss_pad.py create mode 100644 tools/binman/test/193_tpl_bss_pad.dts diff --git a/tools/binman/README.entries b/tools/binman/README.entries index 253c579a62d..cd15073e6df 100644 --- a/tools/binman/README.entries +++ b/tools/binman/README.entries @@ -1047,6 +1047,28 @@ binman uses that to look up symbols to write into the TPL binary. +Entry: u-boot-tpl-bss-pad: U-Boot TPL binary padded with a BSS region +--------------------------------------------------------------------- + +Properties / Entry arguments: + None + +This holds the padding added after the TPL binary to cover the BSS (Block +Started by Symbol) region. This region holds the various variables used by +TPL. It is set to 0 by TPL when it starts up. If you want to append data to +the TPL image (such as a device tree file), you must pad out the BSS region +to avoid the data overlapping with U-Boot variables. This entry is useful in +that case. It automatically pads out the entry size to cover both the code, +data and BSS. + +The contents of this entry will a certain number of zero bytes, determined +by __bss_size + +The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since +binman uses that to look up the BSS address. + + + Entry: u-boot-tpl-dtb: U-Boot TPL device tree --------------------------------------------- diff --git a/tools/binman/etype/u_boot_tpl_bss_pad.py b/tools/binman/etype/u_boot_tpl_bss_pad.py new file mode 100644 index 00000000000..521b24a384e --- /dev/null +++ b/tools/binman/etype/u_boot_tpl_bss_pad.py @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright 2021 Google LLC +# Written by Simon Glass +# +# Entry-type module for BSS padding for tpl/u-boot-tpl.bin. This padding +# can be added after the TPL binary to ensure that anything concatenated +# to it will appear to TPL to be at the end of BSS rather than the start. +# + +from binman import elf +from binman.entry import Entry +from binman.etype.blob import Entry_blob +from patman import tools + +class Entry_u_boot_tpl_bss_pad(Entry_blob): + """U-Boot TPL binary padded with a BSS region + + Properties / Entry arguments: + None + + This holds the padding added after the TPL binary to cover the BSS (Block + Started by Symbol) region. This region holds the various variables used by + TPL. It is set to 0 by TPL when it starts up. If you want to append data to + the TPL image (such as a device tree file), you must pad out the BSS region + to avoid the data overlapping with U-Boot variables. This entry is useful in + that case. It automatically pads out the entry size to cover both the code, + data and BSS. + + The contents of this entry will a certain number of zero bytes, determined + by __bss_size + + The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since + binman uses that to look up the BSS address. + """ + def __init__(self, section, etype, node): + super().__init__(section, etype, node) + + def ObtainContents(self): + fname = tools.GetInputFilename('tpl/u-boot-tpl') + bss_size = elf.GetSymbolAddress(fname, '__bss_size') + if not bss_size: + self.Raise('Expected __bss_size symbol in tpl/u-boot-tpl') + self.SetContents(tools.GetBytes(0, bss_size)) + return True diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index b989dd46caf..10edeab8784 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -4251,6 +4251,22 @@ class TestFunctional(unittest.TestCase): self.assertEqual(U_BOOT_TPL_NODTB_DATA, data[:len(U_BOOT_TPL_NODTB_DATA)]) + def testTplBssPad(self): + """Test that we can pad TPL's BSS with zeros""" + # ELF file with a '__bss_size' symbol + self._SetupTplElf() + data = self._DoReadFile('193_tpl_bss_pad.dts') + self.assertEqual(U_BOOT_TPL_DATA + tools.GetBytes(0, 10) + U_BOOT_DATA, + data) + + def testTplBssPadMissing(self): + """Test that a missing symbol is detected""" + self._SetupTplElf('u_boot_ucode_ptr') + with self.assertRaises(ValueError) as e: + self._DoReadFile('193_tpl_bss_pad.dts') + self.assertIn('Expected __bss_size symbol in tpl/u-boot-tpl', + str(e.exception)) + if __name__ == "__main__": unittest.main() diff --git a/tools/binman/test/193_tpl_bss_pad.dts b/tools/binman/test/193_tpl_bss_pad.dts new file mode 100644 index 00000000000..f5c2db0646c --- /dev/null +++ b/tools/binman/test/193_tpl_bss_pad.dts @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + u-boot-tpl { + }; + + u-boot-tpl-bss-pad { + }; + + u-boot { + }; + }; +}; From patchwork Sun Mar 7 19:31:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448734 X-Patchwork-Delegate: sjg@chromium.org 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=85.214.62.61; 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=BxovAqZ4; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4Dts8s4rtPz9sW5 for ; Mon, 8 Mar 2021 06:33:49 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1830F8284D; Sun, 7 Mar 2021 20:32:26 +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="BxovAqZ4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A03FD827E1; Sun, 7 Mar 2021 20:32:07 +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-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) (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 E82BC82797 for ; Sun, 7 Mar 2021 20:32:00 +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-x233.google.com with SMTP id w195so2116146oif.11 for ; Sun, 07 Mar 2021 11:32:00 -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=cDmXQU0LpHGrmh8wWjQUQFSZFcoVPVP5tZL+8svizqc=; b=BxovAqZ48IRN85YkV6aKyEJABi/+0vGHMA0eRa2SOuBD1KWPEhS7artncxe9V8lJc5 O+RuZWdDakUP1+VvzdFzB8dXsYIEBsKaN3ClRJ6Bm3qYQVH4bvkNFS9Au0ZLaofFlUAU oJ5DTOMYyAAMFq1zqsXTXLLY1Gcw7kpeDkMJM= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=cDmXQU0LpHGrmh8wWjQUQFSZFcoVPVP5tZL+8svizqc=; b=AikkZyZOI2veav26zFsoR3cJiSD3l/lTmxvxjvhTkpN61QsgVLLArN43cSnktTKYo4 y8nJmPfxcrFn9dSskBTZF6HvZQIOs+eNs3i8gDJDD8A4NsDHl+1dDHFsfL5ETdUVlCXf 2U+8sbDfs2vsTz89Vyb2Mw45O+Zl7MWQynxnVDNiXo/FpLHEM9T2Lmz5aq7L+2Psw0v6 DGdn/Zs7PpzV0lh1vUgDIITWYh7/M2yEveMKsrPZikb10vnzvWFcxB0P2BMoEKTPTlhe ul8oUpLuL0Np9fTKp3QyEwRFHllOegz3To9xvwWbdbYWUoi0HLG+PeM2P9l6QGaF9tcr zCWQ== X-Gm-Message-State: AOAM53390t4jWOz/PIIGTNDbEyYXf8QW8MvbkYV1/umItZtZUXihAjSK syQlzUUk4ft7FjrSky6WxZ/PNBJKWsKTh9Vp X-Google-Smtp-Source: ABdhPJxClaG1yuu0a+vffnhR1uyX9vhdMqBsY0m/9yaw9O4udKC1zPtUumqE+Xl5A/lnLQj1iLCCjA== X-Received: by 2002:a05:6808:6cc:: with SMTP id m12mr14525947oih.129.1615145519585; Sun, 07 Mar 2021 11:31:59 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:31:59 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH 08/20] binman: Allow using an an 'expanded' entry type Date: Sun, 7 Mar 2021 12:31:35 -0700 Message-Id: <20210307193148.1513733-9-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 As the first step in supporting expanded entries, add a way for binman to automatically select an 'expanded' version of an entry type, if requested. This is controlled by a class method. Signed-off-by: Simon Glass --- tools/binman/entry.py | 60 ++++++++++++++++++++++++++++++++------ tools/binman/entry_test.py | 12 ++++++++ 2 files changed, 63 insertions(+), 9 deletions(-) diff --git a/tools/binman/entry.py b/tools/binman/entry.py index 507760e2a86..1651a38255e 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -102,22 +102,30 @@ class Entry(object): self.allow_missing = False @staticmethod - def Lookup(node_path, etype): + def Lookup(node_path, etype, expanded): """Look up the entry class for a node. Args: node_node: Path name of Node object containing information about the entry to create (used for errors) etype: Entry type to use + expanded: Use the expanded version of etype Returns: - The entry class object if found, else None + The entry class object if found, else None if not found and expanded + is True + + Raise: + ValueError if expanded is False and the class is not found """ # Convert something like 'u-boot@0' to 'u_boot' since we are only # interested in the type. module_name = etype.replace('-', '_') + if '@' in module_name: module_name = module_name.split('@')[0] + if expanded: + module_name += '_expanded' module = modules.get(module_name) # Also allow entry-type modules to be brought in from the etype directory. @@ -127,6 +135,8 @@ class Entry(object): try: module = importlib.import_module('binman.etype.' + module_name) except ImportError as e: + if expanded: + return None raise ValueError("Unknown entry type '%s' in node '%s' (expected etype/%s.py, error '%s'" % (etype, node_path, module_name, e)) modules[module_name] = module @@ -135,21 +145,31 @@ class Entry(object): return getattr(module, 'Entry_%s' % module_name) @staticmethod - def Create(section, node, etype=None): + def Create(section, node, etype=None, expanded=False): """Create a new entry for a node. Args: - section: Section object containing this node - node: Node object containing information about the entry to - create - etype: Entry type to use, or None to work it out (used for tests) + section: Section object containing this node + node: Node object containing information about the entry to + create + etype: Entry type to use, or None to work it out (used for tests) + expanded: True to use expanded versions of entries, where available Returns: A new Entry object of the correct type (a subclass of Entry) """ if not etype: etype = fdt_util.GetString(node, 'type', node.name) - obj = Entry.Lookup(node.path, etype) + obj = Entry.Lookup(node.path, etype, expanded) + if obj and expanded: + # Check whether to use the expanded entry + new_etype = etype + '-expanded' + if obj.UseExpanded(node, etype, new_etype): + etype = new_etype + else: + obj = None + if not obj: + obj = Entry.Lookup(node.path, etype, False) # Call its constructor to get the object we want. return obj(section, etype, node) @@ -648,7 +668,7 @@ features to produce new behaviours. modules.remove('_testing') missing = [] for name in modules: - module = Entry.Lookup('WriteDocs', name) + module = Entry.Lookup('WriteDocs', name, False) docs = getattr(module, '__doc__') if test_missing == name: docs = None @@ -907,3 +927,25 @@ features to produce new behaviours. self.uncomp_size = len(indata) data = tools.Compress(indata, self.compress) return data + + @classmethod + def UseExpanded(cls, node, etype, new_etype): + """Check whether to use an expanded entry type + + This is called by Entry.Create() when it finds an expanded version of + an entry type (e.g. 'u-boot-expanded'). If this method returns True then + it will be used (e.g. in place of 'u-boot'). If it returns False, it is + ignored. + + Args: + node: Node object containing information about the entry to + create + etype: Original entry type being used + new_etype: New entry type proposed + + Returns: + True to use this entry type, False to use the original one + """ + tout.Info("Node '%s': etype '%s': %s selected" % + (node.path, etype, new_etype)) + return True diff --git a/tools/binman/entry_test.py b/tools/binman/entry_test.py index 80802f33de6..c3d5f3eef48 100644 --- a/tools/binman/entry_test.py +++ b/tools/binman/entry_test.py @@ -87,6 +87,18 @@ class TestEntry(unittest.TestCase): base = entry.Entry.Create(None, self.GetNode(), 'blob-dtb') self.assertIsNone(base.ReadChildData(base)) + def testExpandedEntry(self): + """Test use of an expanded entry when available""" + base = entry.Entry.Create(None, self.GetNode()) + self.assertEqual('u-boot', base.etype) + + expanded = entry.Entry.Create(None, self.GetNode(), expanded=True) + self.assertEqual('u-boot-expanded', expanded.etype) + + with self.assertRaises(ValueError) as e: + entry.Entry.Create(None, self.GetNode(), 'missing', expanded=True) + self.assertIn("Unknown entry type 'missing' in node '/binman/u-boot'", + str(e.exception)) if __name__ == "__main__": unittest.main() From patchwork Sun Mar 7 19:31:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448733 X-Patchwork-Delegate: sjg@chromium.org 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=MikSRPd4; 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 4Dts8f2NW3z9sW5 for ; Mon, 8 Mar 2021 06:33:38 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3620E827E4; Sun, 7 Mar 2021 20:32:24 +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="MikSRPd4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 06CE4827DE; Sun, 7 Mar 2021 20:32:07 +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-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) (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 D2102827E1 for ; Sun, 7 Mar 2021 20:32:01 +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-ot1-x336.google.com with SMTP id d9so7132328ote.12 for ; Sun, 07 Mar 2021 11:32:01 -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=88v4UOlZhNnQ/gD3XTBIoVQoR+PyTX2Jws1HYW+Kt/I=; b=MikSRPd4kLrMAFRMHNRHpe5gPElRi7dMwfUi1fYce53hENbeYXyf2FoISTs+8WpD0w 41NbwpKhteSchdR7mpRtacPjGWsf4GMCDz8keErzYSjaq64zVGkG8iQLeaBanZ6Jkfiq B/QItk8SX8+OQ47cf6pT9J7sjXizOY+ah/jhs= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=88v4UOlZhNnQ/gD3XTBIoVQoR+PyTX2Jws1HYW+Kt/I=; b=PFbVLjtcax5HsntI5D99erdjxWswX+7tFxonu3AqOQDTyBf5VuHvaFbNIuDciOK5s0 pHUYRbf/eU8iWGFkXgtjPcjAImTNIYI2Q9qIa1lf7eZe8fBHkloHBD2Bt+p5/hhXjjXp PmtmHSSwuZfbvwsd3Jqb9YInDgLYeJRNJdCuHv0StsUZC+GDoBgSsKWjsQvfCAPsAbN3 5AmhXHGJD5UMBCNtS/roEuHH3ZdWOUR2Xr7/Zvz/+eJCERhL4DwgsA5j8+8JZfKNboOs OucO9KxFWAhcC2yN1XWu2HqvlLDx+LE1F8UrEWyBr5N8cXklZt7Gsn0ICRrjZoafA5vU wD8w== X-Gm-Message-State: AOAM53109B4nAnaiqnPv3z+VkAJKblO5yhwDm3reK3UCDvDrfaaiSmvN Rx/KP+azvxIQ7xKf7tAPhpEGt+epVBIuFYZr X-Google-Smtp-Source: ABdhPJwO4dLQ0dwdcEXQHKbBC0HNL5EJDQt7CUF0xraTKja4/NRbasXfqb9SIWOv/ekmnOzJoLaRLQ== X-Received: by 2002:a9d:6553:: with SMTP id q19mr16771218otl.201.1615145520379; Sun, 07 Mar 2021 11:32:00 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:32:00 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH 09/20] binman: Allow a way to select expanded entries Date: Sun, 7 Mar 2021 12:31:36 -0700 Message-Id: <20210307193148.1513733-10-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 Add a new command-line option to disable expanded entries. This is needed for most tests, since it is much easier to 'factor out' this function into a separate test and keep the existing packing tests simple. Add the option and select it by default from tests. Signed-off-by: Simon Glass --- tools/binman/cmdline.py | 3 +++ tools/binman/ftest.py | 19 +++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/tools/binman/cmdline.py b/tools/binman/cmdline.py index c007d0a036d..0c0f48951f6 100644 --- a/tools/binman/cmdline.py +++ b/tools/binman/cmdline.py @@ -56,6 +56,9 @@ controlled by a description in the board device tree.''' default=False, help='Output a map file for each image') build_parser.add_argument('-M', '--allow-missing', action='store_true', default=False, help='Allow external blobs to be missing') + build_parser.add_argument('-n', '--no-expanded', action='store_true', + help="Don't use 'expanded' versions of entries where available; " + "normally 'u-boot' becomes 'u-boot-expanded', for example") build_parser.add_argument('-O', '--outdir', type=str, action='store', help='Path to directory to use for intermediate and ' 'output files') diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 10edeab8784..2a0e0460daa 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -305,7 +305,8 @@ class TestFunctional(unittest.TestCase): def _DoTestFile(self, fname, debug=False, map=False, update_dtb=False, entry_args=None, images=None, use_real_dtb=False, - verbosity=None, allow_missing=False, extra_indirs=None): + use_expanded=False, verbosity=None, allow_missing=False, + extra_indirs=None): """Run binman with a given test file Args: @@ -322,6 +323,8 @@ class TestFunctional(unittest.TestCase): the u-boot-dtb entry. Normally this is not needed and the test contents (the U_BOOT_DTB_DATA string) can be used. But in some test we need the real contents. + use_expanded: True to use expanded entries where available, e.g. + 'u-boot-expanded' instead of 'u-boot' verbosity: Verbosity level to use (0-3, None=don't set it) allow_missing: Set the '--allow-missing' flag so that missing external binaries just produce a warning instead of an error @@ -344,6 +347,8 @@ class TestFunctional(unittest.TestCase): args.append('-u') if not use_real_dtb: args.append('--fake-dtb') + if not use_expanded: + args.append('--no-expanded') if entry_args: for arg, value in entry_args.items(): args.append('-a%s=%s' % (arg, value)) @@ -403,9 +408,9 @@ class TestFunctional(unittest.TestCase): dtb.Pack() return dtb.GetContents() - def _DoReadFileDtb(self, fname, use_real_dtb=False, map=False, - update_dtb=False, entry_args=None, reset_dtbs=True, - extra_indirs=None): + def _DoReadFileDtb(self, fname, use_real_dtb=False, use_expanded=False, + map=False, update_dtb=False, entry_args=None, + reset_dtbs=True, extra_indirs=None): """Run binman and return the resulting image This runs binman with a given test file and then reads the resulting @@ -420,6 +425,8 @@ class TestFunctional(unittest.TestCase): the u-boot-dtb entry. Normally this is not needed and the test contents (the U_BOOT_DTB_DATA string) can be used. But in some test we need the real contents. + use_expanded: True to use expanded entries where available, e.g. + 'u-boot-expanded' instead of 'u-boot' map: True to output map files for the images update_dtb: Update the offset and size of each entry in the device tree before packing it into the image @@ -454,7 +461,7 @@ class TestFunctional(unittest.TestCase): try: retcode = self._DoTestFile(fname, map=map, update_dtb=update_dtb, entry_args=entry_args, use_real_dtb=use_real_dtb, - extra_indirs=extra_indirs) + use_expanded=use_expanded, extra_indirs=extra_indirs) self.assertEqual(0, retcode) out_dtb_fname = tools.GetOutputFilename('u-boot.dtb.out') @@ -652,7 +659,7 @@ class TestFunctional(unittest.TestCase): """Test that we can run it with a specific board""" self._SetupDtb('005_simple.dts', 'sandbox/u-boot.dtb') TestFunctional._MakeInputFile('sandbox/u-boot.bin', U_BOOT_DATA) - result = self._DoBinman('build', '-b', 'sandbox') + result = self._DoBinman('build', '-n', '-b', 'sandbox') self.assertEqual(0, result) def testNeedBoard(self): From patchwork Sun Mar 7 19:31:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448735 X-Patchwork-Delegate: sjg@chromium.org 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=SUmeIeqT; 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 4Dts950t9Dz9sW5 for ; Mon, 8 Mar 2021 06:34:01 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3DAB68285A; Sun, 7 Mar 2021 20:32:28 +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="SUmeIeqT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 10284827DE; Sun, 7 Mar 2021 20:32:09 +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 297B4827E3 for ; Sun, 7 Mar 2021 20:32:03 +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 x135so4266967oia.9 for ; Sun, 07 Mar 2021 11:32:03 -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=PBvCBw8EHoibdx5vlXec+uRlww8KkCddODaDLPVMlBk=; b=SUmeIeqTfsi4OxLwgm9GpPcqWJxBMspzoYR6rBQCVsbAiTK0KNnkyYK+sjA91luVIL /M64Yoh7LyDQ7Pu/sF2FztsUAj4XvDj8aiEnLRoUWNHWQ4yc8BRpat8BM8oakghmSxnb a+8ERxvp7T4KcyjaycicKqShKIrBXFtUmcgl4= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=PBvCBw8EHoibdx5vlXec+uRlww8KkCddODaDLPVMlBk=; b=DLc57NHumAXztkgD13Vk/+w7ySz+urh/om4hUVcjjr67MFszxNbzUeOggPBa3wOYXd qR8DAdlGWSAq6Tqphifucw5NfCkw7zsHNNOnbpk5F15yoix4C+gDr6fhj2jC9enPVQVN vf9KwduPXbGqrUZKFrR8aCyRViAMUd037+3uGGQ9NGMceHCDM7Y8Wq1EnlVxLjNI+nOL VDv8EjmX5ukePcYzsBHoHZGfH0jPWoUcxdbrm+ei/2iHeNx+nAxtUauoCxl+VZL/AD71 jOkYohIJ3OCHjxVREVqUXWHRERfbl9JChGVaXQPncRr1sh2X93ZN6yozxW38c2jAD07J FiVg== X-Gm-Message-State: AOAM533TiPK9J7bm0AesPuLCxUFPsmmJohTRxDxmXZKWtYJ0F6RgUl9S xXDhk5DM0C72llqUtYrG2K4wk2H1QBpxL//F X-Google-Smtp-Source: ABdhPJyxfXiwW2rJCcwV5RLkETWunTMsI0LDcwjh/E80drv9tq50TN86V7ilPol9nf9Mofmxg1/pnQ== X-Received: by 2002:aca:4d4e:: with SMTP id a75mr5272070oib.107.1615145521356; Sun, 07 Mar 2021 11:32:01 -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.32.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:32:00 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Alper Nebi Yasak , Bin Meng Subject: [PATCH 10/20] binman: Plumb expanded entries through fully Date: Sun, 7 Mar 2021 12:31:37 -0700 Message-Id: <20210307193148.1513733-11-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 Add support for this feature in the control, image and section modules, so that expanded entries will be selected by default. So far there are no expanded entry types, so this is a nop. Signed-off-by: Simon Glass --- tools/binman/control.py | 24 ++++++++++++++++++------ tools/binman/etype/section.py | 3 ++- tools/binman/image.py | 17 ++++++++++++++++- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/tools/binman/control.py b/tools/binman/control.py index 9c0cafeafc4..9709aa9a2b2 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -28,7 +28,7 @@ images = OrderedDict() # value: Text for the help missing_blob_help = {} -def _ReadImageDesc(binman_node): +def _ReadImageDesc(binman_node, use_expanded): """Read the image descriptions from the /binman node This normally produces a single Image object called 'image'. But if @@ -36,15 +36,17 @@ def _ReadImageDesc(binman_node): Args: binman_node: Node object of the /binman node + use_expanded: True if the FDT will be updated with the entry information Returns: OrderedDict of Image objects, each of which describes an image """ images = OrderedDict() if 'multiple-images' in binman_node.props: for node in binman_node.subnodes: - images[node.name] = Image(node.name, node) + images[node.name] = Image(node.name, node, + use_expanded=use_expanded) else: - images['image'] = Image('image', binman_node) + images['image'] = Image('image', binman_node, use_expanded=use_expanded) return images def _FindBinmanNode(dtb): @@ -399,7 +401,7 @@ def ReplaceEntries(image_fname, input_fname, indir, entry_paths, return image -def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt): +def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded): """Prepare the images to be processed and select the device tree This function: @@ -413,6 +415,9 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt): dtb_fname: Filename of the device tree file to use (.dts or .dtb) selected_images: List of images to output, or None for all update_fdt: True to update the FDT wth entry offsets, etc. + use_expanded: True to use expanded versions of entries, if available. + So if 'u-boot' is called for, we use 'u-boot-expanded' instead. This + is needed if update_fdt is True (although tests may disable it) Returns: OrderedDict of images: @@ -438,7 +443,7 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt): raise ValueError("Device tree '%s' does not have a 'binman' " "node" % dtb_fname) - images = _ReadImageDesc(node) + images = _ReadImageDesc(node, use_expanded) if select_images: skip = [] @@ -611,6 +616,13 @@ def Binman(args): elf.debug = args.debug cbfs_util.VERBOSE = args.verbosity > 2 state.use_fake_dtb = args.fake_dtb + + # Normally we replace the 'u-boot' etype with 'u-boot-expanded', etc. + # When running tests this can be disabled using this flag. When not + # updating the FDT in image, it is not needed by binman, but we use it + # for consistency, so that the images look the same to U-Boot at + # runtime. + use_expanded = not args.no_expanded try: tools.SetInputDirs(args.indir) tools.PrepareOutputDir(args.outdir, args.preserve) @@ -618,7 +630,7 @@ def Binman(args): state.SetEntryArgs(args.entry_arg) images = PrepareImagesAndDtbs(dtb_fname, args.image, - args.update_fdt) + args.update_fdt, use_expanded) missing = False for image in images.values(): missing |= ProcessImage(image, args.update_fdt, args.map, diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index 2103919b0c3..2f862bddf0f 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -84,7 +84,8 @@ class Entry_section(Entry): for node in self._node.subnodes: if node.name.startswith('hash') or node.name.startswith('signature'): continue - entry = Entry.Create(self, node) + entry = Entry.Create(self, node, + expanded=self.GetImage().use_expanded) entry.ReadNode() entry.SetPrefix(self._name_prefix) self._entries[node.name] = entry diff --git a/tools/binman/image.py b/tools/binman/image.py index e9494352413..10778f47fe9 100644 --- a/tools/binman/image.py +++ b/tools/binman/image.py @@ -47,9 +47,23 @@ class Image(section.Entry_section): exception). This should be used if the Image is being loaded from a file rather than generated. In that case we obviously don't need the entry arguments since the contents already exists. + use_expanded: True if we are updating the FDT wth entry offsets, etc. + and should use the expanded versions of the U-Boot entries. + Any entry type that includes a devicetree must put it in a + separate entry so that it will be updated. For example. 'u-boot' + normally just picks up 'u-boot.bin' which includes the + devicetree, but this is not updateable, since it comes into + binman as one piece and binman doesn't know that it is actually + an executable followed by a devicetree. Of course it could be + taught this, but then when reading an image (e.g. 'binman ls') + it may need to be able to split the devicetree out of the image + in order to determine the location of things. Instead we choose + to ignore 'u-boot-bin' in this case, and build it ourselves in + binman with 'u-boot-dtb.bin' and 'u-boot.dtb'. See + Entry_u_boot_expanded and Entry_blob_phase for details. """ def __init__(self, name, node, copy_to_orig=True, test=False, - ignore_missing=False): + ignore_missing=False, use_expanded=False): super().__init__(None, 'section', node, test=test) self.copy_to_orig = copy_to_orig self.name = 'main-section' @@ -59,6 +73,7 @@ class Image(section.Entry_section): self.fdtmap_data = None self.allow_repack = False self._ignore_missing = ignore_missing + self.use_expanded = use_expanded if not test: self.ReadNode() From patchwork Sun Mar 7 19:31:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448740 X-Patchwork-Delegate: sjg@chromium.org 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=85.214.62.61; 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=n7h44HX7; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4DtsB369V6z9sW5 for ; Mon, 8 Mar 2021 06:34:51 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D0C4A82898; Sun, 7 Mar 2021 20:32:40 +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="n7h44HX7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 10B60827E9; Sun, 7 Mar 2021 20:32:14 +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-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) (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 736C4827E9 for ; 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=sjg@chromium.org Received: by mail-ot1-x32b.google.com with SMTP id d9so7132391ote.12 for ; Sun, 07 Mar 2021 11:32:04 -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=R+FBN4NJKzorrbIKz2ohALh95D9FmQ0F5YhnEPuyXH4=; b=n7h44HX7cKTWyOkrb3qjoSR5KYuP37GIL4ODIoT+6VZxOufBpHWQpAKl47wUlo3ZSM +cb6wP1/BKo2+pQ24HUOlXUeG0blmrCn9B9y82LdaEJOGaJaVeVjV7jcrCqNb0UzhVkH TuOhWICUoYelG5O8CnpUQcdVs0GM/+wk9MuPg= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=R+FBN4NJKzorrbIKz2ohALh95D9FmQ0F5YhnEPuyXH4=; b=IbXEpiRKrGp83ljf8qppNWI/NQ/jgE+OTXu5lRtqkm8FvscDGHCjkeVcpB9MK613At VyZ17CYsa5xMEWX1Gh1tfdUMohn+mqd+UwuE5gOZ9IL79CtpSqt5YEQHpuKqZPzPvSxs /Z4cOnHEFvhXg9sPRbxDPlWRSsGnL6ncRyajeuWysTRRlGTKk/t0ieq/DA3B0W4EMVyV M/49WwZ3Dxkqr3t7SI8PyxDfvKxjUqRuT724EKh9mCzCzMuCBgrYpyAB9RQ9xsBIYaCD p+wGvKB1C3cbt4LxXpCoZ1r5WP68ickXidBkuu6oJa9RyKLhDZlzqa04Zw//zRCUEIy8 YMJw== X-Gm-Message-State: AOAM533uECaeYWjmQKE/njzDhguxp4ZT6JXgXq4zIrZWGBbTCPrHsmiy Dk4DKskvzfZeU1rV09/PJpMToTZdtTc2sfjG X-Google-Smtp-Source: ABdhPJwZtn7YuQ6qS6HDd1Wx0Wnwpw8Bdo4Ha4l9zoJeb7rNLvxekvbDQcFcVKommNCDImsHKpIYXQ== X-Received: by 2002:a9d:62cd:: with SMTP id z13mr9333637otk.228.1615145522504; Sun, 07 Mar 2021 11:32:02 -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.32.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:32:01 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Bin Meng Subject: [PATCH 11/20] binman: Automatically expand phase binaries into sections Date: Sun, 7 Mar 2021 12:31:38 -0700 Message-Id: <20210307193148.1513733-12-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 When creating an entry, check for an expanded version of that entry, then use it instead. This allows, for example use of: u-boot { }; instead of having to write out in full: u-boot { type = "section"; u-boot-nodtb { }; u-boot-dtb { }; }; Add an implementaion of this and associated documentation. Signed-off-by: Simon Glass --- tools/binman/README | 77 ++++++++++ tools/binman/README.entries | 96 +++++++++++- tools/binman/etype/blob_phase.py | 51 +++++++ tools/binman/etype/u_boot.py | 8 +- tools/binman/etype/u_boot_expanded.py | 24 +++ tools/binman/etype/u_boot_nodtb.py | 4 +- tools/binman/etype/u_boot_spl.py | 3 + tools/binman/etype/u_boot_spl_expanded.py | 45 ++++++ tools/binman/etype/u_boot_spl_nodtb.py | 5 +- tools/binman/etype/u_boot_tpl.py | 3 + tools/binman/etype/u_boot_tpl_expanded.py | 45 ++++++ tools/binman/etype/u_boot_tpl_nodtb.py | 5 +- tools/binman/ftest.py | 174 ++++++++++++++++++++++ tools/binman/state.py | 19 ++- tools/binman/test/194_fdt_incl.dts | 17 +++ tools/binman/test/195_fdt_incl_tpl.dts | 13 ++ 16 files changed, 571 insertions(+), 18 deletions(-) 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_expanded.py create mode 100644 tools/binman/test/194_fdt_incl.dts create mode 100644 tools/binman/test/195_fdt_incl_tpl.dts diff --git a/tools/binman/README b/tools/binman/README index 45f0a0c2cd3..1de703cc653 100644 --- a/tools/binman/README +++ b/tools/binman/README @@ -840,6 +840,83 @@ of the image) can be used to point to the FDT map. See fdtmap and image-header entries for more information. +Expanded entries +---------------- + +Binman automatically replaces 'u-boot' with an expanded version of that, i.e. +'u-boot-expanded'. This means that when you write: + + u-boot { + }; + +you actually get: + + u-boot { + type = "u-boot-expanded'; + }; + +which in turn expands to: + + u-boot { + type = "section"; + + u-boot-nodtb { + }; + + u-boot-dtb { + }; + }; + +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. + +The above feature ensures that the devicetree is clearly separated from the +U-Boot executable and can be updated separately by binman as needed. It can be +disabled with the --no-expanded flag if required. + +The same applies for u-boot-spl and u-boot-spl. In those cases, the expansion +includes the BSS padding, so for example: + + spl { + type = "u-boot-spl" + }; + +you actually get: + + spl { + type = "u-boot-expanded'; + }; + +which in turn expands to: + + spl { + type = "section"; + + u-boot-spl-nodtb { + }; + + u-boot-spl-bss-pad { + }; + + u-boot-spl-dtb { + }; + }; + + +Of course we should not expand SPL if it has no devicetree. Also if the BSS +padding is not needed (because BSS is in RAM as with CONFIG_SPL_SEPARATE_BSS), +the 'u-boot-spl-bss-pad' subnode should not be created. The use of the expaned +entry type is controlled by the UseExpanded() method. In the SPL case it checks +the 'spl-dtb' entry arg, which is 'y' or '1' if SPL has a devicetree. + +For the BSS case, a 'spl-bss-pad' entry arg controls whether it is present. All +entry args are provided by the U-Boot Makefile. + + Compression ----------- diff --git a/tools/binman/README.entries b/tools/binman/README.entries index cd15073e6df..b5032381c7f 100644 --- a/tools/binman/README.entries +++ b/tools/binman/README.entries @@ -87,6 +87,15 @@ See cros_ec_rw for an example of this. +Entry: blob-phase: Section that holds a phase binary +---------------------------------------------------- + +This is a base class that should not normally be used directly. It is used +when converting a 'u-boot' entry automatically into a 'u-boot-expanded' +entry; similarly for SPL. + + + Entry: cbfs: Entry containing a Coreboot Filesystem (CBFS) ---------------------------------------------------------- @@ -840,8 +849,7 @@ Properties / Entry arguments: This is the U-Boot binary, containing relocation information to allow it to relocate itself at runtime. The binary typically includes a device tree -blob at the end of it. Use u-boot-nodtb if you want to package the device -tree separately. +blob at the end of it. U-Boot can access binman symbols at runtime. See: @@ -849,6 +857,9 @@ U-Boot can access binman symbols at runtime. See: in the binman README for more information. +Note that this entry is automatically replaced with u-boot-expanded unless +--no-expanded is used. + Entry: u-boot-dtb: U-Boot device tree @@ -902,6 +913,21 @@ Properties / Entry arguments: +Entry: u-boot-expanded: U-Boot flat binary broken out into its component parts +------------------------------------------------------------------------------ + +This is a section containing the U-Boot binary and a devicetree. Using this +entry type automatically creates this section, with the following entries +in it: + + u-boot-nodtb + u-boot-dtb + +Having the devicetree separate allows binman to update it in the final +image, so that the entries positions are provided to the running U-Boot. + + + Entry: u-boot-img: U-Boot legacy image -------------------------------------- @@ -925,8 +951,8 @@ Properties / Entry arguments: This is the U-Boot binary, containing relocation information to allow it to relocate itself at runtime. It does not include a device tree blob at the end of it so normally cannot work without it. You can add a u-boot-dtb -entry after this one, or use a u-boot entry instead (which contains both -U-Boot and the device tree). +entry after this one, or use a u-boot entry instead, normally expands to a +section containing u-boot and u-boot-dtb @@ -952,6 +978,9 @@ in the binman README for more information. The ELF file 'spl/u-boot-spl' must also be available for this to work, since binman uses that to look up symbols to write into the SPL binary. +Note that this entry is automatically replaced with u-boot-spl-expanded +unless --no-expanded is used. + Entry: u-boot-spl-bss-pad: U-Boot SPL binary padded with a BSS region @@ -999,6 +1028,29 @@ be relocated to any address for execution. +Entry: u-boot-spl-expanded: U-Boot SPL flat binary broken out into its component parts +-------------------------------------------------------------------------------------- + +Properties / Entry arguments: + - spl-dtb: Controls whether this entry is selected (set to 'y' or '1' to + select) + +This is a section containing the U-Boot binary, BSS padding if needed and a +devicetree. Using this entry type automatically creates this section, with +the following entries in it: + + u-boot-spl-nodtb + u-boot-spl-bss-pad + u-boot-dtb + +Having the devicetree separate allows binman to update it in the final +image, so that the entries positions are provided to the running U-Boot. + +This entry is selected based on the value of the 'spl-dtb' entryarg. If +this is non-empty (and not 'n' or '0') then this expanded entry is selected. + + + Entry: u-boot-spl-nodtb: SPL binary without device tree appended ---------------------------------------------------------------- @@ -1008,8 +1060,9 @@ Properties / Entry arguments: This is the U-Boot SPL binary, It does not include a device tree blob at the end of it so may not be able to work without it, assuming SPL needs a device tree to operate on your platform. You can add a u-boot-spl-dtb -entry after this one, or use a u-boot-spl entry instead (which contains -both SPL and the device tree). +entry after this one, or use a u-boot-spl entry instead' which normally +expands to a section containing u-boot-spl-dtb, u-boot-spl-bss-pad and +u-boot-spl-dtb @@ -1045,6 +1098,9 @@ in the binman README for more information. The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since binman uses that to look up symbols to write into the TPL binary. +Note that this entry is automatically replaced with u-boot-tpl-expanded +unless --no-expanded is used. + Entry: u-boot-tpl-bss-pad: U-Boot TPL binary padded with a BSS region @@ -1102,6 +1158,29 @@ be relocated to any address for execution. +Entry: u-boot-tpl-expanded: U-Boot TPL flat binary broken out into its component parts +-------------------------------------------------------------------------------------- + +Properties / Entry arguments: + - tpl-dtb: Controls whether this entry is selected (set to 'y' or '1' to + select) + +This is a section containing the U-Boot binary, BSS padding if needed and a +devicetree. Using this entry type automatically creates this section, with +the following entries in it: + + u-boot-tpl-nodtb + u-boot-tpl-bss-pad + u-boot-dtb + +Having the devicetree separate allows binman to update it in the final +image, so that the entries positions are provided to the running U-Boot. + +This entry is selected based on the value of the 'tpl-dtb' entryarg. If +this is non-empty (and not 'n' or '0') then this expanded entry is selected. + + + Entry: u-boot-tpl-nodtb: TPL binary without device tree appended ---------------------------------------------------------------- @@ -1111,8 +1190,9 @@ Properties / Entry arguments: This is the U-Boot TPL binary, It does not include a device tree blob at the end of it so may not be able to work without it, assuming TPL needs a device tree to operate on your platform. You can add a u-boot-tpl-dtb -entry after this one, or use a u-boot-tpl entry instead (which contains -both TPL and the device tree). +entry after this one, or use a u-boot-tpl entry instead, which normally +expands to a section containing u-boot-tpl-dtb, u-boot-tpl-bss-pad and +u-boot-tpl-dtb diff --git a/tools/binman/etype/blob_phase.py b/tools/binman/etype/blob_phase.py new file mode 100644 index 00000000000..54ca54c50c1 --- /dev/null +++ b/tools/binman/etype/blob_phase.py @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright 2021 Google LLC +# Written by Simon Glass +# +# Entry-type base class for U-Boot or SPL binary with devicetree +# + +from binman.etype.section import Entry_section + +class Entry_blob_phase(Entry_section): + """Section that holds a phase binary + + This is a base class that should not normally be used directly. It is used + when converting a 'u-boot' entry automatically into a 'u-boot-expanded' + entry; similarly for SPL. + """ + def __init__(self, section, etype, node, root_fname, dtb_file, bss_pad): + """Set up a new blob for a phase + + This holds an executable for a U-Boot phase, optional BSS padding and + a devicetree + + Args: + section: entry_Section object for this entry's parent + etype: Type of object + node: Node defining this entry + root_fname: Root filename for the binary ('u-boot', + 'spl/u-boot-spl', etc.) + dtb_file: Name of devicetree file ('u-boot.dtb', u-boot-spl.dtb', + etc.) + bss_pad: True to add BSS padding before the devicetree + """ + # Put this here to allow entry-docs and help to work without libfdt + global state + from binman import state + + super().__init__(section, etype, node) + self.root_fname = root_fname + self.dtb_file = dtb_file + self.bss_pad = bss_pad + + def ExpandEntries(self): + """Create the subnodes""" + names = [self.root_fname + '-nodtb', self.root_fname + '-dtb'] + if self.bss_pad: + names.insert(1, self.root_fname + '-bss-pad') + for name in names: + subnode = state.AddSubnode(self._node, name) + + # Read entries again, now that we have some + self._ReadEntries() diff --git a/tools/binman/etype/u_boot.py b/tools/binman/etype/u_boot.py index de783b26772..d2eaba6d4aa 100644 --- a/tools/binman/etype/u_boot.py +++ b/tools/binman/etype/u_boot.py @@ -2,7 +2,7 @@ # Copyright (c) 2016 Google, Inc # Written by Simon Glass # -# Entry-type module for U-Boot binary +# Entry-type module for the expanded U-Boot binary # from binman.entry import Entry @@ -16,14 +16,16 @@ class Entry_u_boot(Entry_blob): This is the U-Boot binary, containing relocation information to allow it to relocate itself at runtime. The binary typically includes a device tree - blob at the end of it. Use u-boot-nodtb if you want to package the device - tree separately. + blob at the end of it. U-Boot can access binman symbols at runtime. See: 'Access to binman entry offsets at run time (fdt)' in the binman README for more information. + + Note that this entry is automatically replaced with u-boot-expanded unless + --no-expanded is used. """ def __init__(self, section, etype, node): super().__init__(section, etype, node) diff --git a/tools/binman/etype/u_boot_expanded.py b/tools/binman/etype/u_boot_expanded.py new file mode 100644 index 00000000000..8797824c9f0 --- /dev/null +++ b/tools/binman/etype/u_boot_expanded.py @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright 2021 Google LLC +# Written by Simon Glass +# +# Entry-type module for U-Boot binary +# + +from binman.etype.blob_phase import Entry_blob_phase + +class Entry_u_boot_expanded(Entry_blob_phase): + """U-Boot flat binary broken out into its component parts + + This is a section containing the U-Boot binary and a devicetree. Using this + entry type automatically creates this section, with the following entries + in it: + + u-boot-nodtb + u-boot-dtb + + Having the devicetree separate allows binman to update it in the final + image, so that the entries positions are provided to the running U-Boot. + """ + def __init__(self, section, etype, node): + super().__init__(section, etype, node, 'u-boot', 'u-boot-dtb', False) diff --git a/tools/binman/etype/u_boot_nodtb.py b/tools/binman/etype/u_boot_nodtb.py index 289b24fa6c6..347ba7dc697 100644 --- a/tools/binman/etype/u_boot_nodtb.py +++ b/tools/binman/etype/u_boot_nodtb.py @@ -17,8 +17,8 @@ class Entry_u_boot_nodtb(Entry_blob): This is the U-Boot binary, containing relocation information to allow it to relocate itself at runtime. It does not include a device tree blob at the end of it so normally cannot work without it. You can add a u-boot-dtb - entry after this one, or use a u-boot entry instead (which contains both - U-Boot and the device tree). + entry after this one, or use a u-boot entry instead, normally expands to a + section containing u-boot and u-boot-dtb """ def __init__(self, section, etype, node): super().__init__(section, etype, node) diff --git a/tools/binman/etype/u_boot_spl.py b/tools/binman/etype/u_boot_spl.py index d66e46140be..1c39f982519 100644 --- a/tools/binman/etype/u_boot_spl.py +++ b/tools/binman/etype/u_boot_spl.py @@ -30,6 +30,9 @@ class Entry_u_boot_spl(Entry_blob): The ELF file 'spl/u-boot-spl' must also be available for this to work, since binman uses that to look up symbols to write into the SPL binary. + + Note that this entry is automatically replaced with u-boot-spl-expanded + unless --no-expanded is used. """ def __init__(self, section, etype, node): super().__init__(section, etype, node) diff --git a/tools/binman/etype/u_boot_spl_expanded.py b/tools/binman/etype/u_boot_spl_expanded.py new file mode 100644 index 00000000000..8e138e6a624 --- /dev/null +++ b/tools/binman/etype/u_boot_spl_expanded.py @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright 2021 Google LLC +# Written by Simon Glass +# +# Entry-type module for expanded U-Boot SPL binary +# + +from patman import tout + +from binman import state +from binman.etype.blob_phase import Entry_blob_phase + +class Entry_u_boot_spl_expanded(Entry_blob_phase): + """U-Boot SPL flat binary broken out into its component parts + + Properties / Entry arguments: + - spl-dtb: Controls whether this entry is selected (set to 'y' or '1' to + select) + + This is a section containing the U-Boot binary, BSS padding if needed and a + devicetree. Using this entry type automatically creates this section, with + the following entries in it: + + u-boot-spl-nodtb + u-boot-spl-bss-pad + u-boot-dtb + + Having the devicetree separate allows binman to update it in the final + image, so that the entries positions are provided to the running U-Boot. + + This entry is selected based on the value of the 'spl-dtb' entryarg. If + this is non-empty (and not 'n' or '0') then this expanded entry is selected. + """ + def __init__(self, section, etype, node): + bss_pad = state.GetEntryArgBool('spl-bss-pad') + super().__init__(section, etype, node, 'u-boot-spl', 'u-boot-spl-dtb', + bss_pad) + + @classmethod + def UseExpanded(cls, node, etype, new_etype): + val = state.GetEntryArgBool('spl-dtb') + tout.DoOutput(tout.INFO if val else tout.DETAIL, + "Node '%s': etype '%s': %s %sselected" % + (node.path, etype, new_etype, '' if val else 'not ')) + return val diff --git a/tools/binman/etype/u_boot_spl_nodtb.py b/tools/binman/etype/u_boot_spl_nodtb.py index 41d75054910..f9290ef307f 100644 --- a/tools/binman/etype/u_boot_spl_nodtb.py +++ b/tools/binman/etype/u_boot_spl_nodtb.py @@ -17,8 +17,9 @@ class Entry_u_boot_spl_nodtb(Entry_blob): This is the U-Boot SPL binary, It does not include a device tree blob at the end of it so may not be able to work without it, assuming SPL needs a device tree to operate on your platform. You can add a u-boot-spl-dtb - entry after this one, or use a u-boot-spl entry instead (which contains - both SPL and the device tree). + entry after this one, or use a u-boot-spl entry instead' which normally + expands to a section containing u-boot-spl-dtb, u-boot-spl-bss-pad and + u-boot-spl-dtb """ def __init__(self, section, etype, node): super().__init__(section, etype, node) diff --git a/tools/binman/etype/u_boot_tpl.py b/tools/binman/etype/u_boot_tpl.py index 02287ab3275..95d9bd6b20e 100644 --- a/tools/binman/etype/u_boot_tpl.py +++ b/tools/binman/etype/u_boot_tpl.py @@ -30,6 +30,9 @@ class Entry_u_boot_tpl(Entry_blob): The ELF file 'tpl/u-boot-tpl' must also be available for this to work, since binman uses that to look up symbols to write into the TPL binary. + + Note that this entry is automatically replaced with u-boot-tpl-expanded + unless --no-expanded is used. """ def __init__(self, section, etype, node): super().__init__(section, etype, node) diff --git a/tools/binman/etype/u_boot_tpl_expanded.py b/tools/binman/etype/u_boot_tpl_expanded.py new file mode 100644 index 00000000000..15cdac46556 --- /dev/null +++ b/tools/binman/etype/u_boot_tpl_expanded.py @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright 2021 Google LLC +# Written by Simon Glass +# +# Entry-type module for expanded U-Boot TPL binary +# + +from patman import tout + +from binman import state +from binman.etype.blob_phase import Entry_blob_phase + +class Entry_u_boot_tpl_expanded(Entry_blob_phase): + """U-Boot TPL flat binary broken out into its component parts + + Properties / Entry arguments: + - tpl-dtb: Controls whether this entry is selected (set to 'y' or '1' to + select) + + This is a section containing the U-Boot binary, BSS padding if needed and a + devicetree. Using this entry type automatically creates this section, with + the following entries in it: + + u-boot-tpl-nodtb + u-boot-tpl-bss-pad + u-boot-dtb + + Having the devicetree separate allows binman to update it in the final + image, so that the entries positions are provided to the running U-Boot. + + This entry is selected based on the value of the 'tpl-dtb' entryarg. If + this is non-empty (and not 'n' or '0') then this expanded entry is selected. + """ + def __init__(self, section, etype, node): + bss_pad = state.GetEntryArgBool('tpl-bss-pad') + super().__init__(section, etype, node, 'u-boot-tpl', 'u-boot-tpl-dtb', + bss_pad) + + @classmethod + def UseExpanded(cls, node, etype, new_etype): + val = state.GetEntryArgBool('tpl-dtb') + tout.DoOutput(tout.INFO if val else tout.DETAIL, + "Node '%s': etype '%s': %s %sselected" % + (node.path, etype, new_etype, '' if val else 'not ')) + return val diff --git a/tools/binman/etype/u_boot_tpl_nodtb.py b/tools/binman/etype/u_boot_tpl_nodtb.py index eaeebcadf77..07edbc5efaf 100644 --- a/tools/binman/etype/u_boot_tpl_nodtb.py +++ b/tools/binman/etype/u_boot_tpl_nodtb.py @@ -17,8 +17,9 @@ class Entry_u_boot_tpl_nodtb(Entry_blob): This is the U-Boot TPL binary, It does not include a device tree blob at the end of it so may not be able to work without it, assuming TPL needs a device tree to operate on your platform. You can add a u-boot-tpl-dtb - entry after this one, or use a u-boot-tpl entry instead (which contains - both TPL and the device tree). + entry after this one, or use a u-boot-tpl entry instead, which normally + expands to a section containing u-boot-tpl-dtb, u-boot-tpl-bss-pad and + u-boot-tpl-dtb """ def __init__(self, section, etype, node): super().__init__(section, etype, node) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 2a0e0460daa..2638408246f 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -4274,6 +4274,180 @@ class TestFunctional(unittest.TestCase): self.assertIn('Expected __bss_size symbol in tpl/u-boot-tpl', str(e.exception)) + def checkDtbSizes(self, data, pad_len, start): + """Check the size arguments in a dtb embedded in an image + + Args: + data: The image data + pad_len: Length of the pad section in the image, in bytes + start: Start offset of the devicetree to examine, within the image + + Returns: + Size of the devicetree in bytes + """ + dtb_data = data[start:] + dtb = fdt.Fdt.FromData(dtb_data) + fdt_size = dtb.GetFdtObj().totalsize() + dtb.Scan() + props = self._GetPropTree(dtb, 'size') + self.assertEqual({ + 'size': len(data), + 'u-boot-spl/u-boot-spl-bss-pad:size': pad_len, + 'u-boot-spl/u-boot-spl-dtb:size': 781, + 'u-boot-spl/u-boot-spl-nodtb:size': len(U_BOOT_SPL_NODTB_DATA), + 'u-boot-spl:size': 840, + 'u-boot-tpl:size': len(U_BOOT_TPL_DATA), + 'u-boot/u-boot-dtb:size': 781, + 'u-boot/u-boot-nodtb:size': len(U_BOOT_NODTB_DATA), + 'u-boot:size': 827, + }, props) + return fdt_size + + def testExpanded(self): + """Test that an expanded entry type is selected when needed""" + self._SetupSplElf() + self._SetupTplElf() + + # SPL has a devicetree, TPL does not + entry_args = { + 'spl-dtb': '1', + 'spl-bss-pad': 'y', + 'tpl-dtb': '', + } + self._DoReadFileDtb('194_fdt_incl.dts', use_expanded=True, + entry_args=entry_args) + image = control.images['image'] + entries = image.GetEntries() + self.assertEqual(3, len(entries)) + + # First, u-boot, which should be expanded into u-boot-nodtb and dtb + self.assertIn('u-boot', entries) + entry = entries['u-boot'] + self.assertEqual('u-boot-expanded', entry.etype) + subent = entry.GetEntries() + self.assertEqual(2, len(subent)) + self.assertIn('u-boot-nodtb', subent) + self.assertIn('u-boot-dtb', subent) + + # Second, u-boot-spl, which should be expanded into three parts + self.assertIn('u-boot-spl', entries) + entry = entries['u-boot-spl'] + self.assertEqual('u-boot-spl-expanded', entry.etype) + subent = entry.GetEntries() + self.assertEqual(3, len(subent)) + self.assertIn('u-boot-spl-nodtb', subent) + self.assertIn('u-boot-spl-bss-pad', subent) + self.assertIn('u-boot-spl-dtb', subent) + + # Third, u-boot-tpl, which should be not be expanded, since TPL has no + # devicetree + self.assertIn('u-boot-tpl', entries) + entry = entries['u-boot-tpl'] + self.assertEqual('u-boot-tpl', entry.etype) + self.assertEqual(None, entry.GetEntries()) + + def testExpandedTpl(self): + """Test that an expanded entry type is selected for TPL when needed""" + self._SetupTplElf() + + entry_args = { + 'tpl-bss-pad': 'y', + 'tpl-dtb': 'y', + } + self._DoReadFileDtb('195_fdt_incl_tpl.dts', use_expanded=True, + entry_args=entry_args) + image = control.images['image'] + entries = image.GetEntries() + self.assertEqual(1, len(entries)) + + # We only have u-boot-tpl, which be expanded + self.assertIn('u-boot-tpl', entries) + entry = entries['u-boot-tpl'] + self.assertEqual('u-boot-tpl-expanded', entry.etype) + subent = entry.GetEntries() + self.assertEqual(3, len(subent)) + self.assertIn('u-boot-tpl-nodtb', subent) + self.assertIn('u-boot-tpl-bss-pad', subent) + self.assertIn('u-boot-tpl-dtb', subent) + + def testExpandedNoPad(self): + """Test an expanded entry without BSS pad enabled""" + self._SetupSplElf() + self._SetupTplElf() + + # SPL has a devicetree, TPL does not + entry_args = { + 'spl-dtb': 'something', + 'spl-bss-pad': 'n', + 'tpl-dtb': '', + } + self._DoReadFileDtb('194_fdt_incl.dts', use_expanded=True, + entry_args=entry_args) + image = control.images['image'] + entries = image.GetEntries() + + # Just check u-boot-spl, which should be expanded into two parts + self.assertIn('u-boot-spl', entries) + entry = entries['u-boot-spl'] + self.assertEqual('u-boot-spl-expanded', entry.etype) + subent = entry.GetEntries() + self.assertEqual(2, len(subent)) + self.assertIn('u-boot-spl-nodtb', subent) + self.assertIn('u-boot-spl-dtb', subent) + + def testExpandedTplNoPad(self): + """Test that an expanded entry type with padding disabled in TPL""" + self._SetupTplElf() + + entry_args = { + 'tpl-bss-pad': '', + 'tpl-dtb': 'y', + } + self._DoReadFileDtb('195_fdt_incl_tpl.dts', use_expanded=True, + entry_args=entry_args) + image = control.images['image'] + entries = image.GetEntries() + self.assertEqual(1, len(entries)) + + # We only have u-boot-tpl, which be expanded + self.assertIn('u-boot-tpl', entries) + entry = entries['u-boot-tpl'] + self.assertEqual('u-boot-tpl-expanded', entry.etype) + subent = entry.GetEntries() + self.assertEqual(2, len(subent)) + self.assertIn('u-boot-tpl-nodtb', subent) + self.assertIn('u-boot-tpl-dtb', subent) + + def testFdtInclude(self): + """Test that an Fdt is update within all binaries""" + self._SetupSplElf() + self._SetupTplElf() + + # SPL has a devicetree, TPL does not + self.maxDiff = None + entry_args = { + 'spl-dtb': '1', + 'spl-bss-pad': 'y', + 'tpl-dtb': '', + } + # Build the image. It includes two separate devicetree binaries, each + # with their own contents, but all contain the binman definition. + data = self._DoReadFileDtb( + '194_fdt_incl.dts', use_real_dtb=True, use_expanded=True, + update_dtb=True, entry_args=entry_args)[0] + pad_len = 10 + + # Check the U-Boot dtb + start = len(U_BOOT_NODTB_DATA) + fdt_size = self.checkDtbSizes(data, pad_len, start) + + # Now check SPL + start += fdt_size + len(U_BOOT_SPL_NODTB_DATA) + pad_len + fdt_size = self.checkDtbSizes(data, pad_len, start) + + # TPL has no devicetree + start += fdt_size + len(U_BOOT_TPL_DATA) + self.assertEqual(len(data), start) if __name__ == "__main__": unittest.main() diff --git a/tools/binman/state.py b/tools/binman/state.py index bb3e36ea7af..ebfc7a02002 100644 --- a/tools/binman/state.py +++ b/tools/binman/state.py @@ -136,12 +136,16 @@ def SetEntryArgs(args): global entry_args entry_args = {} + tout.Debug('Processing entry args:') if args: for arg in args: m = re.match('([^=]*)=(.*)', arg) if not m: raise ValueError("Invalid entry arguemnt '%s'" % arg) - entry_args[m.group(1)] = m.group(2) + name, value = m.groups() + tout.Debug(' %20s = %s' % (name, value)) + entry_args[name] = value + tout.Debug('Processing entry args done') def GetEntryArg(name): """Get the value of an entry argument @@ -154,6 +158,19 @@ def GetEntryArg(name): """ return entry_args.get(name) +def GetEntryArgBool(name): + """Get the value of an entry argument as a boolean + + Args: + name: Name of argument to retrieve + + Returns: + False if the entry argument is consider False (empty, '0' or 'n'), else + True + """ + val = GetEntryArg(name) + return val and val not in ['n', '0'] + def Prepare(images, dtb): """Get device tree files ready for use diff --git a/tools/binman/test/194_fdt_incl.dts b/tools/binman/test/194_fdt_incl.dts new file mode 100644 index 00000000000..b14c8ff8f52 --- /dev/null +++ b/tools/binman/test/194_fdt_incl.dts @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + u-boot { + }; + u-boot-spl { + }; + u-boot-tpl { + }; + }; +}; diff --git a/tools/binman/test/195_fdt_incl_tpl.dts b/tools/binman/test/195_fdt_incl_tpl.dts new file mode 100644 index 00000000000..3756ac4fc47 --- /dev/null +++ b/tools/binman/test/195_fdt_incl_tpl.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + u-boot-tpl { + }; + }; +}; From patchwork Sun Mar 7 19:31:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448736 X-Patchwork-Delegate: sjg@chromium.org 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=anJxSP+u; 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 4Dts9H5tDJz9sW5 for ; Mon, 8 Mar 2021 06:34:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 39DB882862; Sun, 7 Mar 2021 20:32:30 +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="anJxSP+u"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 12D8E827E3; Sun, 7 Mar 2021 20:32:10 +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-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) (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 5E2CA827D3 for ; Sun, 7 Mar 2021 20:32:05 +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-ot1-x32a.google.com with SMTP id e45so7145331ote.9 for ; Sun, 07 Mar 2021 11:32:05 -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=rkNkDDKbmOWXkhBnF0DMd5NWn2kn36+Fd85m9JJNKmE=; b=anJxSP+uDGC38meYSvBO5yW1TaSka16ZA3wkgWrr0QJ6A0YxcaW7llwEJEQ2PJKbvz 516WhO8aLnsU//ZqPhiEwXZrsvsNew/CDXD342cqkwtsnOS59VVoLipS5FicSpIJ19x3 ajqN8XJynArvV03z1lc7rpOLtXlnASBsRsoQc= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=rkNkDDKbmOWXkhBnF0DMd5NWn2kn36+Fd85m9JJNKmE=; b=jqCzyozEI4nre6GYrj7R+ps+pYONEHj5hIyemU+Ms4itxc/kFyqbs2eYznIDsoFTsA lsy2w10s3uAzqJFSnM1b8eI8g5SYpryMXJyu3vlb4M5ycdBeO/c6O96elrjGY6qSdmI7 mnJbdcDHZ7GF5ZMQRQZIdMyyXfFQi2WUMqosT58X5PtgvZ/LrI5zoCgff7qYH0Dwakyj Y+mF9AEx9WamrIOGaFKJgAKDgjSzt+Y+CbXr+uutVdYT2IfHzWoUJvoc9gKyVzGnwMCq meMDtN6Of+5Z4op7AS57QY3nBUv6KYz1sUDf99SNI7l148NgnNSq0aOWhDrlLXD+J8tu n2ug== X-Gm-Message-State: AOAM532g9ABRZQ4YtbTH2KBX5Cprz1sg9h7BrNUOuhyNySjTJX77Aa6w HjDIIEEiYGlTc3mWy33/8h5FvpZznsfM2bmK X-Google-Smtp-Source: ABdhPJyFshMJop3xLqOrfqlRPHEeqRe1DjjP2LncEkUMgbJzl264OIW5BBAfcz1veChnTubqE4W6Vg== X-Received: by 2002:a9d:4e8e:: with SMTP id v14mr10416552otk.113.1615145523816; Sun, 07 Mar 2021 11:32:03 -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.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:32:03 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Bin Meng , Chee Hong Ang , Heinrich Schuchardt , Masahiro Yamada , Masahiro Yamada , Michal Simek , =?utf-8?q?Pali_Roh=C3=A1r?= Subject: [PATCH 12/20] Makefile: Pass new entry args to binman Date: Sun, 7 Mar 2021 12:31:39 -0700 Message-Id: <20210307193148.1513733-13-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 To support the use of 'expanded' entries, binman needs to be told whether SPL and TPL have a devicetree and whether they need BSS padding. Add these to the Makefile. Signed-off-by: Simon Glass --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 655de412e9a..07e43a6b09f 100644 --- a/Makefile +++ b/Makefile @@ -1332,6 +1332,11 @@ u-boot.ldr: u-boot # Use 'make BINMAN_DEBUG=1' to enable debugging # Use 'make BINMAN_VERBOSE=3' to set vebosity level default_dt := $(if $(DEVICE_TREE),$(DEVICE_TREE),$(CONFIG_DEFAULT_DEVICE_TREE)) + +# Tell binman whether we have a devicetree for SPL and TPL +have_spl_dt := $(if $(CONFIG_SPL_OF_PLATDATA),,$(CONFIG_SPL_OF_CONTROL)) +have_tpl_dt := $(if $(CONFIG_TPL_OF_PLATDATA),,$(CONFIG_TPL_OF_CONTROL)) + quiet_cmd_binman = BINMAN $@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ --toolpath $(objtree)/tools \ @@ -1342,6 +1347,9 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ -a atf-bl31-path=${BL31} \ -a default-dt=$(default_dt) \ -a scp-path=$(SCP) \ + -a spl-bss-pad=$(if $(CONFIG_SPL_SEPARATE_BSS),,1) \ + -a tpl-bss-pad=$(if $(CONFIG_TPL_SEPARATE_BSS),,1) \ + -a spl-dtb=$(have_spl_dt) -a tpl-dtb=$(have_tpl_dt) \ $(BINMAN_$(@F)) OBJCOPYFLAGS_u-boot.ldr.hex := -I binary -O ihex From patchwork Sun Mar 7 19:31:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448738 X-Patchwork-Delegate: sjg@chromium.org 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=PvbIln1/; 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 4Dts9h0pmpz9sW5 for ; Mon, 8 Mar 2021 06:34:32 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9F72982877; Sun, 7 Mar 2021 20:32:34 +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="PvbIln1/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 59A688282E; Sun, 7 Mar 2021 20:32:12 +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-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) (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 264EE827F9 for ; Sun, 7 Mar 2021 20:32:06 +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-ot1-x330.google.com with SMTP id j22so1314261otp.2 for ; Sun, 07 Mar 2021 11:32:06 -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=HnNuJb2m3o/HWTzMo+k/5d0XIb8BiN0EKszYOeMXq8o=; b=PvbIln1/j+MZogVYUczy5IVof7I0XbAx3ZMrP4KUkJwQDRxaobeiwGPVKbzvRc0Gpf RLTZvBR+A5ICzv1i1VvzIYXKHLOAgXV46YT0NtwoSXcW4TTrBA1dXCf/qjn3XHsQnoO5 ptIhF+/qLAbZU5IVY0atOS/mi3psq0hDfA8yY= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=HnNuJb2m3o/HWTzMo+k/5d0XIb8BiN0EKszYOeMXq8o=; b=lb4ZgUUqLzirNiNKd2qbEB5xXl5Yq3FIm9DPjeOHfSH8Pz+CVstFhWMkfDQYPTv0gV FKVI5um17KFrNZ2XegbLAsxpILRYfN4w6Fz8Eoc8nPVk+yR8L1cOEORR1x3iK1wqB0lg vPHB3DrYQYaN08BBA0jySVLOtQOi/tEnS0gNZ7vgXEKpWCARp7HVw1iMqXh+oPOeaRhZ v+r4q6Q/Cg9TDFRNJug5/gLawAfjetnUQNzVhI85AjZ9U4D+4nCy062iOGgm+fWBCtHn OypFYN5rt71jHZdTo1MnKYR5cylbSavYUh52OGZe478EBHwKMY9W0+18A5S55O1gvZP9 J+6A== X-Gm-Message-State: AOAM533sltonGaH4vDGqqppPcURAqo/tyIsrvKqsa+SfypG9Lkql8lmX X+T8+zu8GgVjRU1ZVIeJTD4GYRgGZC/N1VQY X-Google-Smtp-Source: ABdhPJzf6KHNb5d7dlp/6If+p4QYbLJach+xxQlsExAYHrjfjFVo0coXpkR5lUeeSKFKb8T781tTfw== X-Received: by 2002:a9d:2622:: with SMTP id a31mr16857318otb.205.1615145524753; Sun, 07 Mar 2021 11:32:04 -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.32.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:32:04 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Andy Shevchenko , Bin Meng Subject: [PATCH 13/20] x86: Make use of binman expanded entries Date: Sun, 7 Mar 2021 12:31:40 -0700 Message-Id: <20210307193148.1513733-14-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 We don't need to spell out the separate pieces of U-Boot phase binaries anymore. Revert to using the simple entry and let binman do the expansion itself as needed. Signed-off-by: Simon Glass --- arch/x86/dts/u-boot.dtsi | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi index bf92f45f2d3..50134b2fe00 100644 --- a/arch/x86/dts/u-boot.dtsi +++ b/arch/x86/dts/u-boot.dtsi @@ -38,20 +38,11 @@ }; #endif spl { - type = "section"; + type = "u-boot-spl"; offset = ; - u-boot-spl { - }; - u-boot-spl-dtb { - }; }; u-boot { - type = "section"; offset = ; - u-boot-nodtb { - }; - u-boot-dtb { - }; }; #elif defined(CONFIG_SPL) u-boot-spl-with-ucode-ptr { From patchwork Sun Mar 7 19:31:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448737 X-Patchwork-Delegate: sjg@chromium.org 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=GXh3s72A; 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 4Dts9V5VB5z9sW5 for ; Mon, 8 Mar 2021 06:34:22 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 303FB8287F; Sun, 7 Mar 2021 20:32:32 +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="GXh3s72A"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F36FA8281E; Sun, 7 Mar 2021 20:32:10 +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-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) (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 2325A827B1 for ; Sun, 7 Mar 2021 20:32: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=sjg@chromium.org Received: by mail-oi1-x22e.google.com with SMTP id v192so1193334oia.5 for ; Sun, 07 Mar 2021 11:32:07 -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=EcHcGuJPbglXJNDcRZB+mCAkLP42beHaFU1e63wI1uk=; b=GXh3s72Aj6vPQGR/SK1z3C/MqXd2T/hwCTPrvPpSp1vIZB9BsgTILzrKWtfhUATY6R Zp08BmLKggXmsM9iOssgE+3PPh659nfT4eibbflXdNwQgSIXjxHP44JbnBJVT1EyfszT sJrZNkPpbfVmWOcYYpAukwwF8G9bUMExvU4XU= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=EcHcGuJPbglXJNDcRZB+mCAkLP42beHaFU1e63wI1uk=; b=npHL+6yqp1d5gQf7fnVivyBm/dQNovBGvdsD5uagZzd0jm+bhnHpjtozqGW/l+M2tb ihoaJAKNuhMBlIv6hCAJSKan3bjallsiIGMmQp0rjz4RV6ESpOYi9CTo6wPt12ETBaK6 GO7kXiRj6Y/mT8+J+FjA4VXcJXj1mG8l6TfKctc3d/v1gjUc38T/HNO+f+rmq38mvct9 mrEM8aDH/VmBtXA/ZJLLMkAxQWmed8YNWTaS4tOztGkd2I8Hm8yM9s2tMzegHYUtkw43 RkT6gV/cJ4mPCLPm9tWrzfAEd/wCaz3ym39+c7L2Csg24TlFrQcleS3P9VGteG6q81AY lS0w== X-Gm-Message-State: AOAM5305VA9nxjmdgRUYGeDRiEpw3J+TU8RdYRZHYvOKEpVVpiejhIx0 KoCC6L22sRhRQp2RLeb5Qj4nUMP2kVJl5LmU X-Google-Smtp-Source: ABdhPJxC8blQF4XDEU/EUu6/KEUeAnRd5pT3f0GTfYtY5GKXAItyn2JMrGPTO7kRugSROdpPTO+yKA== X-Received: by 2002:aca:c792:: with SMTP id x140mr14854709oif.86.1615145525802; Sun, 07 Mar 2021 11:32:05 -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.32.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:32:05 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Andy Shevchenko , Bin Meng Subject: [PATCH 14/20] x86: dts: Drop unused CONFIG_SPL Date: Sun, 7 Mar 2021 12:31:41 -0700 Message-Id: <20210307193148.1513733-15-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 This cannot be used since the previous #elif has already dealt with SPL. Drop it. Signed-off-by: Simon Glass --- arch/x86/dts/u-boot.dtsi | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi index 50134b2fe00..ca84d18ad90 100644 --- a/arch/x86/dts/u-boot.dtsi +++ b/arch/x86/dts/u-boot.dtsi @@ -55,11 +55,7 @@ offset = ; }; #else -# ifdef CONFIG_SPL - u-boot { - offset = ; - }; -# elif defined(CONFIG_HAVE_MICROCODE) +# ifdef CONFIG_HAVE_MICROCODE /* If there is no SPL then we need to put microcode in U-Boot */ u-boot-with-ucode-ptr { offset = ; From patchwork Sun Mar 7 19:31:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448739 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=Zpbh/CLe; 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 4Dts9s6lL1z9sW5 for ; Mon, 8 Mar 2021 06:34:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A6A41827BC; Sun, 7 Mar 2021 20:32:37 +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="Zpbh/CLe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 35FDE82824; Sun, 7 Mar 2021 20:32:15 +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-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) (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 471B98280F for ; Sun, 7 Mar 2021 20:32:08 +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-x22f.google.com with SMTP id d20so8739439oiw.10 for ; Sun, 07 Mar 2021 11:32:08 -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=FNn8TsrnotNXCVSUIdR5l0j1jY5MPUy/8Ngle4Ezxxw=; b=Zpbh/CLeChe3flD3nf0SCLiVyNqxOCq+Vb0bViS6QUyTo7W5/tNT15u9UFBEWxNR7/ pFex/XpSjCB0xIwcwUriK8rd3R0mJqLwA1fzvpBP0+CxBwYLsIcwiDT3ZR27vSRvI8J3 u5oqvH8mY6Sik68M8gm1AI+z/K0cIx/75OX/s= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=FNn8TsrnotNXCVSUIdR5l0j1jY5MPUy/8Ngle4Ezxxw=; b=DIJcWZbO91BGSMjsWG/fgu1rw6107BoMKHyPREOlX9u/fWvgThuDG8WixaUdpehk/r n+YXkUyeOtk68vFeXKdq3c7d8Q0agZ0VKgFoycJP6bNFfBKiXEnGBM9KAdLi/o9RhqKT DkCxsLwVefDkz2HKl02GLFWgqMjVnRMXzG10NZBSSI0j3618U9UUQ2qMpxym4uVGsCLs AdF8M/x5n94TnrJCmgcErYknrxviGNZSHc0KjNPytyV48TN9mzrV3a49AeVOPnHmmDwD FQJf6LtiGc5HGmTmkmleQyt0Xg+LQcBm6iP714ck4u5s190ApsPg9X9gzrKqD43D8J+4 7CMw== X-Gm-Message-State: AOAM532KQHvVVXbe3+ssItDnIy3lbWqTOnVxVDF/2ykMF2nHfBxmSm3V wURUesfVf+7tIDPHOn8CMByMWLVgW67Cj5LL X-Google-Smtp-Source: ABdhPJxq8iBoWIYRnlyyoZzfFj8A+0xWT9abfctxMoolfFAQK2cyeSB1L4wuR1zFSgZXT5AWiSmxcA== X-Received: by 2002:aca:ac56:: with SMTP id v83mr14988374oie.16.1615145526795; Sun, 07 Mar 2021 11:32:06 -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.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:32:06 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , =?utf-8?q?Fr=C3=A9d=C3=A9ric_Danis?= , Heinrich Schuchardt , Ilias Apalodimas Subject: [PATCH 15/20] doc: Move UEFI down a bit Date: Sun, 7 Mar 2021 12:31:42 -0700 Message-Id: <20210307193148.1513733-16-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 This features a little too prominently in the contents at present. It seems more important to talk about driver model and the API (which includes some UEFI notes). Reposition it below those. Signed-off-by: Simon Glass --- doc/index.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/index.rst b/doc/index.rst index 4c44955d67f..cdcc0a9e60a 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -38,18 +38,6 @@ want to contribute to U-Boot. develop/index -Unified Extensible Firmware (UEFI) ----------------------------------- - -U-Boot provides an implementation of the UEFI API allowing to run UEFI -compliant software like Linux, GRUB, and iPXE. Furthermore U-Boot itself -can be run an UEFI payload. - -.. toctree:: - :maxdepth: 2 - - uefi/index - Driver-Model documentation -------------------------- @@ -76,6 +64,18 @@ needed). api/index +Unified Extensible Firmware (UEFI) +---------------------------------- + +U-Boot provides an implementation of the UEFI API allowing to run UEFI +compliant software like Linux, GRUB, and iPXE. Furthermore U-Boot itself +can be run an UEFI payload. + +.. toctree:: + :maxdepth: 2 + + uefi/index + Architecture-specific doc ------------------------- From patchwork Sun Mar 7 19:31:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448744 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=iZJohdk0; 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 4DtsBr3mSfz9sW5 for ; Mon, 8 Mar 2021 06:35:31 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 682C7828B3; Sun, 7 Mar 2021 20:32:50 +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="iZJohdk0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8D49382818; Sun, 7 Mar 2021 20:32:21 +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, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) (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 498FA82818 for ; Sun, 7 Mar 2021 20:32:10 +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-x22b.google.com with SMTP id x135so4267173oia.9 for ; Sun, 07 Mar 2021 11:32:10 -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=xe50L3H38J80S99DQyU/yOsetefJ+L6jSoEjZtbdPiM=; b=iZJohdk0CPXf5+utK0rB1RrZVE6XQ2lMq/TV98u/2egW/9oCfkzybp/EtYDGjqiYUn F3WEn3cPbubrkZV1r1B4WhfyfZmlOFZceg3UHZ+Ko+1bnYdZyDrrRaVM8WabIrhaoYk+ gnMqMnK+762K/OgrieU8o2EfOK9MWCe7FfSm4= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=xe50L3H38J80S99DQyU/yOsetefJ+L6jSoEjZtbdPiM=; b=l5HqRkPGbdcSFKYWTJGa7zOBe2CpDYfIsO90Okn8egn9TAQIuZR7IE4Tm3qXrNW3Xl +n59YXdMtWL8dKSBuVXvUmT0RN+C1Uh2+8+ObitqnwwT0PhTc4JzDvnBfvz8EwQrIggf TxY9koQv9aTO5ww6/o1ykcl/mKmhVKccvpz0n2Yb1FtIvgepyB3CPB6whnTlANHljAIe SfLao++52h+3JFVceChlU7pRcAp9KOu7at6bM4o7Emhvhlg2NEB+/77FRkN/hPwBjN0S LpbLSZAmzKIpZ9MuBZcj5jx2R0jg2yu9OWg1omn5fjE+MWZidi6KvAxhJ2ybl11765Fm loCQ== X-Gm-Message-State: AOAM530iMwY7zktB7SSQbI4yGPGlK1oKBWQ/75mb2QMBQ1+lKaCmJ8GL s7yxBew/BQfbnn1Vypm3xEPXB+9SU5uRXnbE X-Google-Smtp-Source: ABdhPJxG+EF3R511hgJxFmg1u7l94JY4ba+socaWlsFIvJrjPxsdEBPRf2UTOvBKWGqHz8SIb2oPzg== X-Received: by 2002:aca:4a87:: with SMTP id x129mr8622567oia.107.1615145527811; Sun, 07 Mar 2021 11:32:07 -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.32.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:32:07 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , =?utf-8?q?Fr=C3=A9d=C3=A9ric_Danis?= , Heinrich Schuchardt , Ilias Apalodimas Subject: [PATCH 16/20] binman: doc: Add documentation to htmldocs Date: Sun, 7 Mar 2021 12:31:43 -0700 Message-Id: <20210307193148.1513733-17-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 Add a link to binman's documentation and adjust the files so that it is accessible. Use the name README.rst so it is easy to discover when binman is installed without U-Boot. Signed-off-by: Simon Glass --- doc/index.rst | 1 + doc/package/binman | 1 + doc/package/fit.rst | 8 + doc/package/index.rst | 20 ++ tools/binman/{README => README.rst} | 480 ++++++++++++++-------------- tools/binman/control.py | 2 +- tools/binman/ftest.py | 4 +- tools/binman/index.rst | 9 + tools/binman/setup.py | 2 +- 9 files changed, 284 insertions(+), 243 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} (73%) create mode 100644 tools/binman/index.rst diff --git a/doc/index.rst b/doc/index.rst index cdcc0a9e60a..26be4be5b3c 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -25,6 +25,7 @@ trying to get it to work optimally on a given system. :maxdepth: 2 build/index + package/index usage/index Developer-oriented documentation diff --git a/doc/package/binman b/doc/package/binman new file mode 120000 index 00000000000..94916117605 --- /dev/null +++ b/doc/package/binman @@ -0,0 +1 @@ +../../tools/binman \ No newline at end of file diff --git a/doc/package/fit.rst b/doc/package/fit.rst new file mode 100644 index 00000000000..70374340577 --- /dev/null +++ b/doc/package/fit.rst @@ -0,0 +1,8 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Flat Image Tree (FIT) +===================== + +U-Boot uses Flat Image Tree (FIT) as a standard file format for packaging +images that it it reads and boots. Documentation about FIT is available at +doc/uImage.FIT diff --git a/doc/package/index.rst b/doc/package/index.rst new file mode 100644 index 00000000000..ca1f7fe2f97 --- /dev/null +++ b/doc/package/index.rst @@ -0,0 +1,20 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Package U-Boot +============== + +U-Boot uses Flat Image Tree (FIT) as a standard file format for packaging +images that it it reads and boots. Documentation about FIT is available at +doc/uImage.FIT + +U-Boot also provides binman for cases not covered by FIT. Examples include +initial execution (since FIT itself does not have an executable header) and +dealing with device boundaries, such as the read-only/read-write separation in +SPI flash. + + +.. toctree:: + :maxdepth: 2 + + fit + binman/index diff --git a/tools/binman/README b/tools/binman/README.rst similarity index 73% rename from tools/binman/README rename to tools/binman/README.rst index 1de703cc653..8d06aa91287 100644 --- a/tools/binman/README +++ b/tools/binman/README.rst @@ -67,18 +67,19 @@ standard format, we can support making valid images for any board without manual effort, lots of READMEs, etc. Benefits: -- Each binary can have its own build system and tool chain without creating -any dependencies between them -- Avoids the need for a single-shot build: individual parts can be updated -and brought in as needed -- Provides for a standard image description available in the build and at -run-time -- SoC-specific image-signing tools can be accommodated -- Avoids cluttering the U-Boot build system with image-building code -- The image description is automatically available at run-time in U-Boot, -SPL. It can be made available to other software also -- The image description is easily readable (it's a text file in device-tree -format) and permits flexible packing of binaries + + - Each binary can have its own build system and tool chain without creating + any dependencies between them + - Avoids the need for a single-shot build: individual parts can be updated + and brought in as needed + - Provides for a standard image description available in the build and at + run-time + - SoC-specific image-signing tools can be accommodated + - Avoids cluttering the U-Boot build system with image-building code + - The image description is automatically available at run-time in U-Boot, + SPL. It can be made available to other software also + - The image description is easily readable (it's a text file in device-tree + format) and permits flexible packing of binaries Terminology @@ -144,14 +145,14 @@ build system. Consider sunxi. It has the following steps: -1. It uses a custom mksunxiboot tool to build an SPL image called -sunxi-spl.bin. This should probably move into mkimage. + #. It uses a custom mksunxiboot tool to build an SPL image called + sunxi-spl.bin. This should probably move into mkimage. -2. It uses mkimage to package U-Boot into a legacy image file (so that it can -hold the load and execution address) called u-boot.img. + #. It uses mkimage to package U-Boot into a legacy image file (so that it can + hold the load and execution address) called u-boot.img. -3. It builds a final output image called u-boot-sunxi-with-spl.bin which -consists of sunxi-spl.bin, some padding and u-boot.img. + #. It builds a final output image called u-boot-sunxi-with-spl.bin which + consists of sunxi-spl.bin, some padding and u-boot.img. Binman is intended to replace the last step. The U-Boot build system builds u-boot.bin and sunxi-spl.bin. Binman can then take over creation of @@ -180,22 +181,22 @@ the configuration of the Intel-format descriptor. Running binman -------------- -First install prerequisites, e.g. +First install prerequisites, e.g:: - sudo apt-get install python-pyelftools python3-pyelftools lzma-alone \ - liblz4-tool + sudo apt-get install python-pyelftools python3-pyelftools lzma-alone \ + liblz4-tool -Type: +Type:: - binman build -b + binman build -b to build an image for a board. The board name is the same name used when configuring U-Boot (e.g. for sandbox_defconfig the board name is 'sandbox'). Binman assumes that the input files for the build are in ../b/. -Or you can specify this explicitly: +Or you can specify this explicitly:: - binman build -I + binman build -I where is the build directory containing the output of the U-Boot build. @@ -212,12 +213,12 @@ Enabling binman for a board --------------------------- At present binman is invoked from a rule in the main Makefile. Typically you -will have a rule like: +will have a rule like:: -ifneq ($(CONFIG_ARCH_),) -u-boot-.bin: checkbinman FORCE - $(call if_changed,binman) -endif + ifneq ($(CONFIG_ARCH_),) + u-boot-.bin: checkbinman FORCE + $(call if_changed,binman) + endif This assumes that u-boot-.bin is a target, and is the final file that you need to produce. You can make it a target by adding it to INPUTS-y @@ -233,18 +234,18 @@ Image description format ------------------------ The binman node is called 'binman'. An example image description is shown -below: +below:: - binman { - filename = "u-boot-sunxi-with-spl.bin"; - pad-byte = <0xff>; - blob { - filename = "spl/sunxi-spl.bin"; - }; - u-boot { - offset = ; - }; - }; + binman { + filename = "u-boot-sunxi-with-spl.bin"; + pad-byte = <0xff>; + blob { + filename = "spl/sunxi-spl.bin"; + }; + u-boot { + offset = ; + }; + }; This requests binman to create an image file called u-boot-sunxi-with-spl.bin @@ -270,184 +271,184 @@ use any unique name, with the 'type' property providing the type. The attributes supported for entries are described below. offset: - This sets the offset of an entry within the image or section containing - it. The first byte of the image is normally at offset 0. If 'offset' is - not provided, binman sets it to the end of the previous region, or the - start of the image's entry area (normally 0) if there is no previous - region. + This sets the offset of an entry within the image or section containing + it. The first byte of the image is normally at offset 0. If 'offset' is + not provided, binman sets it to the end of the previous region, or the + start of the image's entry area (normally 0) if there is no previous + region. align: - This sets the alignment of the entry. The entry offset is adjusted - so that the entry starts on an aligned boundary within the containing - section or image. For example 'align = <16>' means that the entry will - start on a 16-byte boundary. This may mean that padding is added before - the entry. The padding is part of the containing section but is not - included in the entry, meaning that an empty space may be created before - the entry starts. Alignment should be a power of 2. If 'align' is not - provided, no alignment is performed. + This sets the alignment of the entry. The entry offset is adjusted + so that the entry starts on an aligned boundary within the containing + section or image. For example 'align = <16>' means that the entry will + start on a 16-byte boundary. This may mean that padding is added before + the entry. The padding is part of the containing section but is not + included in the entry, meaning that an empty space may be created before + the entry starts. Alignment should be a power of 2. If 'align' is not + provided, no alignment is performed. size: - This sets the size of the entry. The contents will be padded out to - this size. If this is not provided, it will be set to the size of the - contents. + This sets the size of the entry. The contents will be padded out to + this size. If this is not provided, it will be set to the size of the + contents. pad-before: - Padding before the contents of the entry. Normally this is 0, meaning - that the contents start at the beginning of the entry. This can be used - to offset the entry contents a little. While this does not affect the - contents of the entry within binman itself (the padding is performed - only when its parent section is assembled), the end result will be that - the entry starts with the padding bytes, so may grow. Defaults to 0. + Padding before the contents of the entry. Normally this is 0, meaning + that the contents start at the beginning of the entry. This can be used + to offset the entry contents a little. While this does not affect the + contents of the entry within binman itself (the padding is performed + only when its parent section is assembled), the end result will be that + the entry starts with the padding bytes, so may grow. Defaults to 0. pad-after: - Padding after the contents of the entry. Normally this is 0, meaning - that the entry ends at the last byte of content (unless adjusted by - other properties). This allows room to be created in the image for - this entry to expand later. While this does not affect the contents of - the entry within binman itself (the padding is performed only when its - parent section is assembled), the end result will be that the entry ends - with the padding bytes, so may grow. Defaults to 0. + Padding after the contents of the entry. Normally this is 0, meaning + that the entry ends at the last byte of content (unless adjusted by + other properties). This allows room to be created in the image for + this entry to expand later. While this does not affect the contents of + the entry within binman itself (the padding is performed only when its + parent section is assembled), the end result will be that the entry ends + with the padding bytes, so may grow. Defaults to 0. align-size: - This sets the alignment of the entry size. For example, to ensure - that the size of an entry is a multiple of 64 bytes, set this to 64. - While this does not affect the contents of the entry within binman - itself (the padding is performed only when its parent section is - assembled), the end result is that the entry ends with the padding - bytes, so may grow. If 'align-size' is not provided, no alignment is - performed. + This sets the alignment of the entry size. For example, to ensure + that the size of an entry is a multiple of 64 bytes, set this to 64. + While this does not affect the contents of the entry within binman + itself (the padding is performed only when its parent section is + assembled), the end result is that the entry ends with the padding + bytes, so may grow. If 'align-size' is not provided, no alignment is + performed. align-end: - This sets the alignment of the end of an entry with respect to the - containing section. Some entries require that they end on an alignment - boundary, regardless of where they start. This does not move the start - of the entry, so the contents of the entry will still start at the - beginning. But there may be padding at the end. While this does not - affect the contents of the entry within binman itself (the padding is - performed only when its parent section is assembled), the end result - is that the entry ends with the padding bytes, so may grow. - If 'align-end' is not provided, no alignment is performed. + This sets the alignment of the end of an entry with respect to the + containing section. Some entries require that they end on an alignment + boundary, regardless of where they start. This does not move the start + of the entry, so the contents of the entry will still start at the + beginning. But there may be padding at the end. While this does not + affect the contents of the entry within binman itself (the padding is + performed only when its parent section is assembled), the end result + is that the entry ends with the padding bytes, so may grow. + If 'align-end' is not provided, no alignment is performed. filename: - For 'blob' types this provides the filename containing the binary to - put into the entry. If binman knows about the entry type (like - u-boot-bin), then there is no need to specify this. + For 'blob' types this provides the filename containing the binary to + put into the entry. If binman knows about the entry type (like + u-boot-bin), then there is no need to specify this. type: - Sets the type of an entry. This defaults to the entry name, but it is - possible to use any name, and then add (for example) 'type = "u-boot"' - to specify the type. + Sets the type of an entry. This defaults to the entry name, but it is + possible to use any name, and then add (for example) 'type = "u-boot"' + to specify the type. offset-unset: - Indicates that the offset of this entry should not be set by placing - it immediately after the entry before. Instead, is set by another - entry which knows where this entry should go. When this boolean - property is present, binman will give an error if another entry does - not set the offset (with the GetOffsets() method). + Indicates that the offset of this entry should not be set by placing + it immediately after the entry before. Instead, is set by another + entry which knows where this entry should go. When this boolean + property is present, binman will give an error if another entry does + not set the offset (with the GetOffsets() method). image-pos: - This cannot be set on entry (or at least it is ignored if it is), but - with the -u option, binman will set it to the absolute image position - for each entry. This makes it easy to find out exactly where the entry - ended up in the image, regardless of parent sections, etc. + This cannot be set on entry (or at least it is ignored if it is), but + with the -u option, binman will set it to the absolute image position + for each entry. This makes it easy to find out exactly where the entry + ended up in the image, regardless of parent sections, etc. expand-size: - Expand the size of this entry to fit available space. This space is only - limited by the size of the image/section and the position of the next - entry. + Expand the size of this entry to fit available space. This space is only + limited by the size of the image/section and the position of the next + entry. compress: - Sets the compression algortihm to use (for blobs only). See the entry - documentation for details. + Sets the compression algortihm to use (for blobs only). See the entry + documentation for details. missing-msg: - Sets the tag of the message to show if this entry is missing. This is - used for external blobs. When they are missing it is helpful to show - information about what needs to be fixed. See missing-blob-help for the - message for each tag. + Sets the tag of the message to show if this entry is missing. This is + used for external blobs. When they are missing it is helpful to show + information about what needs to be fixed. See missing-blob-help for the + message for each tag. The attributes supported for images and sections are described below. Several are similar to those for entries. size: - Sets the image size in bytes, for example 'size = <0x100000>' for a - 1MB image. + Sets the image size in bytes, for example 'size = <0x100000>' for a + 1MB image. offset: - This is similar to 'offset' in entries, setting the offset of a section - within the image or section containing it. The first byte of the section - is normally at offset 0. If 'offset' is not provided, binman sets it to - the end of the previous region, or the start of the image's entry area - (normally 0) if there is no previous region. + This is similar to 'offset' in entries, setting the offset of a section + within the image or section containing it. The first byte of the section + is normally at offset 0. If 'offset' is not provided, binman sets it to + the end of the previous region, or the start of the image's entry area + (normally 0) if there is no previous region. align-size: - This sets the alignment of the image size. For example, to ensure - that the image ends on a 512-byte boundary, use 'align-size = <512>'. - If 'align-size' is not provided, no alignment is performed. + This sets the alignment of the image size. For example, to ensure + that the image ends on a 512-byte boundary, use 'align-size = <512>'. + If 'align-size' is not provided, no alignment is performed. pad-before: - This sets the padding before the image entries. The first entry will - be positioned after the padding. This defaults to 0. + This sets the padding before the image entries. The first entry will + be positioned after the padding. This defaults to 0. pad-after: - This sets the padding after the image entries. The padding will be - placed after the last entry. This defaults to 0. + This sets the padding after the image entries. The padding will be + placed after the last entry. This defaults to 0. pad-byte: - This specifies the pad byte to use when padding in the image. It - defaults to 0. To use 0xff, you would add 'pad-byte = <0xff>'. + This specifies the pad byte to use when padding in the image. It + defaults to 0. To use 0xff, you would add 'pad-byte = <0xff>'. filename: - This specifies the image filename. It defaults to 'image.bin'. + This specifies the image filename. It defaults to 'image.bin'. sort-by-offset: - This causes binman to reorder the entries as needed to make sure they - are in increasing positional order. This can be used when your entry - order may not match the positional order. A common situation is where - the 'offset' properties are set by CONFIG options, so their ordering is - not known a priori. + This causes binman to reorder the entries as needed to make sure they + are in increasing positional order. This can be used when your entry + order may not match the positional order. A common situation is where + the 'offset' properties are set by CONFIG options, so their ordering is + not known a priori. - This is a boolean property so needs no value. To enable it, add a - line 'sort-by-offset;' to your description. + This is a boolean property so needs no value. To enable it, add a + line 'sort-by-offset;' to your description. multiple-images: - Normally only a single image is generated. To create more than one - image, put this property in the binman node. For example, this will - create image1.bin containing u-boot.bin, and image2.bin containing - both spl/u-boot-spl.bin and u-boot.bin: - - binman { - multiple-images; - image1 { - u-boot { - }; - }; - - image2 { - spl { - }; - u-boot { - }; - }; - }; + Normally only a single image is generated. To create more than one + image, put this property in the binman node. For example, this will + create image1.bin containing u-boot.bin, and image2.bin containing + both spl/u-boot-spl.bin and u-boot.bin:: + + binman { + multiple-images; + image1 { + u-boot { + }; + }; + + image2 { + spl { + }; + u-boot { + }; + }; + }; end-at-4gb: - For x86 machines the ROM offsets start just before 4GB and extend - up so that the image finished at the 4GB boundary. This boolean - option can be enabled to support this. The image size must be - provided so that binman knows when the image should start. For an - 8MB ROM, the offset of the first entry would be 0xfff80000 with - this option, instead of 0 without this option. + For x86 machines the ROM offsets start just before 4GB and extend + up so that the image finished at the 4GB boundary. This boolean + option can be enabled to support this. The image size must be + provided so that binman knows when the image should start. For an + 8MB ROM, the offset of the first entry would be 0xfff80000 with + this option, instead of 0 without this option. skip-at-start: - This property specifies the entry offset of the first entry. + This property specifies the entry offset of the first entry. - For PowerPC mpc85xx based CPU, CONFIG_SYS_TEXT_BASE is the entry - offset of the first entry. It can be 0xeff40000 or 0xfff40000 for - nor flash boot, 0x201000 for sd boot etc. + For PowerPC mpc85xx based CPU, CONFIG_SYS_TEXT_BASE is the entry + offset of the first entry. It can be 0xeff40000 or 0xfff40000 for + nor flash boot, 0x201000 for sd boot etc. - 'end-at-4gb' property is not applicable where CONFIG_SYS_TEXT_BASE + - Image size != 4gb. + 'end-at-4gb' property is not applicable where CONFIG_SYS_TEXT_BASE + + Image size != 4gb. Examples of the above options can be found in the tests. See the tools/binman/test directory. @@ -470,23 +471,23 @@ This feature provides a way of creating hierarchical images. For example here is an example image with two copies of U-Boot. One is read-only (ro), intended to be written only in the factory. Another is read-write (rw), so that it can be upgraded in the field. The sizes are fixed so that the ro/rw boundary is known -and can be programmed: - - binman { - section@0 { - read-only; - name-prefix = "ro-"; - size = <0x100000>; - u-boot { - }; - }; - section@1 { - name-prefix = "rw-"; - size = <0x100000>; - u-boot { - }; - }; - }; +and can be programmed:: + + binman { + section@0 { + read-only; + name-prefix = "ro-"; + size = <0x100000>; + u-boot { + }; + }; + section@1 { + name-prefix = "rw-"; + size = <0x100000>; + u-boot { + }; + }; + }; This image could be placed into a SPI flash chip, with the protection boundary set at 1MB. @@ -494,14 +495,14 @@ set at 1MB. A few special properties are provided for sections: read-only: - Indicates that this section is read-only. This has no impact on binman's - operation, but his property can be read at run time. + Indicates that this section is read-only. This has no impact on binman's + operation, but his property can be read at run time. name-prefix: - This string is prepended to all the names of the binaries in the - section. In the example above, the 'u-boot' binaries which actually be - renamed to 'ro-u-boot' and 'rw-u-boot'. This can be useful to - distinguish binaries with otherwise identical names. + This string is prepended to all the names of the binaries in the + section. In the example above, the 'u-boot' binaries which actually be + renamed to 'ro-u-boot' and 'rw-u-boot'. This can be useful to + distinguish binaries with otherwise identical names. Image Properties @@ -510,21 +511,21 @@ Image Properties Image nodes act like sections but also have a few extra properties: filename: - Output filename for the image. This defaults to image.bin (or in the - case of multiple images .bin where is the name of - the image node. + Output filename for the image. This defaults to image.bin (or in the + case of multiple images .bin where is the name of + the image node. allow-repack: - Create an image that can be repacked. With this option it is possible - to change anything in the image after it is created, including updating - the position and size of image components. By default this is not - permitted since it is not possibly to know whether this might violate a - constraint in the image description. For example, if a section has to - increase in size to hold a larger binary, that might cause the section - to fall out of its allow region (e.g. read-only portion of flash). + Create an image that can be repacked. With this option it is possible + to change anything in the image after it is created, including updating + the position and size of image components. By default this is not + permitted since it is not possibly to know whether this might violate a + constraint in the image description. For example, if a section has to + increase in size to hold a larger binary, that might cause the section + to fall out of its allow region (e.g. read-only portion of flash). - Adding this property causes the original offset and size values in the - image description to be stored in the FDT and fdtmap. + Adding this property causes the original offset and size values in the + image description to be stored in the FDT and fdtmap. Entry Documentation @@ -533,14 +534,14 @@ Entry Documentation For details on the various entry types supported by binman and how to use them, see README.entries. This is generated from the source code using: - binman entry-docs >tools/binman/README.entries + binman entry-docs >tools/binman/README.entries Listing images -------------- It is possible to list the entries in an existing firmware image created by -binman, provided that there is an 'fdtmap' entry in the image. For example: +binman, provided that there is an 'fdtmap' entry in the image. For example:: $ binman ls -i image.bin Name Image-pos Size Entry-type Offset Uncomp-size @@ -559,7 +560,7 @@ This shows the hierarchy of the image, the position, size and type of each entry, the offset of each entry within its parent and the uncompressed size if the entry is compressed. -It is also possible to list just some files in an image, e.g. +It is also possible to list just some files in an image, e.g.:: $ binman ls -i image.bin section/cbfs Name Image-pos Size Entry-type Offset Uncomp-size @@ -568,7 +569,7 @@ It is also possible to list just some files in an image, e.g. u-boot 138 4 u-boot 38 u-boot-dtb 180 108 u-boot-dtb 80 3b5 -or with wildcards: +or with wildcards:: $ binman ls -i image.bin "*cb*" "*head*" Name Image-pos Size Entry-type Offset Uncomp-size @@ -583,22 +584,22 @@ Extracting files from images ---------------------------- You can extract files from an existing firmware image created by binman, -provided that there is an 'fdtmap' entry in the image. For example: +provided that there is an 'fdtmap' entry in the image. For example:: $ binman extract -i image.bin section/cbfs/u-boot which will write the uncompressed contents of that entry to the file 'u-boot' in the current directory. You can also extract to a particular file, in this case -u-boot.bin: +u-boot.bin:: $ binman extract -i image.bin section/cbfs/u-boot -f u-boot.bin It is possible to extract all files into a destination directory, which will -put files in subdirectories matching the entry hierarchy: +put files in subdirectories matching the entry hierarchy:: $ binman extract -i image.bin -O outdir -or just a selection: +or just a selection:: $ binman extract -i image.bin "*u-boot*" -O outdir @@ -616,18 +617,18 @@ to the that entry, compressing if necessary. If the entry size changes, you must add the 'allow-repack' property to the original image before generating it (see above), otherwise you will get an error. -You can also use a particular file, in this case u-boot.bin: +You can also use a particular file, in this case u-boot.bin:: $ binman replace -i image.bin section/cbfs/u-boot -f u-boot.bin It is possible to replace all files from a source directory which uses the same -hierarchy as the entries: +hierarchy as the entries:: $ binman replace -i image.bin -I indir Files that are missing will generate a warning. -You can also replace just a selection of entries: +You can also replace just a selection of entries:: $ binman replace -i image.bin "*u-boot*" -I indir @@ -656,15 +657,15 @@ Hashing Entries --------------- It is possible to ask binman to hash the contents of an entry and write that -value back to the device-tree node. For example: +value back to the device-tree node. For example:: - binman { - u-boot { - hash { - algo = "sha256"; - }; - }; - }; + binman { + u-boot { + hash { + algo = "sha256"; + }; + }; + }; Here, a new 'value' property will be written to the 'hash' node containing the hash of the 'u-boot' entry. Only SHA256 is supported at present. Whole @@ -759,7 +760,7 @@ a common header. You can then put the binman node (and anything else that is specific to U-Boot, such as u-boot,dm-pre-reloc properies) in that header file. -Binman will search for the following files in arch//dts: +Binman will search for the following files in arch//dts:: -u-boot.dtsi where is the base name of the .dts file -u-boot.dtsi @@ -770,7 +771,7 @@ Binman will search for the following files in arch//dts: U-Boot will only use the first one that it finds. If you need to include a more general file you can do that from the more specific file using #include. If you are having trouble figuring out what is going on, you can uncomment -the 'warning' line in scripts/Makefile.lib to see what it has found: +the 'warning' line in scripts/Makefile.lib to see what it has found:: # Uncomment for debugging # This shows all the files that were considered and the one that we chose. @@ -786,13 +787,13 @@ is useful to be able to find the location of U-Boot so that it can be executed when SPL is finished. Binman allows you to declare symbols in the SPL image which are filled in -with their correct values during the build. For example: +with their correct values during the build. For example:: binman_sym_declare(ulong, u_boot_any, image_pos); declares a ulong value which will be assigned to the image-pos of any U-Boot image (u-boot.bin, u-boot.img, u-boot-nodtb.bin) that is present in the image. -You can access this value with something like: +You can access this value with something like:: ulong u_boot_offset = binman_sym(ulong, u_boot_any, image_pos); @@ -844,18 +845,18 @@ Expanded entries ---------------- Binman automatically replaces 'u-boot' with an expanded version of that, i.e. -'u-boot-expanded'. This means that when you write: +'u-boot-expanded'. This means that when you write:: u-boot { }; -you actually get: +you actually get:: u-boot { type = "u-boot-expanded'; }; -which in turn expands to: +which in turn expands to:: u-boot { type = "section"; @@ -879,19 +880,19 @@ U-Boot executable and can be updated separately by binman as needed. It can be disabled with the --no-expanded flag if required. The same applies for u-boot-spl and u-boot-spl. In those cases, the expansion -includes the BSS padding, so for example: +includes the BSS padding, so for example:: spl { type = "u-boot-spl" }; -you actually get: +you actually get:: spl { type = "u-boot-expanded'; }; -which in turn expands to: +which in turn expands to:: spl { type = "section"; @@ -921,7 +922,7 @@ Compression ----------- Binman support compression for 'blob' entries (those of type 'blob' and -derivatives). To enable this for an entry, add a 'compress' property: +derivatives). To enable this for an entry, add a 'compress' property:: blob { filename = "datafile"; @@ -946,7 +947,7 @@ Map files --------- The -m option causes binman to output a .map file for each image that it -generates. This shows the offset and size of each entry. For example: +generates. This shows the offset and size of each entry. For example:: Offset Size Name 00000000 00000028 main-section @@ -969,11 +970,11 @@ Sometimes it is useful to pass binman the value of an entry property from the command line. For example some entries need access to files and it is not always convenient to put these filenames in the image definition (device tree). -The-a option supports this: +The-a option supports this:: -a= -where +where:: is the property to set is the value to set it to @@ -1004,7 +1005,7 @@ Code coverage Binman is a critical tool and is designed to be very testable. Entry implementations target 100% test coverage. Run 'binman test -T' to check this. -To enable Python test coverage on Debian-type distributions (e.g. Ubuntu): +To enable Python test coverage on Debian-type distributions (e.g. Ubuntu):: $ sudo apt-get install python-coverage python3-coverage python-pytest @@ -1015,7 +1016,7 @@ Concurrent tests Binman tries to run tests concurrently. This means that the tests make use of all available CPUs to run. - To enable this: + To enable this:: $ sudo apt-get install python-subunit python3-subunit @@ -1038,11 +1039,11 @@ Binman's tests have been written under the assumption that they'll be run on a x86-like host and there hasn't been an attempt to make them portable yet. However, it's possible to run the tests by cross-compiling to x86. -To install an x86 cross-compiler on Debian-type distributions (e.g. Ubuntu): +To install an x86 cross-compiler on Debian-type distributions (e.g. Ubuntu):: $ sudo apt-get install gcc-x86-64-linux-gnu -Then, you can run the tests under cross-compilation: +Then, you can run the tests under cross-compilation:: $ CROSS_COMPILE=x86_64-linux-gnu- binman test -T @@ -1078,13 +1079,13 @@ the DTC environment variable. This can be useful when the system dtc is too old. To enable a full backtrace and other debugging features in binman, pass -BINMAN_DEBUG=1 to your build: +BINMAN_DEBUG=1 to your build:: make qemu-x86_defconfig make BINMAN_DEBUG=1 To enable verbose logging from binman, base BINMAN_VERBOSE to your build, which -adds a -v option to the call to binman: +adds a -v option to the call to binman:: make qemu-x86_defconfig make BINMAN_VERBOSE=5 @@ -1124,6 +1125,7 @@ To do ----- Some ideas: + - Use of-platdata to make the information available to code that is unable to use device tree (such as a very small SPL image) - Allow easy building of images by specifying just the board name diff --git a/tools/binman/control.py b/tools/binman/control.py index 9709aa9a2b2..f57e34daaaa 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -569,7 +569,7 @@ def Binman(args): if not pager: pager = 'more' fname = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), - 'README') + 'README.rst') command.Run(pager, fname) return 0 diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 2638408246f..df72bb89604 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -631,7 +631,7 @@ class TestFunctional(unittest.TestCase): def testFullHelp(self): """Test that the full help is displayed with -H""" result = self._RunBinman('-H') - help_file = os.path.join(self._binman_dir, 'README') + help_file = os.path.join(self._binman_dir, 'README.rst') # Remove possible extraneous strings extra = '::::::::::::::\n' + help_file + '\n::::::::::::::\n' gothelp = result.stdout.replace(extra, '') @@ -644,7 +644,7 @@ class TestFunctional(unittest.TestCase): try: command.test_result = command.CommandResult() result = self._DoBinman('-H') - help_file = os.path.join(self._binman_dir, 'README') + help_file = os.path.join(self._binman_dir, 'README.rst') finally: command.test_result = None diff --git a/tools/binman/index.rst b/tools/binman/index.rst new file mode 100644 index 00000000000..6eef7b5d050 --- /dev/null +++ b/tools/binman/index.rst @@ -0,0 +1,9 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Binman +====== + +.. toctree:: + :maxdepth: 2 + + README diff --git a/tools/binman/setup.py b/tools/binman/setup.py index fe408ed6911..2dad43d4937 100644 --- a/tools/binman/setup.py +++ b/tools/binman/setup.py @@ -7,6 +7,6 @@ setup(name='binman', scripts=['binman'], packages=['binman', 'binman.etype'], package_dir={'binman': ''}, - package_data={'binman': ['README', 'README.entries']}, + package_data={'binman': ['README.rst', 'README.entries']}, classifiers=['Environment :: Console', 'Topic :: Software Development :: Embedded Systems']) From patchwork Sun Mar 7 19:31:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448741 X-Patchwork-Delegate: sjg@chromium.org 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=i20PGi6v; 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 4DtsBG2Z67z9sW5 for ; Mon, 8 Mar 2021 06:35:02 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5B17C828A4; Sun, 7 Mar 2021 20:32:43 +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="i20PGi6v"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8BE6C8283C; Sun, 7 Mar 2021 20:32:19 +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-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) (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 93AB3827E3 for ; Sun, 7 Mar 2021 20:32:10 +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-x235.google.com with SMTP id d20so8739508oiw.10 for ; Sun, 07 Mar 2021 11:32:10 -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=tbXG2J6/OCBhJT6SaEia/fuYhZFv+r/sIzP8dWFJuPo=; b=i20PGi6vzri0BHcouzUGMbITh4rxKC7y/jVFV/KEVdHSdq1QVdKI9B4rOaRdyGdtg5 tLBvLK2lnzuVr+ZPItkG2euooGDMSsqNe/Jm6Cf+9ms9H+KFZLHXV/kdekmXkul/EG7B lLRxgK35vldcR18vzPiq9FJwV5GomOCsIuP5E= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=tbXG2J6/OCBhJT6SaEia/fuYhZFv+r/sIzP8dWFJuPo=; b=MVNBYr3M10lwb+UGb+vc6QS9mEH6RyZi2kYqnAiN9DqKIE29SwVI1BBTMbQu01ctEi RjfwObebH3me7k9TxkcNg2ZprEUd7c6jh2Km7gMbXpVlSF1htkEFwce7CC3xd0Oyrczz q59mrp9NhlTwjAkB4LzCkM2qnxu5rGzaI80vEt43ZgaJQWxqUyDlTmefCMu+MX5CiFfX JBBProLezAeR800aHiPaI4EBEal6i7r4eBxGh4UzJGENuRZp/t3FHTzIH5zEkMuJOBv0 uxDfDsGkGk5vHUq+ZHlXE4xBFDejM0RS5rovvYa36f6NqRuhCVwsDfqKUQY068f1XiI2 /NOw== X-Gm-Message-State: AOAM530tyZxt8NHm/l/w/KfDcUHje7CKKHj0tN3XnMtPvJPMm3Eewts4 ldSGcro6EVgZ5xLPwJTusBp0xetrpIEe32nm X-Google-Smtp-Source: ABdhPJw7JkwVedkt1zby5J7c+HGYgpCsEuKgSJHdCG7orzB+zdjd9ivVWkZYfzuBuDJ2d9nsrP3Xzg== X-Received: by 2002:aca:ba02:: with SMTP id k2mr15394077oif.60.1615145528684; Sun, 07 Mar 2021 11:32:08 -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.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:32:08 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH 17/20] binman: Rearrange documentation into headings Date: Sun, 7 Mar 2021 12:31:44 -0700 Message-Id: <20210307193148.1513733-18-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 Collect the material into different top-level headings to make it easier to read. Signed-off-by: Simon Glass --- tools/binman/README.rst | 523 ++++++++++++++++++++-------------------- 1 file changed, 266 insertions(+), 257 deletions(-) diff --git a/tools/binman/README.rst b/tools/binman/README.rst index 8d06aa91287..9348a3e8e1d 100644 --- a/tools/binman/README.rst +++ b/tools/binman/README.rst @@ -2,7 +2,7 @@ # Copyright (c) 2016 Google, Inc Introduction ------------- +============ Firmware often consists of several components which must be packaged together. For example, we may have SPL, U-Boot, a device tree and an environment area @@ -137,6 +137,9 @@ the boundaries between building input files (mkimage) and packaging then into a final image (binman). +Using binman +============ + Example use of binman in U-Boot ------------------------------- @@ -230,8 +233,111 @@ You can use other, more specific CONFIG options - see 'Automatic .dtsi inclusion' below. +Access to binman entry offsets at run time (symbols) +---------------------------------------------------- + +Binman assembles images and determines where each entry is placed in the image. +This information may be useful to U-Boot at run time. For example, in SPL it +is useful to be able to find the location of U-Boot so that it can be executed +when SPL is finished. + +Binman allows you to declare symbols in the SPL image which are filled in +with their correct values during the build. For example:: + + binman_sym_declare(ulong, u_boot_any, image_pos); + +declares a ulong value which will be assigned to the image-pos of any U-Boot +image (u-boot.bin, u-boot.img, u-boot-nodtb.bin) that is present in the image. +You can access this value with something like:: + + ulong u_boot_offset = binman_sym(ulong, u_boot_any, image_pos); + +Thus u_boot_offset will be set to the image-pos of U-Boot in memory, assuming +that the whole image has been loaded, or is available in flash. You can then +jump to that address to start U-Boot. + +At present this feature is only supported in SPL and TPL. In principle it is +possible to fill in such symbols in U-Boot proper, as well, but a future C +library is planned for this instead, to read from the device tree. + +As well as image-pos, it is possible to read the size of an entry and its +offset (which is the start position of the entry within its parent). + +A small technical note: Binman automatically adds the base address of the image +(i.e. __image_copy_start) to the value of the image-pos symbol, so that when the +image is loaded to its linked address, the value will be correct and actually +point into the image. + +For example, say SPL is at the start of the image and linked to start at address +80108000. If U-Boot's image-pos is 0x8000 then binman will write an image-pos +for U-Boot of 80110000 into the SPL binary, since it assumes the image is loaded +to 80108000, with SPL at 80108000 and U-Boot at 80110000. + +For x86 devices (with the end-at-4gb property) this base address is not added +since it is assumed that images are XIP and the offsets already include the +address. + + +Access to binman entry offsets at run time (fdt) +------------------------------------------------ + +Binman can update the U-Boot FDT to include the final position and size of +each entry in the images it processes. The option to enable this is -u and it +causes binman to make sure that the 'offset', 'image-pos' and 'size' properties +are set correctly for every entry. Since it is not necessary to specify these in +the image definition, binman calculates the final values and writes these to +the device tree. These can be used by U-Boot at run-time to find the location +of each entry. + +Alternatively, an FDT map entry can be used to add a special FDT containing +just the information about the image. This is preceded by a magic string so can +be located anywhere in the image. An image header (typically at the start or end +of the image) can be used to point to the FDT map. See fdtmap and image-header +entries for more information. + + +Map files +--------- + +The -m option causes binman to output a .map file for each image that it +generates. This shows the offset and size of each entry. For example:: + + Offset Size Name + 00000000 00000028 main-section + 00000000 00000010 section@0 + 00000000 00000004 u-boot + 00000010 00000010 section@1 + 00000000 00000004 u-boot + +This shows a hierarchical image with two sections, each with a single entry. The +offsets of the sections are absolute hex byte offsets within the image. The +offsets of the entries are relative to their respective sections. The size of +each entry is also shown, in bytes (hex). The indentation shows the entries +nested inside their sections. + + +Passing command-line arguments to entries +----------------------------------------- + +Sometimes it is useful to pass binman the value of an entry property from the +command line. For example some entries need access to files and it is not +always convenient to put these filenames in the image definition (device tree). + +The-a option supports this:: + + -a= + +where:: + + is the property to set + is the value to set it to + +Not all properties can be provided this way. Only some entries support it, +typically for filenames. + + Image description format ------------------------- +======================== The binman node is called 'binman'. An example image description is shown below:: @@ -528,6 +634,157 @@ allow-repack: image description to be stored in the FDT and fdtmap. +Hashing Entries +--------------- + +It is possible to ask binman to hash the contents of an entry and write that +value back to the device-tree node. For example:: + + binman { + u-boot { + hash { + algo = "sha256"; + }; + }; + }; + +Here, a new 'value' property will be written to the 'hash' node containing +the hash of the 'u-boot' entry. Only SHA256 is supported at present. Whole +sections can be hased if desired, by adding the 'hash' node to the section. + +The has value can be chcked at runtime by hashing the data actually read and +comparing this has to the value in the device tree. + + +Expanded entries +---------------- + +Binman automatically replaces 'u-boot' with an expanded version of that, i.e. +'u-boot-expanded'. This means that when you write:: + + u-boot { + }; + +you actually get:: + + u-boot { + type = "u-boot-expanded'; + }; + +which in turn expands to:: + + u-boot { + type = "section"; + + u-boot-nodtb { + }; + + u-boot-dtb { + }; + }; + +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. + +The above feature ensures that the devicetree is clearly separated from the +U-Boot executable and can be updated separately by binman as needed. It can be +disabled with the --no-expanded flag if required. + +The same applies for u-boot-spl and u-boot-spl. In those cases, the expansion +includes the BSS padding, so for example:: + + spl { + type = "u-boot-spl" + }; + +you actually get:: + + spl { + type = "u-boot-expanded'; + }; + +which in turn expands to:: + + spl { + type = "section"; + + u-boot-spl-nodtb { + }; + + u-boot-spl-bss-pad { + }; + + u-boot-spl-dtb { + }; + }; + +Of course we should not expand SPL if it has no devicetree. Also if the BSS +padding is not needed (because BSS is in RAM as with CONFIG_SPL_SEPARATE_BSS), +the 'u-boot-spl-bss-pad' subnode should not be created. The use of the expaned +entry type is controlled by the UseExpanded() method. In the SPL case it checks +the 'spl-dtb' entry arg, which is 'y' or '1' if SPL has a devicetree. + +For the BSS case, a 'spl-bss-pad' entry arg controls whether it is present. All +entry args are provided by the U-Boot Makefile. + + +Compression +----------- + +Binman support compression for 'blob' entries (those of type 'blob' and +derivatives). To enable this for an entry, add a 'compress' property:: + + blob { + filename = "datafile"; + compress = "lz4"; + }; + +The entry will then contain the compressed data, using the 'lz4' compression +algorithm. Currently this is the only one that is supported. The uncompressed +size is written to the node in an 'uncomp-size' property, if -u is used. + +Compression is also supported for sections. In that case the entire section is +compressed in one block, including all its contents. This means that accessing +an entry from the section required decompressing the entire section. Also, the +size of a section indicates the space that it consumes in its parent section +(and typically the image). With compression, the section may contain more data, +and the uncomp-size property indicates that, as above. The contents of the +section is compressed first, before any padding is added. This ensures that the +padding itself is not compressed, which would be a waste of time. + + +Automatic .dtsi inclusion +------------------------- + +It is sometimes inconvenient to add a 'binman' node to the .dts file for each +board. This can be done by using #include to bring in a common file. Another +approach supported by the U-Boot build system is to automatically include +a common header. You can then put the binman node (and anything else that is +specific to U-Boot, such as u-boot,dm-pre-reloc properies) in that header +file. + +Binman will search for the following files in arch//dts:: + + -u-boot.dtsi where is the base name of the .dts file + -u-boot.dtsi + -u-boot.dtsi + -u-boot.dtsi + u-boot.dtsi + +U-Boot will only use the first one that it finds. If you need to include a +more general file you can do that from the more specific file using #include. +If you are having trouble figuring out what is going on, you can uncomment +the 'warning' line in scripts/Makefile.lib to see what it has found:: + + # Uncomment for debugging + # This shows all the files that were considered and the one that we chose. + # u_boot_dtsi_options_debug = $(u_boot_dtsi_options_raw) + + Entry Documentation ------------------- @@ -537,6 +794,9 @@ see README.entries. This is generated from the source code using: binman entry-docs >tools/binman/README.entries +Managing images +=============== + Listing images -------------- @@ -653,27 +913,9 @@ by increasing the -v/--verbosity from the default of 1: You can use BINMAN_VERBOSE=5 (for example) when building to select this. -Hashing Entries ---------------- - -It is possible to ask binman to hash the contents of an entry and write that -value back to the device-tree node. For example:: - - binman { - u-boot { - hash { - algo = "sha256"; - }; - }; - }; - -Here, a new 'value' property will be written to the 'hash' node containing -the hash of the 'u-boot' entry. Only SHA256 is supported at present. Whole -sections can be hased if desired, by adding the 'hash' node to the section. - -The has value can be chcked at runtime by hashing the data actually read and -comparing this has to the value in the device tree. +Technical details +================= Order of image creation ----------------------- @@ -750,239 +992,6 @@ what happens in this stage. final step. -Automatic .dtsi inclusion -------------------------- - -It is sometimes inconvenient to add a 'binman' node to the .dts file for each -board. This can be done by using #include to bring in a common file. Another -approach supported by the U-Boot build system is to automatically include -a common header. You can then put the binman node (and anything else that is -specific to U-Boot, such as u-boot,dm-pre-reloc properies) in that header -file. - -Binman will search for the following files in arch//dts:: - - -u-boot.dtsi where is the base name of the .dts file - -u-boot.dtsi - -u-boot.dtsi - -u-boot.dtsi - u-boot.dtsi - -U-Boot will only use the first one that it finds. If you need to include a -more general file you can do that from the more specific file using #include. -If you are having trouble figuring out what is going on, you can uncomment -the 'warning' line in scripts/Makefile.lib to see what it has found:: - - # Uncomment for debugging - # This shows all the files that were considered and the one that we chose. - # u_boot_dtsi_options_debug = $(u_boot_dtsi_options_raw) - - -Access to binman entry offsets at run time (symbols) ----------------------------------------------------- - -Binman assembles images and determines where each entry is placed in the image. -This information may be useful to U-Boot at run time. For example, in SPL it -is useful to be able to find the location of U-Boot so that it can be executed -when SPL is finished. - -Binman allows you to declare symbols in the SPL image which are filled in -with their correct values during the build. For example:: - - binman_sym_declare(ulong, u_boot_any, image_pos); - -declares a ulong value which will be assigned to the image-pos of any U-Boot -image (u-boot.bin, u-boot.img, u-boot-nodtb.bin) that is present in the image. -You can access this value with something like:: - - ulong u_boot_offset = binman_sym(ulong, u_boot_any, image_pos); - -Thus u_boot_offset will be set to the image-pos of U-Boot in memory, assuming -that the whole image has been loaded, or is available in flash. You can then -jump to that address to start U-Boot. - -At present this feature is only supported in SPL and TPL. In principle it is -possible to fill in such symbols in U-Boot proper, as well, but a future C -library is planned for this instead, to read from the device tree. - -As well as image-pos, it is possible to read the size of an entry and its -offset (which is the start position of the entry within its parent). - -A small technical note: Binman automatically adds the base address of the image -(i.e. __image_copy_start) to the value of the image-pos symbol, so that when the -image is loaded to its linked address, the value will be correct and actually -point into the image. - -For example, say SPL is at the start of the image and linked to start at address -80108000. If U-Boot's image-pos is 0x8000 then binman will write an image-pos -for U-Boot of 80110000 into the SPL binary, since it assumes the image is loaded -to 80108000, with SPL at 80108000 and U-Boot at 80110000. - -For x86 devices (with the end-at-4gb property) this base address is not added -since it is assumed that images are XIP and the offsets already include the -address. - - -Access to binman entry offsets at run time (fdt) ------------------------------------------------- - -Binman can update the U-Boot FDT to include the final position and size of -each entry in the images it processes. The option to enable this is -u and it -causes binman to make sure that the 'offset', 'image-pos' and 'size' properties -are set correctly for every entry. Since it is not necessary to specify these in -the image definition, binman calculates the final values and writes these to -the device tree. These can be used by U-Boot at run-time to find the location -of each entry. - -Alternatively, an FDT map entry can be used to add a special FDT containing -just the information about the image. This is preceded by a magic string so can -be located anywhere in the image. An image header (typically at the start or end -of the image) can be used to point to the FDT map. See fdtmap and image-header -entries for more information. - - -Expanded entries ----------------- - -Binman automatically replaces 'u-boot' with an expanded version of that, i.e. -'u-boot-expanded'. This means that when you write:: - - u-boot { - }; - -you actually get:: - - u-boot { - type = "u-boot-expanded'; - }; - -which in turn expands to:: - - u-boot { - type = "section"; - - u-boot-nodtb { - }; - - u-boot-dtb { - }; - }; - -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. - -The above feature ensures that the devicetree is clearly separated from the -U-Boot executable and can be updated separately by binman as needed. It can be -disabled with the --no-expanded flag if required. - -The same applies for u-boot-spl and u-boot-spl. In those cases, the expansion -includes the BSS padding, so for example:: - - spl { - type = "u-boot-spl" - }; - -you actually get:: - - spl { - type = "u-boot-expanded'; - }; - -which in turn expands to:: - - spl { - type = "section"; - - u-boot-spl-nodtb { - }; - - u-boot-spl-bss-pad { - }; - - u-boot-spl-dtb { - }; - }; - - -Of course we should not expand SPL if it has no devicetree. Also if the BSS -padding is not needed (because BSS is in RAM as with CONFIG_SPL_SEPARATE_BSS), -the 'u-boot-spl-bss-pad' subnode should not be created. The use of the expaned -entry type is controlled by the UseExpanded() method. In the SPL case it checks -the 'spl-dtb' entry arg, which is 'y' or '1' if SPL has a devicetree. - -For the BSS case, a 'spl-bss-pad' entry arg controls whether it is present. All -entry args are provided by the U-Boot Makefile. - - -Compression ------------ - -Binman support compression for 'blob' entries (those of type 'blob' and -derivatives). To enable this for an entry, add a 'compress' property:: - - blob { - filename = "datafile"; - compress = "lz4"; - }; - -The entry will then contain the compressed data, using the 'lz4' compression -algorithm. Currently this is the only one that is supported. The uncompressed -size is written to the node in an 'uncomp-size' property, if -u is used. - -Compression is also supported for sections. In that case the entire section is -compressed in one block, including all its contents. This means that accessing -an entry from the section required decompressing the entire section. Also, the -size of a section indicates the space that it consumes in its parent section -(and typically the image). With compression, the section may contain more data, -and the uncomp-size property indicates that, as above. The contents of the -section is compressed first, before any padding is added. This ensures that the -padding itself is not compressed, which would be a waste of time. - - -Map files ---------- - -The -m option causes binman to output a .map file for each image that it -generates. This shows the offset and size of each entry. For example:: - - Offset Size Name - 00000000 00000028 main-section - 00000000 00000010 section@0 - 00000000 00000004 u-boot - 00000010 00000010 section@1 - 00000000 00000004 u-boot - -This shows a hierarchical image with two sections, each with a single entry. The -offsets of the sections are absolute hex byte offsets within the image. The -offsets of the entries are relative to their respective sections. The size of -each entry is also shown, in bytes (hex). The indentation shows the entries -nested inside their sections. - - -Passing command-line arguments to entries ------------------------------------------ - -Sometimes it is useful to pass binman the value of an entry property from the -command line. For example some entries need access to files and it is not -always convenient to put these filenames in the image definition (device tree). - -The-a option supports this:: - - -a= - -where:: - - is the property to set - is the value to set it to - -Not all properties can be provided this way. Only some entries support it, -typically for filenames. - - External tools -------------- @@ -1050,8 +1059,8 @@ Then, you can run the tests under cross-compilation:: You can also use gcc-i686-linux-gnu similar to the above. -Advanced Features / Technical docs ----------------------------------- +Writing new entries and debugging +--------------------------------- The behaviour of entries is defined by the Entry class. All other entries are a subclass of this. An important subclass is Entry_blob which takes binary From patchwork Sun Mar 7 19:31:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448743 X-Patchwork-Delegate: sjg@chromium.org 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=GEYnDv6g; 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 4DtsBf2jkpz9sW5 for ; Mon, 8 Mar 2021 06:35:22 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8CF3F827AB; Sun, 7 Mar 2021 20:32:48 +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="GEYnDv6g"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8DB5282842; Sun, 7 Mar 2021 20:32:20 +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-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (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 D6A0F8281E for ; Sun, 7 Mar 2021 20:32:11 +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-x22a.google.com with SMTP id d20so8739554oiw.10 for ; Sun, 07 Mar 2021 11:32:11 -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=6JD8Kd+zm5+Cks7wBuNi4blxTZJaVkdG+07AiWghDvs=; b=GEYnDv6g6KCNeherl2HSrC9q68mnUilsTBOXS2MdELRZ53OzlM7ihmbiuCs9mTYkEk 6LiIwfxs2Q6LNAOyj9CvTsRXeKf4CAMMhitVKy9Scu/vNaMT8AZAoWFHxPu6Q8BugSdJ 43ZjtJSeQaGwvNHEkGELgPjHslSbfKFdaPRoU= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=6JD8Kd+zm5+Cks7wBuNi4blxTZJaVkdG+07AiWghDvs=; b=ZP88IvXsDDH8GRsDZd7mpY0c9HoPSCJcGzK+Op8x1ozbxjgAVoDWgU6DsMhusxd4Gb LUeddZuIlrDVDjzJ9O2ogdcr5keEvtEFXMDcuqECXs8W9dbsk+0E3ppEBxNr+kLoqjYD JCqgUHpCviXbsI6DOt61IXd4VuVw84R11WqzR4KKn8YOti32SOYn/X8keWbaaPlJzIiy 0X2cbb/p8OH2tIet1mse5DfUZb2dWtFmBaJ6G1JMgdf41NkaHxmF2ezwNl2bEK4lYzmE TyO/62VtdGSGaYPT0hw2ybgrRSGxyR3PdH3EzkhC8E30NvJuvaJQnPCV6ihhaIAQgWQv 9Q3Q== X-Gm-Message-State: AOAM533lSEXcJ4liY9999e/YQRCBpF9FGzElCHgKPy2wo3F4ruodiAml RwrCadle/ltv1vxvJaMTKoAJEDfUZk4OI3Pb X-Google-Smtp-Source: ABdhPJwmRklEr+/Ps/fjss3iwHoi/ucUOfwCNKEHPMbjNPzx/lM7SJTCDVgJ4V9SGh5rIYxG7pW8eg== X-Received: by 2002:a54:4007:: with SMTP id x7mr15720791oie.87.1615145529861; Sun, 07 Mar 2021 11:32:09 -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.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:32:09 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Alper Nebi Yasak , Bin Meng , Jagan Teki , Patrick Wildt , Samuel Holland Subject: [PATCH 18/20] binman: Incorporate entry documentation Date: Sun, 7 Mar 2021 12:31:45 -0700 Message-Id: <20210307193148.1513733-19-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 Update this to avoid sphinx warnings and incorporate it into the new documentaiton tree. Signed-off-by: Simon Glass --- tools/binman/README.rst | 11 ++- tools/binman/cmdline.py | 2 +- tools/binman/{README.entries => entries.rst} | 79 +++++++++++--------- tools/binman/etype/cbfs.py | 10 +-- tools/binman/etype/fdtmap.py | 30 ++++---- tools/binman/etype/fit.py | 19 +++-- tools/binman/etype/intel_ifwi.py | 8 +- tools/binman/etype/mkimage.py | 2 +- tools/binman/etype/section.py | 6 +- tools/binman/etype/text.py | 6 +- tools/binman/setup.py | 2 +- 11 files changed, 95 insertions(+), 80 deletions(-) rename tools/binman/{README.entries => entries.rst} (97%) diff --git a/tools/binman/README.rst b/tools/binman/README.rst index 9348a3e8e1d..5df5de4d8e3 100644 --- a/tools/binman/README.rst +++ b/tools/binman/README.rst @@ -786,12 +786,17 @@ the 'warning' line in scripts/Makefile.lib to see what it has found:: Entry Documentation -------------------- +=================== For details on the various entry types supported by binman and how to use them, -see README.entries. This is generated from the source code using: +see entries.rst which is generated from the source code using: + + binman entry-docs >tools/binman/entries.rst + +.. toctree:: + :maxdepth: 2 - binman entry-docs >tools/binman/README.entries + entries.rst Managing images diff --git a/tools/binman/cmdline.py b/tools/binman/cmdline.py index 0c0f48951f6..95f9ba27fbd 100644 --- a/tools/binman/cmdline.py +++ b/tools/binman/cmdline.py @@ -69,7 +69,7 @@ controlled by a description in the board device tree.''' default=False, help='Update the binman node with offset/size info') entry_parser = subparsers.add_parser('entry-docs', - help='Write out entry documentation (see README.entries)') + help='Write out entry documentation (see entries.rst)') list_parser = subparsers.add_parser('ls', help='List files in an image') list_parser.add_argument('-i', '--image', type=str, required=True, diff --git a/tools/binman/README.entries b/tools/binman/entries.rst similarity index 97% rename from tools/binman/README.entries rename to tools/binman/entries.rst index b5032381c7f..cb89570d5b2 100644 --- a/tools/binman/README.entries +++ b/tools/binman/entries.rst @@ -106,7 +106,7 @@ is not used, it supports compression and storing ELF files. CBFS is used by coreboot as its way of orgnanising SPI-flash contents. -The contents of the CBFS are defined by subnodes of the cbfs entry, e.g.: +The contents of the CBFS are defined by subnodes of the cbfs entry, e.g.:: cbfs { size = <0x100000>; @@ -122,7 +122,7 @@ This creates a CBFS 1MB in size two files in it: u-boot.bin and u-boot.dtb. Note that the size is required since binman does not support calculating it. The contents of each entry is just what binman would normally provide if it were not a CBFS node. A blob type can be used to import arbitrary files as -with the second subnode below: +with the second subnode below:: cbfs { size = <0x100000>; @@ -168,7 +168,7 @@ cbfs-type: This is an ELF file that has been loaded (i.e. mapped to memory), so appears in the CBFS as a flat binary. The input file must be an ELF image, for example this puts "u-boot" (the ELF image) into a 'stage' - entry: + entry:: cbfs { size = <0x100000>; @@ -178,7 +178,7 @@ cbfs-type: }; }; - You can use your own ELF file with something like: + You can use your own ELF file with something like:: cbfs { size = <0x100000>; @@ -211,7 +211,7 @@ not support other file types (e.g. payload), adding multiple files (like the particular offset in the CBFS and a few other things. Of course binman can create images containing multiple CBFSs, simply by -defining these in the binman config: +defining these in the binman config:: binman { @@ -279,24 +279,24 @@ sizes are included. Note that the -u option must be provided to ensure that binman updates the FDT with the position of each entry. -Example output for a simple image with U-Boot and an FDT map: +Example output for a simple image with U-Boot and an FDT map:: -/ { - image-name = "binman"; - size = <0x00000112>; - image-pos = <0x00000000>; - offset = <0x00000000>; - u-boot { - size = <0x00000004>; + / { + image-name = "binman"; + size = <0x00000112>; image-pos = <0x00000000>; offset = <0x00000000>; + u-boot { + size = <0x00000004>; + image-pos = <0x00000000>; + offset = <0x00000000>; + }; + fdtmap { + size = <0x0000010e>; + image-pos = <0x00000004>; + offset = <0x00000004>; + }; }; - fdtmap { - size = <0x0000010e>; - image-pos = <0x00000004>; - offset = <0x00000004>; - }; -}; If allow-repack is used then 'orig-offset' and 'orig-size' properties are added as necessary. See the binman README. @@ -344,7 +344,7 @@ input provided. Nodes for the FIT should be written out in the binman configuration just as they would be in a file passed to mkimage. -For example, this creates an image containing a FIT with U-Boot SPL: +For example, this creates an image containing a FIT with U-Boot SPL:: binman { fit { @@ -374,7 +374,7 @@ that you want to generates nodes for two files: file1.dtb and file2.dtb The fit,fdt-list property (see above) indicates that of-list should be used. If the property is missing you will get an error. -Then add a 'generator node', a node with a name starting with '@': +Then add a 'generator node', a node with a name starting with '@':: images { @fdt-SEQ { @@ -389,7 +389,7 @@ files. All the properties you specify will be included in the node. This node acts like a template to generate the nodes. The generator node itself does not appear in the output - it is replaced with what binman generates. -You can create config nodes in a similar way: +You can create config nodes in a similar way:: configurations { default = "@config-DEFAULT-SEQ"; @@ -406,8 +406,10 @@ each of your two files. Available substitutions for '@' nodes are: - SEQ Sequence number of the generated fdt (1, 2, ...) - NAME Name of the dtb as provided (i.e. without adding '.dtb') +SEQ: + Sequence number of the generated fdt (1, 2, ...) +NAME + Name of the dtb as provided (i.e. without adding '.dtb') Note that if no devicetree files are provided (with '-a of-list' as above) then no nodes will be generated. @@ -416,10 +418,11 @@ The 'default' property, if present, will be automatically set to the name if of configuration whose devicetree matches the 'default-dt' entry argument, e.g. with '-a default-dt=sun50i-a64-pine64-lts'. -Available substitutions for '@' property values are: +Available substitutions for '@' property values are - DEFAULT-SEQ Sequence number of the default fdt,as provided by the - 'default-dt' entry argument +DEFAULT-SEQ: + Sequence number of the default fdt,as provided by the 'default-dt' entry + argument Properties (in the 'fit' node itself): fit,external-offset: Indicates that the contents of the FIT are external @@ -633,10 +636,10 @@ Each subnode describes an entry which is placed into the IFWFI with a given sub-partition (and optional entry name). Properties for subnodes: - ifwi-subpart - sub-parition to put this entry into, e.g. "IBBP" - ifwi-entry - entry name t use, e.g. "IBBL" - ifwi-replace - if present, indicates that the item should be replaced - in the IFWI. Otherwise it is added. + - ifwi-subpart: sub-parition to put this entry into, e.g. "IBBP" + - ifwi-entry: entry name t use, e.g. "IBBL" + - ifwi-replace: if present, indicates that the item should be replaced + in the IFWI. Otherwise it is added. See README.x86 for information about x86 binary blobs. @@ -726,7 +729,7 @@ Properties / Entry arguments: - args: Other arguments to pass The data passed to mkimage is collected from subnodes of the mkimage node, -e.g.: +e.g.:: mkimage { args = "-n test -T imximage"; @@ -766,11 +769,13 @@ This entry holds firmware for an external platform-specific coprocessor. Entry: section: Entry that contains other entries ------------------------------------------------- -Properties / Entry arguments: (see binman README for more information) +Properties / Entry arguments: (see binman README for more information): pad-byte: Pad byte to use when padding sort-by-offset: True if entries should be sorted by offset, False if - they must be in-order in the device tree description + they must be in-order in the device tree description + end-at-4gb: Used to build an x86 ROM which ends at 4GB (2^32) + skip-at-start: Number of bytes before the first entry starts. These effectively adjust the starting offset of entries. For example, if this is 16, then the first entry would start at 16. An entry @@ -808,7 +813,7 @@ Properties / Entry arguments: : The text to place in the entry (overrides the above mechanism). This is useful when the text is constant. -Example node: +Example node:: text { size = <50>; @@ -821,7 +826,7 @@ You can then use: and binman will insert that string into the entry. -It is also possible to put the string directly in the node: +It is also possible to put the string directly in the node:: text { size = <8>; @@ -829,7 +834,7 @@ It is also possible to put the string directly in the node: message = "a message directly in the node" }; -or just: +or just:: text { size = <8>; diff --git a/tools/binman/etype/cbfs.py b/tools/binman/etype/cbfs.py index 6cdbaa085f5..baf9c3e45b7 100644 --- a/tools/binman/etype/cbfs.py +++ b/tools/binman/etype/cbfs.py @@ -22,7 +22,7 @@ class Entry_cbfs(Entry): CBFS is used by coreboot as its way of orgnanising SPI-flash contents. - The contents of the CBFS are defined by subnodes of the cbfs entry, e.g.: + The contents of the CBFS are defined by subnodes of the cbfs entry, e.g.:: cbfs { size = <0x100000>; @@ -38,7 +38,7 @@ class Entry_cbfs(Entry): Note that the size is required since binman does not support calculating it. The contents of each entry is just what binman would normally provide if it were not a CBFS node. A blob type can be used to import arbitrary files as - with the second subnode below: + with the second subnode below:: cbfs { size = <0x100000>; @@ -84,7 +84,7 @@ class Entry_cbfs(Entry): This is an ELF file that has been loaded (i.e. mapped to memory), so appears in the CBFS as a flat binary. The input file must be an ELF image, for example this puts "u-boot" (the ELF image) into a 'stage' - entry: + entry:: cbfs { size = <0x100000>; @@ -94,7 +94,7 @@ class Entry_cbfs(Entry): }; }; - You can use your own ELF file with something like: + You can use your own ELF file with something like:: cbfs { size = <0x100000>; @@ -127,7 +127,7 @@ class Entry_cbfs(Entry): particular offset in the CBFS and a few other things. Of course binman can create images containing multiple CBFSs, simply by - defining these in the binman config: + defining these in the binman config:: binman { diff --git a/tools/binman/etype/fdtmap.py b/tools/binman/etype/fdtmap.py index 6ca88a100e5..2339feeba8d 100644 --- a/tools/binman/etype/fdtmap.py +++ b/tools/binman/etype/fdtmap.py @@ -53,24 +53,24 @@ class Entry_fdtmap(Entry): Note that the -u option must be provided to ensure that binman updates the FDT with the position of each entry. - Example output for a simple image with U-Boot and an FDT map: - - / { - image-name = "binman"; - size = <0x00000112>; - image-pos = <0x00000000>; - offset = <0x00000000>; - u-boot { - size = <0x00000004>; + Example output for a simple image with U-Boot and an FDT map:: + + / { + image-name = "binman"; + size = <0x00000112>; image-pos = <0x00000000>; offset = <0x00000000>; + u-boot { + size = <0x00000004>; + image-pos = <0x00000000>; + offset = <0x00000000>; + }; + fdtmap { + size = <0x0000010e>; + image-pos = <0x00000004>; + offset = <0x00000004>; + }; }; - fdtmap { - size = <0x0000010e>; - image-pos = <0x00000004>; - offset = <0x00000004>; - }; - }; If allow-repack is used then 'orig-offset' and 'orig-size' properties are added as necessary. See the binman README. diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py index 1a7cbd7cec7..c4fa711b850 100644 --- a/tools/binman/etype/fit.py +++ b/tools/binman/etype/fit.py @@ -22,7 +22,7 @@ class Entry_fit(Entry): Nodes for the FIT should be written out in the binman configuration just as they would be in a file passed to mkimage. - For example, this creates an image containing a FIT with U-Boot SPL: + For example, this creates an image containing a FIT with U-Boot SPL:: binman { fit { @@ -52,7 +52,7 @@ class Entry_fit(Entry): The fit,fdt-list property (see above) indicates that of-list should be used. If the property is missing you will get an error. - Then add a 'generator node', a node with a name starting with '@': + Then add a 'generator node', a node with a name starting with '@':: images { @fdt-SEQ { @@ -67,7 +67,7 @@ class Entry_fit(Entry): node acts like a template to generate the nodes. The generator node itself does not appear in the output - it is replaced with what binman generates. - You can create config nodes in a similar way: + You can create config nodes in a similar way:: configurations { default = "@config-DEFAULT-SEQ"; @@ -84,8 +84,10 @@ class Entry_fit(Entry): Available substitutions for '@' nodes are: - SEQ Sequence number of the generated fdt (1, 2, ...) - NAME Name of the dtb as provided (i.e. without adding '.dtb') + SEQ: + Sequence number of the generated fdt (1, 2, ...) + NAME + Name of the dtb as provided (i.e. without adding '.dtb') Note that if no devicetree files are provided (with '-a of-list' as above) then no nodes will be generated. @@ -94,10 +96,11 @@ class Entry_fit(Entry): if of configuration whose devicetree matches the 'default-dt' entry argument, e.g. with '-a default-dt=sun50i-a64-pine64-lts'. - Available substitutions for '@' property values are: + Available substitutions for '@' property values are - DEFAULT-SEQ Sequence number of the default fdt,as provided by the - 'default-dt' entry argument + DEFAULT-SEQ: + Sequence number of the default fdt,as provided by the 'default-dt' entry + argument Properties (in the 'fit' node itself): fit,external-offset: Indicates that the contents of the FIT are external diff --git a/tools/binman/etype/intel_ifwi.py b/tools/binman/etype/intel_ifwi.py index 1a0e481c198..c2ede641aa5 100644 --- a/tools/binman/etype/intel_ifwi.py +++ b/tools/binman/etype/intel_ifwi.py @@ -37,10 +37,10 @@ class Entry_intel_ifwi(Entry_blob_ext): sub-partition (and optional entry name). Properties for subnodes: - ifwi-subpart - sub-parition to put this entry into, e.g. "IBBP" - ifwi-entry - entry name t use, e.g. "IBBL" - ifwi-replace - if present, indicates that the item should be replaced - in the IFWI. Otherwise it is added. + - ifwi-subpart: sub-parition to put this entry into, e.g. "IBBP" + - ifwi-entry: entry name t use, e.g. "IBBL" + - ifwi-replace: if present, indicates that the item should be replaced + in the IFWI. Otherwise it is added. See README.x86 for information about x86 binary blobs. """ diff --git a/tools/binman/etype/mkimage.py b/tools/binman/etype/mkimage.py index 8fddc881187..f8c491d5d0a 100644 --- a/tools/binman/etype/mkimage.py +++ b/tools/binman/etype/mkimage.py @@ -19,7 +19,7 @@ class Entry_mkimage(Entry): - args: Other arguments to pass The data passed to mkimage is collected from subnodes of the mkimage node, - e.g.: + e.g.:: mkimage { args = "-n test -T imximage"; diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index 2f862bddf0f..cce1500b4e5 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -22,11 +22,13 @@ from patman.tools import ToHexSize class Entry_section(Entry): """Entry that contains other entries - Properties / Entry arguments: (see binman README for more information) + Properties / Entry arguments: (see binman README for more information): pad-byte: Pad byte to use when padding sort-by-offset: True if entries should be sorted by offset, False if - they must be in-order in the device tree description + they must be in-order in the device tree description + end-at-4gb: Used to build an x86 ROM which ends at 4GB (2^32) + skip-at-start: Number of bytes before the first entry starts. These effectively adjust the starting offset of entries. For example, if this is 16, then the first entry would start at 16. An entry diff --git a/tools/binman/etype/text.py b/tools/binman/etype/text.py index a69c2a4ec48..45dfcc401e4 100644 --- a/tools/binman/etype/text.py +++ b/tools/binman/etype/text.py @@ -25,7 +25,7 @@ class Entry_text(Entry): : The text to place in the entry (overrides the above mechanism). This is useful when the text is constant. - Example node: + Example node:: text { size = <50>; @@ -38,7 +38,7 @@ class Entry_text(Entry): and binman will insert that string into the entry. - It is also possible to put the string directly in the node: + It is also possible to put the string directly in the node:: text { size = <8>; @@ -46,7 +46,7 @@ class Entry_text(Entry): message = "a message directly in the node" }; - or just: + or just:: text { size = <8>; diff --git a/tools/binman/setup.py b/tools/binman/setup.py index 2dad43d4937..5ed94abdaf9 100644 --- a/tools/binman/setup.py +++ b/tools/binman/setup.py @@ -7,6 +7,6 @@ setup(name='binman', scripts=['binman'], packages=['binman', 'binman.etype'], package_dir={'binman': ''}, - package_data={'binman': ['README.rst', 'README.entries']}, + package_data={'binman': ['README.rst', 'entries.rst']}, classifiers=['Environment :: Console', 'Topic :: Software Development :: Embedded Systems']) From patchwork Sun Mar 7 19:31:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448745 X-Patchwork-Delegate: sjg@chromium.org 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=85.214.62.61; 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=aHAAhAhX; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4DtsC32HFNz9sW5 for ; Mon, 8 Mar 2021 06:35:43 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 258F3828C2; Sun, 7 Mar 2021 20:32:52 +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="aHAAhAhX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3A0388284D; Sun, 7 Mar 2021 20:32:23 +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 0F94F827E1 for ; Sun, 7 Mar 2021 20:32:13 +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 x135so4267259oia.9 for ; Sun, 07 Mar 2021 11:32:12 -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=EzltR80TsWIAsJBMSya8ExIZKFq1yg3/WOhrPC0LKLU=; b=aHAAhAhXPCYdgpkXiGho95LgfMqcBHDnKygPDZlugDRzcgJWzw397z8dlKqHXJx2z3 sBSsnr7DuoaiyTfpS9gmmrEMzW8RE9f0RuQVWiNmlrmDgzDW3ksIVDVSlsAEFGCkC81T D6aZp5AaMQJ6CS20gM07oIK/4Z5S/TT2JL3k4= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=EzltR80TsWIAsJBMSya8ExIZKFq1yg3/WOhrPC0LKLU=; b=KPKEIYzEuAeIH+RCz1QSPl1KNmn988G7GYNA+KRlmygr+aj40S1ca7GkSqiVxK3v+1 yUER7BfHlNkTHTwq2vKw+/FVZvC34bhU4ZxO6pEERHaCOAU3088aB2r2mJRdaUQ/VtBk wfXrtEMScXbLEe1aP4QHAeEVg5pJ6Hbx66Od/7N1euD2q10rMUzh5345/Mthf85QwmzF aumJvTrKwdjZOr8PjuheN3IWgXRtxxFwAOMKtvcF8uNuX/TrIR3UcGEapkGIuVjmRAxb MrkjJQKqCm/ejXif/auuQTKMUd4jb67Dj7+o05F51mE/WDwQ/nY3W9JxUJUQ9/52VRUC mWgA== X-Gm-Message-State: AOAM530sOITbLae6uAFoONZ2UJ63yY0LbcLKjQgL9PwxN273+uVwgy+m aHuV6avY3JFUobPPfjVlnhP4SmqUY+RCjcLv X-Google-Smtp-Source: ABdhPJx0f8OBStG1fQolIS4IHJN2tMW4SV95Q0fa8s0yBQ/LC1quTlPWxedxfg3UkTeKdok9FvY47w== X-Received: by 2002:aca:aad6:: with SMTP id t205mr14854946oie.122.1615145530986; Sun, 07 Mar 2021 11:32:10 -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.32.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:32:10 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Alper Nebi Yasak , Andy Shevchenko , Bin Meng , Jagan Teki , Patrick Wildt , Samuel Holland Subject: [PATCH 19/20] binman: Drop repetitive heading for each entry Date: Sun, 7 Mar 2021 12:31:46 -0700 Message-Id: <20210307193148.1513733-20-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 Many entries start 'Entry containing a'. This looks fine in the source code but is annoying when viewed in the htmldocs table of contents. Drop these unnecessary words. Signed-off-by: Simon Glass --- tools/binman/entries.rst | 76 ++++++++++++++--------------- tools/binman/etype/atf_bl31.py | 2 +- tools/binman/etype/blob.py | 2 +- tools/binman/etype/blob_ext.py | 2 +- tools/binman/etype/cbfs.py | 2 +- tools/binman/etype/files.py | 2 +- tools/binman/etype/fit.py | 2 +- 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 | 2 +- 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 | 2 +- tools/binman/etype/scp.py | 2 +- 20 files changed, 57 insertions(+), 57 deletions(-) diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst index cb89570d5b2..528087db6cd 100644 --- a/tools/binman/entries.rst +++ b/tools/binman/entries.rst @@ -11,8 +11,8 @@ features to produce new behaviours. -Entry: atf-bl31: Entry containing an ARM Trusted Firmware (ATF) BL31 blob -------------------------------------------------------------------------- +Entry: atf-bl31: ARM Trusted Firmware (ATF) BL31 blob +----------------------------------------------------- Properties / Entry arguments: - atf-bl31-path: Filename of file to read into entry. This is typically @@ -25,8 +25,8 @@ about ATF. -Entry: blob: Entry containing an arbitrary binary blob ------------------------------------------------------- +Entry: blob: Arbitrary binary blob +---------------------------------- Note: This should not be used by itself. It is normally used as a parent class by other entry types. @@ -56,8 +56,8 @@ obtained from the list of available device-tree files, managed by the -Entry: blob-ext: Entry containing an externally built binary blob ------------------------------------------------------------------ +Entry: blob-ext: Externally built binary blob +--------------------------------------------- Note: This should not be used by itself. It is normally used as a parent class by other entry types. @@ -96,8 +96,8 @@ entry; similarly for SPL. -Entry: cbfs: Entry containing a Coreboot Filesystem (CBFS) ----------------------------------------------------------- +Entry: cbfs: Coreboot Filesystem (CBFS) +--------------------------------------- A CBFS provides a way to group files into a group. It has a simple directory structure and allows the position of individual files to be set, since it is @@ -303,8 +303,8 @@ added as necessary. See the binman README. -Entry: files: Entry containing a set of files ---------------------------------------------- +Entry: files: A set of files arranged in a section +-------------------------------------------------- Properties / Entry arguments: - pattern: Filename pattern to match the files to include @@ -335,8 +335,8 @@ byte value of a region. -Entry: fit: Entry containing a FIT ----------------------------------- +Entry: fit: FIT +--------------- This calls mkimage to create a FIT (U-Boot Flat Image Tree) based on the input provided. @@ -491,8 +491,8 @@ first/last in the entry list. -Entry: intel-cmc: Entry containing an Intel Chipset Micro Code (CMC) file -------------------------------------------------------------------------- +Entry: intel-cmc: Intel Chipset Micro Code (CMC) file +----------------------------------------------------- Properties / Entry arguments: - filename: Filename of file to read into entry @@ -544,8 +544,8 @@ This entry contains a pointer to the FIT. It is required to be at address -Entry: intel-fsp: Entry containing an Intel Firmware Support Package (FSP) file -------------------------------------------------------------------------------- +Entry: intel-fsp: Intel Firmware Support Package (FSP) file +----------------------------------------------------------- Properties / Entry arguments: - filename: Filename of file to read into entry @@ -561,8 +561,8 @@ See README.x86 for information about x86 binary blobs. -Entry: intel-fsp-m: Entry containing Intel Firmware Support Package (FSP) memory init -------------------------------------------------------------------------------------- +Entry: intel-fsp-m: Intel Firmware Support Package (FSP) memory init +-------------------------------------------------------------------- Properties / Entry arguments: - filename: Filename of file to read into entry @@ -578,8 +578,8 @@ See README.x86 for information about x86 binary blobs. -Entry: intel-fsp-s: Entry containing Intel Firmware Support Package (FSP) silicon init --------------------------------------------------------------------------------------- +Entry: intel-fsp-s: Intel Firmware Support Package (FSP) silicon init +--------------------------------------------------------------------- Properties / Entry arguments: - filename: Filename of file to read into entry @@ -595,8 +595,8 @@ See README.x86 for information about x86 binary blobs. -Entry: intel-fsp-t: Entry containing Intel Firmware Support Package (FSP) temp ram init ---------------------------------------------------------------------------------------- +Entry: intel-fsp-t: Intel Firmware Support Package (FSP) temp ram init +---------------------------------------------------------------------- Properties / Entry arguments: - filename: Filename of file to read into entry @@ -611,8 +611,8 @@ See README.x86 for information about x86 binary blobs. -Entry: intel-ifwi: Entry containing an Intel Integrated Firmware Image (IFWI) file ----------------------------------------------------------------------------------- +Entry: intel-ifwi: Intel Integrated Firmware Image (IFWI) file +-------------------------------------------------------------- Properties / Entry arguments: - filename: Filename of file to read into entry. This is either the @@ -645,8 +645,8 @@ See README.x86 for information about x86 binary blobs. -Entry: intel-me: Entry containing an Intel Management Engine (ME) file ----------------------------------------------------------------------- +Entry: intel-me: Intel Management Engine (ME) file +-------------------------------------------------- Properties / Entry arguments: - filename: Filename of file to read into entry @@ -665,8 +665,8 @@ See README.x86 for information about x86 binary blobs. -Entry: intel-mrc: Entry containing an Intel Memory Reference Code (MRC) file ----------------------------------------------------------------------------- +Entry: intel-mrc: Intel Memory Reference Code (MRC) file +-------------------------------------------------------- Properties / Entry arguments: - filename: Filename of file to read into entry @@ -679,8 +679,8 @@ See README.x86 for information about x86 binary blobs. -Entry: intel-refcode: Entry containing an Intel Reference Code file -------------------------------------------------------------------- +Entry: intel-refcode: Intel Reference Code file +----------------------------------------------- Properties / Entry arguments: - filename: Filename of file to read into entry @@ -693,8 +693,8 @@ See README.x86 for information about x86 binary blobs. -Entry: intel-vbt: Entry containing an Intel Video BIOS Table (VBT) file ------------------------------------------------------------------------ +Entry: intel-vbt: Intel Video BIOS Table (VBT) file +--------------------------------------------------- Properties / Entry arguments: - filename: Filename of file to read into entry @@ -706,8 +706,8 @@ See README.x86 for information about Intel binary blobs. -Entry: intel-vga: Entry containing an Intel Video Graphics Adaptor (VGA) file ------------------------------------------------------------------------------ +Entry: intel-vga: Intel Video Graphics Adaptor (VGA) file +--------------------------------------------------------- Properties / Entry arguments: - filename: Filename of file to read into entry @@ -721,8 +721,8 @@ See README.x86 for information about Intel binary blobs. -Entry: mkimage: Entry containing a binary produced by mkimage -------------------------------------------------------------- +Entry: mkimage: Binary produced by mkimage +------------------------------------------ Properties / Entry arguments: - datafile: Filename for -d argument @@ -756,8 +756,8 @@ placed at offset 'RESET_VECTOR_ADDRESS - 0xffc'. -Entry: scp: Entry containing a System Control Processor (SCP) firmware blob ---------------------------------------------------------------------------- +Entry: scp: System Control Processor (SCP) firmware blob +-------------------------------------------------------- Properties / Entry arguments: - scp-path: Filename of file to read into the entry, typically scp.bin diff --git a/tools/binman/etype/atf_bl31.py b/tools/binman/etype/atf_bl31.py index 195adc714b5..163d7141840 100644 --- a/tools/binman/etype/atf_bl31.py +++ b/tools/binman/etype/atf_bl31.py @@ -8,7 +8,7 @@ from binman.etype.blob_named_by_arg import Entry_blob_named_by_arg class Entry_atf_bl31(Entry_blob_named_by_arg): - """Entry containing an ARM Trusted Firmware (ATF) BL31 blob + """ARM Trusted Firmware (ATF) BL31 blob Properties / Entry arguments: - atf-bl31-path: Filename of file to read into entry. This is typically diff --git a/tools/binman/etype/blob.py b/tools/binman/etype/blob.py index e609a8b253f..018f8c9a319 100644 --- a/tools/binman/etype/blob.py +++ b/tools/binman/etype/blob.py @@ -11,7 +11,7 @@ from patman import tools from patman import tout class Entry_blob(Entry): - """Entry containing an arbitrary binary blob + """Arbitrary binary blob Note: This should not be used by itself. It is normally used as a parent class by other entry types. diff --git a/tools/binman/etype/blob_ext.py b/tools/binman/etype/blob_ext.py index e372445f300..d6b0ca17c3f 100644 --- a/tools/binman/etype/blob_ext.py +++ b/tools/binman/etype/blob_ext.py @@ -13,7 +13,7 @@ from patman import tools from patman import tout class Entry_blob_ext(Entry_blob): - """Entry containing an externally built binary blob + """Externally built binary blob Note: This should not be used by itself. It is normally used as a parent class by other entry types. diff --git a/tools/binman/etype/cbfs.py b/tools/binman/etype/cbfs.py index baf9c3e45b7..1daddeb8229 100644 --- a/tools/binman/etype/cbfs.py +++ b/tools/binman/etype/cbfs.py @@ -13,7 +13,7 @@ from binman.entry import Entry from dtoc import fdt_util class Entry_cbfs(Entry): - """Entry containing a Coreboot Filesystem (CBFS) + """Coreboot Filesystem (CBFS) A CBFS provides a way to group files into a group. It has a simple directory structure and allows the position of individual files to be set, since it is diff --git a/tools/binman/etype/files.py b/tools/binman/etype/files.py index 1feebd0510e..5db36abef0b 100644 --- a/tools/binman/etype/files.py +++ b/tools/binman/etype/files.py @@ -15,7 +15,7 @@ from patman import tools class Entry_files(Entry_section): - """Entry containing a set of files + """A set of files arranged in a section Properties / Entry arguments: - pattern: Filename pattern to match the files to include diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py index c4fa711b850..6936f5736a6 100644 --- a/tools/binman/etype/fit.py +++ b/tools/binman/etype/fit.py @@ -14,7 +14,7 @@ from dtoc.fdt import Fdt from patman import tools class Entry_fit(Entry): - """Entry containing a FIT + """Flat Image Tree (FIT) This calls mkimage to create a FIT (U-Boot Flat Image Tree) based on the input provided. diff --git a/tools/binman/etype/intel_cmc.py b/tools/binman/etype/intel_cmc.py index 644fa421d3f..494d43c9cf9 100644 --- a/tools/binman/etype/intel_cmc.py +++ b/tools/binman/etype/intel_cmc.py @@ -8,7 +8,7 @@ from binman.etype.blob_ext import Entry_blob_ext class Entry_intel_cmc(Entry_blob_ext): - """Entry containing an Intel Chipset Micro Code (CMC) file + """Intel Chipset Micro Code (CMC) file Properties / Entry arguments: - filename: Filename of file to read into entry diff --git a/tools/binman/etype/intel_fsp.py b/tools/binman/etype/intel_fsp.py index 2ac012bce19..326cb7d09b3 100644 --- a/tools/binman/etype/intel_fsp.py +++ b/tools/binman/etype/intel_fsp.py @@ -8,7 +8,7 @@ from binman.etype.blob_ext import Entry_blob_ext class Entry_intel_fsp(Entry_blob_ext): - """Entry containing an Intel Firmware Support Package (FSP) file + """Intel Firmware Support Package (FSP) file Properties / Entry arguments: - filename: Filename of file to read into entry diff --git a/tools/binman/etype/intel_fsp_m.py b/tools/binman/etype/intel_fsp_m.py index 434b0f1856e..9bcac790ed9 100644 --- a/tools/binman/etype/intel_fsp_m.py +++ b/tools/binman/etype/intel_fsp_m.py @@ -8,7 +8,7 @@ from binman.etype.blob_ext import Entry_blob_ext class Entry_intel_fsp_m(Entry_blob_ext): - """Entry containing Intel Firmware Support Package (FSP) memory init + """Intel Firmware Support Package (FSP) memory init Properties / Entry arguments: - filename: Filename of file to read into entry diff --git a/tools/binman/etype/intel_fsp_s.py b/tools/binman/etype/intel_fsp_s.py index 564e1228bba..1d5046d452b 100644 --- a/tools/binman/etype/intel_fsp_s.py +++ b/tools/binman/etype/intel_fsp_s.py @@ -8,7 +8,7 @@ from binman.etype.blob_ext import Entry_blob_ext class Entry_intel_fsp_s(Entry_blob_ext): - """Entry containing Intel Firmware Support Package (FSP) silicon init + """Intel Firmware Support Package (FSP) silicon init Properties / Entry arguments: - filename: Filename of file to read into entry diff --git a/tools/binman/etype/intel_fsp_t.py b/tools/binman/etype/intel_fsp_t.py index df0c5fbee0f..80d95cc6f9c 100644 --- a/tools/binman/etype/intel_fsp_t.py +++ b/tools/binman/etype/intel_fsp_t.py @@ -8,7 +8,7 @@ from binman.etype.blob_ext import Entry_blob_ext class Entry_intel_fsp_t(Entry_blob_ext): - """Entry containing Intel Firmware Support Package (FSP) temp ram init + """Intel Firmware Support Package (FSP) temp ram init Properties / Entry arguments: - filename: Filename of file to read into entry diff --git a/tools/binman/etype/intel_ifwi.py b/tools/binman/etype/intel_ifwi.py index c2ede641aa5..903d39bdbeb 100644 --- a/tools/binman/etype/intel_ifwi.py +++ b/tools/binman/etype/intel_ifwi.py @@ -13,7 +13,7 @@ from dtoc import fdt_util from patman import tools class Entry_intel_ifwi(Entry_blob_ext): - """Entry containing an Intel Integrated Firmware Image (IFWI) file + """Intel Integrated Firmware Image (IFWI) file Properties / Entry arguments: - filename: Filename of file to read into entry. This is either the diff --git a/tools/binman/etype/intel_me.py b/tools/binman/etype/intel_me.py index a6fe5427f31..b93ebabdc9e 100644 --- a/tools/binman/etype/intel_me.py +++ b/tools/binman/etype/intel_me.py @@ -8,7 +8,7 @@ from binman.etype.blob_ext import Entry_blob_ext class Entry_intel_me(Entry_blob_ext): - """Entry containing an Intel Management Engine (ME) file + """Intel Management Engine (ME) file Properties / Entry arguments: - filename: Filename of file to read into entry diff --git a/tools/binman/etype/intel_mrc.py b/tools/binman/etype/intel_mrc.py index ccbb046519d..bb8b26ff686 100644 --- a/tools/binman/etype/intel_mrc.py +++ b/tools/binman/etype/intel_mrc.py @@ -8,7 +8,7 @@ from binman.etype.blob_ext import Entry_blob_ext class Entry_intel_mrc(Entry_blob_ext): - """Entry containing an Intel Memory Reference Code (MRC) file + """Intel Memory Reference Code (MRC) file Properties / Entry arguments: - filename: Filename of file to read into entry diff --git a/tools/binman/etype/intel_refcode.py b/tools/binman/etype/intel_refcode.py index 5ead08b2be4..9112730a9a4 100644 --- a/tools/binman/etype/intel_refcode.py +++ b/tools/binman/etype/intel_refcode.py @@ -8,7 +8,7 @@ from binman.etype.blob_ext import Entry_blob_ext class Entry_intel_refcode(Entry_blob_ext): - """Entry containing an Intel Reference Code file + """Intel Reference Code file Properties / Entry arguments: - filename: Filename of file to read into entry diff --git a/tools/binman/etype/intel_vbt.py b/tools/binman/etype/intel_vbt.py index 2a98c123688..8afd576600c 100644 --- a/tools/binman/etype/intel_vbt.py +++ b/tools/binman/etype/intel_vbt.py @@ -7,7 +7,7 @@ from binman.etype.blob_ext import Entry_blob_ext class Entry_intel_vbt(Entry_blob_ext): - """Entry containing an Intel Video BIOS Table (VBT) file + """Intel Video BIOS Table (VBT) file Properties / Entry arguments: - filename: Filename of file to read into entry diff --git a/tools/binman/etype/intel_vga.py b/tools/binman/etype/intel_vga.py index a103f1ce0ee..51e6465f0d0 100644 --- a/tools/binman/etype/intel_vga.py +++ b/tools/binman/etype/intel_vga.py @@ -8,7 +8,7 @@ from binman.etype.blob_ext import Entry_blob_ext class Entry_intel_vga(Entry_blob_ext): - """Entry containing an Intel Video Graphics Adaptor (VGA) file + """Intel Video Graphics Adaptor (VGA) file Properties / Entry arguments: - filename: Filename of file to read into entry diff --git a/tools/binman/etype/mkimage.py b/tools/binman/etype/mkimage.py index f8c491d5d0a..e9f82729ab4 100644 --- a/tools/binman/etype/mkimage.py +++ b/tools/binman/etype/mkimage.py @@ -12,7 +12,7 @@ from dtoc import fdt_util from patman import tools class Entry_mkimage(Entry): - """Entry containing a binary produced by mkimage + """Binary produced by mkimage Properties / Entry arguments: - datafile: Filename for -d argument diff --git a/tools/binman/etype/scp.py b/tools/binman/etype/scp.py index 93f8787d2d7..a9bee3ce8bc 100644 --- a/tools/binman/etype/scp.py +++ b/tools/binman/etype/scp.py @@ -7,7 +7,7 @@ from binman.etype.blob_named_by_arg import Entry_blob_named_by_arg class Entry_scp(Entry_blob_named_by_arg): - """Entry containing a System Control Processor (SCP) firmware blob + """System Control Processor (SCP) firmware blob Properties / Entry arguments: - scp-path: Filename of file to read into the entry, typically scp.bin From patchwork Sun Mar 7 19:31:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1448742 X-Patchwork-Delegate: sjg@chromium.org 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=D7wXUyb3; 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 4DtsBS5Mm6z9sW5 for ; Mon, 8 Mar 2021 06:35:12 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7E28E827AA; Sun, 7 Mar 2021 20:32:45 +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="D7wXUyb3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3D8DE82842; Sun, 7 Mar 2021 20:32:19 +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 1B076827F9 for ; Sun, 7 Mar 2021 20:32:13 +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 u198so3796838oia.4 for ; Sun, 07 Mar 2021 11:32:13 -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=Ga05eGr6MykF+F9ohLkTgUoipc1bHYG6ZMfwJdXZ0P8=; b=D7wXUyb3D2U4SX4OazfnMjlXAYsInbIai/Tt+TvhNl4L2XhKeoU1wH0wZHgzuiWfRL HNxWDrxyYze+YCtQdAEKfN7Rxe/DIDu1gYHZPzDdnxgHWsjx+JeR7XRCuIKc651j4QNl 23K7JZAcuBupYl0dks1rFxjPQKJefqiybjaPU= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ga05eGr6MykF+F9ohLkTgUoipc1bHYG6ZMfwJdXZ0P8=; b=XFas4Q+PXvKCSR/MuGrMzWlRzjrY9v99T6sYMubw0fz5ZujBTm1XiIOziUJKMGsQjZ 7qxsD9kVRaXI21jAZiO4Vz8+jeLDvebQjZUEOE/oOSqZ+YEcj0OEWee+Ypr+TB8qjeFK Kiha/xVVHRjxFEI6KlmwcyHfQ9wR/xEBLNjczIIB6+Yh3ZF8ag/B+YbdyPHuThza6dpu hQk1Wqi1QglDsVFMp7obmG7zkJvV8KCYfKIEr/ekTiVie6N8JvTK2Be/IKk2TFA+6uuC pool4ROv4rSsW+4wAODpLaOgWmzVilZmj+whPkvv5u7J3+QgcRSASAsf2SufL98882Q8 v3og== X-Gm-Message-State: AOAM530IPXe1f87SIseCpl0idDvdnfH8F9Kp5qZj9aGI8PMiptdBGFAf KDK5BzCDFbXsMdKLNpwcMS3cGm9llWl4pTTL X-Google-Smtp-Source: ABdhPJyFaG3euvWd/tpM78uD/uUHhpV1zUT9KmnbVtSGAJ9ZPS539j3Rh8m4IbyoWtzYKBmS1YkDWA== X-Received: by 2002:aca:f44d:: with SMTP id s74mr7628400oih.168.1615145531701; Sun, 07 Mar 2021 11:32:11 -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.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 11:32:11 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH 20/20] binman: Update various pieces of the documentation Date: Sun, 7 Mar 2021 12:31:47 -0700 Message-Id: <20210307193148.1513733-21-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210307193148.1513733-1-sjg@chromium.org> References: <20210307193148.1513733-1-sjg@chromium.org> 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 A few sections are a little out of date now. Update them. Signed-off-by: Simon Glass --- tools/binman/README.rst | 72 ++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/tools/binman/README.rst b/tools/binman/README.rst index 5df5de4d8e3..680a1c38a8d 100644 --- a/tools/binman/README.rst +++ b/tools/binman/README.rst @@ -9,39 +9,43 @@ For example, we may have SPL, U-Boot, a device tree and an environment area grouped together and placed in MMC flash. When the system starts, it must be able to find these pieces. -So far U-Boot has not provided a way to handle creating such images in a -general way. Each SoC does what it needs to build an image, often packing or -concatenating images in the U-Boot build system. - -Binman aims to provide a mechanism for building images, from simple -SPL + U-Boot combinations, to more complex arrangements with many parts. +Building firmware should be separate from packaging it. Many of the complexities +of modern firmware build systems come from trying to do both at once. With +binman, you build all the pieces that are needed, using whatever assortment of +projects and build systems are needed, then use binman to stitch everything +together. What it does ------------ Binman reads your board's device tree and finds a node which describes the -required image layout. It uses this to work out what to place where. The -output file normally contains the device tree, so it is in principle possible -to read an image and extract its constituent parts. +required image layout. It uses this to work out what to place where. + +Binman provides a mechanism for building images, from simple SPL + U-Boot +combinations, to more complex arrangements with many parts. It also allows +users to inspect images, extract and replace binaries within them, repacking if +needed. Features -------- -So far binman is pretty simple. It supports binary blobs, such as 'u-boot', -'spl' and 'fdt'. It supports empty entries (such as setting to 0xff). It can -place entries at a fixed location in the image, or fit them together with -suitable padding and alignment. It provides a way to process binaries before -they are included, by adding a Python plug-in. The device tree is available -to U-Boot at run-time so that the images can be interpreted. +Apart from basic padding, alignment and positioning features, Binman supports +hierarchical images, compression, hashing and dealing with the binary blobs +which are a sad trend in open-source firmware at present. -Binman can update the device tree with the final location of everything when it -is done. Entry positions can be provided to U-Boot SPL as run-time symbols, -avoiding device-tree code overhead. +Executable binaries can access the location of other binaries in an image by +using special linker symbols (zero-overhead but somewhat limited) or by reading +the devicetree description of the image. -Binman can also support incorporating filesystems in the image if required. -For example x86 platforms may use CBFS in some cases. +Binman is designed primarily for use with U-Boot and associated binaries such +as ARM Trusted Firmware, but it is suitable for use with other projects, such +as Zephyr. Binman also provides facilities useful in Chromium OS, such as CBFS, +vblocks and and the like. + +Binman provides a way to process binaries before they are included, by adding a +Python plug-in. Binman is intended for use with U-Boot but is designed to be general enough to be useful in other image-packaging situations. @@ -50,11 +54,11 @@ to be useful in other image-packaging situations. Motivation ---------- -Packaging of firmware is quite a different task from building the various -parts. In many cases the various binaries which go into the image come from -separate build systems. For example, ARM Trusted Firmware is used on ARMv8 -devices but is not built in the U-Boot tree. If a Linux kernel is included -in the firmware image, it is built elsewhere. +As mentioned above, packaging of firmware is quite a different task from +building the various parts. In many cases the various binaries which go into +the image come from separate build systems. For example, ARM Trusted Firmware +is used on ARMv8 devices but is not built in the U-Boot tree. If a Linux kernel +is included in the firmware image, it is built elsewhere. It is of course possible to add more and more build rules to the U-Boot build system to cover these cases. It can shell out to other Makefiles and @@ -215,17 +219,12 @@ Binman has a few other options which you can see by running 'binman -h'. Enabling binman for a board --------------------------- -At present binman is invoked from a rule in the main Makefile. Typically you -will have a rule like:: - - ifneq ($(CONFIG_ARCH_),) - u-boot-.bin: checkbinman FORCE - $(call if_changed,binman) - endif +At present binman is invoked from a rule in the main Makefile. You should be +able to enable CONFIG_BINMAN to enable this rule. -This assumes that u-boot-.bin is a target, and is the final file -that you need to produce. You can make it a target by adding it to INPUTS-y -either in the main Makefile or in a config.mk file in your arch subdirectory. +The output file is typically named image.bin and is located in the output +directory. If input files are needed to you add these to INPUTS-y either in the +main Makefile or in a config.mk file in your arch subdirectory. Once binman is executed it will pick up its instructions from a device-tree file, typically -u-boot.dtsi, where is your CONFIG_SYS_SOC value. @@ -1141,7 +1140,8 @@ To do Some ideas: - Use of-platdata to make the information available to code that is unable - to use device tree (such as a very small SPL image) + to use device tree (such as a very small SPL image). For now, limited info is + available via linker symbols - Allow easy building of images by specifying just the board name - Support building an image for a board (-b) more completely, with a configurable build directory