Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CCF09C19F28 for ; Sat, 30 Jul 2022 21:58:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2EDDA842A3; Sat, 30 Jul 2022 23:54:22 +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="UmgEM96t"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BF857844F1; Sat, 30 Jul 2022 23:53:51 +0200 (CEST) Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E9E318412C for ; Sat, 30 Jul 2022 23:53: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-ot1-x32d.google.com with SMTP id c20-20020a9d4814000000b0061cecd22af4so5625640otf.12 for ; Sat, 30 Jul 2022 14:53:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=h+MaXEBMKRu8V4ND6vwn7uszrEf/3f9W1EsDX26n0l4=; b=UmgEM96tGZRVLLKftr7E0oSUPHuLw751FrWgUnUn+QNQA1qndqpRHXouLnqFb1aVBb r/hwO92UvNoDiLfZYPAWAY95WEdQzjJ2+DgO7DpzXkRz9slhRTrzdXJS2hpZ2d1th67+ j/f/+JwHmLupUxfyLJlzhENVI+ZTRgxibBehA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=h+MaXEBMKRu8V4ND6vwn7uszrEf/3f9W1EsDX26n0l4=; b=CoyxJwrkgt7POdWkkXPFR6CJc+EuH0HNipg1d+dcpL0y/8MoHh2sd6EbTqDI6Rlev7 FOScDMIpHIuYAA46rPayiNblOHvl+b9KBJTAwUV1fkpzRq77JiiS+TiqWVLVvFAPQsJJ fypmX2ShA7Xb+/gQGNUYQA9LcHEDi8uLt4551078Dsrgg0jSaS4H4hbPK2rS+8zlHwsV MwRI3+9I9DSkxLqGg6ZKXl4bQ+GE8keqwjsOuGZppYGinGtOwSGFdiF+owbeMx2y6uXh k4Wnnpo/llJSvuDi6dsYyXmTH8ERaR97KzbnKCYbRqkwQkuscYjPuRL1u9V53kvK/SHa Oq9A== X-Gm-Message-State: AJIora8QliIwh1i3UJnKRAk0TE0zLoOsTMqnCDGhovDqgduKU/IrmwHX I8DmtLZwf6zbVwC+bHo93KLAmuzvtLVBPJU2 X-Google-Smtp-Source: AGRyM1sM7unnlgXBE4RgjiZYWbLtpeGRsIiFJFYjPRh5i/VXH0RTMXc1sS3BMZQJPsJESw83m9eVlw== X-Received: by 2002:a9d:76d8:0:b0:616:937e:8c7d with SMTP id p24-20020a9d76d8000000b00616937e8c7dmr3688873otl.189.1659218014184; Sat, 30 Jul 2022 14:53:34 -0700 (PDT) Received: from sjg1.lan (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id 19-20020a544193000000b0032f75714af1sm1699656oiy.18.2022.07.30.14.53.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jul 2022 14:53:33 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Bin Meng , Simon Glass Subject: [PATCH v2 27/35] bootstd: Drop the system bootdev Date: Sat, 30 Jul 2022 15:52:29 -0600 Message-Id: <20220730215237.818368-23-sjg@chromium.org> X-Mailer: git-send-email 2.37.1.455.g008518b4e5-goog In-Reply-To: <20220730215237.818368-1-sjg@chromium.org> References: <20220730215237.818368-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This was a work-around for the fact that global bootmeths such as EFI bootmgr and VBE don't use a particular bootdev, or at least select it themselves so that we don't need to scan all bootdevs when using that bootmeth. Drop the system bootdev entirely. Signed-off-by: Simon Glass --- (no changes since v1) boot/Makefile | 2 +- boot/bootstd-uclass.c | 6 ---- boot/system_bootdev.c | 66 ------------------------------------------- test/boot/bootflow.c | 7 +---- 4 files changed, 2 insertions(+), 79 deletions(-) delete mode 100644 boot/system_bootdev.c diff --git a/boot/Makefile b/boot/Makefile index a70674259c1..bab02be53fa 100644 --- a/boot/Makefile +++ b/boot/Makefile @@ -19,7 +19,7 @@ obj-y += image.o image-board.o obj-$(CONFIG_ANDROID_AB) += android_ab.o obj-$(CONFIG_ANDROID_BOOT_IMAGE) += image-android.o image-android-dt.o -obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootdev-uclass.o system_bootdev.o +obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootdev-uclass.o obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootflow.o obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootmeth-uclass.o obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootstd-uclass.o diff --git a/boot/bootstd-uclass.c b/boot/bootstd-uclass.c index 5107b6d4c7f..565c22a36e7 100644 --- a/boot/bootstd-uclass.c +++ b/boot/bootstd-uclass.c @@ -145,12 +145,6 @@ int dm_scan_other(bool pre_reloc_only) } } - /* Create the system bootdev too */ - ret = device_bind_driver(bootstd, "system_bootdev", "system-bootdev", - &dev); - if (ret) - return log_msg_ret("sys", ret); - return 0; } diff --git a/boot/system_bootdev.c b/boot/system_bootdev.c deleted file mode 100644 index 432d2034780..00000000000 --- a/boot/system_bootdev.c +++ /dev/null @@ -1,66 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Bootdevice for system, used for bootmeths not tied to any partition device - * - * Copyright 2021 Google LLC - * Written by Simon Glass - */ - -#define LOG_CATEGORY UCLASS_BOOTSTD - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int system_get_bootflow(struct udevice *dev, struct bootflow_iter *iter, - struct bootflow *bflow) -{ - int ret; - - /* Must be an bootstd device */ - ret = bootflow_iter_uses_system(iter); - if (ret) - return log_msg_ret("net", ret); - - ret = bootmeth_check(bflow->method, iter); - if (ret) - return log_msg_ret("check", ret); - - ret = bootmeth_read_bootflow(bflow->method, bflow); - if (ret) - return log_msg_ret("method", ret); - - return 0; -} - -static int system_bootdev_bind(struct udevice *dev) -{ - struct bootdev_uc_plat *ucp = dev_get_uclass_plat(dev); - - ucp->prio = BOOTDEVP_6_SYSTEM; - - return 0; -} - -struct bootdev_ops system_bootdev_ops = { - .get_bootflow = system_get_bootflow, -}; - -static const struct udevice_id system_bootdev_ids[] = { - { .compatible = "u-boot,bootdev-system" }, - { } -}; - -U_BOOT_DRIVER(system_bootdev) = { - .name = "system_bootdev", - .id = UCLASS_BOOTDEV, - .ops = &system_bootdev_ops, - .bind = system_bootdev_bind, - .of_match = system_bootdev_ids, -}; diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index b2f77972d1f..39c2c33dead 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -337,7 +336,7 @@ static int bootflow_system(struct unit_test_state *uts) ut_assert_skip_to_line( " 0 efi_mgr ready (none) 0 "); ut_assert_skip_to_line("No more bootdevs"); - ut_assert_skip_to_line("(6 bootflows, 6 valid)"); + ut_assert_skip_to_line("(5 bootflows, 5 valid)"); ut_assert_console_end(); return 0; @@ -358,10 +357,6 @@ static int bootflow_iter_disable(struct unit_test_state *uts) ut_assertok(device_bind_driver(bootstd, "bootmeth_sandbox", "sandbox", &dev)); - /* Add the system bootdev that it uses */ - ut_assertok(device_bind_driver(bootstd, "system_bootdev", - "system-bootdev", &dev)); - ut_assertok(bootstd_test_drop_bootdev_order(uts)); bootstd_clear_glob(); -- 2.37.1.455.g008518b4e5-goog