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 6F255C46467 for ; Sun, 8 Jan 2023 02:58:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B2DF885708; Sun, 8 Jan 2023 03:53:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Mlh+SD5l"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CB725856D3; Sun, 8 Jan 2023 03:52:38 +0100 (CET) Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (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 9BF918564F for ; Sun, 8 Jan 2023 03:51:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x132.google.com with SMTP id o13so3286676ilc.7 for ; Sat, 07 Jan 2023 18:51:18 -0800 (PST) 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:subject:date :message-id:reply-to; bh=dfL8zf/71vDouCvZ/hPl6O6nOWCBbU+OGSNIa68Nt2k=; b=Mlh+SD5lZLb206pXtyTBcBJxwe+GWi8dwpz69Had+tNRr+NCwnWAOkbNQEk6kD02dD KTeo5qU8lt3v+prNAmSW/vtxvbedgWbkV+k3+xi6C6IQg5mXpGKU8oEQrXj5/3jGs/xo e3yZkFVPzr1z8NXe1crL7aUS/z3VkD4d9pY/0= 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 :subject:date:message-id:reply-to; bh=dfL8zf/71vDouCvZ/hPl6O6nOWCBbU+OGSNIa68Nt2k=; b=yTkNpX+UaHRUFSC1CDnOh9xyjA2mly1oE7HFAi5FAkUpZb48Jn+AmTSLuPoYOZXJq5 jPyfaMDXpSxoTDlOVmrD/hAtGScd0BEDIG0fsj+tSL3RrJBFm7ewgVa9cxK6ewsErkih xJZqn6pUU1vrfIeZ2twgIViB/mQjMz8KEt+xAUjcR+qwpu475NB8M7rRjnDDaY3lGhfX FLzHws2OIPRy9hRGdR2mbYsyq1q4wmhlVk7eFYhWjd5lBlqFMorf9x08hBq2GPTOdWc1 Igk/7ntwDtjAjRVJSzCh3XwLLGSMg9KgMewgbDn/6GCpZOC13ivEd3meco6pN0vsQq+1 +bvg== X-Gm-Message-State: AFqh2kqhoUxrTGuHpo/shb572p0R0NiGlNiSJDcORY/twlwFViRQxeKG PGUlUkO3xAYVp6HSdzAnNzziKNTnCaCwH916 X-Google-Smtp-Source: AMrXdXuRaXmLhxTBaaFW2xban78xpgdnQxGCxKCgEeuu1nchFe4gWvTUcDua11oa6+wBqFzUxE/LdA== X-Received: by 2002:a92:d583:0:b0:30c:4edd:bd5 with SMTP id a3-20020a92d583000000b0030c4edd0bd5mr13609861iln.17.1673146278084; Sat, 07 Jan 2023 18:51:18 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-71-56-217-229.hsd1.co.comcast.net. [71.56.217.229]) by smtp.gmail.com with ESMTPSA id c17-20020a92bd11000000b00302a00aaefasm1622174ile.26.2023.01.07.18.51.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 18:51:17 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: U-Boot Custodians , Simon Glass Subject: [PATCH v2 29/71] bootstd: Add an MMC hunter Date: Sat, 7 Jan 2023 19:50:05 -0700 Message-Id: <20230108025047.522240-30-sjg@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <20230108025047.522240-1-sjg@chromium.org> References: <20230108025047.522240-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 Add a hunter for MMC. This doesn't do anything at present, since MMC is currently set up when U-Boot starts. If MMC moves to lazy init then we can add a hunter function. Signed-off-by: Simon Glass --- (no changes since v1) drivers/mmc/mmc_bootdev.c | 6 ++++++ test/boot/bootdev.c | 16 ++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/mmc_bootdev.c b/drivers/mmc/mmc_bootdev.c index 037b67bc0ff..300208f0c71 100644 --- a/drivers/mmc/mmc_bootdev.c +++ b/drivers/mmc/mmc_bootdev.c @@ -35,3 +35,9 @@ U_BOOT_DRIVER(mmc_bootdev) = { .bind = mmc_bootdev_bind, .of_match = mmc_bootdev_ids, }; + +BOOTDEV_HUNTER(mmc_bootdev_hunter) = { + .prio = BOOTDEVP_0_INTERNAL_FAST, + .uclass = UCLASS_MMC, + .drv = DM_DRIVER_REF(mmc_bootdev), +}; diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c index 7a0c5793890..78cb0ac628a 100644 --- a/test/boot/bootdev.c +++ b/test/boot/bootdev.c @@ -238,8 +238,9 @@ static int bootdev_test_hunter(struct unit_test_state *uts) bootdev_list_hunters(std); ut_assert_nextline("Prio Used Uclass Hunter"); ut_assert_nextlinen("----"); + ut_assert_nextline(" 10 mmc mmc_bootdev"); ut_assert_nextline(" 40 usb usb_bootdev"); - ut_assert_nextline("(total hunters: 1)"); + ut_assert_nextline("(total hunters: 2)"); ut_assert_console_end(); ut_assertok(bootdev_hunt("usb1", false)); @@ -247,7 +248,8 @@ static int bootdev_test_hunter(struct unit_test_state *uts) "Bus usb@1: scanning bus usb@1 for devices... 5 USB Device(s) found"); ut_assert_console_end(); - ut_asserteq(GENMASK(0, 0), std->hunters_used); + /* USB is second in the list, so bit 1 */ + ut_asserteq(BIT(1), std->hunters_used); return 0; } @@ -267,12 +269,12 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts) ut_assertok(run_command("bootdev hunt -l", 0)); ut_assert_nextline("Prio Used Uclass Hunter"); ut_assert_nextlinen("----"); - ut_assert_nextline(" 40 usb usb_bootdev"); - ut_assert_nextline("(total hunters: 1)"); + ut_assert_skip_to_line("(total hunters: 2)"); ut_assert_console_end(); /* Scan all hunters */ ut_assertok(run_command("bootdev hunt", 0)); + ut_assert_nextline("Hunting with: mmc"); ut_assert_nextline("Hunting with: usb"); ut_assert_nextline( "Bus usb@1: scanning bus usb@1 for devices... 5 USB Device(s) found"); @@ -282,11 +284,13 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts) ut_assertok(run_command("bootdev hunt -l", 0)); ut_assert_nextlinen("Prio"); ut_assert_nextlinen("----"); + ut_assert_nextline(" 10 * mmc mmc_bootdev"); ut_assert_nextline(" 40 * usb usb_bootdev"); - ut_assert_nextline("(total hunters: 1)"); + + ut_assert_nextline("(total hunters: 2)"); ut_assert_console_end(); - ut_asserteq(GENMASK(0, 0), std->hunters_used); + ut_asserteq(GENMASK(1, 0), std->hunters_used); return 0; } -- 2.39.0.314.g84b9a713c41-goog