From mboxrd@z Thu Jan 1 00:00:00 1970 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 DDCFBC433EF for ; Wed, 13 Apr 2022 14:23:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0F02F83E27; Wed, 13 Apr 2022 16:22:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="NjzdPoXp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 067F683E0A; Wed, 13 Apr 2022 16:22:08 +0200 (CEST) Received: from mail-wm1-x34a.google.com (mail-wm1-x34a.google.com [IPv6:2a00:1450:4864:20::34a]) (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 8C96783E1C for ; Wed, 13 Apr 2022 16:22:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=3jNxWYgYKBrkZrbtkkfnnfkd.bnlt-annskhrsr.cdmw.cd@flex--ascull.bounces.google.com Received: by mail-wm1-x34a.google.com with SMTP id t2-20020a7bc3c2000000b003528fe59cb9so847969wmj.5 for ; Wed, 13 Apr 2022 07:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=W0ylptVWPMVUiN8xJdA+45wrt2n7AIABp+lHZMuyI94=; b=NjzdPoXptOLGafhtrXkbisH1pRV5S2W8XcUzEqA9+wQy8HAXwUktBMRzk/2VFK49Lc tmsL6490e98N2t1zfIoy7k3hMUv9GXJ4jjbMQ8TAvknfzsx4fzBK4Ehhmn+74S/DG6Iv dyv5UsyrjEgG9rmC9qWzv3A4H8FUZqdzgEHvsSxEmL0ksfRRjR9Bo/MrMuixSLCfomIg Of5erZmwjZ/BCAtK7BCONrd6UZacyzL/YsLeAPoBTQnkpIjKLwf7wsShNt/OzFe7L0UV lZPkoLCx42TgOicouKwntlZ+eQmoHgshc4LFWOedQjgmkpifPCypAbXWgr+WWZHDL4uj 7ZUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=W0ylptVWPMVUiN8xJdA+45wrt2n7AIABp+lHZMuyI94=; b=J7hyMdNVKNTNcgkeO+SPiuSsxhReu5V62nG/IePLfKRSymP2aDV/1LYqzpNhy/A5BK HWRUSNLl2U8BXXAVhlqwpVBVeawjTv5DXSRcBpCqU3YRynYQTn20R/utEH1tC2RJkyGT SWBVzZiHjLi2S+nOSgPppDnA1+3oFX4e/36I0m4Gik/aOcWXKln7ZhDZfPw2dmz/F9nP 7WFpC/X0fFMFwG0Gpu0qwBHb0EApO8xEkuamTfvpGgaOd4Cpa7w4ivWZb6zNrnjhwEYL TbxQf3K738EYrDYDTtn3Ylg36T30a/S4dhjpksE5Nc1tMgyXGg0gacXp1GNWtszsLWt4 3MKA== X-Gm-Message-State: AOAM531pWX4CBr8GdQy884EYuCKyWZQS7PmNCL9LIGdbf6/oD+VRIjuh nAOMe1kYK/BCCk+RFn1mDxrAC//M5XmDKCKCI9b4JuaFD6xdGLApwNTmLeTnMQnmIsi6uJy2RCt 3VDN/0RTj0Giov3QiEbtFFjCLip/XJUCpBfdjd8y7qHw6AiH0zMpHBVbVc8Q= X-Google-Smtp-Source: ABdhPJx/w4RySipNOyFmVQRx7lku9aM0hvmcnJECw+eALcKaQKcGqh+I6SvO7wE6k3wkRTJ41hWd4FTuBPo= X-Received: from ascull.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1510]) (user=ascull job=sendgmr) by 2002:a05:600c:1c10:b0:38f:f033:b665 with SMTP id j16-20020a05600c1c1000b0038ff033b665mr863564wms.85.1649859724098; Wed, 13 Apr 2022 07:22:04 -0700 (PDT) Date: Wed, 13 Apr 2022 14:21:34 +0000 In-Reply-To: <20220413142137.560987-1-ascull@google.com> Message-Id: <20220413142137.560987-10-ascull@google.com> Mime-Version: 1.0 References: <20220413142137.560987-1-ascull@google.com> X-Mailer: git-send-email 2.35.1.1178.g4f1659d476-goog Subject: [PATCH v2 09/12] virtio: sandbox: Bind RNG rather than block device From: Andrew Scull To: u-boot@lists.denx.de Cc: sjg@chromium.org, trini@konsulko.com, Andrew Scull Content-Type: text/plain; charset="UTF-8" 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.5 at phobos.denx.de X-Virus-Status: Clean The virtio-rng driver is extremely simple, making it suitable for testing more of the virtio uclass logic. Have the sandbox driver bind the virtio-rng driver rather than the virtio-blk driver so it can be used in tests. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- drivers/virtio/virtio_sandbox.c | 2 +- test/dm/Makefile | 2 +- test/dm/virtio_device.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/virtio/virtio_sandbox.c b/drivers/virtio/virtio_sandbox.c index a73b123454..5484ae3a1a 100644 --- a/drivers/virtio/virtio_sandbox.c +++ b/drivers/virtio/virtio_sandbox.c @@ -161,7 +161,7 @@ static int virtio_sandbox_probe(struct udevice *udev) /* fake some information for testing */ priv->device_features = BIT_ULL(VIRTIO_F_VERSION_1); - uc_priv->device = VIRTIO_ID_BLOCK; + uc_priv->device = VIRTIO_ID_RNG; uc_priv->vendor = ('u' << 24) | ('b' << 16) | ('o' << 8) | 't'; return 0; diff --git a/test/dm/Makefile b/test/dm/Makefile index fa54f7cba3..6c467b145e 100644 --- a/test/dm/Makefile +++ b/test/dm/Makefile @@ -108,7 +108,7 @@ obj-$(CONFIG_DM_USB) += usb.o obj-$(CONFIG_DM_VIDEO) += video.o ifeq ($(CONFIG_VIRTIO_SANDBOX),y) obj-y += virtio.o -obj-$(CONFIG_VIRTIO_BLK) += virtio_device.o +obj-$(CONFIG_VIRTIO_RNG) += virtio_device.o endif ifeq ($(CONFIG_WDT_GPIO)$(CONFIG_WDT_SANDBOX),yy) obj-y += wdt.o diff --git a/test/dm/virtio_device.c b/test/dm/virtio_device.c index 46f4798fc2..f5f2349750 100644 --- a/test/dm/virtio_device.c +++ b/test/dm/virtio_device.c @@ -25,10 +25,10 @@ static int dm_test_virtio_base(struct unit_test_state *uts) ut_assertok(uclass_first_device(UCLASS_VIRTIO, &bus)); ut_assertnonnull(bus); - /* check the child virtio-blk device is bound */ + /* check the child virtio-rng device is bound */ ut_assertok(device_find_first_child(bus, &dev)); ut_assertnonnull(dev); - ut_assertok(strcmp(dev->name, "virtio-blk#0")); + ut_asserteq_str("virtio-rng#0", dev->name); /* check driver status */ ut_assertok(virtio_get_status(dev, &status)); -- 2.35.1.1178.g4f1659d476-goog