From: Anthony Liguori <anthony@codemonkey.ws>
To: "Peter A. G. Crosthwaite" <peter.crosthwaite@petalogix.com>
Cc: edgar.iglesias@gmail.com, michal.simek@petalogix.com,
qemu-devel@nongnu.org, john.williams@petalogix.com,
stefanha@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees
Date: Thu, 25 Aug 2011 08:27:24 -0500 [thread overview]
Message-ID: <4E564DBC.8030801@codemonkey.ws> (raw)
In-Reply-To: <1314254480-22438-1-git-send-email-peter.crosthwaite@petalogix.com>
On 08/25/2011 01:41 AM, Peter A. G. Crosthwaite wrote:
> Hello
>
> This is a general RFC for a framework developed at Petalogix for creating QEMU models based on a passed device tree. Machine models are dynamically constructed from parsing a Device Tree Specification (DTS) - no more hard-coded machine models, which is critical for the FPGA-based platforms (i.e. target-microblaze) but also will be very useful for forthcoming DTS-driven ARM kernels as well. Device models (including QDev models) are tagged as being associated with a "compatible" string. If a node with the registered compatible string is found when the argument dts is parsed, then the QDev model is instantiated.
>
> For example, An ethernet controller might have a device tree node:
>
> Ethernet_MAC: ethernet@81000000 {
> compatible = "xlnx,xps-ethernetlite-4.00.a", "xlnx,xps-ethernetlite-1.00.a";
> device_type = "network";
> interrupt-parent =<&xps_intc_0>;
> interrupts =< 1 0>;
> local-mac-address = [ 00 0a 35 00 22 01 ];
> reg =< 0x81000000 0x10000>;
> ...
> } ;
>
> Our framework registers the compatibility "xlnx,xps-ethernetlite-1.00.a" as being associated with the xilinx.ethlite qdev model (hw/xilinx_ethlite.c), and each time this compatiblity is discovered in the device tree, the qdev model is instantiated (see path 10/14 for code details on this particular example).The reg property is used to set the device base address and the interrupt properties are used to connect interrupts. Device tree (more info @ devicetree.org) provides a standarised way of specifiying such connecitons, and we use all this to create machine models.
>
> Compatibilities are registered statically from within device models as such:
>
> fdt_qdev_register_compatibility(&xilinx_ethlite_fdt_qdev_ops,
> "xlnx,xps-ethernetlite-1.00.a");
>
> Where the first argument is a struct containing constant and handlers provided by the deivce model to handle device instantiation. Device instantiation is performed by the framework (not the Qdev models themselves)
>
> We have also set up a mechanism for machine models to communicate with each other by means other than bus transactions. DTS provides a means to specify arbitrary interconnections between devices, and we use this to instantiate connections such as hierarchical interrupt controllers and point to point DMA interconnections. This provides a consistent and clean way of specifying inter-device connectivity other than via the system bus.
>
> The platform is tested for Xilinx Microblaze and PPC platforms, and we have been using it both interally at PetaLogix and publishing to customers for approx. 6 months now. We have setup FDT instantiation code for all of the xilinx microbalze/PPC supported periphperals. We are currently developing support for an ARM platform. The framework itself is however independent of architecture so this could be used for creating machine models for any machine.
>
> This patch series is a minimal patch series containing support for only microblaze and a handful of peripherals. Support for a more complete range of device models and other cpu architectures will come in future patches.
>
> We would welcome any comments or questions about the approach so that we can get it merged upstream.
This is just another form of -readconfig AFAICT.
I don't think the data representation really has anything to do with why
we have hard coded machines. The real work needs to happen in the
device model (see my QEMU Object Model patches).
I'm also not a big fan of the DTS syntax for machine representation
since it makes it very hard to represent backends.
Regards,
Anthony Liguori
>
> Regards,
> Peter
>
> Edgar E. Iglesias (2):
> microblaze: Make the MSR PVR bit non writable
> microblaze: Add an MSR_PVR constant and use it.
>
> Peter A. G. Crosthwaite (12):
> qemu-coroutine: Add simple work queue support
> device_tree: Extended interface for fdt_generic
> fdt_generic: First revision
> xilinx_uartlite: Added fdt gen. platform support
> pflash_cfi01: Added fdt generic platform support
> qdev: Added fn for querying device property types
> fdt_generic_qdev: first revision
> xilinx_timer: Added fdt_generic platform support
> xilinx_intc: Added fdt generic platform support
> xilinx_ethlite: Added fdt generic platform support
> vl.c: Added hw_dtb/kern_dtb command line opts
> microblaze_generic_fdt: first revision
>
> Makefile.objs | 4 +
> Makefile.target | 1 +
> device_tree.c | 202 +++++++++++++++++++
> device_tree.h | 30 +++
> hw/fdt_generic.c | 199 +++++++++++++++++++
> hw/fdt_generic.h | 92 +++++++++
> hw/fdt_generic_devices.h | 8 +
> hw/fdt_generic_qdev.c | 75 +++++++
> hw/fdt_generic_qdev.h | 46 +++++
> hw/fdt_generic_util.c | 196 ++++++++++++++++++
> hw/fdt_generic_util.h | 43 ++++
> hw/microblaze_generic_fdt.c | 439 +++++++++++++++++++++++++++++++++++++++++
> hw/pflash_cfi01.c | 37 ++++
> hw/qdev-properties.c | 9 +
> hw/qdev.h | 1 +
> hw/xilinx_ethlite.c | 39 ++++-
> hw/xilinx_intc.c | 35 ++++-
> hw/xilinx_timer.c | 39 ++++-
> hw/xilinx_uartlite.c | 24 +++
> qemu-coroutine-lock.c | 13 ++
> qemu-coroutine.h | 9 +
> qemu-options.hx | 47 +++++
> sysemu.h | 4 +
> target-microblaze/cpu.h | 1 +
> target-microblaze/translate.c | 11 +-
> vl.c | 19 ++
> 26 files changed, 1617 insertions(+), 6 deletions(-)
> create mode 100644 hw/fdt_generic.c
> create mode 100644 hw/fdt_generic.h
> create mode 100644 hw/fdt_generic_devices.h
> create mode 100644 hw/fdt_generic_qdev.c
> create mode 100644 hw/fdt_generic_qdev.h
> create mode 100644 hw/fdt_generic_util.c
> create mode 100644 hw/fdt_generic_util.h
> create mode 100644 hw/microblaze_generic_fdt.c
>
next prev parent reply other threads:[~2011-08-25 13:27 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-25 6:41 [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Peter A. G. Crosthwaite
2011-08-25 6:41 ` [Qemu-devel] [RFC PATCH V1 01/14] qemu-coroutine: Add simple work queue support Peter A. G. Crosthwaite
2011-08-25 6:41 ` [Qemu-devel] [RFC PATCH V1 02/14] device_tree: Extended interface for fdt_generic Peter A. G. Crosthwaite
2011-08-25 6:41 ` [Qemu-devel] [RFC PATCH V1 03/14] fdt_generic: First revision Peter A. G. Crosthwaite
2011-08-25 6:41 ` [Qemu-devel] [RFC PATCH V1 04/14] xilinx_uartlite: Added fdt gen. platform support Peter A. G. Crosthwaite
2011-08-25 6:41 ` [Qemu-devel] [RFC PATCH V1 05/14] pflash_cfi01: Added fdt generic " Peter A. G. Crosthwaite
2011-08-25 6:41 ` [Qemu-devel] [RFC PATCH V1 06/14] qdev: Added fn for querying device property types Peter A. G. Crosthwaite
2011-08-25 6:41 ` [Qemu-devel] [RFC PATCH V1 07/14] fdt_generic_qdev: first revision Peter A. G. Crosthwaite
2011-08-25 6:41 ` [Qemu-devel] [RFC PATCH V1 08/14] xilinx_timer: Added fdt_generic platform support Peter A. G. Crosthwaite
2011-08-25 6:41 ` [Qemu-devel] [RFC PATCH V1 09/14] xilinx_intc: Added fdt generic " Peter A. G. Crosthwaite
2011-08-25 6:41 ` [Qemu-devel] [RFC PATCH V1 10/14] xilinx_ethlite: " Peter A. G. Crosthwaite
2011-08-25 6:41 ` [Qemu-devel] [RFC PATCH V1 11/14] vl.c: Added hw_dtb/kern_dtb command line opts Peter A. G. Crosthwaite
2011-08-25 6:41 ` [Qemu-devel] [RFC PATCH V1 12/14] microblaze: Make the MSR PVR bit non writable Peter A. G. Crosthwaite
2011-08-25 9:34 ` Peter Maydell
2011-08-25 10:17 ` Peter Crosthwaite
2011-08-25 18:28 ` Edgar E. Iglesias
2011-08-25 21:04 ` Edgar E. Iglesias
2011-08-25 6:41 ` [Qemu-devel] [RFC PATCH V1 13/14] microblaze: Add an MSR_PVR constant and use it Peter A. G. Crosthwaite
2011-08-25 6:41 ` [Qemu-devel] [RFC PATCH V1 14/14] microblaze_generic_fdt: first revision Peter A. G. Crosthwaite
2011-08-25 13:27 ` Anthony Liguori [this message]
2011-08-25 15:43 ` [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Peter Crosthwaite
2011-08-25 15:59 ` Paolo Bonzini
2011-08-25 16:04 ` Anthony Liguori
2011-08-25 19:10 ` Edgar E. Iglesias
2011-08-25 19:54 ` Anthony Liguori
2011-08-25 20:20 ` Edgar E. Iglesias
2011-08-25 21:17 ` Anthony Liguori
2011-09-02 2:45 ` John Williams
2011-09-08 0:29 ` John Williams
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=4E564DBC.8030801@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=edgar.iglesias@gmail.com \
--cc=john.williams@petalogix.com \
--cc=michal.simek@petalogix.com \
--cc=peter.crosthwaite@petalogix.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.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).