From patchwork Thu Jun 27 09:19: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: 1953093 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=ldjbFs/B; 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 (unknown [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) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8tLs40Ylz20X6 for ; Thu, 27 Jun 2024 19:19:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2D44B8852C; Thu, 27 Jun 2024 11:19:36 +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="ldjbFs/B"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 53399884FD; Thu, 27 Jun 2024 11:19:34 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (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 72841883E0 for ; Thu, 27 Jun 2024 11:19:32 +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-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3651ee582cfso4156379f8f.2 for ; Thu, 27 Jun 2024 02:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1719479972; x=1720084772; 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=ldjbFs/BxoRESwS0/hmPtHXsHPJY1WpQEFkkS/G03Tei046F7fMr6l3c/u8iiu1BTG rdHALurys3rS7o9NmGUjsXD7EuET9fd5xZsNriYqeWzcCD1/WFK4eCQvEpWuRTLcWvLB XjdbN2lf+yZ7Y37i2tPcYu6RwBG1tJnkjIwdM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719479972; x=1720084772; 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=mLD6QvlPLYQ13YdIYXu4d/1PUv2ar6ZuS9JHnuoKFbC/PMGWAI1uZxc1pi1VCZf+vO oZMiI36/gql9nW40Ncx8x9Vrawr6gQvC2h7iXQmOPae4s93v2rwuBpKwd2GrQuPdoFF6 +3+ZmVQnJ61AW8a2f59m/NHb8L0EO8W3RR5hKtvNiZ8QavJ7O1G7uSU9xEekTk7vmhp1 ewrGSBEl1c6eCMxIqRSZ3OmhEYaTzuq7YdrFIzlvGjTrG3pi92Df8mdY0Mn+8B5EGsku 362QeQ6Rhe+53QR3RHvrSXhU0d2JV7wRZ81W3PJldcdPcU6Ha5Ps1NSpn435T1yMi97R kpuw== X-Gm-Message-State: AOJu0YxCeDny/IC8hGWGj78jrZICayOIfQK/j/0XWr+LX6AKOo6qG/s/ pYj/uM7Ww/LePuEDNdTPjOj2wbUXeh8GTZxtVaD/Jhqesj9q2wYXQplK0W5+VfrAqLrEZ7cnNWB 86Q== X-Google-Smtp-Source: AGHT+IGdnjhSyjGrPE2gpPBpT5fmyt5KrE1ELAtYCGGrnA26f+XLBR+BjKYka0LH4OSPZ52RRa8HaQ== X-Received: by 2002:a5d:4712:0:b0:362:6908:e2dc with SMTP id ffacd0b85a97d-366e94cbfa2mr8346164f8f.33.1719479971713; Thu, 27 Jun 2024 02:19:31 -0700 (PDT) Received: from tasman.. (host-92-15-194-143.as13285.net. [92.15.194.143]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367436a28f7sm1199818f8f.117.2024.06.27.02.19.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 02:19:31 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v6 1/8] mkeficapsule: Add a --version argument Date: Thu, 27 Jun 2024 10:19:19 +0100 Message-Id: <20240627091926.374633-2-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240627091926.374633-1-sjg@chromium.org> References: <20240627091926.374633-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 --- (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 27 09:19: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: 1953095 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=haBRYuE5; 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) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8tM56gmyz20X6 for ; Thu, 27 Jun 2024 19:20:01 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E8D8B883B6; Thu, 27 Jun 2024 11:19:39 +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="haBRYuE5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2F13C8852A; Thu, 27 Jun 2024 11:19:36 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (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 377F8884A7 for ; Thu, 27 Jun 2024 11:19:33 +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-wr1-x42b.google.com with SMTP id ffacd0b85a97d-366de090da9so3608162f8f.1 for ; Thu, 27 Jun 2024 02:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1719479972; x=1720084772; 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=haBRYuE5ffmb7g/4KaPvnZ85U8sUlKq+isqhPYcqzMUYPu7OVSb8FJjVdIOmFdrCVY f5xkgebYdS+hejeMcv5UwNa4lOm2L39bLEBapXt5b8MEcP5Juw2MeFSBaIb/GXMRr1pi HTpP11v6V63Ok6XWYX/p9YquJNXkKNuiqiXBo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719479972; x=1720084772; 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=PedxKAe/JJIpeNVv8Z+cLp8PUORqx9Ek/H3LBCivYIMCs6+BtQtfXSba8l7TCzfCX8 B2+genEDOJ5UTsukCYBud9MviZY2Q/ocnXlxiLEZUKk96tj0eXdH14m0x3m37lweaPQ9 VTvgU1LBT34rNGhJ9RnERtbSbrYwrU/uzUyi6bff7YLJ9b5JuRexLB7IN+QyQSufGG7e azeNqUOYhnxnv6JoaRcNr3Ysg8cqtSxWrTvOrHhKIxsz9oV+PrDjwdK9OBMdiXMR1WZo lWfLO60xXUNte9dCldrvEaPb9nQKEghEA5/s6oZ450zOdF0fkDqzlll6kpPSCFScH8H2 XsUA== X-Gm-Message-State: AOJu0YxhTpkwWxJq++8wM/OsidyzZQyn+YSgn449g9CJbX08t+FPkxvx fZx52sKnafcVMerIwIQ/+HG3jI365eGO48EVGBnIkvJYuVybNEMGiOno4I7wqGuRK0id0FT1b3K 4BQ== X-Google-Smtp-Source: AGHT+IG2CtDFQcvhA7uQmF7GeuRVsAjRg21Kwgi+ltJp4OnCG3W8WKeLSEnlnJkGkmn4RGSO5mVB0g== X-Received: by 2002:a5d:65ce:0:b0:362:dbc2:9486 with SMTP id ffacd0b85a97d-366e963036cmr6827302f8f.68.1719479972630; Thu, 27 Jun 2024 02:19:32 -0700 (PDT) Received: from tasman.. (host-92-15-194-143.as13285.net. [92.15.194.143]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367436a28f7sm1199818f8f.117.2024.06.27.02.19.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 02:19:32 -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 v6 2/8] binman: Collect the version number for mkeficapsule Date: Thu, 27 Jun 2024 10:19:20 +0100 Message-Id: <20240627091926.374633-3-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240627091926.374633-1-sjg@chromium.org> References: <20240627091926.374633-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 27 09:19: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: 1953096 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=OgOU00Ig; 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 4W8tMK0BdRz20Xg for ; Thu, 27 Jun 2024 19:20:13 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4C6BA884FC; Thu, 27 Jun 2024 11:19: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=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="OgOU00Ig"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 351DF884A7; Thu, 27 Jun 2024 11:19:36 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (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 435EB884FC for ; Thu, 27 Jun 2024 11:19:34 +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-wr1-x42c.google.com with SMTP id ffacd0b85a97d-36703b0f914so1009126f8f.0 for ; Thu, 27 Jun 2024 02:19:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1719479973; x=1720084773; 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=OgOU00IgvABmCdirCI/VFxD2UnkviyDxibv3xAcwlXZJdeaRaQD4D0CTkf+jkwKCS3 PPxtuxWpFNjAtKXdH5s7eiNc3mlpvqMeHq48INMWuvsXuT5NgGzBzjkMD2ISZxFy7nWH 43UGi0Hk+yAafgGG9QbuQsKslWmfMQkGOijyU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719479973; x=1720084773; 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=FzNT0FDBfgMMRxfMD7dlcac171MPjRQF7qVphRgCBRVfAlY239t8QIRcHBesYf/mY5 B5CFoBYKMQCcyFLxGUHDKeK7XxpUWiltMkyI7XatEU8fzp5LgoyxCGM8BR7e8LhKHwTL bpKdwxJsI9x8qxlY2FWfLfr7rDrpGSq3/afQhvGQSFRYj5RkaOspNzEDrcSbyK2zEPEU G9zy3lOPpP3k6BDQvVH9NJAusg5A3CkfdVT8PURu6vo1zm5DBocPa778OrIWRt5bpMh9 3M2Axhnp8uB0zvbWYtErKXK8kTe93mNWM/XC8TI+xqwOHwB0hR8NBICS4Xv1yuiywaPk O0Lw== X-Gm-Message-State: AOJu0YxTDrtVXdB7tpAvsXc7HVnXXC8qHuBko4hOUxbJISz/3E/f6Mac sjJ3HcPNInbx6FXWZIZdHBTPal0upwd0YZNY5Fk+QHjz6sYvGuf7nFIJPZggQa/1qvY008cJa3Z Ehg== X-Google-Smtp-Source: AGHT+IEWDwbwvC1ZTGcV7UzNgogQBy9/Wpqz5vyo0dPG979OwLkui6dlVrVBf5sCQ7B8MO9xct4Utw== X-Received: by 2002:a5d:64ce:0:b0:366:defe:1b3b with SMTP id ffacd0b85a97d-3673cc55d39mr2114698f8f.11.1719479973413; Thu, 27 Jun 2024 02:19:33 -0700 (PDT) Received: from tasman.. (host-92-15-194-143.as13285.net. [92.15.194.143]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367436a28f7sm1199818f8f.117.2024.06.27.02.19.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 02:19:33 -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 v6 3/8] binman: Deal with mkeficapsule being missing Date: Thu, 27 Jun 2024 10:19:21 +0100 Message-Id: <20240627091926.374633-4-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240627091926.374633-1-sjg@chromium.org> References: <20240627091926.374633-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 27 09:19: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: 1953097 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=NVYGCWwq; 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) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8tMc1fnPz20Xg for ; Thu, 27 Jun 2024 19:20:28 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AAC3188579; Thu, 27 Jun 2024 11:19: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=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="NVYGCWwq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D6B778855B; Thu, 27 Jun 2024 11:19:36 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (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 067CB88247 for ; Thu, 27 Jun 2024 11:19:35 +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-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3608e6d14b6so4863645f8f.0 for ; Thu, 27 Jun 2024 02:19:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1719479974; x=1720084774; 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=NVYGCWwqAOiEsYmDrrmAj1xQ8O9e8nApfkI+8Q/IPZY4R3eOuQlfWeH3po+625raVI PFZj5c5fvSZRMDS4tEDnlTudWNH7TD0LNsGftrdJLrRrBnk1/tJwPIfLhHeQPCb7ECQK +6pqBAL4q76HJO4cUNOTXrL07nKZhADAPSumQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719479974; x=1720084774; 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=CbHeQMXhW5vnduFroqaRkDwvDDoNnK7mAGbn0faBlwXBiSjR1Hamy5UaFMs/fxq5Wt KWZsEW0oPWneKsgfKy46tFHLhX5y0WVKR5cioJZjL7nyi84iS8QyTe0nWBXb61D2CVLF wjeRAYsCd2+L61amjvyp1vQQAlaWBY0B5DrdTEsCQXGZa4djykhf0GFAhFhmb3pLHXg2 OM5O3hzeM/Q+0b17T+Pga6UYuWlatAlDE0yaVT1dj5L5H6dPxh/iZJESdhI+VVkiTN7H ilYREXgWtL+XdmfrHgFwh47EnPhcpuciUkm67kUx+URDUi3l/NXeTIwEZYcLQ6hi0gyY gVfA== X-Gm-Message-State: AOJu0YwJ1lDcHXi+gsHoJW+Pp9wqTmrMeiEqDBxhdO2OEB9TVQmMK9WH JAaqayUzXbNsQi7AU11Zyn9r+tJbWGq5EFpqHKeOVrdJb8VhoWKH/eFLWszvQhbaB38v+uFFusn oOQ== X-Google-Smtp-Source: AGHT+IEuTeVaGQBBJ4qN7GNt53rTyJt72r51a8AwSXnzsZPeMwIMQweaB9N/91pfxEC47yfonJ2DdA== X-Received: by 2002:a5d:64e4:0:b0:366:ed80:d045 with SMTP id ffacd0b85a97d-366ed80d1afmr11014463f8f.47.1719479974404; Thu, 27 Jun 2024 02:19:34 -0700 (PDT) Received: from tasman.. (host-92-15-194-143.as13285.net. [92.15.194.143]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367436a28f7sm1199818f8f.117.2024.06.27.02.19.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 02:19:33 -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 v6 4/8] binman: Return failure when a usage() message is generated Date: Thu, 27 Jun 2024 10:19:22 +0100 Message-Id: <20240627091926.374633-5-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240627091926.374633-1-sjg@chromium.org> References: <20240627091926.374633-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 27 09:19: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: 1953098 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=GXeCqT42; 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 4W8tMk38jGz20Xg for ; Thu, 27 Jun 2024 19:20:34 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 12A838855B; Thu, 27 Jun 2024 11:19: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=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="GXeCqT42"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 01AA78855B; Thu, 27 Jun 2024 11:19:38 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450: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 0DC5388256 for ; Thu, 27 Jun 2024 11:19:36 +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-lf1-x129.google.com with SMTP id 2adb3069b0e04-52cdd893e5cso5833969e87.1 for ; Thu, 27 Jun 2024 02:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1719479975; x=1720084775; 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=q7dZ7EgYr0k6vuGV4Zq+HOmn5La1Qr8GHhYneKXIm/g=; b=GXeCqT42Jaym2Skan6TupMYxYwshqL6P+WIjZtzLlEQr1UNHoqj/LUZDg5JfaLx8lR Sf8HNjxsSq/teboOygHn41MSNI1EUNBaz8UVIhanEQR/NYLWCozP/iCzl2ZlOYMYDRkc RfXK7EjK8Ury1C0iyXPRkon0EctW27EQ/+l0o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719479975; x=1720084775; 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=q7dZ7EgYr0k6vuGV4Zq+HOmn5La1Qr8GHhYneKXIm/g=; b=YeIlBpz3GiaHJHKMGgRwLqP7Y7QMjdEL9f/lit9twhkM4KzaifIkryOnEV6lly0S9Q 5JU77Cvy6xAD7qYi8/RbUEIM50Hj4oFox7dp5W07f+pCtHrgYhXCRsSiNygPDm44o2oa scez71cYm+x4q5DGk6zMj6ltNye/pYwAdDqYkIW17tQLaJt2TnwQNX3IUfVN5UAUh4H3 wlBv3zmHk/wolI0pygnWYl1MlBJPK2h3HWvxxs5WC6v+YM9eMaK81nndgna6j+iqwCMZ ApyE4RMRNMHJ3VAhqQgkUVbGwk6yxLHDBNVhdVWreuHO5EuAx5xgY1ezvzr8sHJK9MSh x+GQ== X-Gm-Message-State: AOJu0YwbcxUu4yQP5xxE4U5sEqX1quWFzQ34MVmuLMKiJ0IVnhvORKbq oVtOjMLeN+Hh4fenDiv4a3BzbuFj2yqr3z/RzX8eAvTFQRZO4KsxDHBDNbW4RIVNvXIKnCGgOFv SRw== X-Google-Smtp-Source: AGHT+IHNP5cUwDnfSDNin7G9bLUmgtMFoakBYJd8yvc4TfT47I7CBWwAZBYa3N8bd8s5ViJNSgRBgg== X-Received: by 2002:a05:6512:467:b0:52c:da39:87a7 with SMTP id 2adb3069b0e04-52ce1843951mr10096611e87.41.1719479975149; Thu, 27 Jun 2024 02:19:35 -0700 (PDT) Received: from tasman.. (host-92-15-194-143.as13285.net. [92.15.194.143]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367436a28f7sm1199818f8f.117.2024.06.27.02.19.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 02:19:34 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Sughosh Ganu , Alper Nebi Yasak , Neha Malcom Francis , Peng Fan , Philippe Reynes , Stefan Herbrechtsmeier Subject: [PATCH v6 5/8] binman: Keep the efi_capsule input file Date: Thu, 27 Jun 2024 10:19:23 +0100 Message-Id: <20240627091926.374633-6-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240627091926.374633-1-sjg@chromium.org> References: <20240627091926.374633-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 Acked-by: Sughosh Ganu --- (no changes since v4) Changes in v4: - Drop Fixes tag 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 27 09:19: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: 1953099 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=Ykfm6Lty; 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 4W8tMx0cNlz20Xg for ; Thu, 27 Jun 2024 19:20:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6948488582; Thu, 27 Jun 2024 11:19: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=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="Ykfm6Lty"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A38288855B; Thu, 27 Jun 2024 11:19:38 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BC43F8852E for ; Thu, 27 Jun 2024 11:19:36 +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-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2ec52fbb50cso55074851fa.2 for ; Thu, 27 Jun 2024 02:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1719479976; x=1720084776; 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=AOduDstwRx9JFHQGUTamaoAoIgSOooUTdQ8x/X0aOHc=; b=Ykfm6LtyvIzrZwGEQ5LabFH2erhBbmXY8+ZbHS30b1lsbT/R15guDfix7L7X9Hqk/i C/uWbRDS8EEsclp5BIha9G1ykxN7R+5qxLreaDQmvLXGcfxdWlT6HiUcGh0mbHipvqwI sHrYDRO/eoTuwvVGMdkjQUMsQW2ieHB7abb0E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719479976; x=1720084776; 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=AOduDstwRx9JFHQGUTamaoAoIgSOooUTdQ8x/X0aOHc=; b=FQu6DzjLsUYEef411yfabxnttZVxwUmUTdYimLcC6T1Tai3KPAeLmfKL6K/pRhdg8j IzuP6XhMrZrrTAU/4ljU18eOjAEgyrpd0pMOWc06hlit3Uy2KTTfP+NnMaBNZqEOuuCn cgamkWjBu4MJQleu+sOe3q+SZvExI46oq40SXJpwYGNZPuRjrBuIZtp1JA12dklwUM4w /6Hp7zH4gS+xSeFur4b+MatwswTXhGgVS1+NgegXyj3fHXGdGKzicTZo6e1rIY22qBna cXUQMqEsVi8y/gy0zvhawapVAIgGJVnF0r+fV672KpYzPBbZB9XF5EXPmRd+EgtJdYfd QTLQ== X-Gm-Message-State: AOJu0YzlDkhN1dD1n/uYXE0PQt1Hr05M68OfeMylE1virvaoCe6BHWFv NpGRb0DMmelGDeVoW88UGP0EjMNAz/2qJAzFf571anbXfxjAbxffjzzG3obb7P9Q+S4/qtkTNMz 5bQ== X-Google-Smtp-Source: AGHT+IG9V/3wcXRobw3JVKwex/ISt2dC/19BB+S/d/yDbDi27PxqtqAmMzBV+cpz1lcx9s0hFPnvzw== X-Received: by 2002:a2e:3002:0:b0:2ee:46fd:7ab9 with SMTP id 38308e7fff4ca-2ee46fd7fd9mr16655111fa.30.1719479975983; Thu, 27 Jun 2024 02:19:35 -0700 (PDT) Received: from tasman.. (host-92-15-194-143.as13285.net. [92.15.194.143]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367436a28f7sm1199818f8f.117.2024.06.27.02.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 02:19:35 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Jerry Van Baren Subject: [PATCH v6 6/8] fdt: Correct condition for bloblist existing Date: Thu, 27 Jun 2024 10:19:24 +0100 Message-Id: <20240627091926.374633-7-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240627091926.374633-1-sjg@chromium.org> References: <20240627091926.374633-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 --- (no changes since v3) 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 27 09:19: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: 1953100 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=Q9kBWTsa; 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 4W8tN85rY9z20Xg for ; Thu, 27 Jun 2024 19:20:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C2D6D88599; Thu, 27 Jun 2024 11:19: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=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="Q9kBWTsa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 437CA8855C; Thu, 27 Jun 2024 11:19:39 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (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 5F9FB88247 for ; Thu, 27 Jun 2024 11:19:37 +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-wr1-x431.google.com with SMTP id ffacd0b85a97d-364cdfdaf91so5409902f8f.1 for ; Thu, 27 Jun 2024 02:19:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1719479977; x=1720084777; 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=7l6MRzsmRbZLn3yhrkgcqlQ74+cI72j0xlnribpc3wU=; b=Q9kBWTsad3SwAA0hyI6JczIEFT7O9w3gfiCBJRni+NvBHL96jhYzlIKCoQZGm6znEq /9RNNZjs+oyaGkGy+quAhSpRVcUVy5BGl6FUBZV5MztUzzkjaClpgZlSDCr1YDETLwYJ ZCxBFQSUYKN41lnjpx8ELSOc3DTeIfbIQpKyw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719479977; x=1720084777; 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=7l6MRzsmRbZLn3yhrkgcqlQ74+cI72j0xlnribpc3wU=; b=bKz9JhFLBAYtdG03DoKAWlcpNme8/j1PSsXNTQGPX8I3XXuXKL98GeC1teJfZ/LI+i HMBH7gNvKR6f0IP7+GYa89bjnkMucOOCU2JttPZU/gE5ETF/QWAlQ5dU8IJ7OaFYHfi5 LYS1gcaBYeE+vR/Hx/8prAw9MXRCAsBKF5hVWGVeErPoPdTK8ORAh6mLSaEX+en0Y9Z1 MAI9RJtuFGx+LvUOnnEacQQATLkKZahYCqvas2zq7QyzGNX+3jKssCbOBMmvJVmrgdas /jQ/spb2ODrBLWP0Mk67edhhA3l1hfGdKw02eWiEBcTMXrlUdUu0MEk+h62HPzZXyUoI 1lcA== X-Gm-Message-State: AOJu0YwQ90jZDiK5+6y9GV/epWC/K/RwtFxPDRppUB5McWaqPYQ6Nbhw aJbMgZdCi3PGUpEMQ9Po8UCMnMy5b7TCQIazVBjrC/J7/+xnYUQk1JAH0wss2jlpjnJmUcvp8Af vog== X-Google-Smtp-Source: AGHT+IER/XJovSxZsB50G92UisFlD+Xe6UjicYwyOgTB6yUbS3F6fF5EjdLjWJmk+7wGJzpz4YXZDA== X-Received: by 2002:adf:f3cd:0:b0:364:e963:bd1a with SMTP id ffacd0b85a97d-366e96c0d75mr7917889f8f.65.1719479976702; Thu, 27 Jun 2024 02:19:36 -0700 (PDT) Received: from tasman.. (host-92-15-194-143.as13285.net. [92.15.194.143]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367436a28f7sm1199818f8f.117.2024.06.27.02.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 02:19:36 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Quentin Schulz , Jeffy Chen , Jonas Karlman , huang lin Subject: [PATCH v6 7/8] rockchip: Ensure memory size is available in RK3399 SPL Date: Thu, 27 Jun 2024 10:19:25 +0100 Message-Id: <20240627091926.374633-8-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240627091926.374633-1-sjg@chromium.org> References: <20240627091926.374633-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 Reviewed-by: Quentin Schulz --- (no changes since v3) 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 ef9a1824b2b..bc79c034808 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 27 09:19:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1953101 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=Svms436t; 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 4W8tNK0wzCz20Xg for ; Thu, 27 Jun 2024 19:21:05 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 26B5A8856B; Thu, 27 Jun 2024 11:19: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="Svms436t"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2BD1188256; Thu, 27 Jun 2024 11:19:40 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) (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 3F2E188256 for ; Thu, 27 Jun 2024 11:19:38 +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-wr1-x430.google.com with SMTP id ffacd0b85a97d-36742cc9c12so376360f8f.2 for ; Thu, 27 Jun 2024 02:19:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1719479977; x=1720084777; 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=U0gILEB1FtX5B0CyQ15XlG7xyuizyRU3YuOi5b5eAEo=; b=Svms436tu7rnCI9oNMkRroV7TDe2yU01ZC0MOi8JVD5jyqCahj2+iwl51wzVmfnpGc Sc2m0H86DaBsEv+sjJsAAkIMU32qHPsnWTzxZ01Xy1p5w5Gbq+M+DZJQ8XmdVn/wEvru N7J98Mmdw3Sg3O79lb9xY06qeT++77R3mCLtg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719479977; x=1720084777; 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=U0gILEB1FtX5B0CyQ15XlG7xyuizyRU3YuOi5b5eAEo=; b=Fpl0aOzDhdrxOujc0CCys76keYj2+SSDO7gbnbyp2B6snZvvdDaUTNf3YmzKY8lLsj tw4Srorap3ntkPeACNSbmkNzwUwYmF6kA13/Ud39sbbsy77lz6vb8O2944eIipQ9Lmt4 aXpN1Ac4ml9zIwRqO+QFeabPiZvv0loGQ3YFoPF+5qPMfuXEaLNHSrdrCcycQG8fkOuM O0eE6o15wHSIv36bXilwQEXj3oWGrue/tnDZFacCKcif1jQuGo1zxq/6JUD+2BPcCZlX gjiqdT9hXgTnOJmQLI/OiD05GCsijigxIPcgY9gXx3NQLBOe18wznPCwzzHEq1DKQgjK lKWQ== X-Gm-Message-State: AOJu0YykirRkZ1S4PiiU2aGm80/1QzZ3hmXv4EGyx8DRWNfCKZXMrYBm AA5ItJYunpG5gmUJM8/zbRkYbm7rZJxiHkPHra+zpb4tRomLzKH8AqIuRdoamMt0wpP+iXhLyA3 nAA== X-Google-Smtp-Source: AGHT+IHtqz/+eIuIFfGbxDAYB37BshsaCCBc0f7DW5Yg/4AmGVqWFxP2fLB23OXjwP+EYpvHn7kKWQ== X-Received: by 2002:a5d:4cc5:0:b0:35f:23c6:7bdb with SMTP id ffacd0b85a97d-366e94914e4mr6903139f8f.21.1719479977600; Thu, 27 Jun 2024 02:19:37 -0700 (PDT) Received: from tasman.. (host-92-15-194-143.as13285.net. [92.15.194.143]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367436a28f7sm1199818f8f.117.2024.06.27.02.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 02:19:37 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Jeffy Chen , Jonas Karlman , Quentin Schulz , huang lin Subject: [PATCH v6 8/8] rockchip: Avoid #ifdefs in RK3399 SPL Date: Thu, 27 Jun 2024 10:19:26 +0100 Message-Id: <20240627091926.374633-9-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240627091926.374633-1-sjg@chromium.org> References: <20240627091926.374633-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. - Drop the non-dcache optimisation, since the cache should normally be on Signed-off-by: Simon Glass --- Changes in v6: Take account of ROCKCHIP_EXTERNAL_TPL in phase_sdram_init() Changes in v5: - Move setting of pmugrf into the probe() function Changes in v3: - Split out the refactoring into a separate patch drivers/ram/rockchip/sdram_rk3399.c | 35 +++++++++++++++-------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index bc79c034808..55c0d1d2aed 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,19 @@ 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) && + !IS_ENABLED(CONFIG_ROCKCHIP_EXTERNAL_TPL) && + !spl_in_proper()); +} + static struct io_setting * lpddr4_get_io_settings(const struct rk3399_sdram_params *params, u32 mr5) { @@ -3024,7 +3032,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", @@ -3093,7 +3101,6 @@ static int rk3399_dmc_init(struct udevice *dev) priv->cic = syscon_get_first_range(ROCKCHIP_SYSCON_CIC); priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF); priv->pmu = syscon_get_first_range(ROCKCHIP_SYSCON_PMU); - priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF); priv->pmusgrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUSGRF); priv->pmucru = rockchip_get_pmucru(); priv->cru = rockchip_get_cru(); @@ -3138,19 +3145,16 @@ 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); + if (phase_sdram_init() && rk3399_dmc_init(dev)) + return 0; + priv->info.base = CFG_SYS_SDRAM_BASE; priv->info.size = rockchip_sdram_size((phys_addr_t)&priv->pmugrf->os_reg2); @@ -3181,10 +3185,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) || \