Commit ad93f7b3 authored by Viresh Kumar's avatar Viresh Kumar Committed by Michael S. Tsirkin
Browse files

dt-bindings: virtio: Add binding for virtio devices



Allow virtio device sub-nodes to be added to the virtio mmio or pci
nodes. The compatible property for virtio device must be of the format
"virtio,device<ID>", where ID is virtio device ID in hexadecimal format.

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/d8319fd18df7086b12cdcc23193c313893aa071a.1627362340.git.viresh.kumar@linaro.org


Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
parent 0d8c9e7d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -36,7 +36,8 @@ required:
  - reg
  - interrupts

additionalProperties: false
additionalProperties:
  type: object

examples:
  - |
+41 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/virtio/virtio-device.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Virtio device bindings

maintainers:
  - Viresh Kumar <viresh.kumar@linaro.org>

description:
  These bindings are applicable to virtio devices irrespective of the bus they
  are bound to, like mmio or pci.

# We need a select here so we don't match all nodes with 'virtio,mmio'
properties:
  compatible:
    pattern: "^virtio,device[0-9a-f]{1,8}$"
    description: Virtio device nodes.
      "virtio,deviceID", where ID is the virtio device id. The textual
      representation of ID shall be in lower case hexadecimal with leading
      zeroes suppressed.

required:
  - compatible

additionalProperties: true

examples:
  - |
    virtio@3000 {
        compatible = "virtio,mmio";
        reg = <0x3000 0x100>;
        interrupts = <43>;

        i2c {
            compatible = "virtio,device22";
        };
    };
...