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 72721C433FE for ; Mon, 16 May 2022 10:44:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C5A1884260; Mon, 16 May 2022 12:44:21 +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="p7ibLyw9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5B33284211; Mon, 16 May 2022 12:42:27 +0200 (CEST) Received: from mail-ej1-x64a.google.com (mail-ej1-x64a.google.com [IPv6:2a00:1450:4864:20::64a]) (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 D384C832C3 for ; Mon, 16 May 2022 12:42:11 +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=3gyqCYgYKBvocuewnniqqing.eqow-dqqvnkuvu.fgpz.fg@flex--ascull.bounces.google.com Received: by mail-ej1-x64a.google.com with SMTP id ox8-20020a170907100800b006f9dc6e4a22so5613509ejb.2 for ; Mon, 16 May 2022 03:42:11 -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=yonOeJSWq4lXSPjDr/mWI0QnI+VA0QahnkUicn/95ZQ=; b=p7ibLyw91DOYWDrglXnqsjHQ1/ZhOzaRlWcwMk/jiQqVy1EpBMKnLmY5f97t9BN5KL Z/ENCSwP6sdxp4Nw3rajWt+UZZ5lEvrf2kQov67fI5hI5i4F1VDZVYdyH+IGlXjGgAKi My5qB2kzXveInIWI0z6es7dWVExSTrVoH1uKnv7b9teEz2qnQF4IW7TBY8nmKD77m4SI HPronHqFxrOheLpIIuMVZg1USIH7YNeNFnHXXaGu39wRzlCah4WxBtYycwXTLHEtT/qQ ExIylrbiT+lfp7VmTNdi2c3UUV90TisNfhrAdBVc5bXDawvW4JomsMUTcCZSiQk27h53 m3qw== 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=yonOeJSWq4lXSPjDr/mWI0QnI+VA0QahnkUicn/95ZQ=; b=7fAZXTdBiq+BspuuXnRHb0Uq2iQVu6EP6kcrnKs3/EvUb0E6mEZHVP2y5inr2hMVe9 1whefqemi86knL1vNOPG2hUeI5tOtjJX0bNGKzJapqnL93zdEVyRw2KkCaVhVCG1hr+F yHNjNMmI38H2ZfG5uMhW7t/cW/6xpWcSixp23CLWtDrg4o6mwop1jnA5qerBaKdeliOv RznVLubq+4IUyw+JVnRl23xUS7bio0q9QpDxgKT73z6O9mUkFW87d/ihS/qO4vo7u994 SbY3TeTtncPrE4iKX3ycpxIHJWyj2m6XsShKpOVOYAqjg7SOs9rjousX1Rwx7+DNEs1u ZaRw== X-Gm-Message-State: AOAM533vYQkQd63gVLgGD/HzpYqYwB/dOxMRscW0pO+hkmMA5ixbucJU MtOTg/feE39adX68xF8/1TiclH2jay+1jQlLtwZ9cAG8s3mgZdtZwQqXZSPmeKQFKlskOdfni8P BieIvi+3sjIV5XqAV8kLSfCoptEwCqiwIOqiM3wc9GUjNKY/FJhBk9dA923U= X-Google-Smtp-Source: ABdhPJxRbPfjX21pRTiJcdn2POJvVhnIa0NXck1XLBao/BkXl38fesx6IBbvbDuGp/9e7oB4/HMQIG6cVek= X-Received: from ascull.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1510]) (user=ascull job=sendgmr) by 2002:a17:907:3e8c:b0:6f4:4fdb:6f24 with SMTP id hs12-20020a1709073e8c00b006f44fdb6f24mr14944792ejc.44.1652697731088; Mon, 16 May 2022 03:42:11 -0700 (PDT) Date: Mon, 16 May 2022 10:41:37 +0000 In-Reply-To: <20220516104140.1047229-1-ascull@google.com> Message-Id: <20220516104140.1047229-10-ascull@google.com> Mime-Version: 1.0 References: <20220516104140.1047229-1-ascull@google.com> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog Subject: [PATCH v3 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, bmeng.cn@gmail.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 29dd143517..809f0f239f 100644 --- a/test/dm/Makefile +++ b/test/dm/Makefile @@ -109,7 +109,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.36.0.550.gb090851708-goog