From patchwork Thu Jun 20 23:06:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950485 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ebeP0gYP; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x2p2lD3z1ydW for ; Fri, 21 Jun 2024 09:07:14 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D77F5884AC; Fri, 21 Jun 2024 01:06:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ebeP0gYP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9C38F8834D; Fri, 21 Jun 2024 01:06:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (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 C0B3E87B77 for ; Fri, 21 Jun 2024 01:06:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-7eee7728b00so54503439f.3 for ; Thu, 20 Jun 2024 16:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924799; x=1719529599; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+oOlZ3xjHaF1cpgRNdg6rKrqmBgPxk0dwBXY0MO1Dis=; b=ebeP0gYP3JItFuSEGwTf4HGDLsaco7txnUpFKcZpT/+dT3dZaCZtRbkeQyGVkCS5Mb 9xMNmwNJB9UMMcW3xHQcTDc8SQVL2X+XnrEZYvYGNOS1TA0TIJQ6HTPisab8Ij+5RE/G os366EM+j/5BMTo/acyPWxmTBo4YjkCI1y+sQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924799; x=1719529599; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+oOlZ3xjHaF1cpgRNdg6rKrqmBgPxk0dwBXY0MO1Dis=; b=CGfVpUv8UcCdaQui0favDUYvTQ2GKQhu1uoa9sQP1VArbEO7pqCmjILoOxFqCYi0am z7s/ni5T/UQjTC1+OpwJnS7YcbrvVKLgPmdAXER2hfAPjmRiFO8Ft8VwV7K1jX8v/PeS dpip4QuffkYv8FUSwJc0U8Y8k2OKB8kpBxUtPyqd4T6pcrKbEzy/GCKob2MHnja7M/WB ifIdKE5QOqVV+mj+dj/njI42NVT/L8AbE5U7Jy+nBkytrTf7RbzWGxt4R6IW2zmkc36L AzmvBBDCfLbMtVVXKBt7xm0qZnsVT7ajO6GPzEhELF6uVyA7wXhDf7ai4RPZp4z0j4bV bWbQ== X-Gm-Message-State: AOJu0Yz4AC8GWfOFZ1EMeENtLYIihN5Og6ZmLTXlf/G3LjEn8TN0r1u4 grwI/UAOhnJlXekZdHIJwZ2UyZZV4qOdpxF1/GHP5W0BoJxoXpgGLzNNTlx7j3uwPxanSs8aVn2 BWg== X-Google-Smtp-Source: AGHT+IHxSV7fMOYZkSILKflVqnJVTUSMoQx8+jD2GBH6Px0/Rpg38MFhtkqKNLxjKp8YLqPPyqiIUw== X-Received: by 2002:a05:6602:1493:b0:7eb:6d0a:613a with SMTP id ca18e2360f4ac-7f13edafa38mr801673039f.2.1718924799321; Thu, 20 Jun 2024 16:06:39 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:39 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alper Nebi Yasak , Dario Binacchi , Heinrich Schuchardt , Jonas Karlman , Lukas Funke , Marek Vasut , Massimo Pegorer , Neha Malcom Francis , Peng Fan , Philippe Reynes , Stefan Herbrechtsmeier , Sughosh Ganu Subject: [PATCH v3 01/18] binman: Support an assumed size for missing binaries Date: Thu, 20 Jun 2024 17:06:08 -0600 Message-Id: <20240620230625.1797397-2-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Binman has a the useful feature of handling missing external blobs gracefully, including allowing them to be missing, deciding whether the resulting image is functional or not and faking blobs when this is necessary for particular tools (e.g. mkimage). This feature is widely used in CI. One drawback is that if U-Boot grows too large to fit along with the required blobs, then this is not discovered until someone does a 'real' build which includes the blobs. Add a 'assume-size' property to entries to allow Binman to reserve a given size for missing external blobs. Signed-off-by: Simon Glass --- (no changes since v1) tools/binman/binman.rst | 7 ++++++ tools/binman/entry.py | 1 + tools/binman/etype/blob.py | 7 +++++- tools/binman/ftest.py | 28 ++++++++++++++++++++++++ tools/binman/test/326_assume_size.dts | 16 ++++++++++++++ tools/binman/test/327_assume_size_ok.dts | 16 ++++++++++++++ 6 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 tools/binman/test/326_assume_size.dts create mode 100644 tools/binman/test/327_assume_size_ok.dts diff --git a/tools/binman/binman.rst b/tools/binman/binman.rst index 230e055667f..872e9746c8c 100644 --- a/tools/binman/binman.rst +++ b/tools/binman/binman.rst @@ -711,6 +711,13 @@ missing-msg: information about what needs to be fixed. See missing-blob-help for the message for each tag. +assume-size: + Sets the assumed size of a blob entry if it is missing. This allows for a + check that the rest of the image fits into the available space, even when + the contents are not available. If the entry is missing, Binman will use + this assumed size for the entry size, including creating a fake file of that + size if requested. + no-expanded: By default binman substitutes entries with expanded versions if available, so that a `u-boot` entry type turns into `u-boot-expanded`, for example. The diff --git a/tools/binman/entry.py b/tools/binman/entry.py index 42e0b7b9145..c1904f8ae69 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -315,6 +315,7 @@ class Entry(object): self.overlap = fdt_util.GetBool(self._node, 'overlap') if self.overlap: self.required_props += ['offset', 'size'] + self.assume_size = fdt_util.GetInt(self._node, 'assume-size', 0) # This is only supported by blobs and sections at present self.compress = fdt_util.GetString(self._node, 'compress', 'none') diff --git a/tools/binman/etype/blob.py b/tools/binman/etype/blob.py index 064fae50365..041e1122953 100644 --- a/tools/binman/etype/blob.py +++ b/tools/binman/etype/blob.py @@ -48,11 +48,16 @@ class Entry_blob(Entry): self.external and (self.optional or self.section.GetAllowMissing())) # Allow the file to be missing if not self._pathname: + if not fake_size and self.assume_size: + fake_size = self.assume_size self._pathname, faked = self.check_fake_fname(self._filename, fake_size) self.missing = True if not faked: - self.SetContents(b'') + content_size = 0 + if self.assume_size: # Ensure we get test coverage on next line + content_size = self.assume_size + self.SetContents(tools.get_bytes(0, content_size)) return True self.ReadBlobContents() diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 8a44bc051b3..bd0a10ff885 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -7460,5 +7460,33 @@ fdt fdtmap Extract the devicetree blob from the fdtmap with self.assertRaises(ValueError) as e: self._DoReadFile('323_capsule_accept_revert_missing.dts') + def test_assume_size(self): + """Test handling of the assume-size property for external blob""" + with self.assertRaises(ValueError) as e: + self._DoTestFile('326_assume_size.dts', allow_missing=True, + allow_fake_blobs=True) + self.assertIn("contents size 0xa (10) exceeds section size 0x9 (9)", + str(e.exception)) + + def test_assume_size_ok(self): + """Test handling of the assume-size where it fits OK""" + with test_util.capture_sys_output() as (stdout, stderr): + self._DoTestFile('327_assume_size_ok.dts', allow_missing=True, + allow_fake_blobs=True) + err = stderr.getvalue() + self.assertRegex( + err, + "Image '.*' has faked external blobs and is non-functional: .*") + + def test_assume_size_no_fake(self): + """Test handling of the assume-size where it fits OK""" + with test_util.capture_sys_output() as (stdout, stderr): + self._DoTestFile('327_assume_size_ok.dts', allow_missing=True) + err = stderr.getvalue() + self.assertRegex( + err, + "Image '.*' is missing external blobs and is non-functional: .*") + + if __name__ == "__main__": unittest.main() diff --git a/tools/binman/test/326_assume_size.dts b/tools/binman/test/326_assume_size.dts new file mode 100644 index 00000000000..4c5f8b418d8 --- /dev/null +++ b/tools/binman/test/326_assume_size.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + size = <9>; + blob-ext { + filename = "assume_blob"; + assume-size = <10>; + }; + }; +}; diff --git a/tools/binman/test/327_assume_size_ok.dts b/tools/binman/test/327_assume_size_ok.dts new file mode 100644 index 00000000000..00ed726f872 --- /dev/null +++ b/tools/binman/test/327_assume_size_ok.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + size = <10>; + blob-ext { + filename = "assume_blob"; + assume-size = <10>; + }; + }; +}; From patchwork Thu Jun 20 23:06:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950486 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=iAid8nqb; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x313jY2z1ydW for ; Fri, 21 Jun 2024 09:07:25 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 48ACC88555; Fri, 21 Jun 2024 01:06:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="iAid8nqb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5B9FC8834D; Fri, 21 Jun 2024 01:06:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (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 677EC88568 for ; Fri, 21 Jun 2024 01:06:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-7ec0385de1fso48787239f.3 for ; Thu, 20 Jun 2024 16:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924800; x=1719529600; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=asc59Z1ZDtMFES+Na6cEttWuA//ajEC8Am+1ZXIXMXY=; b=iAid8nqbQ9iKKnnkkJLFEI506m7zyVs7bIC3w2stC8llwi0bdU9emNKXAzJ4H/UadJ ZYgHUDvYikKurrX9BAGCwzfjXtnIGmGPLWMWILZEZX+0WLRUn0m9c08jbL9WfeMrbSZ8 vg11kEZ6g4CKCo8vn4wDFeferXkNNv15/Te44= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924800; x=1719529600; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=asc59Z1ZDtMFES+Na6cEttWuA//ajEC8Am+1ZXIXMXY=; b=tsx79QgI9KRZUwQHQAucdvBPI5hg62421oJ8nwgvCNAsDYhZf+8Xs1TP1YQpqdovRg WsqRQm8A+InFVNgH2wi+eA4TO6PTEf0SIthA83tLVCjJR14ZqpNr2ZlJziCkDWbLAww5 rAHy4pn/Ki5dm0snHEbJsyO2+BsjclPrhdaalVUgjkcRAg1B2uMLlbrJ2vSuKy4hjCz8 618xRMfNk4yp1u74fWcsMIU0HOyq/TQzNTWtYXUBa4zKfkspWrN0s+PyfoyV1kgglNTI hYFDwfSgKB7V9UIZYhvQAMUnNpOlq0hIYLKjsQfHbrBvk4dTGXoTPSD572W0d3bR6Z0o vtSg== X-Gm-Message-State: AOJu0Yw/wx0Xw0TUqlCWp4Tsc6qUSWxaoMOgng71xj8MtTmRI1M3Oo3I WaOP7GjL2ldigGmHZ7/LS764f1k9maOGCb1clvZnyUxFIg8eEgqz0kn+qazP4WFNDNlMlFxkRz4 FKg== X-Google-Smtp-Source: AGHT+IFQjFTX1P4UvEfXcTyIC1fFAT+6XcBnIsus8YiY9rnssLtgYtzPl0XfbWI5tfw7AXqxp9jfig== X-Received: by 2002:a05:6602:2cd3:b0:7ea:da27:e59e with SMTP id ca18e2360f4ac-7f13ee664f9mr814369539f.12.1718924800034; Thu, 20 Jun 2024 16:06:40 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:39 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alper Nebi Yasak , Neha Malcom Francis , Peng Fan , Philippe Reynes , Stefan Herbrechtsmeier Subject: [PATCH v3 02/18] binman: Make Intel ME default to position 0x1000 Date: Thu, 20 Jun 2024 17:06:09 -0600 Message-Id: <20240620230625.1797397-3-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This cannot ever go at offset 0 since the descriptor is there. Use a better offset for the ME, as used by link and coral, for example. This matters when we start using assumed sizes for missing blobs. Signed-off-by: Simon Glass --- (no changes since v1) tools/binman/etype/intel_descriptor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/binman/etype/intel_descriptor.py b/tools/binman/etype/intel_descriptor.py index 7fe88a9ec1a..3ce967fe81a 100644 --- a/tools/binman/etype/intel_descriptor.py +++ b/tools/binman/etype/intel_descriptor.py @@ -59,7 +59,7 @@ class Entry_intel_descriptor(Entry_blob_ext): if self.missing: # Return zero offsets so that these entries get placed somewhere if self.HasSibling('intel-me'): - info['intel-me'] = [0, None] + info['intel-me'] = [0x1000, None] return info offset = self.data.find(FD_SIGNATURE) if offset == -1: From patchwork Thu Jun 20 23:06:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950487 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=HP6Jj68K; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x3D2fnhz1ydW for ; Fri, 21 Jun 2024 09:07:36 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AD86888577; Fri, 21 Jun 2024 01:06:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="HP6Jj68K"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A1FEE8834D; Fri, 21 Jun 2024 01:06:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (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 2DA9E88551 for ; Fri, 21 Jun 2024 01:06:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-7eb7a2f062cso50900039f.0 for ; Thu, 20 Jun 2024 16:06:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924801; x=1719529601; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1DwbEmlb7j97i9Q+0Gkqlcn3kq0fvAKIR9SwwmRHzEg=; b=HP6Jj68KOTqeKI2nemKOfNdVLhzf2InSfhMP0snq2j+Grv5Bi8Csfqn9ezlUsM/TGm gy7bqmBojuUXFTLFuM4N5fiPjbuL/dRzkOf67FDDpJD4pf+HwDrg0rQwLNjYJchNIj4L CJ9Zp13lf5dwsqDwuZ3uZAZvMzjjEdcscSawc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924801; x=1719529601; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1DwbEmlb7j97i9Q+0Gkqlcn3kq0fvAKIR9SwwmRHzEg=; b=tpg9imPBJU4K0Lq78vHCoaCNmoep4V+dBNNRV1iiGlpzXeOim1AVZf+Ut7VKRATDVf lTYnsfMG+9pkQNsR3fYDs58hkbdXDevX0SkKVBVwA1JceSs7HXj4aj612jnZPgTBcXbY t/evL8iRwLNgRHWWXJREvixbclAs1QBY1MF0J8Qo33prWwHHvkHz3zxH5dbcfU99rK7u BFfwdfNYZCW8/qwLoo7EpSVGtJbHl6L1EszME5EpQdnUP78LZOFi0va8xygVUeqsLVq1 8C1O+YS1q8WujghggBEcpZuZktGXdZtqO1LNYc5st5krnwJDPoSnJDnZ2tFGFDqxgeDd GZ+Q== X-Gm-Message-State: AOJu0YxTN04/S9GihWdzQdymFn1Pu725ofasgQCkkdpQ6cg3fqvz5COa Bv+8PMAoSp9pAcdJ3SYoAJqjfuwJzgLbFiSjTSaVRNFnEsj66c9VFSile8WY8PhW2m+BeJbsEFH q3w== X-Google-Smtp-Source: AGHT+IEsvXZk/8a8pw19QP5yQfu1jz/W3kDS36Xemy6AJ+IqloNbYigXXGLTDQQzRH4hMCBYlRdzIw== X-Received: by 2002:a05:6602:60cb:b0:7eb:ae17:c234 with SMTP id ca18e2360f4ac-7f13ee5a7c2mr801108739f.11.1718924800692; Thu, 20 Jun 2024 16:06:40 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:40 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Heinrich Schuchardt , Ilias Apalodimas , Sughosh Ganu Subject: [PATCH v3 03/18] mkeficapsule: Add a --version argument Date: Thu, 20 Jun 2024 17:06:10 -0600 Message-Id: <20240620230625.1797397-4-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Tools should have an option to obtain the version, so add this to the mkeficapsule tool. Signed-off-by: Simon Glass Reviewed-by: Ilias Apalodimas --- (no changes since v1) doc/mkeficapsule.1 | 4 ++++ tools/mkeficapsule.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/mkeficapsule.1 b/doc/mkeficapsule.1 index c4c2057d5c7..c3d0f21488a 100644 --- a/doc/mkeficapsule.1 +++ b/doc/mkeficapsule.1 @@ -87,6 +87,10 @@ Generate a firmware revert empty capsule .BI "-o\fR,\fB --capoemflag " Capsule OEM flag, value between 0x0000 to 0xffff +.TP +.BR -V ", " --version +Print version information and exit. + .TP .BR -h ", " --help Print a help message diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c index 6a261ff549d..c112ae2de8d 100644 --- a/tools/mkeficapsule.c +++ b/tools/mkeficapsule.c @@ -21,6 +21,8 @@ #include #include +#include + #include "eficapsule.h" static const char *tool_name = "mkeficapsule"; @@ -28,7 +30,7 @@ static const char *tool_name = "mkeficapsule"; efi_guid_t efi_guid_fm_capsule = EFI_FIRMWARE_MANAGEMENT_CAPSULE_ID_GUID; efi_guid_t efi_guid_cert_type_pkcs7 = EFI_CERT_TYPE_PKCS7_GUID; -static const char *opts_short = "g:i:I:v:p:c:m:o:dhARD"; +static const char *opts_short = "g:i:I:v:p:c:m:o:dhARDV"; enum { CAPSULE_NORMAL_BLOB = 0, @@ -70,6 +72,7 @@ static void print_usage(void) "\t-R, --fw-revert firmware revert capsule, takes no GUID, no image blob\n" "\t-o, --capoemflag Capsule OEM Flag, an integer between 0x0000 and 0xffff\n" "\t-D, --dump-capsule dump the contents of the capsule headers\n" + "\t-V, --version show version number\n" "\t-h, --help print a help message\n", tool_name); } @@ -969,6 +972,9 @@ int main(int argc, char **argv) case 'D': capsule_dump = true; break; + case 'V': + printf("mkeficapsule version %s\n", PLAIN_VERSION); + exit(EXIT_SUCCESS); default: print_usage(); exit(EXIT_SUCCESS); From patchwork Thu Jun 20 23:06:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950488 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=VxKCMjnA; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x3S2Vmbz1ydW for ; Fri, 21 Jun 2024 09:07:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1954B88585; Fri, 21 Jun 2024 01:06:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="VxKCMjnA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F10108854A; Fri, 21 Jun 2024 01:06:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (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 D85F087D1A for ; Fri, 21 Jun 2024 01:06:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-7eb7c8f114eso51676539f.1 for ; Thu, 20 Jun 2024 16:06:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924801; x=1719529601; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9w+sUR2AVGoO5kGbs1GbQb9CzRrIlLYGbu0jwVoLkS8=; b=VxKCMjnAFfn66yIqx0nhnuewDlqMNGvJZZWd8gNYay0Xs1WD7LsNbnjY/KjUK2+CRu l8PkHK4+AmMJZReeO+vnoULpnwgoZ8jCViOpzf4aEZYqCeegUXFKKUeZqa2j94jmumib eztD6xdEtJDFYTvngdZ1KyF6NSBgT6oF07dZk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924801; x=1719529601; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9w+sUR2AVGoO5kGbs1GbQb9CzRrIlLYGbu0jwVoLkS8=; b=EvJdezoEjq+SVZHNH9sUMfv6orByC3hVKxQNUiKRWhtBs9VEwiWl0pSYYv/fpfymlz Tw7ZpJJddIBvXR+AA/G16UGMN9eiBg1+6tM5mwbbiMlNXXQJPUl6XYfzXfvryTaV3lzG 0ZXw6jjfQSCgC32jh5EfN6qW/YB1kLn92sVM37K6Ccz+33M309kERqN/HOLjqcMk/V+A 7KaAWs70QmcXUzUqAvvd1+cTmVLjHGWI392KqXFr4w46asqvqeKhpH2CLnQjtg0kAbsA ZcU2VU1ASyyG51pTVC0qygFuunq0w3X9C8yz8qOdEnWzEsERCkco9EgimcEGstD0JzyQ 0Flg== X-Gm-Message-State: AOJu0YxxYf3aOeONshmYst3Xozdlp7flb7aqoH27sjiKnmghl97o/wKf vcRpecNV+hXJ24rknUwVL9XQfMGep3HfqTv3AiVkv4akeSxxc5O5JdVveBoxk9dqqpeahk0jZKR wjA== X-Google-Smtp-Source: AGHT+IHXkvEwocd6n6CuYgvz3DvEkjPDOSJDYPXnxWmskQfi6IZlLgiNwY149xWFmudxULeh/nIPVw== X-Received: by 2002:a05:6602:14d2:b0:7eb:9864:410b with SMTP id ca18e2360f4ac-7f13ee202bbmr779322939f.5.1718924801459; Thu, 20 Jun 2024 16:06:41 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:41 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alper Nebi Yasak , Neha Malcom Francis , Peng Fan , Philippe Reynes , Stefan Herbrechtsmeier , Sughosh Ganu Subject: [PATCH v3 04/18] binman: Collect the version number for mkeficapsule Date: Thu, 20 Jun 2024 17:06:11 -0600 Message-Id: <20240620230625.1797397-5-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Now that this tool has a version number, collect it. Signed-off-by: Simon Glass --- (no changes since v1) tools/binman/btool/mkeficapsule.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/binman/btool/mkeficapsule.py b/tools/binman/btool/mkeficapsule.py index ef1da638df1..f7e5a886849 100644 --- a/tools/binman/btool/mkeficapsule.py +++ b/tools/binman/btool/mkeficapsule.py @@ -33,7 +33,8 @@ class Bintoolmkeficapsule(bintool.Bintool): commandline, or through a config file. """ def __init__(self, name): - super().__init__(name, 'mkeficapsule tool for generating capsules') + super().__init__(name, 'mkeficapsule tool for generating capsules', + r'mkeficapsule version (.*)') def generate_capsule(self, image_index, image_guid, hardware_instance, payload, output_fname, priv_key, pub_key, From patchwork Thu Jun 20 23:06:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950489 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=hwKL+Fl/; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x3g6SyKz1ydW for ; Fri, 21 Jun 2024 09:07:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7F01388591; Fri, 21 Jun 2024 01:06:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="hwKL+Fl/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 930A288551; Fri, 21 Jun 2024 01:06:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) (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 81B1087E13 for ; Fri, 21 Jun 2024 01:06:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-7eb895539e3so51908439f.2 for ; Thu, 20 Jun 2024 16:06:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924802; x=1719529602; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I7f7BP+opKLFa9/ciieR5UyH6P8YpaRYZrb5EZwJ4oQ=; b=hwKL+Fl/a86uI4nfLrmRqrg8aJX6eYeDcvz8yk0n3rVrule9Ul3W/lYMN2Qn10TdLe elFb/b8vEv76KPBiadzF/In/9+eVVjoErez5+6Uscsdk6VvgatLAaWU0hg8KZuqSII8j 2sGdrA7zrByHoBNgEM8EMCccTt1q3ILMkG3m4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924802; x=1719529602; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I7f7BP+opKLFa9/ciieR5UyH6P8YpaRYZrb5EZwJ4oQ=; b=XJQdLksX79sITfhNf8JTIWLVhY7wtsErAjHr+/hG7C0AyUpL0wqXv2+Jer+FmuHM58 3Ak8FWSJ4S3J0ZieVkUVzPVvxcDePj5cLMODSjoSv9ZVxMBudC2ZR01kCj4Xe5lH35EL AI0FONXAK/0dp7BHXBd508mz+vb/6zfvEIwoRNJgkoAuG1mw9ciMEfyBj41a5uMaT2// rXPtq4Omf2Ouh72QdZ0769LEsVRXDbkzK0xOhgIBSJ7CPjZ4SpFwsaHf+TwxKjgYiWtO HsFMWfDOnz71u9/HaSRD5jw2hI9lee+mOgGlFmT2MMN2P4xtYSQ9832jSOL1svrPSYMZ xQDw== X-Gm-Message-State: AOJu0YxFlwmsIc0NjqXa7wo+rBlSd4FcVYBkrzsDaSDi5jJt/sEGlVhG lLDU9EmasXV8wjBRZq/Jb+3d+eHFXdztLTrtf6RJBpgxsBfZdUVgTMlOqk/uSFI8DJ6banN/kXb MMQ== X-Google-Smtp-Source: AGHT+IEVzJKYLfvIWt3uCIp7nz89qVJjU/gkLZRFLZdCIXvQbCzuZRbAD4Wn+l3+spsYB9e3QFMoHw== X-Received: by 2002:a05:6602:6b82:b0:7eb:776f:d963 with SMTP id ca18e2360f4ac-7f13eddea04mr737866739f.8.1718924802201; Thu, 20 Jun 2024 16:06:42 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:41 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alper Nebi Yasak , Neha Malcom Francis , Peng Fan , Philippe Reynes , Stefan Herbrechtsmeier , Sughosh Ganu Subject: [PATCH v3 05/18] binman: Deal with mkeficapsule being missing Date: Thu, 20 Jun 2024 17:06:12 -0600 Message-Id: <20240620230625.1797397-6-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Tools cannot be assumed to be present. Add a check for this with the mkeficpasule tool. Signed-off-by: Simon Glass Fixes: b617611b27a ("binman: capsule: Add support for generating...") --- (no changes since v1) tools/binman/etype/efi_capsule.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/binman/etype/efi_capsule.py b/tools/binman/etype/efi_capsule.py index e3203717822..47da5da324b 100644 --- a/tools/binman/etype/efi_capsule.py +++ b/tools/binman/etype/efi_capsule.py @@ -150,6 +150,10 @@ class Entry_efi_capsule(Entry_section): if ret is not None: os.remove(payload) return tools.read_file(capsule_fname) + else: + # Bintool is missing; just use the input data as the output + self.record_missing_bintool(self.mkeficapsule) + return data def AddBintools(self, btools): self.mkeficapsule = self.AddBintool(btools, 'mkeficapsule') From patchwork Thu Jun 20 23:06:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950490 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ITgpSa7E; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x3w20jbz1ydW for ; Fri, 21 Jun 2024 09:08:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DB39588581; Fri, 21 Jun 2024 01:06:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ITgpSa7E"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7D787883F2; Fri, 21 Jun 2024 01:06:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 687618839C for ; Fri, 21 Jun 2024 01:06:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x129.google.com with SMTP id e9e14a558f8ab-375f43e005cso4348845ab.0 for ; Thu, 20 Jun 2024 16:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924803; x=1719529603; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8WYab1vLvZBJbf0Xi3jX9RE96p1eZZ7nMT1fkj99CFg=; b=ITgpSa7EkFcZffTD+rMmmKWqKJWVIiz8tm5Da2Wxgt/KEJCfq+MZGg6CCgx6fHwVWb +B1KmVO4z82HLEalMNrwKiuaCGlkkTxyGWtKEcvpe7DstmZmDcbOJnNRO4TuuoCY/Cbp ZoPlM8q2/OYQ6iBugcen6DCQ/Las38W7SJ/Q8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924803; x=1719529603; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8WYab1vLvZBJbf0Xi3jX9RE96p1eZZ7nMT1fkj99CFg=; b=lSjuR1pDRU9woGPIjkM+GTmRiS3fg5KHRHHMLBo4yC30YJ8OcHxRJd/8zLSMvNhg4x g+tSExKvyGtsNNzw8wElRizGsOn6Nju6NSXGMNeuZ1J1GI3C+jR5nltZwL7QDNRAZLhw I5oHfCrd2oHlroROaKmADV87OLMral7BLdCczlfolbE43zdNGSCdkXRua4LROPYUvwFi NQtw2h5a0E3swhh+bWDmSQYN7comcOnCLUmfgrLcU1AUv+EixqgOPJmN9knzWNQdCOie BZI7AVPTMlr3nQlHq/W9ivzOgEEd1CUvyZRlpZWwbxMAa2Gfp6+FwCA4vvm9AZ6F9xwH mtSg== X-Gm-Message-State: AOJu0YzPd5BfdafzavAAionXJY9t2tSXaeInETYt0Vv9KJKRQ3DnUaBh gBDDBiSJJtEf3N/pJsqfhvMuexRmK2JNU58iWc9bcOgtL4n7OfmHUsusA2Eosny0LxcvTtdB6vQ 50Q== X-Google-Smtp-Source: AGHT+IH6LdXLFeYAMCAKSyza1udYYFIIjYNYY5yFji99o7UYMGUYK+YFJxKXSyOUW+idmfR9jHFa6Q== X-Received: by 2002:a92:c545:0:b0:376:2a41:5f42 with SMTP id e9e14a558f8ab-3762a4160b1mr14799155ab.10.1718924803002; Thu, 20 Jun 2024 16:06:43 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:42 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , AKASHI Takahiro , Alper Nebi Yasak , Heinrich Schuchardt , Ilias Apalodimas , Neha Malcom Francis , Peng Fan , Philippe Reynes , Stefan Herbrechtsmeier , Sughosh Ganu Subject: [PATCH v3 06/18] binman: Return failure when a usage() message is generated Date: Thu, 20 Jun 2024 17:06:13 -0600 Message-Id: <20240620230625.1797397-7-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The tool must return an error code when invalid arguments are provided, otherwise binman has no way of knowing that anything went wrong. Correct this. Signed-off-by: Simon Glass Fixes: fab430be2f4 ("tools: add mkeficapsule command for UEFI...") --- (no changes since v1) tools/mkeficapsule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c index c112ae2de8d..f28008a0829 100644 --- a/tools/mkeficapsule.c +++ b/tools/mkeficapsule.c @@ -977,7 +977,7 @@ int main(int argc, char **argv) exit(EXIT_SUCCESS); default: print_usage(); - exit(EXIT_SUCCESS); + exit(EXIT_FAILURE); } } From patchwork Thu Jun 20 23:06:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950491 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Hn+tf34G; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x473tl2z1ydW for ; Fri, 21 Jun 2024 09:08:23 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 461978859B; Fri, 21 Jun 2024 01:06:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Hn+tf34G"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2DA808834D; Fri, 21 Jun 2024 01:06:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (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 0FDE287D1A for ; Fri, 21 Jun 2024 01:06:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-7eb75c0d0a7so47046439f.3 for ; Thu, 20 Jun 2024 16:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924803; x=1719529603; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uAZMgiVxwFgtbJU8wOG/tKdJ9lPjPSo6ap+M0/rqlWE=; b=Hn+tf34GgW+zw14j5i+eUmYodeeewjCntjLiPdjsmjVuOp0MdM6FzsIwBPe/+z/Khi YZXqCqNJl+WMGkGRhdJaYz66UeV1FJKRXBNJEPTMeASHn3KHWIm1qSgVG9Y7I3ftYlap OvzFNJnXcklKOUVST+3N3BRpeqgLkVvzpObqc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924803; x=1719529603; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uAZMgiVxwFgtbJU8wOG/tKdJ9lPjPSo6ap+M0/rqlWE=; b=rBTC0Rr2PFolVL42OhbXWoL8FJkzn1ZuTPKhVt1uwa8xdi1D1qIfR+GsSJNcn3Ryiv MdZX9BvKmrPyQOxP00rIdYn3POMznhxlfkT3Wd0aPMjLxrXw1D+IKi+k/Bzyes2ei77K O0SAbJFlcbD8hFEwtHX7a97hfnkS+qN8SVCcCEy3VeG82ZAwTd9SgVD12euVOzsuhniu +oZdQouL8uo8stOQRD+SNUpTKz4KBPIijy62/TQWtpdN+WcqWM2lRkBDltzPmno7syTR h29E6L7N0nAkLGh1zMHAY4DF/JH++5obGq1Aq5DJ/+rmhoP6simD7thfzDAOo8V6XeZL aYlQ== X-Gm-Message-State: AOJu0YzVS5Z4ve+mzY9lwSzTiYHC+HOFnSyW4M6XiJ5ysF/AcBmsf8W9 QFOsfYwClxXJRophuu4xt/WZ02aiiVD61I3O+PT/rg65lxzd7gBgUrBQKpWPwZb40mCLRkFw04B BJg== X-Google-Smtp-Source: AGHT+IHae8mIXWFJac1AwyoQtAsySjb5F1NF/7U/qMlKZ/+CmnJOD/kfz8bEIj3/bzxxIwxwBwJCdg== X-Received: by 2002:a05:6602:14cf:b0:7eb:708a:3272 with SMTP id ca18e2360f4ac-7f13ee0c250mr796304039f.3.1718924803734; Thu, 20 Jun 2024 16:06:43 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:43 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alper Nebi Yasak , Neha Malcom Francis , Peng Fan , Philippe Reynes , Stefan Herbrechtsmeier , Sughosh Ganu Subject: [PATCH v3 07/18] binman: Keep the efi_capsule input file Date: Thu, 20 Jun 2024 17:06:14 -0600 Message-Id: <20240620230625.1797397-8-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean There is no need to remove input files. It makes it harder to diagnose failures. Keep the payload file. There is no test for this condition, but one could be added. Signed-off-by: Simon Glass Fixes: b617611b27a ("binman: capsule: Add support for generating...") Acked-by: Sughosh Ganu --- (no changes since v1) tools/binman/etype/efi_capsule.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/binman/etype/efi_capsule.py b/tools/binman/etype/efi_capsule.py index 47da5da324b..03e55cbc4d9 100644 --- a/tools/binman/etype/efi_capsule.py +++ b/tools/binman/etype/efi_capsule.py @@ -148,7 +148,6 @@ class Entry_efi_capsule(Entry_section): self.fw_version, self.oem_flags) if ret is not None: - os.remove(payload) return tools.read_file(capsule_fname) else: # Bintool is missing; just use the input data as the output From patchwork Thu Jun 20 23:06:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950492 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ErGoDq9x; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x4K6Gymz1ydW for ; Fri, 21 Jun 2024 09:08:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A3D5C885A2; Fri, 21 Jun 2024 01:06:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ErGoDq9x"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C89D68859B; Fri, 21 Jun 2024 01:06:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AF82B87B77 for ; Fri, 21 Jun 2024 01:06:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-7eb5dd9f994so49019139f.2 for ; Thu, 20 Jun 2024 16:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924804; x=1719529604; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=55AI1Zdq2PtMQvY/0hkcvJqBd9KlBMTMR5uFE0YcI/k=; b=ErGoDq9xH84K6q5cfG5Tk/6Br/tByJU/yAyDX0PdUoP52G3Or5mFx9dWHLTo4xWrRo I2zJrXkboc9VOot+NBIyToQw5E9mVXlvQT1az1vE6WgNAXbxO8nqWYrk43QSEqFw++Wa 4IvSRxMwTZ0rwK8FAJ8u1csDQy36/mmE9QXTI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924804; x=1719529604; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=55AI1Zdq2PtMQvY/0hkcvJqBd9KlBMTMR5uFE0YcI/k=; b=eiYtbhTlJVgHwGuriGOdthYcl13eZcg/M2JgUZIBjUo2QvCblnLLH0f1YLQaNWITyQ +5XUgBXKymVs018CPQp+r5muQbWkvEEdcHxAZ2Sb6kbO18k0AQhROCZXE1PPODI1MMnr lcc0exegLOhfoupW5XeBpcegQKJ1dV3kArfwG/GNDZO/RIN2akHwItNbN1sc8GfBgZjO W8df7SEoFz+F6wSIa3SKWKtNS917Xqi1Rnav1n1x9JY7fo238FQOS/kAuuNVE/XQwWh7 jIU2NGw/E7LitZ/H/feNc3ZMhsGYNpomyu3HcpItAnbm4Hw7gfqKRcuwP3W0owT3xH68 MXrA== X-Gm-Message-State: AOJu0Yyu/oRQ2Oa7yioijo+IHN5buMNTG8J7lan9AkGMfu3KgLm0mSjv ON4e2/ze6BnapDg7VQJGqsbZVoJrsSgi2CTDpAmTxJuK6ZyHK+w7v0+c/oMyPytpweNjhz/JPoo ytw== X-Google-Smtp-Source: AGHT+IGLnZAJ44OCy90q1HuPE748YtsmNyGjAfWkiWEPSyN1gH4G+3T7KU84X7TwinYibGGDpxppQQ== X-Received: by 2002:a05:6602:6003:b0:7f1:3ad1:2341 with SMTP id ca18e2360f4ac-7f13ee24152mr775004539f.7.1718924804350; Thu, 20 Jun 2024 16:06:44 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:44 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Bin Meng Subject: [PATCH v3 08/18] x86: Set up some assumed sizes for binary blobs Date: Thu, 20 Jun 2024 17:06:15 -0600 Message-Id: <20240620230625.1797397-9-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add assumed sizes so that Binman can check that the U-Boot binaries do not grow too large. Signed-off-by: Simon Glass --- (no changes since v1) arch/x86/dts/u-boot.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi index e0de3318091..fdd28979e0b 100644 --- a/arch/x86/dts/u-boot.dtsi +++ b/arch/x86/dts/u-boot.dtsi @@ -24,9 +24,11 @@ #ifdef CONFIG_HAVE_INTEL_ME intel-descriptor { filename = CONFIG_FLASH_DESCRIPTOR_FILE; + assume-size = <0x1000>; }; intel-me { filename = CONFIG_INTEL_ME_FILE; + assume-size = <0x1ff000>; }; #endif #ifdef CONFIG_TPL @@ -87,6 +89,7 @@ #ifdef CONFIG_HAVE_MRC intel-mrc { offset = ; + assume-size = <0x2fc94>; }; #endif #ifdef CONFIG_FSP_VERSION1 @@ -98,6 +101,7 @@ #ifdef CONFIG_FSP_VERSION2 intel-descriptor { filename = CONFIG_FLASH_DESCRIPTOR_FILE; + assume-size = <4096>; }; intel-ifwi { filename = CONFIG_IFWI_INPUT_FILE; @@ -139,6 +143,7 @@ intel-vga { filename = CONFIG_VGA_BIOS_FILE; offset = ; + assume-size = <0x10000>; }; #endif #ifdef CONFIG_HAVE_VBT From patchwork Thu Jun 20 23:06:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950493 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=QDiOa/Eq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x4W5mn2z1ydW for ; Fri, 21 Jun 2024 09:08:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 151EB88571; Fri, 21 Jun 2024 01:06:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="QDiOa/Eq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 63568885A0; Fri, 21 Jun 2024 01:06:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) (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 5A50F8855E for ; Fri, 21 Jun 2024 01:06:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-7eb6aedcabcso52374139f.0 for ; Thu, 20 Jun 2024 16:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924805; x=1719529605; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XeXW3Qkj/z7FbBVWiNsQkea6rMAPAsdsziJNKVVIk2Y=; b=QDiOa/EqY8VCLZ736paLbTrMp3rm3AGU7wWc1konXB5Mw0jvn1H32WtqBT3sCMwGFd HfiN6v2nQC+4o1l/wPkRvHOuNUuX6Snbt4GF/xBamB0plxTxoj4nTUtTg/+3ht6vnaox h8zWdewTz+g3zZyMWfLj/75UdluEadwEQiPKw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924805; x=1719529605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XeXW3Qkj/z7FbBVWiNsQkea6rMAPAsdsziJNKVVIk2Y=; b=sm3p7MZxTThO+P2SM3fPduUNSH0f1fm4fDKj9TR1wVhks4g0Vs5hu6d/BKP6L/H21j EVM1ixs8MW22yMPrCcFEuarKOsNP9IUhgxa2L9C5/F2f3r4ig2mqWOLmtGd+lWqh4Pxz BgpCfzUdhNaN5hZ7e/Ho888MidXg926ZLoy/t/8oAmYDQaacpDgiZrCWJBPxGUdbcyWS TJBN7OisUesadWRoS2HiWaNkR7IgaURWDt+3sFGuwfUMTStutVxUJjAXIRofUuFLgiqz S6+6QwckdMLhhoWqrXo11U+khEvPRIm6DHuFnxOHhm+NfBedMCyCEYwQuAx97l4dub+W sDYw== X-Gm-Message-State: AOJu0YwXo1Z4KPMJZiVtal3VG0QCnwA3KsknvTQKCc7IfbxfG4aHw5Np cB/D6f7M/0/SPVjRsl2/Xg2ebEBQcAGztBM/5/MMhuk7eOirv9z4iOBzqSX2IXqIpFNFQ9YnyXO ofw== X-Google-Smtp-Source: AGHT+IHp6Q2eh9UCm9xhD9ylDEpBZqf0prGHF9Ao30eWFiGBUNjdOlJzrtQcxu6SdJPW1le6HI2YgQ== X-Received: by 2002:a05:6602:1582:b0:7eb:eeba:5e90 with SMTP id ca18e2360f4ac-7f13ee84deemr813149239f.18.1718924805036; Thu, 20 Jun 2024 16:06:45 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:44 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Allen Martin , Ilias Apalodimas , Martyn Welch , Peter Robinson , Svyatoslav Ryhel Subject: [PATCH v3 09/18] nvidia: nyan-big: Disable debug UART Date: Thu, 20 Jun 2024 17:06:16 -0600 Message-Id: <20240620230625.1797397-10-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This cannot be enabled early in boot since some other init is needed. At this point it is unclear exactly what init is needed, so disable the debug UART to avoid a hang. Signed-off-by: Simon Glass --- (no changes since v1) configs/nyan-big_defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/nyan-big_defconfig b/configs/nyan-big_defconfig index 1483d17d975..4dec710cf8d 100644 --- a/configs/nyan-big_defconfig +++ b/configs/nyan-big_defconfig @@ -17,7 +17,6 @@ CONFIG_TEGRA124=y CONFIG_TARGET_NYAN_BIG=y CONFIG_TEGRA_GPU=y CONFIG_SYS_LOAD_ADDR=0x82408000 -CONFIG_DEBUG_UART=y CONFIG_FIT=y CONFIG_FIT_BEST_MATCH=y CONFIG_BOOTSTAGE=y From patchwork Thu Jun 20 23:06:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950494 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=nuiHZAOP; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x4j5KWGz1ydW for ; Fri, 21 Jun 2024 09:08:53 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 72BC3885BF; Fri, 21 Jun 2024 01:06:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="nuiHZAOP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5D6E58855E; Fri, 21 Jun 2024 01:06:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (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 2F5C687D1A for ; Fri, 21 Jun 2024 01:06:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-7ea0b5e0977so56530339f.2 for ; Thu, 20 Jun 2024 16:06:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924806; x=1719529606; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mfcLD1zI16U3eN8QPXtyDsRvUuj2hvtPCbl0nEveeBM=; b=nuiHZAOPd/HqqbHLg6AvK2zdj8MUcfb4Extid09fn2arBzjtvDa12lZ9nVtMNLBI7r cdmG1NWVOL9A5/gn+U4sL+GwgIHpVfhgOHR1RzArEj9xx7gW08MlRxfUytNLg/MgKPz1 6IORriXQqWFDg39k2Ohdv1lB/cqBAEh9dDTCg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924806; x=1719529606; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mfcLD1zI16U3eN8QPXtyDsRvUuj2hvtPCbl0nEveeBM=; b=cCCDCNv4l/JUktayfpD5YssG8l89jwA8H4ExDFmR5p/xJH1+G+kvcvNjKuIvGoOval 5ER0i5KGjv+IqST8wc5Tj0QFuSaR+NFrFUg86vzPAG0GfOYQvhaQGUkFJoiPslSx2i0u fAEdiV0IStAed+AXbXKmymRBbsZCUGrZJSTCHfelDAw0ce2Jp+c09C+lWZG0zkyfUZPN BkBW9b/1mZ3sKdYGrCVizfnalWh3YKx1Nf44477P+OgGFyUSiHlsQNfISYuYOqDmlZJN 19xCVdpAF9wOu9+7reNieSAXBBXd+0FJFDaylzPtkuropULlEs8KV8RWzSSb9fMA48RG seOQ== X-Gm-Message-State: AOJu0Yy0bmBsuiNiRhIExnp9ShiycwHG1CVRA+qEtesA13/xAoGlkb5f IsvHTOxgM651LZHu60vQC2K39nkUeIvpevy8jp5mxg5GF3s6jA36j9++JcPXHRogX+4V6Q8Y045 ndA== X-Google-Smtp-Source: AGHT+IG2taZTGw8gvm0zJNCEZUutOC8O2aXxLKthfXPEUfg278UYTmZLKkmp1La7ItFGGlwbDGHmBA== X-Received: by 2002:a05:6602:15d1:b0:7e1:a7e8:eecb with SMTP id ca18e2360f4ac-7f13edde67cmr748517939f.6.1718924805853; Thu, 20 Jun 2024 16:06:45 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:45 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Heinrich Schuchardt , AKASHI Takahiro , Bin Meng , Eddie James , Ilias Apalodimas , Michal Simek , Oleksandr Suvorov , Sean Anderson , =?utf-8?q?Vincent_Stehl=C3=A9?= Subject: [PATCH v3 10/18] tpm: Avoid code bloat when not using EFI_TCG2_PROTOCOL Date: Thu, 20 Jun 2024 17:06:17 -0600 Message-Id: <20240620230625.1797397-11-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean It does not make sense to enable all SHA algorithms unless they are needed. It bloats the code and in this case, causes chromebook_link to fail to build. That board does use the TPM, but not with measured boot, nor EFI. Since EFI_TCG2_PROTOCOL already selects these options, we just need to add them to MEASURED_BOOT as well. Note that the original commit combines refactoring and new features, which makes it hard to see what is going on. Fixes: 97707f12fda tpm: Support boot measurements Reviewed-by: Heinrich Schuchardt Signed-off-by: Simon Glass --- (no changes since v2) Changes in v2: - Put the conditions under EFI_TCG2_PROTOCOL - Consider MEASURED_BOOT too boot/Kconfig | 4 ++++ lib/Kconfig | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/boot/Kconfig b/boot/Kconfig index 6f3096c15a6..b061891e109 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -734,6 +734,10 @@ config LEGACY_IMAGE_FORMAT config MEASURED_BOOT bool "Measure boot images and configuration when booting without EFI" depends on HASH && TPM_V2 + select SHA1 + select SHA256 + select SHA384 + select SHA512 help This option enables measurement of the boot process when booting without UEFI . Measurement involves creating cryptographic hashes diff --git a/lib/Kconfig b/lib/Kconfig index 189e6eb31aa..568892fce44 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -438,10 +438,6 @@ config TPM bool "Trusted Platform Module (TPM) Support" depends on DM imply DM_RNG - select SHA1 - select SHA256 - select SHA384 - select SHA512 help This enables support for TPMs which can be used to provide security features for your board. The TPM can be connected via LPC or I2C From patchwork Thu Jun 20 23:06:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950495 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Hp8SVGOh; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x4w6nzyz1ydW for ; Fri, 21 Jun 2024 09:09:04 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D590188569; Fri, 21 Jun 2024 01:06:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Hp8SVGOh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5B8E987E13; Fri, 21 Jun 2024 01:06:50 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (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 DF94387B77 for ; Fri, 21 Jun 2024 01:06:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd41.google.com with SMTP id ca18e2360f4ac-7ebe019b9cdso51284939f.0 for ; Thu, 20 Jun 2024 16:06:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924806; x=1719529606; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A6d6Au1EjTcFyCj48QfjSy1CLH2vHtoyvSNInjPJf5g=; b=Hp8SVGOhpo/hqzdbkWukpUr1ylMJ9ST0gZCHE6dni2zKzZmdVjcK9pxansvNP0Hd0G i4i1n5USa2ieIC4h5JdHXEMgAsSwloRQBvNOK6w0ynaiq/oOju+S7NsoQAygOU5tPOBf MXg4FoWGMjwroIlETClWH9DRDAK0wwKTpE7/I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924806; x=1719529606; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A6d6Au1EjTcFyCj48QfjSy1CLH2vHtoyvSNInjPJf5g=; b=U5J1Vt/xzc+DaaFtjLZmRR7biaNve5jAhoaLbC5hlNs02fj3GvopHv4RXwN3bWW8Ms mFYWxqMrUzUeG/DEISQ8Crs2P7ibXxiXBWDikrc5uQRk9Vys2pQz/cHO5KtGWfEqKrYC 9yY9BUihB8HSqz9nzUxJjdlw8wYOEDvBJA9TXaCsBVsXGVPQmQy0lVPhUWMTCXG3BAOM rTXCpQUFdU/m/oaZANWMHy/pG7cAbGwMZs/cwywOLfdyvzPtyqNJjDTQSDd/a9gCu+GG PjgLDcZVWjm4nax9sD8rFt2Oze0J5Z9a/OWF+BNW3k1yITUJp2WAR8N2kji+wfD7A4JJ LsIA== X-Gm-Message-State: AOJu0YzJleIHvRW0tJwoiVqenIf7xdztjEjpzDGUqa1sAUgrWxWIYJsN JuoEFYRc6bKYB2j7Y3Dak0GH5jjhScn1t/7gyo8F3DDZ3zoJmb4BGqFTJq5RT50LjYJrP/JW9MW GLMn9 X-Google-Smtp-Source: AGHT+IHxFxB5cf4sOZjtWZRdYfpgsrbWr5vyLcxUAWHl6MOjecFLr+P/qTd3/zj7hyTTdPrj0hneMw== X-Received: by 2002:a05:6602:3429:b0:7eb:708a:3264 with SMTP id ca18e2360f4ac-7f13ee0f2cfmr718115539f.10.1718924806574; Thu, 20 Jun 2024 16:06:46 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:46 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Quentin Schulz , Jeffy Chen , Kever Yang , huang lin Subject: [PATCH v3 11/18] rockchip: veyron: Add logging for power init Date: Thu, 20 Jun 2024 17:06:18 -0600 Message-Id: <20240620230625.1797397-12-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add better logging for power init so that CONFIG_LOG_ERROR_RETURN can be enabled. Signed-off-by: Simon Glass Reviewed-by: Quentin Schulz --- (no changes since v2) Changes in v2: - Remove the superfluous if() and drop the debug() as well board/google/veyron/veyron.c | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/board/google/veyron/veyron.c b/board/google/veyron/veyron.c index 32dbcdc4d10..6d4c9debdee 100644 --- a/board/google/veyron/veyron.c +++ b/board/google/veyron/veyron.c @@ -29,44 +29,38 @@ static int veyron_init(void) int ret; ret = regulator_get_by_platname("vdd_arm", &dev); - if (ret) { - debug("Cannot set regulator name\n"); - return ret; - } + if (ret) + return log_msg_ret("vdd", ret); /* Slowly raise to max CPU voltage to prevent overshoot */ ret = regulator_set_value(dev, 1200000); if (ret) - return ret; + return log_msg_ret("s12", ret); udelay(175); /* Must wait for voltage to stabilize, 2mV/us */ ret = regulator_set_value(dev, 1400000); if (ret) - return ret; + return log_msg_ret("s14", ret); udelay(100); /* Must wait for voltage to stabilize, 2mV/us */ ret = rockchip_get_clk(&clk.dev); if (ret) - return ret; + return log_msg_ret("clk", ret); clk.id = PLL_APLL; ret = clk_set_rate(&clk, 1800000000); if (IS_ERR_VALUE(ret)) - return ret; + return log_msg_ret("s18", ret); ret = regulator_get_by_platname("vcc33_sd", &dev); - if (ret) { - debug("Cannot get regulator name\n"); - return ret; - } + if (ret) + return log_msg_ret("vcc", ret); ret = regulator_set_value(dev, 3300000); if (ret) - return ret; + return log_msg_ret("s33", ret); ret = regulators_enable_boot_on(false); - if (ret) { - debug("%s: Cannot enable boot on regulators\n", __func__); - return ret; - } + if (ret) + return log_msg_ret("boo", ret); return 0; } @@ -81,7 +75,7 @@ int board_early_init_r(void) if (!fdt_node_check_compatible(gd->fdt_blob, 0, "google,veyron")) { ret = veyron_init(); if (ret) - return ret; + return log_msg_ret("vey", ret); } #endif /* From patchwork Thu Jun 20 23:06:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950496 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=CdvzKGaP; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x574TFhz1ydW for ; Fri, 21 Jun 2024 09:09:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3F1C588590; Fri, 21 Jun 2024 01:06:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CdvzKGaP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DD74A8857E; Fri, 21 Jun 2024 01:06:50 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 A1DF0883F2 for ; Fri, 21 Jun 2024 01:06:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-7ea0b5e0977so56531039f.2 for ; Thu, 20 Jun 2024 16:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924807; x=1719529607; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bJXFsCW6LCl1bXkmZ8sKbXEiUPqgjCbPoT+lGmHDHLY=; b=CdvzKGaPU+bCrOC3SDkb/0c+tPIbLRWpbxlgVHveqAVXslKc9d1WdKFn9dtUedyKW+ olest1mAVMf0bD7aZcZpNyae70CoKrIMAayK20uIpWDEVF+qKu8o5kxNcLcew6Mh/8uq +UR3tPfe/18Fvbl1+qASdwdpSn6be/4dgRxdM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924807; x=1719529607; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bJXFsCW6LCl1bXkmZ8sKbXEiUPqgjCbPoT+lGmHDHLY=; b=vw3L79Hwo79EtHCX7Qic1wvHYORMZ6cylYmlg4v5VvOEQpLjB8sIcD0eKrW23YBgRO 2GkEx6Is8EoSZ2fBX6TdW5nVn4KMVm+YZKGV/WTAxZ8ExF/NgqLzuCwvRqDJ7RxGEldf c+wz8uvKalo3TLIVZR37j0E+P5TzQfFXFG40U/QIZ9tyczR8ep25UvsOppbWW3QlLkah ntUGwJDMYMyQwC3vMwohNK+LoeWIWY4+FuVzr3Iy/pQS5DeOursJhGajGqkrBpZwhA8o zj+K7eI+ClCMP22K7vgoavqNoFAidPqrAufjm/UdtjaeBaCErNS9ATE6vy8Dcb6apfrZ 3ygw== X-Gm-Message-State: AOJu0Yz9bR7XyORH30hB6YEUEYEM/aU9zERhT8+t/sgV4LJ+QPU6zkm/ Yfhe1mY328XgjV1+dOneCJVS/SqGO83GYyyXAinwg+ZwZZ9I5gbjv2wUxPJDW/Nnz6FTOdk5KeJ imQ== X-Google-Smtp-Source: AGHT+IHszklWeWJyugW7BqqRA4xKPSuzvgNMacX1FBngAbvhAFgp9gx5DwjumMIevx4iUu07TYi6Dg== X-Received: by 2002:a05:6602:2d86:b0:7eb:7bc9:7fe2 with SMTP id ca18e2360f4ac-7f13edde98amr735623439f.8.1718924807311; Thu, 20 Jun 2024 16:06:47 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:47 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Jonas Karlman , Quentin Schulz , Eugen Hristev , Jaehoon Chung , Kever Yang , Lukasz Majewski , Patrice Chotard Subject: [PATCH v3 12/18] power: regulator: Handle autoset in regulators_enable_boot_on() Date: Thu, 20 Jun 2024 17:06:19 -0600 Message-Id: <20240620230625.1797397-13-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean With a recent change, regulators_enable_boot_on() returns an error if a regulator is already set. Check for and handle this situation. Fixes: d99fb64a98a power: regulator: Only run autoset once for each regulator Reviewed-by: Jonas Karlman Reviewed-by: Quentin Schulz Signed-off-by: Simon Glass --- (no changes since v1) drivers/power/regulator/regulator-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c index 77d101f262e..d9e1fb68295 100644 --- a/drivers/power/regulator/regulator-uclass.c +++ b/drivers/power/regulator/regulator-uclass.c @@ -518,7 +518,7 @@ int regulators_enable_boot_on(bool verbose) dev; uclass_next_device(&dev)) { ret = regulator_autoset(dev); - if (ret == -EMEDIUMTYPE) { + if (ret == -EMEDIUMTYPE || ret == -EALREADY) { ret = 0; continue; } From patchwork Thu Jun 20 23:06:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950497 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=miYTlxSm; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x5K5R3zz1ydW for ; Fri, 21 Jun 2024 09:09:25 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A5380885A9; Fri, 21 Jun 2024 01:06:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="miYTlxSm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5CE258839C; Fri, 21 Jun 2024 01:06:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (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 46A4E8839C for ; Fri, 21 Jun 2024 01:06:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-7eeea388a8eso53539339f.2 for ; Thu, 20 Jun 2024 16:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924808; x=1719529608; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Y4lytI5B/VVQ+P1ExYkyDHmVTgiifZTk2pLRXpeygHA=; b=miYTlxSmIkcc/Lv8tcBAKDmgYDapQQfKUdb19mdfLFNiy5GzVBkf2k/RZ4CazugMRs KfxfDu4CIBTtBwKk0YkCgs54HiYwDuENKU0T4XR9mCbz9mnQSU0lMdC6mzzOTKA33ja1 bNKNXvp1PTb4YoQyDzACZYCW5YTzgMJkjezyk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924808; x=1719529608; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y4lytI5B/VVQ+P1ExYkyDHmVTgiifZTk2pLRXpeygHA=; b=J+qcg8HGN5ftcCQrsvhA35DhoXY3jxkCb+Y00Gdnd7t4/aEhH2A0aFPpSBohh1GTCA x1YzQO2J37z9MRpBxuwPEK09txAO3SgBTwZbZg9IWwdtRZZGxdN/L23faEg86h2PIv9k aK6uVb1oHspvD4MepOLnGH2voieIpaBM7m38Jy5lT1RgLxnNgCtht2PZiuH/txbUoBGw bG7CxVDqdL+1pogLrMKyOKzsJk4MuQHonDioPbqVbkGCoy1roUnPmcQYc8QGREGhveeh SX/l6Os2c6FWIVlVCQf50qAiBKDXckfEk1iiqGDTRZciaGuKT6Cyyo+UOVqBySWrGddu VZaQ== X-Gm-Message-State: AOJu0Yz4wdOYnFDkTJG3XSXmF4ZBokRU0qw7O9Pv738/ohUOAhn0oV17 5Ym16EFEH+2VV2C1WfbXA6EWtGd9CaqTlztuUe8K+NazqQBkE50YPUbIAuYc+MsOoqwfCGp2QoC M8g== X-Google-Smtp-Source: AGHT+IE6YV1uDBnHAw5UUsL2TJbJ4trSvvmqc5WkLI8DS/fziNQqRMC5X54m4YVMq4KvkMx2FmiAAQ== X-Received: by 2002:a05:6602:6002:b0:7eb:cbef:1731 with SMTP id ca18e2360f4ac-7f13eea7dbfmr723704439f.21.1718924807984; Thu, 20 Jun 2024 16:06:47 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:47 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Ilias Apalodimas , Jerry Van Baren , Shiji Yang Subject: [PATCH v3 13/18] fdt: Correct condition for bloblist existing Date: Thu, 20 Jun 2024 17:06:20 -0600 Message-Id: <20240620230625.1797397-14-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On some boards, the bloblist is created in SPL once SDRAM is ready. It cannot be accessed until that point, so is not available early in SPL. Add a condition to avoid a hang in this case. This fixes a hang in chromebook_coral Fixes: 70fe2385943 ("fdt: Allow the devicetree to come from a bloblist") Signed-off-by: Simon Glass --- Changes in v3: - Use BLOBLIST instead of OF_BLOBLIST Changes in v2: - Use 'phase' instead of 'stage' lib/fdtdec.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/fdtdec.c b/lib/fdtdec.c index b2c59ab3818..e16d1819449 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1669,8 +1669,16 @@ int fdtdec_setup(void) { int ret = -ENOENT; - /* If allowing a bloblist, check that first */ - if (CONFIG_IS_ENABLED(BLOBLIST)) { + /* + * If allowing a bloblist, check that first. This would be better + * handled with an OF_BLOBLIST Kconfig, but that caused far too much + * argument, so add a hack here, used e.g. by chromebook_coral + * The necessary test is whether the previous phase passed a bloblist, + * not whether this phase creates one. + */ + if (CONFIG_IS_ENABLED(BLOBLIST) && + (spl_prev_phase() != PHASE_TPL || + !IS_ENABLED(CONFIG_TPL_BLOBLIST))) { ret = bloblist_maybe_init(); if (!ret) { gd->fdt_blob = bloblist_find(BLOBLISTT_CONTROL_FDT, 0); From patchwork Thu Jun 20 23:06:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950498 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=I2oXj4WQ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x5W5G50z1ydW for ; Fri, 21 Jun 2024 09:09:35 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 15044885BC; Fri, 21 Jun 2024 01:06:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="I2oXj4WQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EE4CA885A8; Fri, 21 Jun 2024 01:06:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) (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 DCA728855E for ; Fri, 21 Jun 2024 01:06:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-7ea0b5e0977so56531539f.2 for ; Thu, 20 Jun 2024 16:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924808; x=1719529608; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JPDTBpVZuVkaqULrtYe8FXz9i1e5MJHdje88Wa78OmY=; b=I2oXj4WQ3tZwnoYg9jnsrObsO31Z/EE4YS33SX7DcrVWVrZfebOElNHyTzBVKnpSFA QkxBTudmBwIbyttUg+nEuRFBPO2clE6qyLmrE1FSzEGUIT6qCqeGTC9brBkr4plQSR66 MVHpr2Ps1XLj6hiICYQR8Sn4Y3tYj8UddoT3E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924808; x=1719529608; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JPDTBpVZuVkaqULrtYe8FXz9i1e5MJHdje88Wa78OmY=; b=GikEO2SskyktbTqgcU5TbR0zX+PptQEEknk6gi5DlVub4dzGkR+HeQDGG+KlIrx/G+ FvWDcshn+a73g0bojrp4YCL+CgGbhnFS78QNGI0AwZhfJ9QWU9hi+7Y/7hKO6xxeMjun YAl2OzEVDyj/YlwalQkUL/CCr/EaxyA+AOCalhRrBPi1VDpzUEw+3cfPYblKzrmyVNlb qoL2/CxbN9utBRSMXd7VEo+Bpv9VO827fqzUTtPmgU70muDicTdWIAm4ArL+tz+ZL2/t 5TNqqwgsZ2vlXWOvpMRD83bkSdKIUZxqwVRNMBtTXsPu9/TsStSFw1JnmFxEWxvSYmMm G8rA== X-Gm-Message-State: AOJu0YxTt4RyTLs+EMKw6pSgzDBEsqiF93E32wsDZR+IiZgeVn2S4fzc oR71bvjpZCxXBf/xmMrNf8V/sumFZpRCzc2jc8JoXK9HljcbcJRjYfSzHvm9y9L2Zqaqib0JbZU k9Q== X-Google-Smtp-Source: AGHT+IEgRhCTfLirSQl8kT5LwzPNNCVPgu1rGZkm+P8aGilIPNczbWGB7YYINX69ujsbdwT1bWP5MA== X-Received: by 2002:a05:6602:6d15:b0:7eb:71b9:fc8 with SMTP id ca18e2360f4ac-7f13ee6983cmr742120939f.16.1718924808612; Thu, 20 Jun 2024 16:06:48 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:48 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Chanho Park Subject: [PATCH v3 14/18] spl: Allow ATF to work when dcache is disabled Date: Thu, 20 Jun 2024 17:06:21 -0600 Message-Id: <20240620230625.1797397-15-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The dcache may not be enabled in SPL. Add a check to avoid trying to use an undefined function. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- (no changes since v1) common/spl/spl_atf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c index 3bdd013a35f..9afe6456bc4 100644 --- a/common/spl/spl_atf.c +++ b/common/spl/spl_atf.c @@ -204,7 +204,8 @@ static void __noreturn bl31_entry(uintptr_t bl31_entry, uintptr_t bl32_entry, fdt_addr); raw_write_daif(SPSR_EXCEPTION_MASK); - dcache_disable(); + if (!CONFIG_IS_ENABLED(SYS_DCACHE_OFF)) + dcache_disable(); atf_entry(bl31_params, (void *)fdt_addr); } From patchwork Thu Jun 20 23:06:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950499 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=naj0CcHu; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x5j1HsZz1ydW for ; Fri, 21 Jun 2024 09:09:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 768EE885CF; Fri, 21 Jun 2024 01:06:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="naj0CcHu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AEDAD88569; Fri, 21 Jun 2024 01:06:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (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 9DBD887B77 for ; Fri, 21 Jun 2024 01:06:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-7f38f5584ebso21979139f.3 for ; Thu, 20 Jun 2024 16:06:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924809; x=1719529609; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3QVjgvZkf9bVBvoxHsy/rlFaH05Vnyr++Ji4XD4ula4=; b=naj0CcHu52yNN6FYgCi0snzMRzKVmK9/zbTmKRNi73ZeFJdRPSNTOQexgc71A8r8EF 7NJZjSf0NEgiHLPK2E2FVDArCsq3tNpicPLjLRPlD+x4QUAJ3LRbit8FQ3UhgTVW8dvC ma31lkulN+zd3U6Lm8vekpZAZMaBU6SIv6jrk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924809; x=1719529609; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3QVjgvZkf9bVBvoxHsy/rlFaH05Vnyr++Ji4XD4ula4=; b=b4mMXasckUp7TGTMToouFHuYESnmGi5bOLfMPjcDRxQxsPyzUYAKaYE2eL6Lx7X5EA HQMM6hlpAkJPbkMdY6B+g1FeJjQpqk36niAhczIYOSqI68zevMVt/U8Uh67R4nbFZe/B TaioWmweMYoUPtn94W1mS3Ib91X1kBuq6wduld0J3MqmDhdsKCoygMEMenAaazvamC3J GOZWWFVBjPiHWs7gBVlByT1vxwYYzQkK2V2HI9ru3eY5YIbZgXfLkMBqamPwzuAI8ilB hfsGEI/f0DF7eWfjyxmsefiYB4htNtkwWnmqFYAACW7zXq3f2g6N+e/tJWQ+JDD5+p7b GbWg== X-Gm-Message-State: AOJu0Ywqgfp/6k7QJG2J/MdGi6j6fu1rwF9oTfVqxuMwVwx2KaSr69/D /mYm0XjQ7mtzGO1CZgrMXgAK78FjzDaUIQkt1O4Kn72CtUgkQDnWhoCkFRIIi9bWLEVFh4fTwtq j4w== X-Google-Smtp-Source: AGHT+IHkL5oh2n8QWFqmUJweYkgfb1/CWLfNe8h7dm5tUbVkIrS0fTl6hq7uMeVknaWJTQsZJX/6Hw== X-Received: by 2002:a05:6602:2cd2:b0:7eb:8afa:ecf8 with SMTP id ca18e2360f4ac-7f13ee0eb39mr786962339f.11.1718924809314; Thu, 20 Jun 2024 16:06:49 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:49 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Jeffy Chen , Jonas Karlman , Kever Yang , Philipp Tomsich , Quentin Schulz , huang lin Subject: [PATCH v3 15/18] rockchip: Ensure memory size is available in RK3399 SPL Date: Thu, 20 Jun 2024 17:06:22 -0600 Message-Id: <20240620230625.1797397-16-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean At present gd->ram_size is 0 in SPL, meaning that it is not possible to enable the cache. Correct this by always populating the RAM size correctly. This increases code size by about 500 bytes in SPL, since it must call the rather large rockchip_sdram_size() function. Signed-off-by: Simon Glass --- Changes in v3: - Cut the patch down to bare bones Changes in v2: - Add new patch to correct memory size in SPL drivers/ram/rockchip/sdram_rk3399.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 02cc4a38cf0..3c4e20f4e80 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -3142,19 +3142,19 @@ static int rk3399_dmc_init(struct udevice *dev) static int rk3399_dmc_probe(struct udevice *dev) { + struct dram_info *priv = dev_get_priv(dev); + #if defined(CONFIG_TPL_BUILD) || \ (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) if (rk3399_dmc_init(dev)) return 0; -#else - struct dram_info *priv = dev_get_priv(dev); - +#endif priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF); debug("%s: pmugrf = %p\n", __func__, priv->pmugrf); priv->info.base = CFG_SYS_SDRAM_BASE; priv->info.size = rockchip_sdram_size((phys_addr_t)&priv->pmugrf->os_reg2); -#endif + return 0; } From patchwork Thu Jun 20 23:06:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950500 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ilxVihdA; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x5v3Qpqz1ydW for ; Fri, 21 Jun 2024 09:09:55 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D6E05885DF; Fri, 21 Jun 2024 01:06:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="ilxVihdA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C6B2C88590; Fri, 21 Jun 2024 01:06:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (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 9C3FC8859F for ; Fri, 21 Jun 2024 01:06:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-7eb75c0d0a7so47049339f.3 for ; Thu, 20 Jun 2024 16:06:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924810; x=1719529610; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ju9PAOGjEluCOxzy16vw0egRYSER0uqH9roSyQ2V8fI=; b=ilxVihdAuedgvc5BTEzW10wt0TQXASiorAgtvPrCXBjw0WnesO7AfmscFAKz7F6N7T XrZN82JYIsrRdAH/BmknyljtxTux4z8nXQ9SaU5u8r+qzPsCz/oLwlin3sinDpNmpjoP GobjDaODvjNpPgWZv/FZFnbVfAINfSkx2AM/I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924810; x=1719529610; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ju9PAOGjEluCOxzy16vw0egRYSER0uqH9roSyQ2V8fI=; b=hPpMv8tPCsSL2agTrboWuimgz3JTgUyOsbeHJRFyqyjSQpN9GXcPaXesOim9GWPUoL 34U2/9OyPgVOcLhgFX8lyv2OIWw8dFILnaN34mFheh7Yz4YwwN5DSe4VN10FBvlbi82y ALMfsIsG5U7OCFK7BEAh3MCvcpypyk/FMHY5Il/k+69fLRS6WXaNb0oNgotvTOKc3WNc UQCtdfXQJ1ligwnFAqYNx/JXS/oKXMkGTbjfsTpCAMXztuota7cyYd0Fur6nl5+ZrRY4 5BLgTKarwhtFTXn8L+JdCWpzNabhcDuNrS93rFXWaAgS2KGRP8q/TlVBkm71UOb6XUTH QMWg== X-Gm-Message-State: AOJu0Yy8iClcbVkZ1vRDBtTpRks+DP1N/GEEThRJbujd797CnM8TAm/A p6odYwgphUowITNKw4nJkSUqrdfipHFmU5XDhNZK22HNht/hJa3/6P9YAeKU+w6u/yDlViIIOVZ Dgw== X-Google-Smtp-Source: AGHT+IFAV0mRybPRVTgRmnAM/ka9e/PS/1qOFMU82/xYKEvMu7Dpi7IBSgvJaQoQzJFhExMsFVQusw== X-Received: by 2002:a05:6602:2c84:b0:7eb:49ed:441f with SMTP id ca18e2360f4ac-7f13eea3a27mr752483439f.20.1718924810287; Thu, 20 Jun 2024 16:06:50 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:49 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Jeffy Chen , Jonas Karlman , Kever Yang , Philipp Tomsich , Quentin Schulz , huang lin Subject: [PATCH v3 16/18] rockchip: Avoid #ifdefs in RK3399 SPL Date: Thu, 20 Jun 2024 17:06:23 -0600 Message-Id: <20240620230625.1797397-17-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The code here is confusing due to large blocks which are #ifdefed out. Add a function phase_sdram_init() which returns whether SDRAM init should happen in the current phase, using that as needed to control the code flow. This increases code size by about 500 bytes in SPL when the cache is on, since it must call the rather large rockchip_sdram_size() function. Signed-off-by: Simon Glass --- Changes in v3: - Split out the refactoring into a separate patch - Drop the non-dcache optimisation, since the cache should normally be on drivers/ram/rockchip/sdram_rk3399.c | 47 ++++++++++++++++------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 3c4e20f4e80..2f37dd712e7 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -63,8 +64,6 @@ struct chan_info { }; struct dram_info { -#if defined(CONFIG_TPL_BUILD) || \ - (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) u32 pwrup_srefresh_exit[2]; struct chan_info chan[2]; struct clk ddr_clk; @@ -75,7 +74,6 @@ struct dram_info { struct rk3399_pmusgrf_regs *pmusgrf; struct rk3399_ddr_cic_regs *cic; const struct sdram_rk3399_ops *ops; -#endif struct ram_info info; struct rk3399_pmugrf_regs *pmugrf; }; @@ -92,9 +90,6 @@ struct sdram_rk3399_ops { struct rk3399_sdram_params *params); }; -#if defined(CONFIG_TPL_BUILD) || \ - (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) - struct rockchip_dmc_plat { #if CONFIG_IS_ENABLED(OF_PLATDATA) struct dtd_rockchip_rk3399_dmc dtplat; @@ -191,6 +186,17 @@ struct io_setting { }, }; +/** + * phase_sdram_init() - Check if this is the phase where SDRAM init happens + * + * Returns: true to do SDRAM init in this phase, false to not + */ +static bool phase_sdram_init(void) +{ + return spl_phase() == PHASE_TPL || + (!IS_ENABLED(CONFIG_TPL) && !spl_in_proper()); +} + static struct io_setting * lpddr4_get_io_settings(const struct rk3399_sdram_params *params, u32 mr5) { @@ -3024,7 +3030,7 @@ static int rk3399_dmc_of_to_plat(struct udevice *dev) struct rockchip_dmc_plat *plat = dev_get_plat(dev); int ret; - if (!CONFIG_IS_ENABLED(OF_REAL)) + if (!CONFIG_IS_ENABLED(OF_REAL) || !phase_sdram_init()) return 0; ret = dev_read_u32_array(dev, "rockchip,sdram-params", @@ -3138,22 +3144,24 @@ static int rk3399_dmc_init(struct udevice *dev) return 0; } -#endif static int rk3399_dmc_probe(struct udevice *dev) { struct dram_info *priv = dev_get_priv(dev); -#if defined(CONFIG_TPL_BUILD) || \ - (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) - if (rk3399_dmc_init(dev)) - return 0; -#endif - priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF); - debug("%s: pmugrf = %p\n", __func__, priv->pmugrf); - priv->info.base = CFG_SYS_SDRAM_BASE; - priv->info.size = - rockchip_sdram_size((phys_addr_t)&priv->pmugrf->os_reg2); + if (phase_sdram_init()) { + if (rk3399_dmc_init(dev)) + return 0; + } else { + priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF); + debug("%s: pmugrf = %p\n", __func__, priv->pmugrf); + } + + if (!CONFIG_IS_ENABLED(SYS_DCACHE_OFF)) { + priv->info.base = CFG_SYS_SDRAM_BASE; + priv->info.size = + rockchip_sdram_size((ulong)&priv->pmugrf->os_reg2); + } return 0; } @@ -3181,10 +3189,7 @@ U_BOOT_DRIVER(dmc_rk3399) = { .id = UCLASS_RAM, .of_match = rk3399_dmc_ids, .ops = &rk3399_dmc_ops, -#if defined(CONFIG_TPL_BUILD) || \ - (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) .of_to_plat = rk3399_dmc_of_to_plat, -#endif .probe = rk3399_dmc_probe, .priv_auto = sizeof(struct dram_info), #if defined(CONFIG_TPL_BUILD) || \ From patchwork Thu Jun 20 23:06:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950501 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=dXFHa0d5; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x6643J2z1ydW for ; Fri, 21 Jun 2024 09:10:06 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 40F0A885EC; Fri, 21 Jun 2024 01:06:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="dXFHa0d5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8C151885A0; Fri, 21 Jun 2024 01:06:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (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 6A583885B6 for ; Fri, 21 Jun 2024 01:06:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-7f39116e564so9051139f.0 for ; Thu, 20 Jun 2024 16:06:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924811; x=1719529611; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CiMow7s4j2CsLyjXWJPRpZ4yYDVro6zP4w6YhlUwuAw=; b=dXFHa0d5liYw1BbI6VAl5/jvNsdAV/S18d6LOTRaQEZyrlR1qyaMvZT1bbKF3BaWvZ 01RiFlU5nY7tbazy+Q4TwibNl6pwnuoi50jHmzOZfFrIo6kn2mS5VX37sBR3T6BsI2GG kMT8dvVSCtGhCjFIgx2JfKgLUDJnMtMNtdlro= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924811; x=1719529611; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CiMow7s4j2CsLyjXWJPRpZ4yYDVro6zP4w6YhlUwuAw=; b=k8TLXIUzpR44Fv5xuCpSTFCNlqH80yupLlaYBJ+oiZHBzFEKwIEMO28s7DDSYrg9BE lfOiMyqmstqOwpX5+/Kz/nClzFcc+kuiKsnmB4kl6qIS2kutzCQ9VWkv8h5W/wJsFnqJ 7eB9IESkfoDv6SCLZJ9fKF17fLEOuat5efhgpx6mC0pAKKktyn81gMNptw1w4v52y/YM eifzYTxaPCxtvtpAqq/DPZahgiOYE4pLlXg7/CLKJ2fqElnUqrgvZ4RYhNOOHC/q2Oob 98bbIZ6wffpzXankmoLGyiwLuEFJ5+ZpiiK9+Hs02v1RVe+PJ8FjxY9V8P1UgXzZEIxO HYHg== X-Gm-Message-State: AOJu0Yy4Fa0ziDG+e10pbZvH2HXVr3dJt2wmLy98jGB5dcuw2EmW6YkP NpjTwW69CxQjf/VWkq1ekM1IwM0/IUtIkEq+Txz83SYTnYEZ/ExPecwuk2tvbLTzq8MLgY9WSt6 RLA== X-Google-Smtp-Source: AGHT+IH0SlKS1hTLNZd6rnzvto58I9YU+TqW6mc2r0ngbcdHDElYHCLNLRm7Inf5ZXJj5yeZ+RfQEw== X-Received: by 2002:a05:6602:3421:b0:7f1:3ad1:234e with SMTP id ca18e2360f4ac-7f13eea32f1mr828065639f.18.1718924811135; Thu, 20 Jun 2024 16:06:51 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:50 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alper Nebi Yasak , Chen-Yu Tsai , Dragan Simic , Jeffy Chen , Jonas Karlman , Kever Yang , Marek Vasut , Peter Robinson , Quentin Schulz , huang lin Subject: [PATCH v3 17/18] rockchip: bob: kevin: Disable dcache in SPL Date: Thu, 20 Jun 2024 17:06:24 -0600 Message-Id: <20240620230625.1797397-18-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This causes a hang, so disable it. Unfortunately the RAM-size fix does not resolve the problem and I am unsure what is wrong. As soon as the cache is enabled the board appears to hang. Fixes: 6d8cdfd1536 ("rockchip: spl: Enable caches to speed up checksum validation") Signed-off-by: Simon Glass --- (no changes since v1) configs/chromebook_bob_defconfig | 1 + configs/chromebook_kevin_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/chromebook_bob_defconfig b/configs/chromebook_bob_defconfig index acfe3934104..b2ecfa6050c 100644 --- a/configs/chromebook_bob_defconfig +++ b/configs/chromebook_bob_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_SKIP_LOWLEVEL_INIT=y +CONFIG_SPL_SYS_DCACHE_OFF=y CONFIG_COUNTER_FREQUENCY=24000000 CONFIG_ARCH_ROCKCHIP=y CONFIG_TEXT_BASE=0x00200000 diff --git a/configs/chromebook_kevin_defconfig b/configs/chromebook_kevin_defconfig index 95fdb418d82..da748e4f022 100644 --- a/configs/chromebook_kevin_defconfig +++ b/configs/chromebook_kevin_defconfig @@ -2,6 +2,7 @@ CONFIG_ARM=y CONFIG_SKIP_LOWLEVEL_INIT=y CONFIG_COUNTER_FREQUENCY=24000000 CONFIG_ARCH_ROCKCHIP=y +CONFIG_SPL_SYS_DCACHE_OFF=y CONFIG_TEXT_BASE=0x00200000 CONFIG_SPL_GPIO=y CONFIG_NR_DRAM_BANKS=1 From patchwork Thu Jun 20 23:06:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1950502 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Yz3O0vHI; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4x6J42lqz20Wb for ; Fri, 21 Jun 2024 09:10:16 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A5DA4885EE; Fri, 21 Jun 2024 01:06:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Yz3O0vHI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7C7E1883F2; Fri, 21 Jun 2024 01:06:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (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 43ECF88574 for ; Fri, 21 Jun 2024 01:06:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-7eb671a835fso74680939f.2 for ; Thu, 20 Jun 2024 16:06:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718924812; x=1719529612; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pADTaHtDLzw39bnYlq5J/QbnYcsHuuXPkWa6zAk38dE=; b=Yz3O0vHIbF8wVP3tQRK5U/+rs6TYhkSWMaWKRxI/JLsK/KJdn/R0yVj7SQB0iZ1s9D qXAR/6fQQlk6PJ9zhj+24x/XQQEfUlnsbj+3QQSqEbU/VZZr84fc8dehgxiZd0MgmfIk GULMw+1kRPGTFoVQWaS3/hc2bokaR3pJZXl7k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718924812; x=1719529612; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pADTaHtDLzw39bnYlq5J/QbnYcsHuuXPkWa6zAk38dE=; b=uM3hOvajELJ1c5X2taMcDCRIIcGwEmmVitlhkshsdCnIE/+eQ+cHl3fB2gRX/0QsP7 PDQAqrTW41Qa3eiOwH2YNCSfcsTv/4yYd/8KTKhusl1Hfcsznq2NXJe0Kr+BSql/W8cN SuCHa7yxCk4tgDBqG1ThyhxZbRm+3yGA/UTNdTGZMOxUfuJvwGWxcyHLc2paRPXmMgyv WX+tgCFzPXNMNQNNKS564SBgydUEdZBGyjbioebYmqTM9qlV179QH2U1QeUEXVOh2sDb EpQT6la/qxSJ9g31C//N1z2y/2XLtIIe6fW+JykGhE/isfSyOZtCmeT1CFB9M7DNTK8x aaCw== X-Gm-Message-State: AOJu0Yyacg0L4a8aRbcL4bGSOAFSoGaipQLcyuSitqhV1ART55eqyYqz LCDkxXwO6QIXqCYF+I0YpF1l5m9mBvwvr3JKm3dU2FMT+G3ImbkMHUIHqGPT3Koyoe1cDkkfMcT jjQ== X-Google-Smtp-Source: AGHT+IHUKYdwU37y19Eb2unrNFp85/kxV7TSbjYJnUIvOZszFP+Ot//9bHbWsa2CgBYorL8KcZFqeg== X-Received: by 2002:a05:6602:1488:b0:7eb:89ba:44fe with SMTP id ca18e2360f4ac-7f13eea39d3mr705754539f.17.1718924811869; Thu, 20 Jun 2024 16:06:51 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9d110f566sm53269173.44.2024.06.20.16.06.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 16:06:51 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Heinrich Schuchardt , Marcel Ziswiler , Martyn Welch , Peter Robinson , Sean Anderson , Svyatoslav Ryhel Subject: [PATCH v3 18/18] Drop the special am335x_boneblack_vboot target Date: Thu, 20 Jun 2024 17:06:25 -0600 Message-Id: <20240620230625.1797397-19-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620230625.1797397-1-sjg@chromium.org> References: <20240620230625.1797397-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Now that am335x_evm boots OK on the Beaglebone black, drop the latter and update the docs to cover the change. Also add a few updates about 'make fit' and drop the note about the security review, as U-Boot's verified boot has had quite extensive review now. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- (no changes since v2) Changes in v2: - Drop patch "regulator: rk8xx: Fix incorrect parameter" - Rewrite boneblack patch to onstead drop the target and update docs board/ti/am335x/MAINTAINERS | 1 - configs/am335x_boneblack_vboot_defconfig | 94 ------------------------ configs/am335x_evm_defconfig | 3 +- doc/usage/fit/beaglebone_vboot.rst | 21 +++--- 4 files changed, 12 insertions(+), 107 deletions(-) delete mode 100644 configs/am335x_boneblack_vboot_defconfig diff --git a/board/ti/am335x/MAINTAINERS b/board/ti/am335x/MAINTAINERS index 219c8715bf1..ed8800a2663 100644 --- a/board/ti/am335x/MAINTAINERS +++ b/board/ti/am335x/MAINTAINERS @@ -3,6 +3,5 @@ M: Tom Rini S: Maintained F: board/ti/am335x/ F: include/configs/am335x_evm.h -F: configs/am335x_boneblack_vboot_defconfig F: configs/am335x_evm_defconfig F: configs/am335x_evm_spiboot_defconfig diff --git a/configs/am335x_boneblack_vboot_defconfig b/configs/am335x_boneblack_vboot_defconfig deleted file mode 100644 index d473a1a793b..00000000000 --- a/configs/am335x_boneblack_vboot_defconfig +++ /dev/null @@ -1,94 +0,0 @@ -CONFIG_ARM=y -CONFIG_ARCH_CPU_INIT=y -# CONFIG_SPL_USE_ARCH_MEMCPY is not set -# CONFIG_SPL_USE_ARCH_MEMSET is not set -CONFIG_ARCH_OMAP2PLUS=y -CONFIG_TI_COMMON_CMD_OPTIONS=y -CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y -CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4030ff00 -CONFIG_SF_DEFAULT_SPEED=24000000 -CONFIG_DEFAULT_DEVICE_TREE="am335x-boneblack" -CONFIG_AM33XX=y -CONFIG_CLOCK_SYNTHESIZER=y -CONFIG_SPL=y -CONFIG_ENV_OFFSET_REDUND=0x280000 -CONFIG_TIMESTAMP=y -CONFIG_FIT_SIGNATURE=y -CONFIG_FIT_VERBOSE=y -CONFIG_SYS_BOOTM_LEN=0x1000000 -CONFIG_DISTRO_DEFAULTS=y -CONFIG_AUTOBOOT_KEYED=y -CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n" -CONFIG_AUTOBOOT_DELAY_STR="d" -CONFIG_AUTOBOOT_STOP_STR=" " -CONFIG_BOOTCOMMAND="run findfdt; run init_console; run finduuid; run distro_bootcmd" -CONFIG_SYS_CONSOLE_INFO_QUIET=y -CONFIG_ARCH_MISC_INIT=y -CONFIG_SPL_SYS_MALLOC=y -CONFIG_SPL_SYS_MALLOC_SIZE=0x800000 -CONFIG_SPL_MUSB_NEW=y -# CONFIG_SPL_NAND_SUPPORT is not set -CONFIG_SPL_NET=y -CONFIG_SPL_NET_VCI_STRING="AM33xx U-Boot SPL" -CONFIG_SPL_OS_BOOT=y -CONFIG_SPL_FALCON_BOOT_MMCSD=y -CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 -CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR=0x1500 -CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS=0x200 -CONFIG_CMD_SPL=y -CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2 -# CONFIG_CMD_SETEXPR is not set -CONFIG_BOOTP_DNS2=y -CONFIG_OF_CONTROL=y -CONFIG_SPL_OF_CONTROL=y -CONFIG_ENV_OVERWRITE=y -CONFIG_ENV_IS_IN_MMC=y -CONFIG_SYS_REDUNDAND_ENVIRONMENT=y -CONFIG_SYS_RELOC_GD_ENV_ADDR=y -CONFIG_SYS_MMC_ENV_DEV=1 -CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y -CONFIG_VERSION_VARIABLE=y -CONFIG_NET_RETRY_COUNT=10 -CONFIG_BOOTP_SEND_HOSTNAME=y -# CONFIG_SPL_BLK is not set -CONFIG_BOOTCOUNT_LIMIT=y -CONFIG_SYS_BOOTCOUNT_BE=y -CONFIG_DFU_MMC=y -CONFIG_DFU_RAM=y -CONFIG_USB_FUNCTION_FASTBOOT=y -CONFIG_DM_I2C=y -CONFIG_MISC=y -CONFIG_SYS_I2C_EEPROM_ADDR=0x50 -# CONFIG_SPL_DM_MMC is not set -CONFIG_MMC_OMAP_HS=y -CONFIG_MTD=y -CONFIG_DM_SPI_FLASH=y -CONFIG_SPI_FLASH_WINBOND=y -CONFIG_PHY_ATHEROS=y -CONFIG_PHY_SMSC=y -CONFIG_PHY_GIGE=y -CONFIG_MII=y -CONFIG_DRIVER_TI_CPSW=y -CONFIG_DM_PMIC=y -# CONFIG_SPL_DM_PMIC is not set -CONFIG_PMIC_TPS65217=y -CONFIG_SPL_POWER_TPS65910=y -CONFIG_SPI=y -CONFIG_DM_SPI=y -CONFIG_OMAP3_SPI=y -CONFIG_TIMER=y -CONFIG_OMAP_TIMER=y -CONFIG_USB=y -CONFIG_DM_USB_GADGET=y -CONFIG_SPL_DM_USB_GADGET=y -CONFIG_USB_MUSB_HOST=y -CONFIG_USB_MUSB_GADGET=y -CONFIG_USB_MUSB_TI=y -CONFIG_USB_GADGET=y -CONFIG_SPL_USB_GADGET=y -CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments" -CONFIG_USB_GADGET_VENDOR_NUM=0x0451 -CONFIG_USB_GADGET_PRODUCT_NUM=0xd022 -CONFIG_USB_ETHER=y -CONFIG_SPL_USB_ETHER=y -CONFIG_LZO=y diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig index d243cb16e72..cabc181460a 100644 --- a/configs/am335x_evm_defconfig +++ b/configs/am335x_evm_defconfig @@ -13,6 +13,8 @@ CONFIG_AM335X_USB0_PERIPHERAL=y CONFIG_AM335X_USB1=y CONFIG_SPL=y CONFIG_TIMESTAMP=y +CONFIG_FIT_SIGNATURE=y +CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y CONFIG_SYS_BOOTM_LEN=0x1000000 CONFIG_DISTRO_DEFAULTS=y @@ -119,5 +121,4 @@ CONFIG_SPL_USB_ETHER=y CONFIG_WDT=y # CONFIG_SPL_WDT is not set CONFIG_DYNAMIC_CRC_TABLE=y -CONFIG_RSA=y CONFIG_LZO=y diff --git a/doc/usage/fit/beaglebone_vboot.rst b/doc/usage/fit/beaglebone_vboot.rst index cd6bb141910..1360c71803c 100644 --- a/doc/usage/fit/beaglebone_vboot.rst +++ b/doc/usage/fit/beaglebone_vboot.rst @@ -67,18 +67,20 @@ a. Set up the environment variable to point to your toolchain. You will need export CROSS_COMPILE=arm-linux-gnueabi- -b. Configure and build U-Boot with verified boot enabled:: +b. Configure and build U-Boot with verified boot enabled. Note that we use the +am335x_evm target since it covers all boards based on the AM335x evaluation +board:: export UBOOT=/path/to/u-boot cd $UBOOT # You can add -j10 if you have 10 CPUs to make it faster - make O=b/am335x_boneblack_vboot am335x_boneblack_vboot_config all - export UOUT=$UBOOT/b/am335x_boneblack_vboot + make O=b/am335x_evm am335x_evm_config all + export UOUT=$UBOOT/b/am335x_evm c. You will now have a U-Boot image:: - file b/am335x_boneblack_vboot/u-boot-dtb.img - b/am335x_boneblack_vboot/u-boot-dtb.img: u-boot legacy uImage, + file b/am335x_evm/u-boot-dtb.img + b/am335x_evm/u-boot-dtb.img: u-boot legacy uImage, U-Boot 2014.07-rc2-00065-g2f69f8, Firmware/ARM, Firmware Image (Not compressed), 395375 bytes, Sat May 31 16:19:04 2014, Load Address: 0x80800000, Entry Point: 0x00000000, @@ -466,7 +468,7 @@ the private key that you signed with so that it can verify any kernels that you sign:: cd $UBOOT - make O=b/am335x_boneblack_vboot EXT_DTB=${WORK}/am335x-boneblack-pubkey.dtb + make O=b/am335x_evm EXT_DTB=${WORK}/am335x-boneblack-pubkey.dtb Here we are overriding the normal device tree file with our one, which contains the public key. @@ -597,14 +599,11 @@ Further Improvements Several of the steps here can be easily automated. In particular it would be capital if signing and packaging a kernel were easy, perhaps a simple make -target in the kernel. +target in the kernel. A stating point for this is the 'make image.fit' target +for ARM64 in Linux from v6.9 onwards. Some mention of how to use multiple .dtb files in a FIT might be useful. -U-Boot's verified boot mechanism has not had a robust and independent security -review. Such a review should look at the implementation and its resistance to -attacks. - Perhaps the verified boot feature could be integrated into the Amstrom distribution.