Skip to content

Commit b240560

Browse files
Jakub Klimczakhenrikbrixandersen
authored andcommitted
tests: drivers: build_all: virtio: Add VIRTIO Network device
Add the VIRTIO Network device to the driver build_all test on qemu_x86_64 (PCI) and qemu_cortex_a53 (MMIO). Additionally, restrict the test to these two platforms, getting rid of qemu_x86, as enabling networking would cause build errors on many boards, including the qemu_x86. Use dashes in node names. Signed-off-by: Jakub Klimczak <[email protected]>
1 parent 1abfb70 commit b240560

File tree

5 files changed

+35
-25
lines changed

5 files changed

+35
-25
lines changed

tests/drivers/build_all/virtio/boards/qemu_cortex_a53.overlay

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
&virtio_mmio0 {
1515
status = "okay";
1616

17-
virtio_entropy: virtio_entropy {
17+
virtio_entropy: virtio-entropy {
1818
compatible = "virtio,device4";
1919
status = "okay";
2020
};
@@ -23,8 +23,18 @@
2323
&virtio_mmio1 {
2424
status = "okay";
2525

26-
virtio_console: virtio_console {
26+
virtio_console: virtio-console {
2727
compatible = "virtio,console";
2828
status = "okay";
2929
};
3030
};
31+
32+
&virtio_mmio2 {
33+
status = "okay";
34+
35+
virtio_net: virtio-net {
36+
compatible = "virtio,net";
37+
status = "okay";
38+
zephyr,random-mac-address;
39+
};
40+
};

tests/drivers/build_all/virtio/boards/qemu_x86.overlay

Lines changed: 0 additions & 19 deletions
This file was deleted.

tests/drivers/build_all/virtio/boards/qemu_x86_64.overlay

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
};
1313

1414
&pcie0 {
15-
virtio_pci: virtio_pci {
15+
virtio_pci: virtio-pci {
1616
compatible = "virtio,pci";
1717

1818
vendor-id = <0x1af4>;
@@ -24,7 +24,23 @@
2424
status = "okay";
2525
};
2626

27-
virtio_console_pci: virtio_console_pci {
27+
virtio_net: virtio-net {
28+
compatible = "virtio,pci";
29+
30+
vendor-id = <0x1af4>;
31+
device-id = <0x1000>;
32+
33+
interrupts = <0xb 0x0 0x0>;
34+
interrupt-parent = <&intc>;
35+
36+
device {
37+
compatible = "virtio,net";
38+
status = "okay";
39+
zephyr,random-mac-address;
40+
};
41+
};
42+
43+
virtio_console_pci: virtio-console-pci {
2844
compatible = "virtio,pci";
2945

3046
vendor-id = <0x1af4>;
@@ -33,13 +49,13 @@
3349
interrupts = <0xb 0x0 0x0>;
3450
interrupt-parent = <&intc>;
3551

36-
virtio_console: virtio_console {
52+
virtio_console: virtio-console {
3753
compatible = "virtio,console";
3854
status = "okay";
3955
};
4056
};
4157

42-
virtio_entropy: virtio_entropy {
58+
virtio_entropy: virtio-entropy {
4359
compatible = "virtio,pci";
4460

4561
vendor-id = <0x1af4>;

tests/drivers/build_all/virtio/prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ CONFIG_EARLY_CONSOLE=n
66
CONFIG_X86_VERY_EARLY_CONSOLE=n
77
CONFIG_UART_VIRTIO_CONSOLE_F_MULTIPORT=y
88
CONFIG_ENTROPY_GENERATOR=y
9+
CONFIG_NETWORKING=y

tests/drivers/build_all/virtio/testcase.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ tests:
88
extra_configs:
99
- CONFIG_PCIE=y
1010
filter: CONFIG_DT_HAS_VIRTIO_PCI_ENABLED
11+
platform_allow: qemu_x86_64
1112
drivers.virtio_mmio.build:
1213
filter: CONFIG_DT_HAS_VIRTIO_MMIO_ENABLED
14+
platform_allow: qemu_cortex_a53

0 commit comments

Comments
 (0)