Further potential upstream fixes

This commit is contained in:
Peter Robinson 2023-10-23 15:42:39 +01:00
parent 6cd0d073d6
commit d9dd20bdd0
3 changed files with 633 additions and 216 deletions

View File

@ -1,213 +0,0 @@
From patchwork Sat Sep 23 20:50:15 2023
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Patchwork-Submitter: Simon Glass <sjg@chromium.org>
X-Patchwork-Id: 1838641
X-Patchwork-Delegate: sjg@chromium.org
Return-Path: <u-boot-bounces@lists.denx.de>
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=KG3aXwv5;
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 4RtLr82vCNz1ynH
for <incoming@patchwork.ozlabs.org>; Sun, 24 Sep 2023 06:50:30 +1000 (AEST)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id C5750868D8;
Sat, 23 Sep 2023 22:50:24 +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="KG3aXwv5";
dkim-atps=neutral
Received: by phobos.denx.de (Postfix, from userid 109)
id E66458698D; Sat, 23 Sep 2023 22:50:23 +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.1 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-io1-xd35.google.com (mail-io1-xd35.google.com
[IPv6:2607:f8b0:4864:20::d35])
(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 739828684C
for <u-boot@lists.denx.de>; Sat, 23 Sep 2023 22:50:21 +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-xd35.google.com with SMTP id
ca18e2360f4ac-79fa4ff8220so82788439f.3
for <u-boot@lists.denx.de>; Sat, 23 Sep 2023 13:50:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1695502220; x=1696107020; darn=lists.denx.de;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to;
bh=fcy5WkVBoc7uoRrzJTdjAvllGuUSUwfIiQ5P7MPqanU=;
b=KG3aXwv5HvtWYkt2G7n3DcwAsa2xdEa6uyrBRWhucS+3OUN5eZ79edhY+dVDuwuEAL
I/Ci/8cflRdX1s9cv7mPYw2tXHkWnudM3Jwyw+72113wGGZG+e1q9i0wvb+MmxxK4lDM
ApdxnzfJunDfWMC4zu0PhcdG39ZcuC82Ezgcc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1695502220; x=1696107020;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=fcy5WkVBoc7uoRrzJTdjAvllGuUSUwfIiQ5P7MPqanU=;
b=UNAm2llXUYdkTNewaIJpX2/kKkDsigJYBX1Ch147g7NChNygnu0Glr6Ya3Cw6WpHIG
OzXCeyakwC/pjiea0NTxHVU01HvJOlAiZwBZoQMMnavjUuSAdMqDCSLIndWzRhOARHfS
ksVozUDoXyyT/gV0XsaczFQgdgBImzMU7OR4NRnNalhSl2iZqYqt/TJ3Ftciv0KfxrcB
CrNKVLlJySDCY+svy4oHY0uID6SHsIAGjKBEAE1x9VhZ1jtpTJE4Zzrqa4nrrt+oEgus
A44BAwUrpks5SSMYfllyvb2A/OavxCiknMLIS7ENPr4izxS2EvAZcqH0KhFUUzD5aDXf
XmKg==
X-Gm-Message-State: AOJu0YwjY6Rk6HbA8DutFJQwzzA4q1TI/KwnuD1ZteWezSPjeMGyx26P
qvXFutS0QtYRlcVbGETlNS4BhMXg2YyAsItRSoI=
X-Google-Smtp-Source:
AGHT+IE/HwkByEI0cMcKWYghOMoUVXCzjV4a68DB17kNo1TCDUCCFa07idjIRi4hzVA51WQbE/JX/w==
X-Received: by 2002:a05:6e02:19cd:b0:34f:f5a4:3e68 with SMTP id
r13-20020a056e0219cd00b0034ff5a43e68mr4812478ill.30.1695502219881;
Sat, 23 Sep 2023 13:50:19 -0700 (PDT)
Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net.
[73.14.173.85]) by smtp.gmail.com with ESMTPSA id
i8-20020a056e020ec800b0034fda29890asm691408ilk.10.2023.09.23.13.50.19
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sat, 23 Sep 2023 13:50:19 -0700 (PDT)
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Date Huang <tjjh89017@hotmail.com>, Tom Rini <trini@konsulko.com>,
=?utf-8?q?Vincent_Stehl=C3=A9?= <vincent.stehle@arm.com>,
Simon Glass <sjg@chromium.org>
Subject: [PATCH] bootstd: Scan all bootdevs in a boot_targets entry
Date: Sat, 23 Sep 2023 14:50:15 -0600
Message-ID: <20230923205017.1754340-1-sjg@chromium.org>
X-Mailer: git-send-email 2.42.0.515.g380fc7ccd1-goog
MIME-Version: 1.0
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de
X-Virus-Status: Clean
When the boot_targets environment variable is used with the distro-boot
scripts, each device is included individually. For example, if there
are three mmc devices, then we will have something like:
boot_targets="mmc0 mmc1 mmc2"
In contrast, standard boot supports specifying just the uclass, i.e.:
boot_targets="mmc"
The intention is that this should scan all MMC devices, but in fact it
currently only scans the first.
Update the logic to handle this case, without required BOOTSTD_FULL to
be enabled.
I believe at least three people reported this, but I found two.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Date Huang <tjjh89017@hotmail.com>
Reported-by: Vincent Stehlé <vincent.stehle@arm.com>
---
boot/bootdev-uclass.c | 3 ++-
boot/bootflow.c | 21 +++++++++++++++++++--
test/boot/bootdev.c | 10 ++++++++++
3 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c
index fa52bc3a9c4e..5a60cf223c79 100644
--- a/boot/bootdev-uclass.c
+++ b/boot/bootdev-uclass.c
@@ -460,10 +460,11 @@ int bootdev_find_by_label(const char *label, struct udevice **devp,
* if no sequence number was provided, we must scan all
* bootdevs for this media uclass
*/
- if (IS_ENABLED(CONFIG_BOOTSTD_FULL) && seq == -1)
+ if (seq == -1)
method_flags |= BOOTFLOW_METHF_SINGLE_UCLASS;
if (method_flagsp)
*method_flagsp = method_flags;
+ log_debug("method flags %x\n", method_flags);
return 0;
}
log_debug("- no device in %s\n", media->name);
diff --git a/boot/bootflow.c b/boot/bootflow.c
index 81b5829d5b37..74abf3e17d7e 100644
--- a/boot/bootflow.c
+++ b/boot/bootflow.c
@@ -260,8 +260,25 @@ static int iter_incr(struct bootflow_iter *iter)
} else {
log_debug("labels %p\n", iter->labels);
if (iter->labels) {
- ret = bootdev_next_label(iter, &dev,
- &method_flags);
+ /*
+ * when the label is "mmc" we want to scan all
+ * mmc bootdevs, not just the first. See
+ * bootdev_find_by_label() where this flag is
+ * set up
+ */
+ if (iter->method_flags & BOOTFLOW_METHF_SINGLE_UCLASS) {
+ uclass_next_device(&dev);
+ log_debug("looking for next device %s: %s\n",
+ iter->dev->name,
+ dev ? dev->name : "<none>");
+ } else {
+ dev = NULL;
+ }
+ if (!dev) {
+ log_debug("looking at next label\n");
+ ret = bootdev_next_label(iter, &dev,
+ &method_flags);
+ }
} else {
ret = bootdev_next_prio(iter, &dev);
method_flags = 0;
diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index 6b29213416db..c5f14a7a1323 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -221,6 +221,16 @@ static int bootdev_test_order(struct unit_test_state *uts)
ut_asserteq_str("mmc2.bootdev", iter.dev_used[1]->name);
bootflow_iter_uninit(&iter);
+ /* Make sure it scans a bootdevs in each target */
+ ut_assertok(env_set("boot_targets", "mmc spi"));
+ ut_asserteq(0, bootflow_scan_first(NULL, NULL, &iter, 0, &bflow));
+ ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
+ ut_asserteq(3, iter.num_devs);
+ ut_asserteq_str("mmc2.bootdev", iter.dev_used[0]->name);
+ ut_asserteq_str("mmc1.bootdev", iter.dev_used[1]->name);
+ ut_asserteq_str("mmc0.bootdev", iter.dev_used[2]->name);
+ bootflow_iter_uninit(&iter);
+
return 0;
}
BOOTSTD_TEST(bootdev_test_order, UT_TESTF_DM | UT_TESTF_SCAN_FDT);

View File

@ -0,0 +1,626 @@
From patchwork Mon Oct 23 07:02:11 2023
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Simon Glass <sjg@chromium.org>
X-Patchwork-Id: 1853514
Return-Path: <u-boot-bounces@lists.denx.de>
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=ft1tNW5r;
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 4SDR4l2QBzz202k
for <incoming@patchwork.ozlabs.org>; Mon, 23 Oct 2023 18:04:07 +1100 (AEDT)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id 3591D87893;
Mon, 23 Oct 2023 09:03: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="ft1tNW5r";
dkim-atps=neutral
Received: by phobos.denx.de (Postfix, from userid 109)
id 74EC18789D; Mon, 23 Oct 2023 09:03:55 +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.1 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-oi1-x22f.google.com (mail-oi1-x22f.google.com
[IPv6:2607:f8b0:4864:20::22f])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id 5F22E87874
for <u-boot@lists.denx.de>; Mon, 23 Oct 2023 09:03: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-oi1-x22f.google.com with SMTP id
5614622812f47-3b2ea7cca04so2216594b6e.2
for <u-boot@lists.denx.de>; Mon, 23 Oct 2023 00:03:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1698044632; x=1698649432; 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=cIwvqOWntoH56aVh+uK5vSKMw8BFeAK+5xfygEqOPIs=;
b=ft1tNW5rHnnlnf552nQnVvJdgHJqUOIPR89PZQ12NUAyrlDzlzOEdzF55vs0bmokXJ
czzGmRw8FwBvmzO/fekIxGsNzg40U5ypkgqj13Plvj07iGgJvNLbwmOGyYwpTD86eBO8
HxWQUCwgkoFZldu1VLcZHUzw69U1vUVcLpDqE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1698044632; x=1698649432;
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=cIwvqOWntoH56aVh+uK5vSKMw8BFeAK+5xfygEqOPIs=;
b=AvcWPKPeRESlQnvwva3Yydv23E8Q1GOx+sH830m0arYUvEW4+J/TkXRzyM0Z8amaDR
4dvztcY+Hh54LqVGw9cD0R65sHvXrvqUPURdBpVFT3yX2LhoN7ZxPD1EcKy9Hqr3ATlJ
9eOCuyD+UHHeMAIvdTR918uaO5Bja38XSaNAzNV57JBYkDgWJeNK9OBHBuJj2Y2sTNZ1
poF5sGH839p3nx69X+ImsEwsgz8JIZFnwe4WBsXMMM13hVQ1ZDpdhKzKI7ai1jE67Ixo
4hOXD6ACVKkBijBRqW8t2V1Wf12AAun1z+mrhyFaq/UgyxuplGyHQHWGmwL7maxTzdVv
IX4A==
X-Gm-Message-State: AOJu0YwtYv7Lh6kUp+eOTO6dV8tIAMnl+FJU9kPSXGHNBjxPmbWNgo0/
gEs6R/iZt+vLqxRzuubv1ROzFkNfj6SlCXza5g7l1A==
X-Google-Smtp-Source:
AGHT+IHvJm5/lr6rXt08U65SxntTogh09qTfiLs2+CF8IjsSnkkTeqbhy/o2f2YjHn0GHRZ0TtCNpA==
X-Received: by 2002:a05:6808:e85:b0:3b2:d8cb:8e14 with SMTP id
k5-20020a0568080e8500b003b2d8cb8e14mr11558910oil.28.1698044631920;
Mon, 23 Oct 2023 00:03:51 -0700 (PDT)
Received: from sjg1.roam.corp.google.com ([202.144.206.130])
by smtp.gmail.com with ESMTPSA id
u187-20020a6279c4000000b006bde8e1f0adsm5910841pfc.98.2023.10.23.00.03.49
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 23 Oct 2023 00:03:51 -0700 (PDT)
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
Guillaume Gardet <Guillaume.Gardet@arm.com>, Tom Rini <trini@konsulko.com>,
Simon Glass <sjg@chromium.org>
Subject: [PATCH 2/4] bootstd: Expand boot-ordering test to include USB
Date: Mon, 23 Oct 2023 00:02:11 -0700
Message-ID:
<20231023000211.2.I9d49d1e28d3ef75af768dc20bb491e4c82e4ab76@changeid>
X-Mailer: git-send-email 2.42.0.655.g421f12c284-goog
In-Reply-To: <20231023070216.394709-1-sjg@chromium.org>
References: <20231023070216.394709-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 <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de
X-Virus-Status: Clean
Scan the USB bus as well, so we can check that different uclasses work
correctly in boot_targets
update the function comment with more detail.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
test/boot/bootdev.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index 6b29213416db..7228f545e9e6 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -190,12 +190,21 @@ static int bootdev_test_any(struct unit_test_state *uts)
BOOTSTD_TEST(bootdev_test_any, UT_TESTF_DM | UT_TESTF_SCAN_FDT |
UT_TESTF_ETH_BOOTDEV);
-/* Check bootdev ordering with the bootdev-order property */
+/*
+ * Check bootdev ordering with the bootdev-order property and boot_targets
+ * environment variable
+ */
static int bootdev_test_order(struct unit_test_state *uts)
{
struct bootflow_iter iter;
struct bootflow bflow;
+ test_set_skip_delays(true);
+
+ /* Start up USB which gives us three additional bootdevs */
+ usb_started = false;
+ ut_assertok(run_command("usb start", 0));
+
/*
* First try the order set by the bootdev-order property
* Like all sandbox unit tests this relies on the devicetree setting up
@@ -213,12 +222,14 @@ static int bootdev_test_order(struct unit_test_state *uts)
bootflow_iter_uninit(&iter);
/* Use the environment variable to override it */
- ut_assertok(env_set("boot_targets", "mmc1 mmc2"));
+ ut_assertok(env_set("boot_targets", "mmc1 mmc2 usb"));
ut_assertok(bootflow_scan_first(NULL, NULL, &iter, 0, &bflow));
ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
- ut_asserteq(2, iter.num_devs);
+ ut_asserteq(3, iter.num_devs);
ut_asserteq_str("mmc1.bootdev", iter.dev_used[0]->name);
ut_asserteq_str("mmc2.bootdev", iter.dev_used[1]->name);
+ ut_asserteq_str("usb_mass_storage.lun0.bootdev",
+ iter.dev_used[2]->name);
bootflow_iter_uninit(&iter);
return 0;
From patchwork Mon Oct 23 07:02:12 2023
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Simon Glass <sjg@chromium.org>
X-Patchwork-Id: 1853515
Return-Path: <u-boot-bounces@lists.denx.de>
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=aYxxWBdy;
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 4SDR4z5WcTz202k
for <incoming@patchwork.ozlabs.org>; Mon, 23 Oct 2023 18:04:19 +1100 (AEDT)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id A279B878A9;
Mon, 23 Oct 2023 09:03: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="aYxxWBdy";
dkim-atps=neutral
Received: by phobos.denx.de (Postfix, from userid 109)
id 231CE878B2; Mon, 23 Oct 2023 09:03:59 +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.1 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-pf1-x431.google.com (mail-pf1-x431.google.com
[IPv6:2607:f8b0: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 E9DE187874
for <u-boot@lists.denx.de>; Mon, 23 Oct 2023 09:03:56 +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-pf1-x431.google.com with SMTP id
d2e1a72fcca58-6bd73395bceso2113746b3a.0
for <u-boot@lists.denx.de>; Mon, 23 Oct 2023 00:03:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1698044635; x=1698649435; 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=8b4yhHi8HkVDVyxmZZ8a/B9oJfD95880A8O7ScnCUlA=;
b=aYxxWBdy/wJMQ/tjjK8Fxa3hq2jB+RQ/GZvaC5Z3WX/PHTfrcBBEncxnUjhKGVpRDX
W+KcG58tqawI84z5bFLFL0b9sW2fogOlQatvQajdAUe47BPNqB6QAhnJi9Kz7r/r9Gs6
NNgvS1a0l6YIH9C//eL4UL+4CZAI3w/xuJglw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1698044635; x=1698649435;
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=8b4yhHi8HkVDVyxmZZ8a/B9oJfD95880A8O7ScnCUlA=;
b=I5RQ7op3C0RGr709+nlAxagLQLSvqp2mbM2boS7Q037eSoibAVpk4mZ4eybB3mgH7s
CU7QPLmTk89Z+nypz02nbdWiiDUxCGGmjyWllc8F1lpiyjdILqp5njd+8mukVbhujjua
wbRX/7IaEywz0hp5/4jlTO+cz+b6t8VrLGXFFR8MJNzfchp2hHCRDypg8K/GlpfN9Vrh
SeZuMbw7X3R9vJf+qkLzCYC4bKuMUFgXrXnL/ZNgq+cmMfXFwT5f92+aIq8MvTuIIJMI
krBCjES1iIXXHLKw7aF3b1EC0+alfvtIAfIjK8UhAiTW019VbZ/uyxJbG+XG2ZLxkJPB
QhTQ==
X-Gm-Message-State: AOJu0YxXE6hDpzTCrR02q/+ia8kFUD/3VJLYeldwCaUAM/ZjNFiglRSk
N+4b2ozl4hRwo7qO57OeOxowm5MFBDGdy9h+8WGPjQ==
X-Google-Smtp-Source:
AGHT+IEjnpgei2u9GBHpMxAqISqdKlCrvD572cRfntnploYm1RPfc2ermsDOfWBp72z4zSgZo07dRw==
X-Received: by 2002:a05:6a00:1817:b0:68e:3616:604a with SMTP id
y23-20020a056a00181700b0068e3616604amr11976822pfa.8.1698044635168;
Mon, 23 Oct 2023 00:03:55 -0700 (PDT)
Received: from sjg1.roam.corp.google.com ([202.144.206.130])
by smtp.gmail.com with ESMTPSA id
u187-20020a6279c4000000b006bde8e1f0adsm5910841pfc.98.2023.10.23.00.03.52
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 23 Oct 2023 00:03:54 -0700 (PDT)
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
Guillaume Gardet <Guillaume.Gardet@arm.com>, Tom Rini <trini@konsulko.com>,
Simon Glass <sjg@chromium.org>
Subject: [PATCH 3/4] bootstd: Correct logic for single uclass
Date: Mon, 23 Oct 2023 00:02:12 -0700
Message-ID:
<20231023000211.3.Icefe7db8f3c1ddc3624f95ca5dc89b81ef97eab4@changeid>
X-Mailer: git-send-email 2.42.0.655.g421f12c284-goog
In-Reply-To: <20231023070216.394709-1-sjg@chromium.org>
References: <20231023070216.394709-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 <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de
X-Virus-Status: Clean
The current logic for "bootflow mmc" is flawed since it checks the
uclass of the bootdev instead of its parent, the media device. Correct
this and add a test that covers this scenario.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
boot/bootflow.c | 24 ++++++++++++++++++++++--
test/boot/bootdev.c | 13 +++++++++++++
2 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/boot/bootflow.c b/boot/bootflow.c
index 6ef62e1d1896..7f5b0e942078 100644
--- a/boot/bootflow.c
+++ b/boot/bootflow.c
@@ -155,6 +155,27 @@ static void bootflow_iter_set_dev(struct bootflow_iter *iter,
}
}
+/**
+ * scan_next_in_uclass() - Scan for the next bootdev in the same media uclass
+ *
+ * Move through the following bootdevs until we find another in this media
+ * uclass, or run out
+ *
+ * @devp: On entry, the device to check, on exit the new device, or NULL if
+ * there is none
+ */
+static void scan_next_in_uclass(struct udevice **devp)
+{
+ struct udevice *dev = *devp;
+ enum uclass_id cur_id = device_get_uclass_id(dev->parent);
+
+ do {
+ uclass_find_next_device(&dev);
+ } while (dev && cur_id != device_get_uclass_id(dev->parent));
+
+ *devp = dev;
+}
+
/**
* iter_incr() - Move to the next item (method, part, bootdev)
*
@@ -230,8 +251,7 @@ static int iter_incr(struct bootflow_iter *iter)
&method_flags);
} else if (IS_ENABLED(CONFIG_BOOTSTD_FULL) &&
(iter->flags & BOOTFLOWIF_SINGLE_UCLASS)) {
- /* Move to the next bootdev in this uclass */
- uclass_find_next_device(&dev);
+ scan_next_in_uclass(&dev);
if (!dev) {
log_debug("finished uclass %s\n",
dev_get_uclass_name(dev));
diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index 7228f545e9e6..637861748057 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -232,6 +232,19 @@ static int bootdev_test_order(struct unit_test_state *uts)
iter.dev_used[2]->name);
bootflow_iter_uninit(&iter);
+ /* Try a single uclass */
+ ut_assertok(env_set("boot_targets", NULL));
+ ut_assertok(bootflow_scan_first(NULL, "mmc", &iter, 0, &bflow));
+ ut_asserteq(2, iter.num_devs);
+
+ /* Now scan pass mmc1 and make sure that only mmc0 shows up */
+ ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
+ ut_asserteq(3, iter.num_devs);
+ ut_asserteq_str("mmc2.bootdev", iter.dev_used[0]->name);
+ ut_asserteq_str("mmc1.bootdev", iter.dev_used[1]->name);
+ ut_asserteq_str("mmc0.bootdev", iter.dev_used[2]->name);
+ bootflow_iter_uninit(&iter);
+
return 0;
}
BOOTSTD_TEST(bootdev_test_order, UT_TESTF_DM | UT_TESTF_SCAN_FDT);
From patchwork Mon Oct 23 07:02:13 2023
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Patchwork-Submitter: Simon Glass <sjg@chromium.org>
X-Patchwork-Id: 1853516
Return-Path: <u-boot-bounces@lists.denx.de>
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=g7MVFEGd;
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 4SDR5C2s5gz202k
for <incoming@patchwork.ozlabs.org>; Mon, 23 Oct 2023 18:04:31 +1100 (AEDT)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id 1A36A87880;
Mon, 23 Oct 2023 09:04:04 +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="g7MVFEGd";
dkim-atps=neutral
Received: by phobos.denx.de (Postfix, from userid 109)
id 2EC9687897; Mon, 23 Oct 2023 09:04:03 +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.1 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-oi1-x22d.google.com (mail-oi1-x22d.google.com
[IPv6:2607:f8b0:4864:20::22d])
(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 F1B5887880
for <u-boot@lists.denx.de>; Mon, 23 Oct 2023 09:04:00 +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-oi1-x22d.google.com with SMTP id
5614622812f47-3af604c3f8fso2266068b6e.1
for <u-boot@lists.denx.de>; Mon, 23 Oct 2023 00:04:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1698044639; x=1698649439; 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=ZQHdVZoqu6vL//0Rc8e1SX1+2VK3djq3hW1NDOA/VUc=;
b=g7MVFEGdmwlVgYbQvsUlLUH8u5YdqRAZZ7IGvJkKw+t9TgR7CBLAz6FTbcUqCf7ix3
ka6wz36z3I7e9+8Vu/XxtfjMh+FsE2MmR1pR8WtODlM2rNTfjAL7SzMzFwNNdBolnbaF
YEgrsCKckVERiDmY6ZcR1st7af2v4Zd3IMEjU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1698044639; x=1698649439;
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=ZQHdVZoqu6vL//0Rc8e1SX1+2VK3djq3hW1NDOA/VUc=;
b=dmetYCxcqOdjG06nNcEgNsHTXN2i2yJe2yaTu9+igYWthZh3jBPskXE+lqfItnIeWl
7Ti/qjE0EfHZfEfg2qVDuxSbj3zUqB8FRtcGV9rNXUn6NCsu3+zbWL03hsVUpc3vryFx
jWRyDrV2iQXJFbTcXuutCHCXNMwcCuHwGgN1nSfK/4Dxxw4T8y/c0y2O8gb1V3cURCB4
iIUvgFjuI6Cr+EVLkWuTmm292mJryz7Wnj14Gvh1f3kgdWqfDOCJHBmSu2DImC0KGlsU
5OwVzpagMZfWwuofbsHzRRvhzjEWAFhbwaIB7TeQMQBQfO+eAJ4ItsCll1m4KCusAJtm
fq2w==
X-Gm-Message-State: AOJu0YyL+7DxZXljBQhaS2gWBuhvR5uESsc040WsnLpteLMvL8txONvN
ASxmZ+0rltdSHxuUUw73ZNSNctboaLQkz2ygO4kSZg==
X-Google-Smtp-Source:
AGHT+IEn4DDw7VvfhcVhjZx6AfZZp+iDzM6s6RxSA4wM8oGRbEEwrJxjkMtDfxGtuPQjJkuiEWQW+w==
X-Received: by 2002:a05:6808:4d4:b0:3a7:44da:d5e6 with SMTP id
a20-20020a05680804d400b003a744dad5e6mr9586643oie.38.1698044639506;
Mon, 23 Oct 2023 00:03:59 -0700 (PDT)
Received: from sjg1.roam.corp.google.com ([202.144.206.130])
by smtp.gmail.com with ESMTPSA id
u187-20020a6279c4000000b006bde8e1f0adsm5910841pfc.98.2023.10.23.00.03.55
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 23 Oct 2023 00:03:59 -0700 (PDT)
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
Guillaume Gardet <Guillaume.Gardet@arm.com>, Tom Rini <trini@konsulko.com>,
Simon Glass <sjg@chromium.org>, Date Huang <tjjh89017@hotmail.com>,
=?utf-8?q?Vincent_Stehl=C3=A9?= <vincent.stehle@arm.com>,
Ivan Ivanov <ivan.ivanov@suse.com>
Subject: [PATCH 4/4] bootstd: Scan all bootdevs in a boot_targets entry (take
2)
Date: Mon, 23 Oct 2023 00:02:13 -0700
Message-ID:
<20231023000211.4.Ie4e7ba290d4957a88bebf306ca39f46618d9c363@changeid>
X-Mailer: git-send-email 2.42.0.655.g421f12c284-goog
In-Reply-To: <20231023070216.394709-1-sjg@chromium.org>
References: <20231023070216.394709-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 <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de
X-Virus-Status: Clean
When the boot_targets environment variable is used with the distro-boot
scripts, each device is included individually. For example, if there
are three mmc devices, then we will have something like:
boot_targets="mmc0 mmc1 mmc2"
In contrast, standard boot supports specifying just the uclass, i.e.:
boot_targets="mmc"
The intention is that this should scan all MMC devices, but in fact it
currently only scans the first.
Update the logic to handle this case, without required BOOTSTD_FULL to
be enabled.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Date Huang <tjjh89017@hotmail.com>
Reported-by: Vincent Stehlé <vincent.stehle@arm.com>
Reported-by: Ivan Ivanov <ivan.ivanov@suse.com>
---
boot/bootdev-uclass.c | 3 ++-
boot/bootflow.c | 22 ++++++++++++++++++++--
test/boot/bootdev.c | 32 ++++++++++++++++++++++++++++++--
3 files changed, 52 insertions(+), 5 deletions(-)
diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c
index 974ddee5d2fa..44ae98a9269c 100644
--- a/boot/bootdev-uclass.c
+++ b/boot/bootdev-uclass.c
@@ -469,10 +469,11 @@ int bootdev_find_by_label(const char *label, struct udevice **devp,
* if no sequence number was provided, we must scan all
* bootdevs for this media uclass
*/
- if (IS_ENABLED(CONFIG_BOOTSTD_FULL) && seq == -1)
+ if (seq == -1)
method_flags |= BOOTFLOW_METHF_SINGLE_UCLASS;
if (method_flagsp)
*method_flagsp = method_flags;
+ log_debug("method flags %x\n", method_flags);
return 0;
}
log_debug("- no device in %s\n", media->name);
diff --git a/boot/bootflow.c b/boot/bootflow.c
index 7f5b0e942078..be543c8588cc 100644
--- a/boot/bootflow.c
+++ b/boot/bootflow.c
@@ -280,8 +280,26 @@ static int iter_incr(struct bootflow_iter *iter)
} else {
log_debug("labels %p\n", iter->labels);
if (iter->labels) {
- ret = bootdev_next_label(iter, &dev,
- &method_flags);
+ /*
+ * when the label is "mmc" we want to scan all
+ * mmc bootdevs, not just the first. See
+ * bootdev_find_by_label() where this flag is
+ * set up
+ */
+ if (iter->method_flags &
+ BOOTFLOW_METHF_SINGLE_UCLASS) {
+ scan_next_in_uclass(&dev);
+ log_debug("looking for next device %s: %s\n",
+ iter->dev->name,
+ dev ? dev->name : "<none>");
+ } else {
+ dev = NULL;
+ }
+ if (!dev) {
+ log_debug("looking at next label\n");
+ ret = bootdev_next_label(iter, &dev,
+ &method_flags);
+ }
} else {
ret = bootdev_next_prio(iter, &dev);
method_flags = 0;
diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index 637861748057..0702fccdae60 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -225,7 +225,7 @@ static int bootdev_test_order(struct unit_test_state *uts)
ut_assertok(env_set("boot_targets", "mmc1 mmc2 usb"));
ut_assertok(bootflow_scan_first(NULL, NULL, &iter, 0, &bflow));
ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
- ut_asserteq(3, iter.num_devs);
+ ut_asserteq(5, iter.num_devs);
ut_asserteq_str("mmc1.bootdev", iter.dev_used[0]->name);
ut_asserteq_str("mmc2.bootdev", iter.dev_used[1]->name);
ut_asserteq_str("usb_mass_storage.lun0.bootdev",
@@ -237,7 +237,20 @@ static int bootdev_test_order(struct unit_test_state *uts)
ut_assertok(bootflow_scan_first(NULL, "mmc", &iter, 0, &bflow));
ut_asserteq(2, iter.num_devs);
- /* Now scan pass mmc1 and make sure that only mmc0 shows up */
+ /* Now scan past mmc1 and make sure that only mmc0 shows up */
+ ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
+ ut_asserteq(3, iter.num_devs);
+ ut_asserteq_str("mmc2.bootdev", iter.dev_used[0]->name);
+ ut_asserteq_str("mmc1.bootdev", iter.dev_used[1]->name);
+ ut_asserteq_str("mmc0.bootdev", iter.dev_used[2]->name);
+ bootflow_iter_uninit(&iter);
+
+ /* Try a single uclass with boot_targets */
+ ut_assertok(env_set("boot_targets", "mmc"));
+ ut_assertok(bootflow_scan_first(NULL, NULL, &iter, 0, &bflow));
+ ut_asserteq(2, iter.num_devs);
+
+ /* Now scan past mmc1 and make sure that only mmc0 shows up */
ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
ut_asserteq(3, iter.num_devs);
ut_asserteq_str("mmc2.bootdev", iter.dev_used[0]->name);
@@ -245,6 +258,21 @@ static int bootdev_test_order(struct unit_test_state *uts)
ut_asserteq_str("mmc0.bootdev", iter.dev_used[2]->name);
bootflow_iter_uninit(&iter);
+ /* Try a single uclass with boot_targets */
+ ut_assertok(env_set("boot_targets", "mmc usb"));
+ ut_assertok(bootflow_scan_first(NULL, NULL, &iter, 0, &bflow));
+ ut_asserteq(2, iter.num_devs);
+
+ /* Now scan past mmc1 and make sure that the 3 USB devices show up */
+ ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
+ ut_asserteq(6, iter.num_devs);
+ ut_asserteq_str("mmc2.bootdev", iter.dev_used[0]->name);
+ ut_asserteq_str("mmc1.bootdev", iter.dev_used[1]->name);
+ ut_asserteq_str("mmc0.bootdev", iter.dev_used[2]->name);
+ ut_asserteq_str("usb_mass_storage.lun0.bootdev",
+ iter.dev_used[3]->name);
+ bootflow_iter_uninit(&iter);
+
return 0;
}
BOOTSTD_TEST(bootdev_test_order, UT_TESTF_DM | UT_TESTF_SCAN_FDT);

View File

@ -7,7 +7,7 @@
Name: uboot-tools
Version: 2023.10
Release: 0.7%{?candidate:.%{candidate}}%{?dist}
Release: 0.8%{?candidate:.%{candidate}}%{?dist}
Summary: U-Boot utilities
License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+
URL: http://www.denx.de/wiki/U-Boot
@ -16,12 +16,13 @@ ExcludeArch: s390x
Source0: https://ftp.denx.de/pub/u-boot/u-boot-%{version}%{?candidate:-%{candidate}}.tar.bz2
Source1: aarch64-boards
Patch1: uefi-Boot-var-automatic-management-for-removable-medias.patch
Patch1: uefi-distro-load-FDT-from-any-partition-on-boot-device.patch
Patch2: smbios-Simplify-reporting-of-unknown-values.patch
Patch3: disable-VBE-by-default.patch
Patch4: enable-bootmenu-by-default.patch
Patch5: Add-video-damage-tracking.patch
Patch6: bootstd-Scan-all-bootdevs-in-a-boot_targets-entry.patch
Patch6: uefi-Boot-var-automatic-management-for-removable-medias.patch
Patch7: bootstd-Test-and-boot_targets-improvements.patch
# Board fixes and enablement
# RPi - uses RPI firmware device tree for HAT support
@ -213,6 +214,9 @@ cp -p board/sunxi/README.nand builds/docs/README.sunxi-nand
%endif
%changelog
* Mon Oct 23 2023 Peter Robinson <pbrobinson@fedoraproject.org> - 2023.10-0.8
- Further potential upstream fixes
* Mon Oct 02 2023 Peter Robinson <pbrobinson@fedoraproject.org> - 2023.10-0.7
- Update to 2023.10 GA
- Some upstream fixes