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 617DAC433F5 for ; Thu, 31 Mar 2022 10:12:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 08FB18421D; Thu, 31 Mar 2022 12:11:16 +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="eiqAHPyw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AEF1A841F7; Thu, 31 Mar 2022 12:10:25 +0200 (CEST) Received: from mail-wm1-x349.google.com (mail-wm1-x349.google.com [IPv6:2a00:1450:4864:20::349]) (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 E850284201 for ; Thu, 31 Mar 2022 12:10:15 +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=3Bn5FYgYKBjENfPhYYTbbTYR.PbZh-ObbgYVfgf.QRak.QR@flex--ascull.bounces.google.com Received: by mail-wm1-x349.google.com with SMTP id 12-20020a05600c24cc00b0038c6caa95f7so966859wmu.4 for ; Thu, 31 Mar 2022 03:10:15 -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=PDc/sxEKnc8nffPcJC5avBWPGLOjv2fEk1hVACe0WFA=; b=eiqAHPywWwsRG1fNU4EAflmeYA6Ec68fPjI8Vv65z+h3GnCuRqvTebbqD8msHV/Qg4 Pp6b9hcarRFoivy7L7dVpSLrHGhneMY9HoZjLImeuhl3rJ241OcM3p5z0YCfWt0HWJ/x IIBbw37HKgSQtJZ/gKHCZzM71IjJCJdozi/LLzeAEx5iZ7zhFWcjoJF87omebBSN+i3Y AP08gZs6PYID88fdQARzZ3QZJi3zsxqXgEM4SKDl8GuVq+r/28lSouvPKPmGlAVn6t7e 99CHBQ4rHFQeoOUFMQfo7PLs3JnqhRyZY76rmdPQgwjIe434ejykDGuxH55M95I1X/W9 0ZeA== 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=PDc/sxEKnc8nffPcJC5avBWPGLOjv2fEk1hVACe0WFA=; b=ZZEo1Vs7T3IxtYrtNteCM2qsqyMcSOgbMPaqOY9312murqUv1UKWprVsJTnn9fAlZ4 mQEBD9vyZEkerEF0FRk1J4Q0IsZMZgMIZWqYx5O9AcUjTtda0BPeOl1bCF7Vs7AsH4Ev 1iFrNLAqqVbB05trRaQiJGPzAT42vz+0P+KyWk47uGdcOyp0CEmFADLQzQFrDdzDIZ1L ty1x+vyh0dG+/c/xtii5GtwRRfAxLXu7RGngunjPF8si4/9vIELY/MJSScRb9AZKbHdV LjstXb2GJr2/+CFW5O4klQxyftyfeNEgZ+YAqqlZy9Mz96edG6l5IK1Yn4fCIoQOpDfM OkOw== X-Gm-Message-State: AOAM5334L8q3D19FoB6rbTGx+NJisjC24fICmGSFsMOUEoTVXKc7lXj1 zhLjOYDxEDNc/82vvOWSyq0wbPE/3ANnJctwTsOHZ77ryHfdQiyLL3/Q7cXI4esPg0GmfRgF4mT E4gh3NT+iaccTmWQ9ohhKx5FId8AtnbsI8o/AdCbQz+FsCA1BhSD9qupj+yM= X-Google-Smtp-Source: ABdhPJxMrtTBi3wHaT9LQoD0qcE0EQs+Agb0Yb+CGrHQxjSs3/SX5H29UpOYYpPNfQ+EiQbzg1K3rDrwU9I= X-Received: from ascull.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1510]) (user=ascull job=sendgmr) by 2002:a1c:35c7:0:b0:38e:4c59:6788 with SMTP id c190-20020a1c35c7000000b0038e4c596788mr77917wma.1.1648721414905; Thu, 31 Mar 2022 03:10:14 -0700 (PDT) Date: Thu, 31 Mar 2022 10:09:46 +0000 In-Reply-To: <20220331100949.3637425-1-ascull@google.com> Message-Id: <20220331100949.3637425-9-ascull@google.com> Mime-Version: 1.0 References: <20220331100949.3637425-1-ascull@google.com> X-Mailer: git-send-email 2.35.1.1094.g7c7d902a7c-goog Subject: [PATCH 08/11] virtio: sandbox: Bind RNG rather than block device From: Andrew Scull To: u-boot@lists.denx.de Cc: sjg@chromium.org, bmeng.cn@gmail.com, adelva@google.com, keirf@google.com, ptosi@google.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 --- drivers/virtio/virtio_sandbox.c | 2 +- test/dm/virtio.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 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/virtio.c b/test/dm/virtio.c index d054ccfaa4..769945a0d8 100644 --- a/test/dm/virtio.c +++ b/test/dm/virtio.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)); @@ -54,7 +54,7 @@ static int dm_test_virtio_all_ops(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); @@ -114,7 +114,7 @@ static int dm_test_virtio_remove(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); -- 2.35.1.1094.g7c7d902a7c-goog