# Device-ID from Device Tree not mapped to user space

**URL:** <https://sel4.discourse.group/t/device-id-from-device-tree-not-mapped-to-user-space/869>\
**Category:** New to seL4\
**Created:** [September 1, 2024, 3:05pm UTC](https://sel4.discourse.group/t/device-id-from-device-tree-not-mapped-to-user-space/869 "2024-09-01T15:05:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BDUG](https://yyz2.discourse-cdn.com/free1/user_avatar/sel4.discourse.group/bdug/32/313_2.png) [@BDUG](https://sel4.discourse.group/u/BDUG)\
**Post date:** [September 1, 2024, 3:05pm UTC](https://sel4.discourse.group/t/device-id-from-device-tree-not-mapped-to-user-space/869/1 "2024-09-01T15:05:34Z")

</div>

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:

1. Access the device ID via volatile read
2. Interpret the `FdtNode` informations such as properties and nodes.

My qemu config is the following:

```auto
/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?

---

<div class="post-metadata">

**Author:** ![BDUG](https://yyz2.discourse-cdn.com/free1/user_avatar/sel4.discourse.group/bdug/32/313_2.png) [@BDUG](https://sel4.discourse.group/u/BDUG)\
**Post date:** [September 10, 2024, 5:57pm UTC](https://sel4.discourse.group/t/device-id-from-device-tree-not-mapped-to-user-space/869/2 "2024-09-10T17:57:01Z")

</div>

Fixed. Compare [https://sel4.discourse.group/t/rust-call-cause-vm-fault-on-data-at-address/865/13](https://sel4.discourse.group/t/rust-call-cause-vm-fault-on-data-at-address/865/13)
