summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/virtio
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2021-07-27 10:53:48 +0530
committerMichael S. Tsirkin <mst@redhat.com>2021-09-05 16:23:08 -0400
commitad93f7b3715449704225feb33d5fbe6507472245 (patch)
treee1da093402eeb5953f94846c65ce5e752712ef8c /Documentation/devicetree/bindings/virtio
parent0d8c9e7d4b403f10f5c277efefd787244198a00c (diff)
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: Viresh Kumar <viresh.kumar@linaro.org> Link: https://lore.kernel.org/r/d8319fd18df7086b12cdcc23193c313893aa071a.1627362340.git.viresh.kumar@linaro.org Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'Documentation/devicetree/bindings/virtio')
-rw-r--r--Documentation/devicetree/bindings/virtio/mmio.yaml3
-rw-r--r--Documentation/devicetree/bindings/virtio/virtio-device.yaml41
2 files changed, 43 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/virtio/mmio.yaml b/Documentation/devicetree/bindings/virtio/mmio.yaml
index d46597028cf1..4b7a0273181c 100644
--- a/Documentation/devicetree/bindings/virtio/mmio.yaml
+++ b/Documentation/devicetree/bindings/virtio/mmio.yaml
@@ -36,7 +36,8 @@ required:
- reg
- interrupts
-additionalProperties: false
+additionalProperties:
+ type: object
examples:
- |
diff --git a/Documentation/devicetree/bindings/virtio/virtio-device.yaml b/Documentation/devicetree/bindings/virtio/virtio-device.yaml
new file mode 100644
index 000000000000..1778ea9b5aa5
--- /dev/null
+++ b/Documentation/devicetree/bindings/virtio/virtio-device.yaml
@@ -0,0 +1,41 @@
+# 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";
+ };
+ };
+...