diff options
author | Simon Glass <sjg@chromium.org> | 2023-01-17 20:47:51 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-01-24 02:11:40 +0300 |
commit | 00fc8cade89e36855fe8143c4ee66e951a41734e (patch) | |
tree | 8e9b0f3f981b8e2a19387d2919c7d35a4c26d3c9 /drivers | |
parent | 902400201de139cc1499dc4f794ed34d8a758ca8 (diff) | |
download | u-boot-00fc8cade89e36855fe8143c4ee66e951a41734e.tar.xz |
virtio: Add a block device
The test code for virtio is fairly simplistic and does not actually create
a block device. Add a way to specify the device type in the device tree.
Add a block device so that we can do more testing.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/virtio/virtio_sandbox.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/virtio/virtio_sandbox.c b/drivers/virtio/virtio_sandbox.c index cf7761c75e..b34f1d6045 100644 --- a/drivers/virtio/virtio_sandbox.c +++ b/drivers/virtio/virtio_sandbox.c @@ -161,7 +161,8 @@ 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_RNG; + uc_priv->device = dev_read_u32_default(udev, "virtio-type", + VIRTIO_ID_RNG); uc_priv->vendor = ('u' << 24) | ('b' << 16) | ('o' << 8) | 't'; return 0; |