Skip to content

Commit bf0b9fe

Browse files
GuEe-GUIRbb666
authored andcommitted
[dm][virtio] update virtio dm
1. support RPMsg 2. support Sound 3. fixup virtio-blk free Signed-off-by: GuEe-GUI <2991707448@qq.com>
1 parent ed332e4 commit bf0b9fe

7 files changed

Lines changed: 2798 additions & 0 deletions

File tree

components/drivers/virtio/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ config RT_VIRTIO_RNG
4545
depends on RT_HWCRYPTO_USING_RNG
4646
default y
4747

48+
config RT_VIRTIO_RPMSG
49+
bool "VirtIO Rpmsg"
50+
depends on RT_USING_VIRTIO
51+
depends on RT_USING_RPMSG
52+
default y
53+
4854
config RT_VIRTIO_SCSI
4955
bool "VirtIO SCSI"
5056
depends on RT_USING_VIRTIO
@@ -92,6 +98,12 @@ config RT_VIRTIO_CRYPTO
9298
depends on RT_HWCRYPTO_USING_RC4
9399
default y
94100

101+
config RT_VIRTIO_SOUND
102+
bool "VirtIO Sound"
103+
depends on RT_USING_VIRTIO
104+
depends on RT_USING_AUDIO
105+
default y
106+
95107
config RT_VIRTIO_SCMI
96108
bool "VirtIO SCMI"
97109
depends on RT_USING_VIRTIO

components/drivers/virtio/SConscript

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ if GetDepend(['RT_VIRTIO_CONSOLE']) or GetDepend(['RT_VIRTIO_RPROC_SERIAL']):
2828
if GetDepend(['RT_VIRTIO_RNG']):
2929
src += ['virtio-rng.c']
3030

31+
if GetDepend(['RT_VIRTIO_RPMSG']):
32+
src += ['virtio-rpmsg.c']
33+
3134
if GetDepend(['RT_VIRTIO_SCSI']):
3235
src += ['virtio-scsi.c']
3336

@@ -43,6 +46,9 @@ if GetDepend(['RT_VIRTIO_INPUT']):
4346
if GetDepend(['RT_VIRTIO_CRYPTO']):
4447
src += ['virtio-crypto.c']
4548

49+
if GetDepend(['RT_VIRTIO_SOUND']):
50+
src += ['virtio-sound.c']
51+
4652
if GetDepend(['RT_VIRTIO_SCMI']):
4753
src += ['virtio-scmi.c']
4854

components/drivers/virtio/virtio-blk.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ static rt_err_t virtio_blk_probe(struct rt_virtio_device *vdev)
257257

258258
if ((vblk->vblk_id = rt_dm_ida_alloc(&virtio_blk_ida)) < 0)
259259
{
260+
rt_free(vblk);
260261
return -RT_EFULL;
261262
}
262263

0 commit comments

Comments
 (0)