devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: devicetree <devicetree@vger.kernel.org>,
	Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	Jailhouse <jailhouse-dev@googlegroups.com>,
	"Måns Rullgård" <mans@denx.de>,
	"Antonios Motakis" <antonios.motakis@huawei.com>
Subject: Using DT overlays for adding virtual hardware
Date: Wed, 8 Jun 2016 16:16:32 +0200	[thread overview]
Message-ID: <575828C0.5000008@siemens.com> (raw)

Hi all,

already started the discussion off-list with Pantelis, but it's better
done in public:

I'm currently exploring ways to make Linux recognize dynamically added
virtual hardware when running under the Jailhouse hypervisor [1]. We
need to load drivers for inter-partition communication devices that only
appear after Jailhouse started (which is done from within Linux, i.e.
long after boot) or when a partition was added later on. Probably, we
will simply add a virtual PCI host bridge on systems without physical
PCI and let the IPC device be explored that way (already works on x86).
Still, that leaves us with hotplug and unplug on hypervisor activation
and deactivation.

Inspired by how FPGA bitstream loaders and the caps/hats for BeagleBones
and RasPis work, I thought of using device tree overlays for this.
However, it seems there are still some gaps in upstream Linux /wrt
overlays. So I would like to find out what already works and what may
need further patches.

The plan (open for suggestions) is as follows:

- have an overlay template for a virtual platform device
- compile it into the Jailhouse loader kernel module
- adjust key parameters (e.g. register base addresses) after
  instantiating a device (of_update_property?)
- push modified dt into of_overlay_create

To my understanding, the last step will trigger driver probing which
will cause the device being activated (provided the driver is available,
of course).

I played with the fragment from
Documentation/devicetree/overlay-notes.txt, but already that failed
because the in-kernel dtc does not support /plugin/ yet, right? (Why
not, btw?) What else do I need to patch/update to make the above work?
Or are the simpler ways to achieve what we need?

Thanks,
Jan

[1] https://github.com/siemens/jailhouse

-- 
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux

             reply	other threads:[~2016-06-08 14:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-08 14:16 Jan Kiszka [this message]
2016-06-08 15:17 ` Using DT overlays for adding virtual hardware Mark Rutland
2016-06-08 15:27   ` Jan Kiszka
2016-06-08 15:57   ` Pantelis Antoniou
2016-06-08 16:23     ` Mark Rutland
2016-06-08 16:31       ` Pantelis Antoniou
2016-06-08 16:39         ` Jan Kiszka
2016-06-09  6:03           ` Jan Kiszka
2016-06-21 10:13             ` Jan Kiszka
2016-06-21 10:24               ` Pantelis Antoniou
2016-06-21 11:22                 ` Jan Kiszka
2016-06-21 11:35                   ` Pantelis Antoniou
2016-06-21 11:43                     ` Jan Kiszka
2016-06-21 11:45                       ` Pantelis Antoniou
2016-06-21 11:59                         ` Jan Kiszka
2016-06-21 13:12                           ` Jan Kiszka
2016-06-21 13:29                             ` Pantelis Antoniou
2016-06-09  7:22           ` Arnd Bergmann
2016-06-10 14:57             ` Jan Kiszka

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=575828C0.5000008@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=antonios.motakis@huawei.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jailhouse-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mans@denx.de \
    --cc=pantelis.antoniou@konsulko.com \
    /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).