mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 09:12:08 +02:00
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>
This commit is contained in:
@@ -1527,12 +1527,18 @@
|
|||||||
|
|
||||||
sandbox_virtio1 {
|
sandbox_virtio1 {
|
||||||
compatible = "sandbox,virtio1";
|
compatible = "sandbox,virtio1";
|
||||||
|
virtio-type = <4>; /* rng */
|
||||||
};
|
};
|
||||||
|
|
||||||
sandbox_virtio2 {
|
sandbox_virtio2 {
|
||||||
compatible = "sandbox,virtio2";
|
compatible = "sandbox,virtio2";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sandbox-virtio-blk {
|
||||||
|
compatible = "sandbox,virtio1";
|
||||||
|
virtio-type = <2>; /* block */
|
||||||
|
};
|
||||||
|
|
||||||
sandbox_scmi {
|
sandbox_scmi {
|
||||||
compatible = "sandbox,scmi-devices";
|
compatible = "sandbox,scmi-devices";
|
||||||
clocks = <&clk_scmi 2>, <&clk_scmi 0>;
|
clocks = <&clk_scmi 2>, <&clk_scmi 0>;
|
||||||
|
@@ -161,7 +161,8 @@ static int virtio_sandbox_probe(struct udevice *udev)
|
|||||||
|
|
||||||
/* fake some information for testing */
|
/* fake some information for testing */
|
||||||
priv->device_features = BIT_ULL(VIRTIO_F_VERSION_1);
|
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';
|
uc_priv->vendor = ('u' << 24) | ('b' << 16) | ('o' << 8) | 't';
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user