I try to access VirtIO MMIO devices. For doing so I need the device id to identity the device class e.g., net, block, etc. In all approaches the device ID is missing:
- Access the device ID via volatile read
- Interpret the
FdtNode
informations such as properties and nodes.
My qemu config is the following:
/dts-v1/;
/ {
#address-cells = <2>;
#size-cells = <2>;
compatible = "qemu,virt";
model = "QEMU Virt Machine";
chosen {
bootargs = "console=ttyS0,115200 root=/dev/vda";
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
timebase-frequency = <1000000>;
cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a53";
reg = <0>;
};
};
memory@40000000 {
device_type = "memory";
reg = <0x0 0x40000000 0x0 0x40000000>; /* 1 GB RAM starting at 0x40000000 */
};
soc {
#address-cells = <2>;
#size-cells = <2>;
compatible = "simple-bus";
ranges;
gic: interrupt-controller@8000000 {
compatible = "arm,cortex-a15-gic";
interrupt-controller;
reg = <0x0 0x8000000 0x0 0x1000>, /* GIC Distributor */
<0x0 0x8001000 0x0 0x1000>; /* GIC CPU Interface */
#interrupt-cells = <3>;
};
serial@9000000 {
compatible = "ns16550a";
reg = <0x0 0x09000000 0x0 0x1000>;
clock-frequency = <1843200>;
interrupts = <0 32 4>; /* Interrupt type 0 (SPI), number 32, edge-triggered */
interrupt-parent = <&gic>;
};
virtio_mmio@10001000 {
compatible = "virtio,mmio";
reg = <0x0 0x10001000 0x0 0x1000>;
interrupts = <0 33 4>; /* Interrupt type 0 (SPI), number 33, edge-triggered */
interrupt-parent = <&gic>;
device-id = <0x6>;
vendor-id = <0x1af4>;
};
virtio_blk@10002000 {
compatible = "virtio,mmio";
reg = <0x0 0x10002000 0x0 0x1000>;
interrupts = <0 34 4>; /* Interrupt type 0 (SPI), number 34, edge-triggered */
interrupt-parent = <&gic>;
device-id = <0x2>;
vendor-id = <0x1af4>;
};
virtio_net@10003000 {
compatible = "virtio,mmio";
reg = <0x0 0x10003000 0x0 0x1000>;
interrupts = <0 35 4>; /* Interrupt type 0 (SPI), number 35, edge-triggered */
interrupt-parent = <&gic>;
device-id = <0x1>;
vendor-id = <0x1af4>;
};
};
};
Where can I get the device id information from?