From: Viresh Kumar <viresh.kumar@linaro.org>
To: Jason Wang <jasowang@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Rob Herring <robh+dt@kernel.org>, Arnd Bergmann <arnd@kernel.org>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Linus Walleij <linus.walleij@linaro.org>,
Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Vincent Guittot" <vincent.guittot@linaro.org>,
"Bill Mills" <bill.mills@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Enrico Weigelt, metux IT consult" <info@metux.net>,
"Jie Deng" <jie.deng@intel.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org,
"Arnd Bergmann" <arnd@arndb.de>,
linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org,
"Wolfram Sang" <wsa@kernel.org>
Subject: [PATCH V3 0/5] virtio: Add virtio-device bindings
Date: Mon, 26 Jul 2021 10:21:40 +0530 [thread overview]
Message-ID: <cover.1627273794.git.viresh.kumar@linaro.org> (raw)
Hi,
Currently the DT only provides support for following node types for virtio-mmio
nodes:
virtio_mmio@a000000 {
dma-coherent;
interrupts = <0x00 0x10 0x01>;
reg = <0x00 0xa000000 0x00 0x200>;
compatible = "virtio,mmio";
};
Here, each virtio-mmio corresponds to a virtio-device. But there is no way for
other users in the DT to show their dependency on virtio devices.
This patchset provides that support.
The first patch adds virtio-device bindings to allow for device sub-nodes to be
present and the second patch updates the virtio core to update the of_node.
Other patches add bindings for i2c and gpio devices.
Tested on x86 with qemu for arm64.
Pending:
- Arnd suggested that "virtio,deviceXX" may be a better compatible string, while
I used "virtio,XX" to match what PCI and USB do currently. I didn't change it
yet to hear Rob's view on the same before making the change, in case he has
any preferences.
V2/2.1->V3:
- Added review-tags from Arnd and Wolfram.
- Only the 5th patch changed otherwise:
- Use of_device_is_compatible() instead of keeping a list of devices.
- Use snprintf (with BUG_ON on return value) to create the compatible string,
whose length is fixed using "virtio,XXXXXXXX".
- Use dev_of_node().
V1->V2:
- The changes (both binding and code) are made at virtio level, instead of
virtio-mmio. This allows the same to be used by all device types, irrespective
of the transport mechanism.
- Dropped the reg property and used compatible in the form "virtio,<DID>".
- Dropped dt-bindings/virtio/virtio_ids.h.
- Add a patch to sync virtio-ids from spec, required for the last patch.
--
Viresh
Viresh Kumar (5):
dt-bindings: virtio: Add binding for virtio devices
dt-bindings: i2c: Add bindings for i2c-virtio
dt-bindings: gpio: Add bindings for gpio-virtio
uapi: virtio_ids: Sync ids with specification
virtio: Bind virtio device to device-tree node
.../devicetree/bindings/gpio/gpio-virtio.yaml | 60 +++++++++++++++++++
.../devicetree/bindings/i2c/i2c-virtio.yaml | 51 ++++++++++++++++
.../devicetree/bindings/virtio/mmio.yaml | 2 +-
.../bindings/virtio/virtio-device.yaml | 47 +++++++++++++++
drivers/virtio/virtio.c | 57 +++++++++++++++++-
include/uapi/linux/virtio_ids.h | 12 ++++
6 files changed, 225 insertions(+), 4 deletions(-)
create mode 100644 Documentation/devicetree/bindings/gpio/gpio-virtio.yaml
create mode 100644 Documentation/devicetree/bindings/i2c/i2c-virtio.yaml
create mode 100644 Documentation/devicetree/bindings/virtio/virtio-device.yaml
--
2.31.1.272.g89b43f80a514
next reply other threads:[~2021-07-26 4:51 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-26 4:51 Viresh Kumar [this message]
2021-07-26 4:51 ` [PATCH V3 1/5] dt-bindings: virtio: Add binding for virtio devices Viresh Kumar
2021-07-26 14:57 ` Rob Herring
2021-07-26 15:53 ` Arnd Bergmann
2021-07-26 20:36 ` Rob Herring
2021-07-26 21:20 ` Arnd Bergmann
2021-07-27 5:09 ` Viresh Kumar
2021-07-26 4:51 ` [PATCH V3 2/5] dt-bindings: i2c: Add bindings for i2c-virtio Viresh Kumar
2021-07-26 8:06 ` Arnd Bergmann
2021-07-26 8:11 ` Arnd Bergmann
2021-07-26 9:21 ` Viresh Kumar
2021-07-26 15:06 ` Rob Herring
2021-07-26 4:51 ` [PATCH V3 3/5] dt-bindings: gpio: Add bindings for gpio-virtio Viresh Kumar
2021-07-26 8:13 ` Arnd Bergmann
2021-07-26 15:11 ` Rob Herring
2021-07-26 4:51 ` [PATCH V3 4/5] uapi: virtio_ids: Sync ids with specification Viresh Kumar
2021-07-26 4:51 ` [PATCH V3 5/5] virtio: Bind virtio device to device-tree node Viresh Kumar
2021-09-13 9:19 ` Alexey Kardashevskiy
2021-09-13 9:45 ` Michael S. Tsirkin
2021-09-13 10:27 ` Alexey Kardashevskiy
2021-09-13 14:49 ` Guenter Roeck
2021-09-13 16:19 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1627273794.git.viresh.kumar@linaro.org \
--to=viresh.kumar@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=bgolaszewski@baylibre.com \
--cc=bill.mills@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=info@metux.net \
--cc=jasowang@redhat.com \
--cc=jean-philippe@linaro.org \
--cc=jie.deng@intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=robh+dt@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=wsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).