All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees
@ 2011-08-25  6:41 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
                   ` (14 more replies)
  0 siblings, 15 replies; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Peter A. G. Crosthwaite

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.

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

-- 
1.7.3.2

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [Qemu-devel] [RFC PATCH V1 01/14] qemu-coroutine: Add simple work queue support
  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 ` 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
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Peter A. G. Crosthwaite

Add a function co_queue_enter_next() which will immediately transfer
control to the coroutine at the head of a co queue. This can be used for
implementing simple work queues where the manager of a co-queue only
needs to enter queued routines one at a time.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 qemu-coroutine-lock.c |   13 +++++++++++++
 qemu-coroutine.h      |    9 +++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/qemu-coroutine-lock.c b/qemu-coroutine-lock.c
index a80f437..4da670d 100644
--- a/qemu-coroutine-lock.c
+++ b/qemu-coroutine-lock.c
@@ -75,6 +75,19 @@ bool qemu_co_queue_next(CoQueue *queue)
     return (next != NULL);
 }
 
+bool qemu_co_queue_enter_next(CoQueue *queue)
+{
+    Coroutine *next;
+
+    next = QTAILQ_FIRST(&queue->entries);
+    if (next) {
+        QTAILQ_REMOVE(&queue->entries, next, co_queue_next);
+        qemu_coroutine_enter(next, NULL);
+    }
+
+    return (next != NULL);
+}
+
 bool qemu_co_queue_empty(CoQueue *queue)
 {
     return (QTAILQ_FIRST(&queue->entries) == NULL);
diff --git a/qemu-coroutine.h b/qemu-coroutine.h
index 2f2fd95..65776e5 100644
--- a/qemu-coroutine.h
+++ b/qemu-coroutine.h
@@ -125,6 +125,15 @@ void coroutine_fn qemu_co_queue_wait(CoQueue *queue);
 bool qemu_co_queue_next(CoQueue *queue);
 
 /**
+ * Transfers control to the next coroutine in the CoQueue and removes it from
+ * the queue.
+ *
+ * Returns true once after control transfers back to caller, or false
+ * immediately if the queue is empty.
+ */
+bool qemu_co_queue_enter_next(CoQueue *queue);
+
+/**
  * Checks if the CoQueue is empty.
  */
 bool qemu_co_queue_empty(CoQueue *queue);
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [Qemu-devel] [RFC PATCH V1 02/14] device_tree: Extended interface for fdt_generic
  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 ` Peter A. G. Crosthwaite
  2011-08-25  6:41 ` [Qemu-devel] [RFC PATCH V1 03/14] fdt_generic: First revision Peter A. G. Crosthwaite
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Peter A. G. Crosthwaite

Extended the wrapper interface (around libfdt) for device tree. Node Property
getters have been added (qemu_devtree_getprop*) as well as helpers to search/
navigate the nodes of a FDT blob.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 device_tree.c |  202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 device_tree.h |   30 +++++++++
 2 files changed, 232 insertions(+), 0 deletions(-)

diff --git a/device_tree.c b/device_tree.c
index 3a224d1..c48c90a 100644
--- a/device_tree.c
+++ b/device_tree.c
@@ -107,3 +107,205 @@ int qemu_devtree_setprop_string(void *fdt, const char *node_path,
 
     return fdt_setprop_string(fdt, offset, property, string);
 }
+
+/* FIXME: guard against move argument running off the end of the parameter */
+
+int qemu_devtree_getprop(void *fdt, int *err, const char *node_path,
+        const char *type, int move, int inherit)
+{
+    int offset = fdt_path_offset(fdt, node_path);
+    unsigned int *temp;
+
+    if (err) {
+        *err = 0;
+    }
+
+    temp = (unsigned int *)fdt_getprop(fdt, offset, type, NULL);
+
+    if (temp) {
+        return be32_to_cpu(*(temp + move));
+    } else if (inherit) {
+        char parent [DT_PATH_LENGTH];
+        if (!qemu_devtree_getparent(fdt, parent, node_path)) {
+            return qemu_devtree_getprop(fdt, err, parent, type, move, 1);
+        }
+    }
+    if (err) {
+        *err = 1;
+    }
+    return 0;
+}
+
+char *qemu_devtree_getprop_string(void *fdt, const char *node_path,
+        const char *type, int move, int *len, int inherit)
+{
+    int offset = fdt_path_offset(fdt, node_path);
+    int llen;
+    const char *temp;
+    if (!len) {
+        len = &llen;
+    }
+    temp = fdt_getprop(fdt, offset, type, len);
+
+    if (temp) {
+        char *ret;
+        while (move) {
+            char *next = memchr(temp, '\0', *len) + 1;
+            *len -= (next - temp);
+            temp = next;
+            if (*len <= 0) {
+                printf("Can't get %s property - not enough elements\n", type);
+                return NULL;
+            }
+            move--;
+        }
+        ret = g_malloc0(*len);
+        memcpy(ret, temp, *len);
+        return ret;
+    } else if (inherit) {
+        char parent [DT_PATH_LENGTH];
+        if (!qemu_devtree_getparent(fdt, parent, node_path)) {
+            return qemu_devtree_getprop_string(fdt, parent, type, move, len,
+                1);
+        }
+    }
+    return NULL;
+}
+
+char *qemu_devtree_get_node_name(void *fdt, const char *node_path) {
+    char *ret = fdt_get_name(fdt, fdt_path_offset(fdt, node_path), NULL);
+    return ret ? strdup(ret) : NULL;
+}
+
+int qemu_devtree_get_node_depth(void *fdt, const char *node_path)
+{
+    return fdt_node_depth(fdt, fdt_path_offset(fdt, node_path));
+}
+
+static void qemu_devtree_children_info(void *fdt, const char *node_path,
+        int depth, int *num, char **returned_paths) {
+    int offset = fdt_path_offset(fdt, node_path);
+    int root_depth = fdt_node_depth(fdt, offset);
+    int cur_depth = root_depth;
+    *num = 0;
+    for (;;) {
+        offset = fdt_next_node(fdt, offset, &cur_depth);
+        if (cur_depth <= root_depth) {
+            break;
+        }
+        if (cur_depth <= root_depth + depth || depth == 0) {
+            if (returned_paths) {
+                returned_paths[*num] = g_malloc0(DT_PATH_LENGTH);
+                fdt_get_path(fdt, offset, returned_paths[*num], DT_PATH_LENGTH);
+            }
+            (*num)++;
+        }
+    }
+}
+
+char **qemu_devtree_get_children(void *fdt, const char *node_path, int depth)
+{
+    int num_children = qemu_devtree_get_num_children(fdt, node_path, depth);
+    char **ret = g_malloc0(sizeof(*ret) * num_children);
+    qemu_devtree_children_info(fdt, node_path, depth, &num_children, ret);
+    return ret;
+}
+
+int qemu_devtree_get_num_children(void *fdt, const char *node_path, int depth)
+{
+    int ret;
+    qemu_devtree_children_info(fdt, node_path, depth, &ret, NULL);
+    return ret;
+}
+
+int qemu_devtree_node_by_compatible(void *fdt, char *node_path,
+                        const char *compats)
+{
+    int offset = fdt_node_offset_by_compatible(fdt, 0, compats);
+    return offset > 0 ?
+        fdt_get_path(fdt, offset, node_path, DT_PATH_LENGTH) : 1;
+}
+
+int qemu_devtree_get_node_by_name(void *fdt, char *node_path,
+        const char *cmpname) {
+    int offset = 0;
+    char *name = NULL;
+    do {
+        offset = fdt_next_node(fdt, offset, NULL);
+        name = (void *)fdt_get_name(fdt, offset, NULL);
+        if (!name) {
+            continue;
+        }
+        if (!strncmp(name, cmpname, strlen(cmpname))) {
+             break;
+        }
+    } while (offset > 0);
+    return offset > 0 ?
+        fdt_get_path(fdt, offset, node_path, DT_PATH_LENGTH) : 1;
+}
+
+int qemu_devtree_get_node_by_phandle(void *fdt, char *node_path, int phandle)
+{
+    return fdt_get_path(fdt, fdt_node_offset_by_phandle(fdt, phandle),
+        node_path, DT_PATH_LENGTH);
+}
+
+int qemu_devtree_getparent(void *fdt, char *node_path, const char *current)
+{
+    int offset = fdt_path_offset(fdt, current);
+    int parent_offset = fdt_supernode_atdepth_offset(fdt, offset,
+        fdt_node_depth(fdt, offset) -1, NULL);
+    return parent_offset > 0 ?
+        fdt_get_path(fdt, parent_offset, node_path, DT_PATH_LENGTH) : 1;
+}
+
+static void devtree_scan(void *fdt, int *num_nodes, int info_dump)
+{
+    int depth = 0, offset = 0;
+    if (num_nodes) {
+        *num_nodes = 0;
+    }
+    for (;;) {
+        offset = fdt_next_node(fdt, offset, &depth);
+        if (num_nodes)
+            (*num_nodes)++;
+        if (offset <= 0 || depth <= 0)
+            break;
+
+        if (info_dump) {
+            char node_path[DT_PATH_LENGTH];
+            char *all_compats = 0;
+            int compat_len;
+            if (fdt_get_path(fdt, offset, node_path, DT_PATH_LENGTH))
+                sprintf(node_path, "(none)");
+            else
+                all_compats = qemu_devtree_getprop_string(fdt, node_path,
+                    "compatible", 0, &compat_len, 0);
+            if (all_compats) {
+                char *i = all_compats;
+                for (;;) {
+                    char *j = rawmemchr(i, '\0');
+                    compat_len -= ((j+1)-i);
+                    if (!compat_len)
+                        break;
+                    *j = ' ';
+                    i = j+1;
+                }
+            }
+            printf("OFFSET: %d, DEPTH: %d, PATH: %s, COMPATS: %s\n", offset,
+                depth, node_path, all_compats ? all_compats : "(none)");
+        }
+    }
+}
+
+void devtree_info_dump(void *fdt)
+{
+    devtree_scan(fdt, NULL, 1);
+}
+
+int devtree_get_num_nodes(void *fdt)
+{
+    int ret;
+    devtree_scan(fdt, &ret, 0);
+    return ret;
+}
diff --git a/device_tree.h b/device_tree.h
index cecd98f..e4f2d8a 100644
--- a/device_tree.h
+++ b/device_tree.h
@@ -16,6 +16,8 @@
 
 void *load_device_tree(const char *filename_path, int *sizep);
 
+/* property setters */
+
 int qemu_devtree_setprop(void *fdt, const char *node_path,
                          const char *property, void *val_array, int size);
 int qemu_devtree_setprop_cell(void *fdt, const char *node_path,
@@ -23,4 +25,32 @@ int qemu_devtree_setprop_cell(void *fdt, const char *node_path,
 int qemu_devtree_setprop_string(void *fdt, const char *node_path,
                                 const char *property, const char *string);
 
+/* property getters */
+
+int qemu_devtree_getprop(void *fdt, int *err, const char *node_path,
+                        const char *type, int move, int inherit);
+char *qemu_devtree_getprop_string(void *fdt, const char *node_path,
+                        const char *type, int move, int *len, int inherit);
+char *qemu_devtree_get_node_name(void *fdt, const char *node_path);
+int qemu_devtree_get_node_depth(void *fdt, const char *node_path);
+int qemu_devtree_get_num_children(void *fdt, const char *node_path, int depth);
+char **qemu_devtree_get_children(void *fdt, const char *node_path, int depth);
+
+/* node getters */
+
+int qemu_devtree_node_by_compatible(void *fdt, char *node_path,
+                        const char *compats);
+int qemu_devtree_get_node_by_name(void *fdt, char *node_path,
+                        const char *cmpname);
+int qemu_devtree_get_node_by_phandle(void *fdt, char *node_path, int phandle);
+int qemu_devtree_getparent(void *fdt, char *node_path,
+                        const char *current);
+
+/* misc */
+
+int devtree_get_num_nodes(void *fdt);
+void devtree_info_dump(void *fdt);
+
+#define DT_PATH_LENGTH 1024
+
 #endif /* __DEVICE_TREE_H__ */
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [Qemu-devel] [RFC PATCH V1 03/14] fdt_generic: First revision
  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 ` 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
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Peter A. G. Crosthwaite

First revision of fdt generic infrastructure. These modules allow
for fdt generic machine models, which create machines to match a device
tree specification.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 Makefile.objs         |    3 +
 hw/fdt_generic.c      |  199 +++++++++++++++++++++++++++++++++++++++++++++++++
 hw/fdt_generic.h      |   92 +++++++++++++++++++++++
 hw/fdt_generic_util.c |  196 ++++++++++++++++++++++++++++++++++++++++++++++++
 hw/fdt_generic_util.h |   43 +++++++++++
 5 files changed, 533 insertions(+), 0 deletions(-)
 create mode 100644 hw/fdt_generic.c
 create mode 100644 hw/fdt_generic.h
 create mode 100644 hw/fdt_generic_util.c
 create mode 100644 hw/fdt_generic_util.h

diff --git a/Makefile.objs b/Makefile.objs
index d1f3e5d..9fd18ff 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -220,6 +220,9 @@ hw-obj-$(CONFIG_SMARTCARD) += usb-ccid.o ccid-card-passthru.o
 hw-obj-$(CONFIG_SMARTCARD_NSS) += ccid-card-emulated.o
 hw-obj-$(CONFIG_USB_REDIR) += usb-redir.o
 
+hw-obj-$(CONFIG_FDT) += fdt_generic.o
+hw-obj-$(CONFIG_FDT) += fdt_generic_util.o
+
 # PPC devices
 hw-obj-$(CONFIG_OPENPIC) += openpic.o
 hw-obj-$(CONFIG_PREP_PCI) += prep_pci.o
diff --git a/hw/fdt_generic.c b/hw/fdt_generic.c
new file mode 100644
index 0000000..cfcaaf6
--- /dev/null
+++ b/hw/fdt_generic.c
@@ -0,0 +1,199 @@
+/*
+ * Tables of FDT device models and their init functions. Keyed by compatibility
+ * strings, device instance names.
+ *
+ * Copyright (c) 2010 PetaLogix Qld Pty Ltd.
+ * Copyright (c) 2010 Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "fdt_generic.h"
+
+#define FDT_GENERIC_MAX_PATTERN_LEN 1024
+
+typedef struct TableListNode {
+    void *next;
+    char key[FDT_GENERIC_MAX_PATTERN_LEN];
+    FDTInitFn fdt_init;
+    void *opaque;
+} TableListNode;
+
+/* add a node to the table specified by *head_p */
+
+static void add_to_table(
+        FDTInitFn fdt_init,
+        const char *key,
+        void *opaque,
+        TableListNode **head_p)
+{
+    TableListNode *nn = malloc(sizeof(*nn));
+    nn->next = (void*)(*head_p);
+    strcpy(nn->key, key);
+    nn->fdt_init = fdt_init;
+    nn->opaque = opaque;
+    *head_p = nn;
+}
+
+/* FIXME: add return codes that differentiate between not found and error */
+
+/* search a table for a key string and call the fdt init function if found.
+ * Returns 0 if a match if found, 1 otherwise
+ */
+
+static int fdt_init_search_table(
+        char *node_path,
+        FDTMachineInfo *fdti,
+        const char *key, /* string to match */
+        TableListNode **head) /* head of the list to search */
+{
+    TableListNode *c = *head;
+    if (c == NULL) {
+        return 1;
+    } else if (!strcmp(key, c->key)) {
+        return c->fdt_init(node_path, fdti, c->opaque);
+    }
+    return fdt_init_search_table(node_path, fdti, key,
+        (TableListNode**)(&(*head)->next));
+}
+
+TableListNode *compat_list_head = NULL;
+
+void add_to_compat_table(FDTInitFn fdt_init, const char *compat, void *opaque)
+{
+    add_to_table(fdt_init, compat, opaque, &compat_list_head);
+}
+
+int fdt_init_compat(char *node_path, FDTMachineInfo *fdti, const char *compat)
+{
+    return fdt_init_search_table(node_path, fdti, compat, &compat_list_head);
+}
+
+TableListNode *inst_bind_list_head = NULL;
+
+void add_to_inst_bind_table(FDTInitFn fdt_init, const char *name, void *opaque)
+{
+    add_to_table(fdt_init, name, opaque, &inst_bind_list_head);
+}
+
+int fdt_init_inst_bind(char *node_path, FDTMachineInfo *fdti,
+        const char *name)
+{
+    return fdt_init_search_table(node_path, fdti, name, &inst_bind_list_head);
+}
+
+TableListNode *force_list_head = NULL;
+
+void add_to_force_table(FDTInitFn fdt_init, const char *name, void *opaque)
+{
+    add_to_table(fdt_init, name, opaque, &force_list_head);
+}
+
+int fdt_force_bind_all(FDTMachineInfo *fdti)
+{
+    int ret = 0;
+    while (force_list_head != NULL) {
+        TableListNode *to_delete = force_list_head;
+        ret |= force_list_head->fdt_init(NULL, fdti, force_list_head->opaque);
+        force_list_head = force_list_head->next;
+        free(to_delete);
+    }
+    return ret;
+}
+
+static void dump_table(TableListNode *head)
+{
+    if (head == NULL) {
+        return;
+    }
+    printf("key : %s, opaque data %p\n", head->key, head->opaque);
+    dump_table(head->next);
+}
+
+void dump_compat_table(void)
+{
+    printf("FDT COMPATIBILITY TABLE:\n");
+    dump_table(compat_list_head);
+}
+
+void dump_inst_bind_table(void)
+{
+    printf("FDT INSTANCE BINDING TABLE:\n");
+    dump_table(inst_bind_list_head);
+}
+
+void fdt_init_yield(FDTMachineInfo *fdti)
+{
+    qemu_co_queue_wait(fdti->cq);
+}
+
+void fdt_init_set_opaque(FDTMachineInfo *fdti, char *node_path, void *opaque)
+{
+    FDTDevOpaque *dp;
+    for (dp = fdti->dev_opaques;
+        dp->node_path && strcmp(dp->node_path, node_path);
+        dp++);
+    if (!dp->node_path) {
+        dp->node_path = strdup(node_path);
+    }
+    dp->opaque = opaque;
+}
+
+int fdt_init_has_opaque(FDTMachineInfo *fdti, char *node_path)
+{
+    FDTDevOpaque *dp;
+    for (dp = fdti->dev_opaques; dp->node_path; dp++) {
+        if (!strcmp(dp->node_path, node_path)) {
+            return 1;
+         }
+    }
+    return 0;
+}
+
+void *fdt_init_get_opaque(FDTMachineInfo *fdti, char *node_path)
+{
+    FDTDevOpaque *dp;
+    for (dp = fdti->dev_opaques; dp->node_path; dp++) {
+        if (!strcmp(dp->node_path, node_path)) {
+            return dp->opaque;
+        }
+    }
+    return NULL;
+}
+
+FDTMachineInfo *fdt_init_new_fdti(void *fdt)
+{
+    FDTMachineInfo *fdti = g_malloc0(sizeof(*fdti));
+    fdti->fdt = fdt;
+    fdti->cq = g_malloc0(sizeof(*(fdti->cq)));
+    qemu_co_queue_init(fdti->cq);
+    fdti->dev_opaques = g_malloc0( sizeof(*(fdti->dev_opaques)) *
+        (devtree_get_num_nodes(fdt) + 1) );
+    return fdti;
+}
+
+void fdt_init_destroy_fdti(FDTMachineInfo *fdti)
+{
+    FDTDevOpaque *dp;
+    for (dp = fdti->dev_opaques; dp->node_path; dp++) {
+        g_free(dp->node_path);
+    }
+    g_free(fdti->dev_opaques);
+    g_free(fdti);
+}
diff --git a/hw/fdt_generic.h b/hw/fdt_generic.h
new file mode 100644
index 0000000..977b627
--- /dev/null
+++ b/hw/fdt_generic.h
@@ -0,0 +1,92 @@
+/*
+ * Tables of FDT device models and their init functions. Keyed by compatibility
+ * strings, device instance names.
+ */
+
+#ifndef FDT_GENERIC_H
+#define FDT_GENERIC_H
+
+#include "qemu-common.h"
+#include "sysbus.h"
+#include "device_tree.h"
+#include "qemu-coroutine.h"
+
+typedef struct FDTDevOpaque {
+    char *node_path;
+    void *opaque;
+} FDTDevOpaque;
+
+typedef struct FDTMachineInfo {
+    /* the fdt blob */
+    void *fdt;
+    /* irq descriptors for top level int controller */
+    qemu_irq *irq_base;
+    /* per-device specific opaques */
+    FDTDevOpaque *dev_opaques;
+    /* recheck coroutine queue */
+    CoQueue *cq;
+} FDTMachineInfo;
+
+/* create a new FDTMachineInfo. The client is responsible for setting irq_base.
+ * the mutex fdt_mutex is locked on return. Client must call
+ * fdt_init_destroy_fdti to cleanup
+ */
+
+FDTMachineInfo *fdt_init_new_fdti(void *fdt);
+void fdt_init_destroy_fdti(FDTMachineInfo *fdti);
+
+typedef int (*FDTInitFn)(char *, FDTMachineInfo *, void *);
+
+/* associate a FDTInitFn with a FDT compatibility */
+
+void add_to_compat_table(FDTInitFn, const char *, void *);
+
+/* try and find a device model for a particular compatibility. If found,
+ * the FDTInitFn associated with the compat will be called and 0 will
+ * be returned. Returns non-zero on not found or error
+ */
+
+int fdt_init_compat(char *, FDTMachineInfo *, const char *);
+
+/* same as above, but associates with a FDT node name (rather than compat) */
+
+void add_to_inst_bind_table(FDTInitFn, const char *, void *);
+int fdt_init_inst_bind(char *, FDTMachineInfo *, const char *);
+
+/* Register an FDTInitFn that should always be called upon machine creation */
+
+void add_to_force_table(FDTInitFn, const char *, void *);
+int fdt_force_bind_all(FDTMachineInfo *);
+
+void dump_compat_table(void);
+void dump_inst_bind_table(void);
+
+/* Called from FDTInitFn's to inform the framework that a dependency is unresolved
+ * and the calling context needs to wait for another device to instantiate
+ * first. The calling thread will suspend until a change in state in the
+ * argument fdt machine is detected
+ */
+
+void fdt_init_yield(FDTMachineInfo *);
+
+/* set, check and get per device opaques. Keyed by fdt node_paths */
+
+void fdt_init_set_opaque(FDTMachineInfo *fdti, char *node_path, void *opaque);
+int fdt_init_has_opaque(FDTMachineInfo *fdti, char *node_path);
+void *fdt_init_get_opaque(FDTMachineInfo *fdti, char *node_path);
+
+/* statically register a FDTInitFn as being associate with a compatibility */
+
+#define fdt_register_compatibility_opaque(function, compat, n, opaque) \
+static void __attribute__((constructor)) \
+function ## n ## _register_imp( void ) { \
+    add_to_compat_table(function, compat, opaque); \
+}
+
+#define fdt_register_compatibility_n(function, compat, n) \
+fdt_register_compatibility_opaque(function, compat, n, NULL)
+
+#define fdt_register_compatibility(function, compat) \
+fdt_register_compatibility_n(function, compat, 0)
+
+#endif /* FDT_GENERIC_H */
diff --git a/hw/fdt_generic_util.c b/hw/fdt_generic_util.c
new file mode 100644
index 0000000..bd78fc4
--- /dev/null
+++ b/hw/fdt_generic_util.c
@@ -0,0 +1,196 @@
+/*
+ * Utility functions for fdt generic framework
+ *
+ * Copyright (c) 2009 Edgar E. Iglesias.
+ * Copyright (c) 2009 Michal Simek.
+ * Copyright (c) 2011 PetaLogix Qld Pty Ltd.
+ * Copyright (c) 2011 Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "fdt_generic_util.h"
+#include "net.h"
+
+FDTMachineInfo *fdt_generic_create_machine(void *fdt, qemu_irq *cpu_irq)
+{
+    char node_path[DT_PATH_LENGTH];
+
+    FDTMachineInfo *fdti = fdt_init_new_fdti(fdt);
+
+    fdti->irq_base = cpu_irq;
+
+    /* bind any force bound instances */
+    fdt_force_bind_all(fdti);
+
+    /* parse the device tree branch under the simple-bus node */
+    if (!qemu_devtree_node_by_compatible(fdt, node_path, "simple-bus")) {
+        simple_bus_fdt_init(node_path, fdti, NULL);
+        while (qemu_co_queue_enter_next(fdti->cq));
+    }
+    else
+        fprintf(stderr, "FDT: ERROR: no system bus found in device tree\n");
+
+    printf("FDT: Device tree scan complete\n");
+    FDTMachineInfo *ret = g_malloc0(sizeof(*ret));
+    return fdti;
+}
+
+const char *fdt_generic_chosen_kcmdline(void *fdt, const char *append)
+{
+    char *p;
+    char chosen [DT_PATH_LENGTH];
+    if (!(
+        qemu_devtree_get_node_by_name(fdt, chosen, "chosen") &&
+        qemu_devtree_get_node_by_name(fdt, chosen, "chosen@0") )) {
+        int len = strlen(append), plen;
+
+        p = qemu_devtree_getprop_string(fdt, chosen,"bootargs", 0, NULL, 0);
+        if (p) {
+            plen = strlen(p);
+            len += plen;
+
+            p = memcpy(malloc(len + 2), p, plen);
+            p[plen] = ' ';
+            memcpy(p + plen + 1, append, len - plen + 1);
+            return p;
+        } else
+            return strdup(append);
+    }
+    return NULL;
+}
+
+struct FDTInitNodeArgs {
+    char *node_path;
+    FDTMachineInfo *fdti;
+};
+
+static void fdt_init_node(void *args) {
+
+    struct FDTInitNodeArgs *a = args;
+    char *node_path = a->node_path;
+    FDTMachineInfo *fdti = a->fdti;
+    g_free(a);
+
+    char *all_compats, *compat, *node_name, *next_compat;
+    int compat_len;
+
+    /* try instance binding first */
+    if (!(node_name = qemu_devtree_get_node_name(fdti->fdt, node_path))) {
+        printf("FDT: ERROR: nameless node: %s\n", node_path);
+    }
+    if (!fdt_init_inst_bind(node_path, fdti, node_name)) {
+        goto exit;
+    }
+
+    /* fallback to compatibility binding */
+    all_compats = qemu_devtree_getprop_string(fdti->fdt, node_path,
+        "compatible", 0, &compat_len, 0);
+    if (!all_compats) {
+        printf("FDT: ERROR: no compatibility found for node %s%s\n",node_path,
+            node_name);
+        return;
+    }
+    compat = all_compats;
+
+try_next_compat:
+    if (compat_len == 0) goto invalidate;
+    if (!fdt_init_compat(node_path, fdti, compat)) {
+        goto exit;
+    }
+    next_compat = rawmemchr(compat, '\0');
+    compat_len -= (next_compat + 1 - compat);
+    if (compat_len > 0) {
+        *next_compat = ' ';
+    }
+    compat = next_compat+1;
+    goto try_next_compat;
+invalidate:
+    printf("FDT: Unsupported peripheral invalidated %s compatibilities %s\n",
+        node_name, all_compats);
+    qemu_devtree_setprop_string(fdti->fdt, node_path, "compatible",
+        "invalidated");
+exit:
+    if (!fdt_init_has_opaque(fdti, node_path))
+        fdt_init_set_opaque(fdti, node_path, NULL);
+    g_free(node_path);
+    return;
+}
+
+int simple_bus_fdt_init(char *bus_node_path, FDTMachineInfo *fdti, void *unused)
+{
+    int i;
+    int num_children = qemu_devtree_get_num_children(fdti->fdt, bus_node_path, 1);
+    char **children = qemu_devtree_get_children(fdti->fdt, bus_node_path, 1);
+
+    for (i = 0; i < num_children;i++) {
+        struct FDTInitNodeArgs *init_args = g_malloc0(sizeof(*init_args));
+        init_args->node_path = children[i];
+        init_args->fdti = fdti;
+        qemu_coroutine_enter(qemu_coroutine_create(fdt_init_node), init_args);
+    }
+
+    g_free(children);
+    return 0;
+}
+
+qemu_irq fdt_get_irq_info(FDTMachineInfo *fdti, char *node_path, int irq_idx,
+        int *err, char *info) {
+    void *fdt = fdti->fdt;
+    int errl;
+    if (!err)
+        err = &errl;
+    int intc_phandle = qemu_devtree_getprop(fdt, err, node_path,
+        "interrupt-parent", 0, 1);
+    if (*err)
+        goto fail;
+    char intc_node_path[DT_PATH_LENGTH];
+    if (qemu_devtree_get_node_by_phandle(fdt, intc_node_path, intc_phandle))
+        goto fail;
+    int intc_cells = qemu_devtree_getprop(fdt, err, intc_node_path,
+        "#interrupt-cells", 0, 0);
+    if (*err)
+        goto fail;
+    int intc_idx = qemu_devtree_getprop(fdt, err, node_path, "interrupts",
+        intc_cells *irq_idx, 0);
+    if (*err)
+        goto fail;
+    while (!fdt_init_has_opaque(fdti, intc_node_path))
+        fdt_init_yield(fdti);
+    qemu_irq *irqs = fdt_init_get_opaque(fdti, intc_node_path);
+    if (!irqs)
+        goto fail;
+    if (info) {
+        char *node_name = qemu_devtree_get_node_name(fdt, intc_node_path);
+        sprintf(info, "%d (%s)", intc_idx, node_name);
+        g_free((void*)node_name);
+    }
+    return irqs[intc_idx];
+fail:
+    *err = 1;
+    if (info)
+        sprintf(info, "(none)");
+    return NULL;
+}
+
+qemu_irq fdt_get_irq(FDTMachineInfo *fdti, char *node_path, int irq_idx) {
+    return fdt_get_irq_info(fdti, node_path, irq_idx, NULL, NULL);
+}
+
+fdt_register_compatibility(simple_bus_fdt_init, "simple-bus");
diff --git a/hw/fdt_generic_util.h b/hw/fdt_generic_util.h
new file mode 100644
index 0000000..161cf7f
--- /dev/null
+++ b/hw/fdt_generic_util.h
@@ -0,0 +1,43 @@
+#ifndef FDT_GENERIC_UTIL_H
+#define FDT_GENERIC_UTIL_H
+
+#include "qemu-common.h"
+#include "fdt_generic.h"
+
+/* create a fdt_generic machine. the top level cpu irqs are required for
+ * systems instantiating interrupt devices. The client is responsible for
+ * destroying the returned FDTMachineInfo (using fdt_init_destroy_fdti)
+ */
+
+FDTMachineInfo *fdt_generic_create_machine(void *fdt, qemu_irq *cpu_irq);
+
+/* search a device tree for the 'chosen' node and return the boot args. An
+ * optional argument append can specify a string to cat onto the end of the
+ * returned bootargs
+ */
+
+const char *fdt_generic_chosen_kcmdline(void *fdt, const char *append);
+
+/* fdt init a simple bus. Search the bus for child nodes and instantiate or
+ * invalidate devices as appropriate. Conformant to FDTInitFn prototype, i.e.
+ * a bus may fdt_register_compatibilty this as its instantiator.
+ */
+
+int simple_bus_fdt_init(char *node_path, FDTMachineInfo *fdti, void *priv);
+
+/* get an irq for a device. The interrupt parent of a device is idenitified
+ * and the specified irq (by the interrupts device-tree property) is retrieved
+ */
+
+qemu_irq fdt_get_irq(FDTMachineInfo *fdti, char *node_path, int irq_idx);
+
+/* same as above, but poulates err with non-zero if something goes wrong, and
+ * populates info with a human readable string giving some basic information
+ * about the interrupt connection found (or not found). Both arguments are
+ * optional (i.e. can be NULL)
+ */
+
+qemu_irq fdt_get_irq_info(FDTMachineInfo *fdti, char *node_path, int irq_idx,
+    int * err, char * info);
+
+#endif /* FDT_GENERIC_UTIL_H */
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [Qemu-devel] [RFC PATCH V1 04/14] xilinx_uartlite: Added fdt gen. platform support
  2011-08-25  6:41 [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Peter A. G. Crosthwaite
                   ` (2 preceding siblings ...)
  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 ` 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
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Peter A. G. Crosthwaite

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 hw/xilinx_uartlite.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/hw/xilinx_uartlite.c b/hw/xilinx_uartlite.c
index 467a26c..dc2debd 100644
--- a/hw/xilinx_uartlite.c
+++ b/hw/xilinx_uartlite.c
@@ -218,3 +218,27 @@ static void xilinx_uart_register(void)
 }
 
 device_init(xilinx_uart_register)
+
+#ifdef CONFIG_FDT
+
+#include "fdt_generic_util.h"
+
+static int xilinx_uartlite_fdt_init(char *node_path, FDTMachineInfo *fdti,
+    void *unused)
+{
+    target_phys_addr_t base;
+    qemu_irq irqline;
+    char irq_info[1024];
+
+    base = qemu_devtree_getprop(fdti->fdt, NULL, node_path, "reg", 0, 0);
+    irqline = fdt_get_irq_info(fdti, node_path, 0, NULL, irq_info);
+    printf("FDT: UARTLITE: baseaddr: 0x" TARGET_FMT_plx ", irq: %s\n", base,
+        irq_info);
+    sysbus_create_simple("xilinx,uartlite", base, irqline);
+    return 0;
+}
+
+fdt_register_compatibility(xilinx_uartlite_fdt_init,
+    "xlnx,xps-uartlite-1.00.a");
+
+#endif /* CONFIG_FDT */
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [Qemu-devel] [RFC PATCH V1 05/14] pflash_cfi01: Added fdt generic platform support
  2011-08-25  6:41 [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Peter A. G. Crosthwaite
                   ` (3 preceding siblings ...)
  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 ` 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
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Peter A. G. Crosthwaite

Added fdt generic platform support. Note that this does not add the fdt init
handler to the table of registered models as this needs to be handled in a
platform dependent way (due to target endianness issues). Fdt generic machine
models are required to register this device should it be supported.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 hw/fdt_generic_devices.h |    8 ++++++++
 hw/pflash_cfi01.c        |   37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 0 deletions(-)
 create mode 100644 hw/fdt_generic_devices.h

diff --git a/hw/fdt_generic_devices.h b/hw/fdt_generic_devices.h
new file mode 100644
index 0000000..3bb4c05
--- /dev/null
+++ b/hw/fdt_generic_devices.h
@@ -0,0 +1,8 @@
+#ifndef FDT_GENERIC_DEVICES_H
+#define FDT_GENERIC_DEVICES_H
+
+#include "fdt_generic.h"
+
+int pflash_cfi01_fdt_init(char *node_path, FDTMachineInfo *fdti, void *opaque);
+
+#endif /* FDT_GENERIC_DEVICES_H */
diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c
index 90e1301..5cc6c17 100644
--- a/hw/pflash_cfi01.c
+++ b/hw/pflash_cfi01.c
@@ -724,3 +724,40 @@ pflash_t *pflash_cfi01_register(target_phys_addr_t base, ram_addr_t off,
 
     return pfl;
 }
+
+#ifdef CONFIG_FDT
+
+#include "blockdev.h"
+
+#include "fdt_generic_util.h"
+#include "fdt_generic_devices.h"
+
+int pflash_cfi01_fdt_init(char *node_path, FDTMachineInfo *fdti, void *opaque) {
+
+    ram_addr_t phys_flash;
+    int flash_base = 0;
+    int flash_size = 0;
+
+    int be = *((int*)opaque);
+
+    DriveInfo *dinfo;
+    int bank_width;
+
+    flash_base = qemu_devtree_getprop(fdti->fdt, NULL, node_path, "reg", 0, 0);
+    flash_size = qemu_devtree_getprop(fdti->fdt, NULL, node_path, "reg", 1, 0);
+    bank_width = qemu_devtree_getprop(fdti->fdt, NULL, node_path, "bank-width",
+        0, 0);
+
+    printf("FDT: FLASH: baseaddr: 0x%x, size: 0x%x\n",
+           flash_base, flash_size);
+
+    phys_flash = qemu_ram_alloc(NULL, "mb.flash", flash_size);
+    dinfo = drive_get(IF_PFLASH, 0, 0);
+    pflash_cfi01_register(flash_base, phys_flash,
+        dinfo ? dinfo->bdrv : NULL, (64 * 1024),
+        flash_size >> 16,
+        bank_width, 0x89, 0x18, 0x0000, 0x0, be);
+    return 0;
+}
+
+#endif /* CONFIG_FDT */
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [Qemu-devel] [RFC PATCH V1 06/14] qdev: Added fn for querying device property types
  2011-08-25  6:41 [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Peter A. G. Crosthwaite
                   ` (4 preceding siblings ...)
  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 ` 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
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Peter A. G. Crosthwaite

Added a function qdev_get_prop_type(), which allows a machine model to
query the type of a qdev prop of a device using a handle to the device,
and the string name of the property

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 hw/qdev-properties.c |    9 +++++++++
 hw/qdev.h            |    1 +
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index 0c0c292..b5b2a78 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -583,6 +583,15 @@ int qdev_prop_exists(DeviceState *dev, const char *name)
     return qdev_prop_find(dev, name) ? true : false;
 }
 
+int qdev_prop_get_type(DeviceState *dev, const char *name, enum PropertyType *ret)
+{
+    Property *prop = qdev_prop_find(dev, name);
+    if (!prop)
+        return 1;
+    *ret = prop->info->type;
+    return 0;
+}
+
 int qdev_prop_parse(DeviceState *dev, const char *name, const char *value)
 {
     Property *prop;
diff --git a/hw/qdev.h b/hw/qdev.h
index 8a13ec9..79d9f9d 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -295,6 +295,7 @@ extern PropertyInfo qdev_prop_pci_devfn;
 /* Set properties between creation and init.  */
 void *qdev_get_prop_ptr(DeviceState *dev, Property *prop);
 int qdev_prop_exists(DeviceState *dev, const char *name);
+int qdev_prop_get_type(DeviceState *dev, const char *name, enum PropertyType *ret);
 int qdev_prop_parse(DeviceState *dev, const char *name, const char *value);
 void qdev_prop_set(DeviceState *dev, const char *name, void *src, enum PropertyType type);
 void qdev_prop_set_bit(DeviceState *dev, const char *name, bool value);
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [Qemu-devel] [RFC PATCH V1 07/14] fdt_generic_qdev: first revision
  2011-08-25  6:41 [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Peter A. G. Crosthwaite
                   ` (5 preceding siblings ...)
  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 ` 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
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Peter A. G. Crosthwaite

Support for setting up qdev models for use by the fdt-generic framwork. A
single fdt init function is shared by all qdev models and the qdev model
registers a handler function that maps fdt properties to qdev properties.
Support for basic interrupt controllers and nics is there.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 Makefile.objs         |    1 +
 hw/fdt_generic_qdev.c |   75 +++++++++++++++++++++++++++++++++++++++++++++++++
 hw/fdt_generic_qdev.h |   46 ++++++++++++++++++++++++++++++
 3 files changed, 122 insertions(+), 0 deletions(-)
 create mode 100644 hw/fdt_generic_qdev.c
 create mode 100644 hw/fdt_generic_qdev.h

diff --git a/Makefile.objs b/Makefile.objs
index 9fd18ff..9d5100a 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -222,6 +222,7 @@ hw-obj-$(CONFIG_USB_REDIR) += usb-redir.o
 
 hw-obj-$(CONFIG_FDT) += fdt_generic.o
 hw-obj-$(CONFIG_FDT) += fdt_generic_util.o
+hw-obj-$(CONFIG_FDT) += fdt_generic_qdev.o
 
 # PPC devices
 hw-obj-$(CONFIG_OPENPIC) += openpic.o
diff --git a/hw/fdt_generic_qdev.c b/hw/fdt_generic_qdev.c
new file mode 100644
index 0000000..53b32ab
--- /dev/null
+++ b/hw/fdt_generic_qdev.c
@@ -0,0 +1,75 @@
+#include "fdt_generic_qdev.h"
+#include "fdt_generic_util.h"
+#include "net.h"
+
+#define D(a)
+
+int fdt_init_qdev(char *node_path, FDTMachineInfo *fdti, void *opaque)
+{
+    int err;
+    qemu_irq irq;
+    target_phys_addr_t base;
+    DeviceState *dev;
+    FDTQDevOps *ops = opaque;
+    struct FDTQDevPropMapping *props =
+        (ops && ops->map) ? ops->map(node_path, fdti) : NULL;
+    struct FDTQDevPropMapping *propsi;
+
+    /* create the device */
+    if (!ops || !ops->dev_name) {
+        return 1;
+    }
+    dev = qdev_create(NULL, ops->dev_name);
+    D(fprintf(stderr, "FDT: Creating QDEV model %s %s %d\n",
+        ops->dev_name, ops->is_nic ? "(nic)" : "", ops->is_intc);)
+    /* connect nic if appropriate */
+    if (ops->is_nic) {
+        qemu_check_nic_model(&nd_table[0], ops->dev_name);
+        qdev_set_nic_properties(dev, &nd_table[0]);
+    }
+    /* connect custom properties */
+    for (propsi = props; propsi && propsi->name; propsi++) {
+        enum PropertyType type;
+        if (!qdev_prop_get_type(dev, propsi->name, &type)) {
+            qdev_prop_set(dev, propsi->name, &propsi->src, type);
+            D(fprintf(stderr, "\tFDT: setting qdev prop %s %d (u32) %p (p)\n",
+                propsi->name, propsi->src.u32, propsi->src.p);)
+        }
+        if (propsi->freesrc) {
+            g_free(propsi->src.p);
+        }
+    }
+    qdev_init_nofail(dev);
+    /* map slave attachment */
+    base = qemu_devtree_getprop(fdti->fdt, NULL, node_path, "reg", 0, 0);
+    sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
+    /* connect irq */
+    {
+        char irq_info[1024];
+        /* FIXME: add support for multiple IRQs */
+        irq = fdt_get_irq_info(fdti, node_path, 0, &err, irq_info);
+        /* INTCs inferr their top level, if no IRQ connection specified */
+        if (err && ops->is_intc) {
+            irq = fdti->irq_base[0];
+            err = 0;
+        }
+        if (!err) {
+            sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
+            fprintf(stderr, "FDT: (%s) connected irq %s\n", ops->dev_name, irq_info);
+        }
+    }
+    /* create interrupt controller connections if appropriate */
+    if (ops->is_intc) {
+        int i;
+        qemu_irq *irqs = g_malloc0(sizeof(*irqs) * ops->is_intc);
+        for (i = 0; i < ops->is_intc; i++) {
+            irqs[i] = qdev_get_gpio_in(dev, i);
+        }
+        fdt_init_set_opaque(fdti, node_path, irqs);
+    }
+
+    if (props) {
+        g_free(props);
+    }
+    return 0;
+}
diff --git a/hw/fdt_generic_qdev.h b/hw/fdt_generic_qdev.h
new file mode 100644
index 0000000..fe140b3
--- /dev/null
+++ b/hw/fdt_generic_qdev.h
@@ -0,0 +1,46 @@
+#ifndef FDT_GENERIC_QDEV_H
+#define FDT_GENERIC_QDEV_H
+
+#include "fdt_generic.h"
+#include "qdev.h"
+
+typedef struct FDTQDevPropMapping {
+    const char *name;
+    union {
+        /* TODO: add support for structure type QDEV props */
+        uint8_t u8;
+        uint16_t u16;
+        uint32_t u32;
+        void *p;
+    } src;
+    int freesrc;
+} FDTQDevPropMapping;
+
+typedef FDTQDevPropMapping* (*FDTQDevMapFn)(char *, FDTMachineInfo *);
+
+typedef struct FDTQDevOps {
+    const char *dev_name;
+    /* TODO: implement */
+    const int *irq_map;
+    const int is_nic;
+    /* FIXME: Add mechanism for dynamically chnginging number of intc IRQs */
+    const int is_intc;
+    FDTQDevMapFn map;
+} FDTQDevOps;
+
+/* FDT init functions for qdev models */
+
+int fdt_init_qdev(char *, FDTMachineInfo *, void *);
+
+/* statically register a FDTQDevMapFn as being associate with a compatibility */
+
+#define fdt_qdev_register_compatibility_n(ops, compat, n) \
+static void __attribute__((constructor)) \
+function ## n ## _register_imp (void) { \
+    add_to_compat_table(fdt_init_qdev, compat, ops); \
+}
+
+#define fdt_qdev_register_compatibility(ops, compat) \
+fdt_qdev_register_compatibility_n(ops, compat, 0);
+
+#endif /* FDT_GENERIC_QDEV_H */
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [Qemu-devel] [RFC PATCH V1 08/14] xilinx_timer: Added fdt_generic platform support
  2011-08-25  6:41 [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Peter A. G. Crosthwaite
                   ` (6 preceding siblings ...)
  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 ` 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
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Peter A. G. Crosthwaite

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 hw/xilinx_timer.c |   39 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/hw/xilinx_timer.c b/hw/xilinx_timer.c
index f1c7abc..8fe32f6 100644
--- a/hw/xilinx_timer.c
+++ b/hw/xilinx_timer.c
@@ -215,9 +215,11 @@ static int xilinx_timer_init(SysBusDevice *dev)
     return 0;
 }
 
+#define QDEV_NAME "xilinx,timer"
+
 static SysBusDeviceInfo xilinx_timer_info = {
     .init = xilinx_timer_init,
-    .qdev.name  = "xilinx,timer",
+    .qdev.name  = QDEV_NAME,
     .qdev.size  = sizeof(struct timerblock),
     .qdev.props = (Property[]) {
         DEFINE_PROP_UINT32("frequency", struct timerblock, freq_hz,   0),
@@ -232,3 +234,38 @@ static void xilinx_timer_register(void)
 }
 
 device_init(xilinx_timer_register)
+
+#ifdef CONFIG_FDT
+
+#include "fdt_generic_qdev.h"
+
+#define FREQ_HZ (62 * 1000000)
+
+static FDTQDevPropMapping *
+xilinx_timer_fdt_qdev_map(char *node_path, FDTMachineInfo *fdti)
+{
+    FDTQDevPropMapping *ret = g_malloc0(sizeof(*ret) * 3);
+    struct FDTQDevPropMapping sprops [] = {
+        {
+            .name = "frequency",
+            .src.u32 = FREQ_HZ
+        },{
+            .name = "nr-timers",
+            .src.u32 = 2 - qemu_devtree_getprop(fdti->fdt, NULL, node_path,
+                                  "xlnx,one-timer-only", 0, 0)
+        },{
+           .name = NULL
+        }
+    };
+    return memcpy(ret, sprops, sizeof(*ret) * 3);
+}
+
+FDTQDevOps xilinx_timer_fdt_qdev_ops = {
+    .dev_name = QDEV_NAME,
+    .map = xilinx_timer_fdt_qdev_map,
+};
+
+fdt_qdev_register_compatibility(&xilinx_timer_fdt_qdev_ops,
+    "xlnx,xps-timer-1.00.a");
+
+#endif /* CONFIG_FDT */
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [Qemu-devel] [RFC PATCH V1 09/14] xilinx_intc: Added fdt generic platform support
  2011-08-25  6:41 [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Peter A. G. Crosthwaite
                   ` (7 preceding siblings ...)
  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 ` Peter A. G. Crosthwaite
  2011-08-25  6:41 ` [Qemu-devel] [RFC PATCH V1 10/14] xilinx_ethlite: " Peter A. G. Crosthwaite
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Peter A. G. Crosthwaite

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 hw/xilinx_intc.c |   35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/hw/xilinx_intc.c b/hw/xilinx_intc.c
index cb72d5a..aa7783a 100644
--- a/hw/xilinx_intc.c
+++ b/hw/xilinx_intc.c
@@ -158,9 +158,11 @@ static int xilinx_intc_init(SysBusDevice *dev)
     return 0;
 }
 
+#define QDEV_NAME "xilinx,intc"
+
 static SysBusDeviceInfo xilinx_intc_info = {
     .init = xilinx_intc_init,
-    .qdev.name  = "xilinx,intc",
+    .qdev.name  = QDEV_NAME,
     .qdev.size  = sizeof(struct xlx_pic),
     .qdev.props = (Property[]) {
         DEFINE_PROP_UINT32("kind-of-intr", struct xlx_pic, c_kind_of_intr, 0),
@@ -174,3 +176,34 @@ static void xilinx_intc_register(void)
 }
 
 device_init(xilinx_intc_register)
+
+#ifdef CONFIG_FDT
+
+#include "fdt_generic_qdev.h"
+
+static FDTQDevPropMapping *
+xilinx_intc_fdt_qdev_map(char *node_path, FDTMachineInfo *fdti)
+{
+    FDTQDevPropMapping *ret = g_malloc0(sizeof(*ret) * 2);
+    struct FDTQDevPropMapping sprops [] = {
+        {
+            .name = "kind-of-intr",
+            .src.u32 = qemu_devtree_getprop(fdti->fdt, NULL, node_path,
+                "xlnx,kind-of-intr", 0, 0)
+        },{
+           .name = NULL
+        }
+    };
+    return memcpy(ret, sprops, sizeof(*ret) * 2);
+}
+
+FDTQDevOps xilinx_intc_fdt_qdev_ops = {
+    .dev_name = QDEV_NAME,
+    .is_intc = 32,
+    .map = xilinx_intc_fdt_qdev_map,
+};
+
+fdt_qdev_register_compatibility(&xilinx_intc_fdt_qdev_ops,
+    "xlnx,xps-intc-1.00.a");
+
+#endif /* CONFIG_FDT */
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [Qemu-devel] [RFC PATCH V1 10/14] xilinx_ethlite: Added fdt generic platform support
  2011-08-25  6:41 [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Peter A. G. Crosthwaite
                   ` (8 preceding siblings ...)
  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 ` 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
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Peter A. G. Crosthwaite

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 hw/xilinx_ethlite.c |   39 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/hw/xilinx_ethlite.c b/hw/xilinx_ethlite.c
index f35ba84..c06b015 100644
--- a/hw/xilinx_ethlite.c
+++ b/hw/xilinx_ethlite.c
@@ -221,9 +221,11 @@ static int xilinx_ethlite_init(SysBusDevice *dev)
     return 0;
 }
 
+#define QDEV_NAME "xilinx,ethlite"
+
 static SysBusDeviceInfo xilinx_ethlite_info = {
     .init = xilinx_ethlite_init,
-    .qdev.name  = "xilinx,ethlite",
+    .qdev.name  = QDEV_NAME,
     .qdev.size  = sizeof(struct xlx_ethlite),
     .qdev.props = (Property[]) {
         DEFINE_PROP_UINT32("txpingpong", struct xlx_ethlite, c_tx_pingpong, 1),
@@ -239,3 +241,38 @@ static void xilinx_ethlite_register(void)
 }
 
 device_init(xilinx_ethlite_register)
+
+#ifdef CONFIG_FDT
+
+#include "fdt_generic_qdev.h"
+
+static FDTQDevPropMapping *
+xilinx_ethlite_fdt_qdev_map(char *node_path, FDTMachineInfo *fdti)
+{
+    FDTQDevPropMapping *ret = g_malloc0(sizeof(*ret) * 3);
+    struct FDTQDevPropMapping sprops [] = {
+        {
+            .name = "txpingpong",
+            .src.u32 = qemu_devtree_getprop(fdti->fdt, NULL, node_path,
+                                        "xlnx,tx-ping-pong", 0, 0)
+        },{
+            .name = "rxpingpong",
+            .src.u32 = qemu_devtree_getprop(fdti->fdt, NULL, node_path,
+                                        "xlnx,rx-ping-pong", 0, 0)
+        },{
+           .name = NULL
+        }
+    };
+    return memcpy(ret, sprops, sizeof(*ret) * 3);
+}
+
+FDTQDevOps xilinx_ethlite_fdt_qdev_ops = {
+    .dev_name = QDEV_NAME,
+    .is_nic = 1,
+    .map = xilinx_ethlite_fdt_qdev_map,
+};
+
+fdt_qdev_register_compatibility(&xilinx_ethlite_fdt_qdev_ops,
+    "xlnx,xps-ethernetlite-1.00.a");
+
+#endif /*CONFIG_FDT */
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [Qemu-devel] [RFC PATCH V1 11/14] vl.c: Added hw_dtb/kern_dtb command line opts
  2011-08-25  6:41 [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Peter A. G. Crosthwaite
                   ` (9 preceding siblings ...)
  2011-08-25  6:41 ` [Qemu-devel] [RFC PATCH V1 10/14] xilinx_ethlite: " Peter A. G. Crosthwaite
@ 2011-08-25  6:41 ` 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
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Peter A. G. Crosthwaite

Added command line options to specify device-tree-blobs for fdt generic
platforms. Different dtbs can be used for software and harware by using
both options concurrently

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 qemu-options.hx |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 sysemu.h        |    4 ++++
 vl.c            |   19 +++++++++++++++++++
 3 files changed, 70 insertions(+), 0 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index d86815d..b778471 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2444,6 +2444,53 @@ Specify a trace file to log output traces to.
 ETEXI
 #endif
 
+HXCOMM Flat device-tree commandline options
+DEFHEADING()
+DEFHEADING(Flat device-tree options:)
+STEXI
+@table @option
+ETEXI
+
+DEF("hw-dtb", HAS_ARG, QEMU_OPTION_hwdtb, \
+    "-hw-dtb dtb      flat device tree describing hardware system\n",
+    QEMU_ARCH_MICROBLAZE | QEMU_ARCH_PPC)
+STEXI
+@item -hw-dtb @var{hw-dtb}
+use @var{hw-dtb} as flat device tree describing hardware system
+ETEXI
+
+DEF("kern-dtb", HAS_ARG, QEMU_OPTION_kerndtb, \
+    "-kern-dtb dtb   flat device tree passed to kernel boot\n",
+    QEMU_ARCH_MICROBLAZE | QEMU_ARCH_PPC)
+STEXI
+@item -kern-dtb @var{kern-dtb}
+use @var{kern-dtb} as flat device tree passed to kernel boot
+ETEXI
+
+STEXI
+@end table
+ETEXI
+
+
+HXCOMM AXIS device specific commandline options
+DEFHEADING()
+DEFHEADING(AXIS device options:)
+STEXI
+@table @option
+ETEXI
+
+DEF("bootsel", HAS_ARG, QEMU_OPTION_bootsel, \
+    "-bootsel      Reset value of boot select register\n",
+    QEMU_ARCH_CRIS | QEMU_ARCH_MIPS | QEMU_ARCH_ARM)
+STEXI
+@item -bootsel @var{bootsel}
+use @var{bootsel} as the reset value for the bootsel register.
+ETEXI
+
+STEXI
+@end table
+ETEXI
+
 HXCOMM This is the last statement. Insert new options before this line!
 STEXI
 @end table
diff --git a/sysemu.h b/sysemu.h
index 9090457..2108a67 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -122,6 +122,10 @@ extern int no_quit;
 extern int no_shutdown;
 extern int semihosting_enabled;
 extern int old_param;
+
+extern const char *qemu_hwdtb;
+extern const char *qemu_kerndtb;
+
 extern int boot_menu;
 extern uint8_t *boot_splash_filedata;
 extern int boot_splash_filedata_size;
diff --git a/vl.c b/vl.c
index 9cd67a3..38cc153 100644
--- a/vl.c
+++ b/vl.c
@@ -227,6 +227,10 @@ int alt_grab = 0;
 int ctrl_grab = 0;
 unsigned int nb_prom_envs = 0;
 const char *prom_envs[MAX_PROM_ENVS];
+#ifdef CONFIG_FDT
+const char *qemu_hwdtb = NULL;
+const char *qemu_kerndtb = NULL;
+#endif
 int boot_menu;
 uint8_t *boot_splash_filedata;
 int boot_splash_filedata_size;
@@ -2928,6 +2932,21 @@ int main(int argc, char **argv, char **envp)
                 }
                 xen_mode = XEN_ATTACH;
                 break;
+#ifdef CONFIG_FDT
+            case QEMU_OPTION_hwdtb:
+                qemu_hwdtb = optarg;
+                break;
+            case QEMU_OPTION_kerndtb:
+                qemu_kerndtb = optarg;
+                break;
+#else
+            case QEMU_OPTION_hwdtb:
+            case QEMU_OPTION_kerndtb:
+                printf("Option %s not supported by this qemu build"
+                    " (libfdt missing).\n", popt->name);
+                exit(1);
+                break;
+#endif
 #ifdef CONFIG_SIMPLE_TRACE
             case QEMU_OPTION_trace:
                 opts = qemu_opts_parse(qemu_find_opts("trace"), optarg, 0);
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [Qemu-devel] [RFC PATCH V1 12/14] microblaze: Make the MSR PVR bit non writable
  2011-08-25  6:41 [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Peter A. G. Crosthwaite
                   ` (10 preceding siblings ...)
  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 ` Peter A. G. Crosthwaite
  2011-08-25  9:34   ` Peter Maydell
  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
                   ` (2 subsequent siblings)
  14 siblings, 1 reply; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Edgar E. Iglesias

From: Edgar E. Iglesias <edgar.iglesias@petalogix.com>

Instead of hardcoding it to 1.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
---
 target-microblaze/translate.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index 1a862d3..15f1fe5 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -424,10 +424,15 @@ static inline void msr_read(DisasContext *dc, TCGv d)
 
 static inline void msr_write(DisasContext *dc, TCGv v)
 {
+    TCGv t;
+
+    t = tcg_temp_new();
     dc->cpustate_changed = 1;
-    tcg_gen_mov_tl(cpu_SR[SR_MSR], v);
-    /* PVR, we have a processor version register.  */
-    tcg_gen_ori_tl(cpu_SR[SR_MSR], cpu_SR[SR_MSR], (1 << 10));
+    /* PVR bit is not writable.  */
+    tcg_gen_andi_tl(t, v, ~(1 << 10));
+    tcg_gen_andi_tl(cpu_SR[SR_MSR], cpu_SR[SR_MSR], (1 << 10));
+    tcg_gen_or_tl(cpu_SR[SR_MSR], cpu_SR[SR_MSR], v);
+    tcg_temp_free(t);
 }
 
 static void dec_msr(DisasContext *dc)
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [Qemu-devel] [RFC PATCH V1 13/14] microblaze: Add an MSR_PVR constant and use it.
  2011-08-25  6:41 [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Peter A. G. Crosthwaite
                   ` (11 preceding siblings ...)
  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  6:41 ` 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 ` [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Anthony Liguori
  14 siblings, 0 replies; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Edgar E. Iglesias

From: Edgar E. Iglesias <edgar.iglesias@petalogix.com>

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
---
 target-microblaze/cpu.h       |    1 +
 target-microblaze/translate.c |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
index a81da62..3530286 100644
--- a/target-microblaze/cpu.h
+++ b/target-microblaze/cpu.h
@@ -65,6 +65,7 @@ struct CPUMBState;
 #define MSR_DCE (1<<7) /* 0x080 */
 #define MSR_EE  (1<<8) /* 0x100 */
 #define MSR_EIP (1<<9) /* 0x200 */
+#define MSR_PVR (1<<10) /* 0x400 */
 #define MSR_CC  (1<<31)
 
 /* Machine State Register (MSR) Fields */
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index 15f1fe5..366fd3e 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -429,8 +429,8 @@ static inline void msr_write(DisasContext *dc, TCGv v)
     t = tcg_temp_new();
     dc->cpustate_changed = 1;
     /* PVR bit is not writable.  */
-    tcg_gen_andi_tl(t, v, ~(1 << 10));
-    tcg_gen_andi_tl(cpu_SR[SR_MSR], cpu_SR[SR_MSR], (1 << 10));
+    tcg_gen_andi_tl(t, v, ~MSR_PVR);
+    tcg_gen_andi_tl(cpu_SR[SR_MSR], cpu_SR[SR_MSR], MSR_PVR);
     tcg_gen_or_tl(cpu_SR[SR_MSR], cpu_SR[SR_MSR], v);
     tcg_temp_free(t);
 }
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [Qemu-devel] [RFC PATCH V1 14/14] microblaze_generic_fdt: first revision
  2011-08-25  6:41 [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Peter A. G. Crosthwaite
                   ` (12 preceding siblings ...)
  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 ` Peter A. G. Crosthwaite
  2011-08-25 13:27 ` [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Anthony Liguori
  14 siblings, 0 replies; 29+ messages in thread
From: Peter A. G. Crosthwaite @ 2011-08-25  6:41 UTC (permalink / raw)
  To: qemu-devel, stefanha, edgar.iglesias, john.williams, michal.simek
  Cc: Peter A. G. Crosthwaite

First revision of fdt generic platform for xilinx microblaze platforms.
Adds machine model "microblaze-fdt" which can be used along with the --hw-dtb
option to lauch dts driven machine models for microblaze platforms.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 Makefile.target             |    1 +
 hw/microblaze_generic_fdt.c |  439 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 440 insertions(+), 0 deletions(-)
 create mode 100644 hw/microblaze_generic_fdt.c

diff --git a/Makefile.target b/Makefile.target
index e280bf6..6a0ee92 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -296,6 +296,7 @@ obj-mips-$(CONFIG_FULONG) += bonito.o vt82c686.o mips_fulong2e.o
 
 obj-microblaze-y = petalogix_s3adsp1800_mmu.o
 obj-microblaze-y += petalogix_ml605_mmu.o
+obj-microblaze-$(CONFIG_FDT) += microblaze_generic_fdt.o
 
 obj-microblaze-y += microblaze_pic_cpu.o
 obj-microblaze-y += xilinx_intc.o
diff --git a/hw/microblaze_generic_fdt.c b/hw/microblaze_generic_fdt.c
new file mode 100644
index 0000000..08852ff
--- /dev/null
+++ b/hw/microblaze_generic_fdt.c
@@ -0,0 +1,439 @@
+/*
+ * Model of Petalogix linux reference design targetting
+ * Xilinx Spartan 3ADSP-1800 boards.
+ *
+ * Copyright (c) 2009 Edgar E. Iglesias.
+ * Copyright (c) 2009 Michal Simek.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/* TODO slim down these includes */
+
+#include <time.h>
+#include <sys/time.h>
+#include "sysbus.h"
+#include "hw.h"
+#include "pc.h"
+#include "net.h"
+#include "flash.h"
+#include "sysemu.h"
+#include "devices.h"
+#include "boards.h"
+#include "device_tree.h"
+#include "qdev-addr.h"
+#include "loader.h"
+#include "elf.h"
+#include "fdt_generic_util.h"
+#include "fdt_generic_devices.h"
+
+#include "microblaze_pic_cpu.h"
+
+#define VAL(name) qemu_devtree_getprop(fdt, NULL, node_path, name, 0, 0)
+
+static inline void
+microblaze_pvr_fdt_init(CPUState *env, void *fdt)
+{
+    char node_path [DT_PATH_LENGTH];
+    qemu_devtree_get_node_by_name(fdt, node_path, "cpu@");
+    int t;
+    int use_exc = 0;
+
+    env->pvr.regs[0] = 0;
+    env->pvr.regs[2] = PVR2_D_OPB_MASK \
+                        | PVR2_D_LMB_MASK \
+                        | PVR2_I_OPB_MASK \
+                        | PVR2_I_LMB_MASK \
+                        | 0;
+
+    if (VAL("xlnx,pvr")) {
+        env->sregs[SR_MSR] |= MSR_PVR;
+    }
+
+    /* Even if we don't have PVR's, we fill out everything
+       because QEMU will internally follow what the pvr regs
+       state about the HW.  */
+
+    if (VAL("xlnx,pvr") == 2) {
+        env->pvr.regs[0] |= PVR0_PVR_FULL_MASK;
+    }
+
+    if (VAL("xlnx,endianness")) {
+        env->pvr.regs[0] |= PVR0_ENDI;
+    }
+
+    if (VAL("xlnx,use-barrel")) {
+        env->pvr.regs[0] |= PVR0_USE_BARREL_MASK;
+        env->pvr.regs[2] |= PVR2_USE_BARREL_MASK;
+    }
+
+    if (VAL("xlnx,use-div")) {
+        env->pvr.regs[0] |= PVR0_USE_DIV_MASK;
+        env->pvr.regs[2] |= PVR2_USE_DIV_MASK;
+    }
+
+    t = VAL("xlnx,use-hw-mul");
+    if (t) {
+        env->pvr.regs[0] |= PVR0_USE_HW_MUL_MASK;
+        env->pvr.regs[2] |= PVR2_USE_HW_MUL_MASK;
+        if (t >= 2) {
+            env->pvr.regs[2] |= PVR2_USE_MUL64_MASK;
+        }
+    }
+
+    t = VAL("xlnx,use-fpu");
+    if (t) {
+        env->pvr.regs[0] |= PVR0_USE_FPU_MASK;
+        env->pvr.regs[2] |= PVR2_USE_FPU_MASK;
+        if (t > 1) {
+            env->pvr.regs[2] |= PVR2_USE_FPU2_MASK;
+        }
+    }
+
+    if (VAL("xlnx,use-msr-instr")) {
+        env->pvr.regs[2] |= PVR2_USE_MSR_INSTR;
+    }
+
+    if (VAL("xlnx,use-pcmp-instr")) {
+        env->pvr.regs[2] |= PVR2_USE_PCMP_INSTR;
+    }
+
+    if (VAL("xlnx,opcode-0x0-illegal")) {
+        env->pvr.regs[2] |= PVR2_OPCODE_0x0_ILL_MASK;
+    }
+
+    if (VAL("xlnx,unaligned-exceptions")) {
+        env->pvr.regs[2] |= PVR2_UNALIGNED_EXC_MASK;
+        use_exc = 1;
+    }
+
+    if (VAL("xlnx,ill-opcode-exception")) {
+        env->pvr.regs[2] |= PVR2_ILL_OPCODE_EXC_MASK;
+        use_exc = 1;
+    }
+
+    if (VAL("xlnx,iopb-bus-exception")) {
+        env->pvr.regs[2] |= PVR2_IOPB_BUS_EXC_MASK;
+        use_exc = 1;
+    }
+
+    if (VAL("xlnx,dopb-bus-exception")) {
+        env->pvr.regs[2] |= PVR2_DOPB_BUS_EXC_MASK;
+        use_exc = 1;
+    }
+
+    if (VAL("xlnx,div-zero-exception")) {
+        env->pvr.regs[2] |= PVR2_DIV_ZERO_EXC_MASK;
+        use_exc = 1;
+    }
+
+    if (VAL("xlnx,fpu-exception")) {
+        env->pvr.regs[2] |= PVR2_FPU_EXC_MASK;
+        use_exc = 1;
+    }
+
+    env->pvr.regs[0] |= VAL("xlnx,pvr-user1") & 0xff;
+    env->pvr.regs[1] = VAL("xlnx,pvr-user2");
+
+    /* MMU regs.  */
+    t = VAL("xlnx,use-mmu");
+    if (use_exc || t) {
+        env->pvr.regs[0] |= PVR0_USE_EXC_MASK ;
+    }
+
+    if (t) {
+        env->pvr.regs[0] |= PVR0_USE_MMU;
+    }
+    env->pvr.regs[11] = t << 30;
+    t = VAL("xlnx,mmu-zones");
+    env->pvr.regs[11] |= t << 17;
+    env->mmu.c_mmu_zones = t;
+
+    t = VAL("xlnx,mmu-tlb-access");
+    env->mmu.c_mmu_tlb_access = t;
+    env->pvr.regs[11] |= t << 22;
+
+    {
+        const char *str;
+        const struct {
+            const char *name;
+            unsigned int arch;
+        } arch_lookup[] = {
+            {"virtex2", 0x4},
+            {"virtex2pro", 0x5},
+            {"spartan3", 0x6},
+            {"virtex4", 0x7},
+            {"virtex5", 0x8},
+            {"spartan3e", 0x9},
+            {"spartan3a", 0xa},
+            {"spartan3an", 0xb},
+            {"spartan3adsp", 0xc},
+            {"spartan6", 0xd},
+            {"virtex6", 0xe},
+            {"spartan2", 0xf0},
+            {NULL, 0},
+        };
+        unsigned int i = 0;
+
+        str = qemu_devtree_getprop_string(fdt, node_path, "xlnx,family", 0,
+            NULL, 0);
+        while (arch_lookup[i].name && str) {
+            if (strcmp(arch_lookup[i].name, str) == 0) {
+                break;
+            }
+            i++;
+        }
+        if (!str || !arch_lookup[i].arch) {
+            env->pvr.regs[10] = 0x0c000000; /* spartan 3a dsp family.  */
+        } else
+            env->pvr.regs[10] = arch_lookup[i].arch << 24;
+    }
+
+    {
+        const char *str;
+        const struct {
+            const char *name;
+            unsigned int arch;
+        } cpu_lookup[] = {
+            /* These key value are as per MBV field in PVR0 */
+            {"5.00.a", 0x01},
+            {"5.00.b", 0x02},
+            {"5.00.c", 0x03},
+            {"6.00.a", 0x04},
+            {"6.00.b", 0x06},
+            {"7.00.a", 0x05},
+            {"7.00.b", 0x07},
+            {"7.10.a", 0x08},
+            {"7.10.b", 0x09},
+            {"7.10.c", 0x0a},
+            {"7.10.d", 0x0b},
+            {"7.20.a", 0x0c},
+            {"7.20.b", 0x0d},
+            {"7.20.c", 0x0e},
+            {"7.20.d", 0x0f},
+            {"7.30.a", 0x10},
+            {"7.30.b", 0x11},
+            {"8.00.a", 0x12},
+            {"8.00.b", 0x13},
+            {"8.10.a", 0x14},
+            /* FIXME There is no keycode defined in MBV for these versions */
+            {"2.10.a", 0x10},
+            {"3.00.a", 0x20},
+            {"4.00.a", 0x30},
+            {"4.00.b", 0x40},
+            {NULL, 0},
+        };
+        unsigned int i = 0;
+
+        str = qemu_devtree_getprop_string(fdt, node_path, "model", 0, NULL, 0);
+        if (str)
+            str += strlen("microblaze,");
+
+        while (cpu_lookup[i].name && str) {
+            if (strcmp(cpu_lookup[i].name, str) == 0) {
+                break;
+            }
+            i++;
+        }
+        if (!str || !cpu_lookup[i].arch) {
+            fprintf(stderr, "unable to find MicroBlaze model.\n");
+            env->pvr.regs[0] |= 0xb << 8;
+        } else
+            env->pvr.regs[0] |= cpu_lookup[i].arch << 8;
+    }
+
+    {
+        env->pvr.regs[4] = PVR4_USE_ICACHE_MASK
+                           | (21 << 26) /* Tag size.  */
+                           | (4 << 21)
+                           | (11 << 16);
+        env->pvr.regs[6] = VAL("d-cache-baseaddr");
+        env->pvr.regs[7] = VAL("d-cache-highaddr");
+        env->pvr.regs[5] = PVR5_USE_DCACHE_MASK
+                           | (21 << 26) /* Tag size.  */
+                           | (4 << 21)
+                           | (11 << 16);
+
+        if(VAL("xlnx,dcache-use-writeback"))
+            env->pvr.regs[5] |= PVR5_DCACHE_WRITEBACK_MASK;
+
+        env->pvr.regs[8] = VAL("i-cache-baseaddr");
+        env->pvr.regs[9] = VAL("i-cache-highaddr");
+    }
+}
+
+#define LMB_BRAM_SIZE  (128 * 1024)
+
+static struct
+{
+    uint32_t bootstrap_pc;
+    uint32_t cmdline;
+    uint32_t fdt;
+    void *vfdt;
+} boot_info;
+
+static void main_cpu_reset(void *opaque)
+{
+    CPUState *env = opaque;
+
+    cpu_reset(env);
+    microblaze_pvr_fdt_init(env, boot_info.vfdt);
+
+    env->regs[5] = boot_info.cmdline;
+    env->regs[7] = boot_info.fdt;
+    env->sregs[SR_PC] = boot_info.bootstrap_pc;
+}
+
+#ifdef TARGET_WORDS_BIGENDIAN
+int endian = 1;
+#else
+int endian = 0;
+#endif
+
+static void
+microblaze_generic_fdt_init(ram_addr_t ram_size,
+                          const char *boot_device,
+                          const char *kernel_filename,
+                          const char *kernel_cmdline,
+                          const char *initrd_filename, const char *cpu_model)
+{
+    CPUState *env;
+    int kernel_size;
+    target_phys_addr_t ram_base;
+    ram_addr_t phys_lmb_bram;
+    ram_addr_t phys_ram;
+    void *fdt = NULL, *kfdt = NULL;
+    int fdt_size, kfdt_size;
+    int r;
+
+    /* for memory node */
+    char node_path[DT_PATH_LENGTH];
+
+    const char *dtb = "mb.dtb";
+
+    /* If a non-default DTB is specified, try to load it first */
+    if (qemu_hwdtb)
+        dtb = qemu_hwdtb;
+
+    fdt = boot_info.vfdt = load_device_tree(dtb, &fdt_size);
+    if (!fdt) {
+        fprintf(stderr, "Error: Unable to load Device Tree %s\n", dtb);
+        return;
+    }
+
+    /* find memory node */
+    /* FIXME it could be good to fix case when you don't find memory node */
+    qemu_devtree_get_node_by_name(fdt, node_path, "memory@");
+    ram_base = qemu_devtree_getprop(fdt, NULL, node_path, "reg", 0, 0);
+    ram_size = qemu_devtree_getprop(fdt, NULL, node_path, "reg", 1, 0);
+
+    /* init CPUs */
+    if (cpu_model == NULL) {
+        cpu_model = "microblaze";
+    }
+    env = cpu_init(cpu_model);
+    microblaze_pvr_fdt_init(env, fdt);
+
+    qemu_register_reset(main_cpu_reset, env);
+
+    /* Attach emulated BRAM through the LMB.  */
+    phys_lmb_bram = qemu_ram_alloc(NULL, "mb.lmb", LMB_BRAM_SIZE);
+    cpu_register_physical_memory(0x00000000, LMB_BRAM_SIZE,
+                                 phys_lmb_bram | IO_MEM_RAM);
+
+    phys_ram = qemu_ram_alloc(NULL, "mb.ram", ram_size);
+    cpu_register_physical_memory(ram_base, ram_size, phys_ram | IO_MEM_RAM);
+
+    /* Instantiate peripherals from the FDT.  */
+    fdt_init_destroy_fdti(
+        fdt_generic_create_machine(fdt, microblaze_pic_init_cpu(env)) );
+
+    if (kernel_filename) {
+        uint64_t entry, low, high;
+        int kcmdline_len;
+
+        kernel_size = load_elf(kernel_filename, NULL, NULL,
+                               &entry, &low, &high, endian, ELF_MACHINE, 0);
+
+        /* If we failed loading ELF's try a raw image.  */
+        if (kernel_size < 0) {
+            kernel_size = load_image_targphys(kernel_filename, ram_base,
+                                              ram_size);
+            boot_info.bootstrap_pc = ram_base;
+            high = ram_base + kernel_size;
+        }
+        boot_info.bootstrap_pc = (uint32_t)entry;
+
+        kernel_cmdline = fdt_generic_chosen_kcmdline(fdt, kernel_cmdline);
+
+        boot_info.cmdline = high + 8192;
+        if (kernel_cmdline && (kcmdline_len = strlen(kernel_cmdline))) {
+            pstrcpy_targphys("cmdline", boot_info.cmdline, 256, kernel_cmdline);
+        }
+        /* Provide a device-tree.  */
+        boot_info.fdt = boot_info.cmdline + 8192;
+
+        if (kernel_cmdline && (kcmdline_len = strlen(kernel_cmdline))) {
+            r = qemu_devtree_setprop_string(fdt, "/chosen", "bootargs",
+                                            kernel_cmdline);
+           if (r < 0) {
+               fprintf(stderr, "couldn't set /chosen/bootargs\n");
+           }
+        }
+
+        /* Check for a specific device tree intended for the kernel */
+        if (qemu_kerndtb) {
+            if (!strncmp(qemu_kerndtb, "none", 5)) {
+                fprintf(stderr, "No kernel FDT - use compiled-in FDT\n");
+                boot_info.fdt = 0x0;
+            } else {
+                kfdt = load_device_tree(qemu_kerndtb, &kfdt_size);
+                if (!kfdt) {
+                    fprintf(stderr, "Unable to load kernel DTB: %s, "
+                           "reverting to HW DTB\n", qemu_kerndtb);
+                } else {
+                    dtb = qemu_kerndtb;
+                    fdt = kfdt;
+                    fdt_size = kfdt_size;
+                }
+            }
+        }
+        if (boot_info.fdt) {
+            cpu_physical_memory_write (boot_info.fdt, (void *)fdt, fdt_size);
+        }
+    }
+
+}
+
+static QEMUMachine microblaze_generic_fdt = {
+    .name = "microblaze-fdt",
+    .desc = "Petalogix linux refdesign for all MMU boards",
+    .init = microblaze_generic_fdt_init,
+};
+
+static void microblaze_fdt_init(void)
+{
+    qemu_register_machine(&microblaze_generic_fdt);
+}
+
+machine_init(microblaze_fdt_init);
+
+fdt_register_compatibility(simple_bus_fdt_init, "xlnx,compound");
+fdt_register_compatibility_opaque(pflash_cfi01_fdt_init, "cfi-flash",0 ,
+    &endian);
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [Qemu-devel] [RFC PATCH V1 12/14] microblaze: Make the MSR PVR bit non writable
  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
  0 siblings, 1 reply; 29+ messages in thread
From: Peter Maydell @ 2011-08-25  9:34 UTC (permalink / raw)
  To: Peter A. G. Crosthwaite
  Cc: stefanha, qemu-devel, michal.simek, Edgar E. Iglesias,
	edgar.iglesias, john.williams

On 25 August 2011 07:41, Peter A. G. Crosthwaite
<peter.crosthwaite@petalogix.com> wrote:
> From: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
>
> Instead of hardcoding it to 1.

This and patch 13/14 seem to be generic target-microblaze
fixes -- did you mean to include them in this devicetree
series rather than sending them separately?

-- PMM

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Qemu-devel] [RFC PATCH V1 12/14] microblaze: Make the MSR PVR bit non writable
  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
  0 siblings, 2 replies; 29+ messages in thread
From: Peter Crosthwaite @ 2011-08-25 10:17 UTC (permalink / raw)
  To: Peter Maydell
  Cc: stefanha, qemu-devel, michal.simek, Edgar E. Iglesias,
	edgar.iglesias, john.williams

[-- Attachment #1: Type: text/plain, Size: 574 bytes --]

Hi Peter , I included them as they are prerequisite for patch 14. Edgar, can
we get a review / push of these two separate of this series so I can take
them out next revision ?

On Aug 25, 2011 7:34 PM, "Peter Maydell" <peter.maydell@linaro.org> wrote:

On 25 August 2011 07:41, Peter A. G. Crosthwaite

<peter.crosthwaite@petalogix.com> wrote:
> From: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
>
...
This and patch 13/14 seem to be generic target-microblaze
fixes -- did you mean to include them in this devicetree
series rather than sending them separately?

-- PMM

[-- Attachment #2: Type: text/html, Size: 883 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees
  2011-08-25  6:41 [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Peter A. G. Crosthwaite
                   ` (13 preceding siblings ...)
  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
  2011-08-25 15:43   ` Peter Crosthwaite
  14 siblings, 1 reply; 29+ messages in thread
From: Anthony Liguori @ 2011-08-25 13:27 UTC (permalink / raw)
  To: Peter A. G. Crosthwaite
  Cc: edgar.iglesias, michal.simek, qemu-devel, john.williams, stefanha

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
>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees
  2011-08-25 13:27 ` [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Anthony Liguori
@ 2011-08-25 15:43   ` Peter Crosthwaite
  2011-08-25 15:59     ` Paolo Bonzini
  2011-08-25 16:04     ` Anthony Liguori
  0 siblings, 2 replies; 29+ messages in thread
From: Peter Crosthwaite @ 2011-08-25 15:43 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: edgar.iglesias, michal.simek, qemu-devel, john.williams, stefanha

[-- Attachment #1: Type: text/plain, Size: 9534 bytes --]

Hi Anthony,

So the primary motivation for using this is in embedded systems design flows
where you are already working with DTS for software boot. For
microblaze-linux, xilinx-ppc and the xilinx-arm platforms which we are
working with, it even more makes sense as the hardware platform design tools
are capable of emitting platforms descriptions as DTS. With this framework,
there is no need to write another description of your system (i.e. a config
file, or a hardcoded machine model). DTSs are a standardised way of
describing machines in the embedded linux arena, and are our machine
description source, so in one way or another, we will continue need to
create QEMU machines that match a DTB.

So anyways, the framework does a little bit more than read-config as the
framework allows you to define a mapping between dts descriptions and qdev
device models, rather than your configuration source being straight up qdev
property values. There's also examples of more Ad-Hoc device models that are
not currently qdev models (e.g. pflash_cfi) where you are forced to take a
code driven approach rather than have to rely on QDev. It also allows you to
define machine creation behavior for device nodes that are not QDev devices
at all (e.g. simple busses or memories).

The possibility would exist to take a DTS and to auto-translate it into a
config format, however the process for doing this would be near identical to
the code in this patch series, but rather than just straight up instantiate
the devices as you go, you would have to dump all the results to a single
data structure then read-config that result i.e:

foo.dtb -> foo.cfg -> pass to qemu.

But another important feature of this work that is perhaps glossed over in
the original description, is the ability to specify opaque interconnection
data for inter-communicating devices. dtb provides a natural way for devices
to reference each other and we use this to handle device interconnections
without interferring with device models.  In the example given, we create
qemu_irqs for interrupt controllers as they are discovered then tag them as
opaque data for the interrupt controller fdt_node. When connected device
instantiate, they cast the opaque data to qemu_irq and connect the
interrupt. It would be difficult to do this is the two stage process, as you
would have create directives for managing this opaque data in config files.

Now my understanding is the part of the qdev philosophy is to not embed
connection information in device models themselves? So I am wondering what
you mean by the work needs to happen in the device model? Just briefly
looking at the QOM patches you mentioned they seem to solving a different
problem of encapsulating and interfacing device connections at the device
level. The problem we are trying to solve here is instanitating and
interconnecting devices at the machine level, so I am looking for some
clarification on what you mean there.

Regards
Peter

On Thu, Aug 25, 2011 at 11:27 PM, Anthony Liguori <anthony@codemonkey.ws>wrote:

> 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
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 10678 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees
  2011-08-25 15:43   ` Peter Crosthwaite
@ 2011-08-25 15:59     ` Paolo Bonzini
  2011-08-25 16:04     ` Anthony Liguori
  1 sibling, 0 replies; 29+ messages in thread
From: Paolo Bonzini @ 2011-08-25 15:59 UTC (permalink / raw)
  To: Peter Crosthwaite
  Cc: stefanha, qemu-devel, michal.simek, edgar.iglesias, john.williams

On 08/25/2011 05:43 PM, Peter Crosthwaite wrote:
>
> Now my understanding is the part of the qdev philosophy is to not embed
> connection information in device models themselves?

This is going to change sooner or later, the GPIO connections in qdev 
_are_ embedded connections and extending qdev requires making those 
connections more ubiquitous and less of a special case than they are now.

Anthony's QOM work will let people describe those connections in 
configuration files or similar.

Paolo

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees
  2011-08-25 15:43   ` Peter Crosthwaite
  2011-08-25 15:59     ` Paolo Bonzini
@ 2011-08-25 16:04     ` Anthony Liguori
  2011-08-25 19:10       ` Edgar E. Iglesias
  1 sibling, 1 reply; 29+ messages in thread
From: Anthony Liguori @ 2011-08-25 16:04 UTC (permalink / raw)
  To: Peter Crosthwaite
  Cc: edgar.iglesias, stefanha, qemu-devel, john.williams, michal.simek

On 08/25/2011 10:43 AM, Peter Crosthwaite wrote:
> Hi Anthony,
>
> So the primary motivation for using this is in embedded systems design flows
> where you are already working with DTS for software boot. For
> microblaze-linux, xilinx-ppc and the xilinx-arm platforms which we are
> working with, it even more makes sense as the hardware platform design tools
> are capable of emitting platforms descriptions as DTS. With this framework,
> there is no need to write another description of your system (i.e. a config
> file, or a hardcoded machine model). DTSs are a standardised way of
> describing machines in the embedded linux arena, and are our machine
> description source, so in one way or another, we will continue need to
> create QEMU machines that match a DTB.

Yes, but as is obvious in your series, the DTB used to create the guest 
is not necessarily what you expose to the guest.

So whether the config you use to create the guest is DTB or something 
else sort of doesn't matter.  It's an implementation detail and you 
should be able to easily use any number of formats.

> So anyways, the framework does a little bit more than read-config as the
> framework allows you to define a mapping between dts descriptions and qdev
> device models,

Yes, this is the main problem.  You should be able to do this via a 
programmatic interface (via the monitor).  Really, you should be able to 
do this all via qdev.

> rather than your configuration source being straight up qdev
> property values. There's also examples of more Ad-Hoc device models that are
> not currently qdev models (e.g. pflash_cfi)

That's a bug.  We should convert those devices to qdev, not paper around it.

  where you are forced to take a
> code driven approach rather than have to rely on QDev. It also allows you to
> define machine creation behavior for device nodes that are not QDev devices
> at all (e.g. simple busses or memories).

Another bug.  We should fix those bugs.

> The possibility would exist to take a DTS and to auto-translate it into a
> config format, however the process for doing this would be near identical to
> the code in this patch series, but rather than just straight up instantiate
> the devices as you go, you would have to dump all the results to a single
> data structure then read-config that result i.e:
>
> foo.dtb ->  foo.cfg ->  pass to qemu.
>
> But another important feature of this work that is perhaps glossed over in
> the original description, is the ability to specify opaque interconnection
> data for inter-communicating devices.

This is the goal of QOM except it does this by fixing the problems in 
qdev instead of adding another layer on top of things.

  dtb provides a natural way for devices
> to reference each other and we use this to handle device interconnections
> without interferring with device models.  In the example given, we create
> qemu_irqs for interrupt controllers as they are discovered then tag them as
> opaque data for the interrupt controller fdt_node. When connected device
> instantiate, they cast the opaque data to qemu_irq and connect the
> interrupt. It would be difficult to do this is the two stage process, as you
> would have create directives for managing this opaque data in config files.
>
> Now my understanding is the part of the qdev philosophy is to not embed
> connection information in device models themselves?

No, that's not a philosophy, it's a bug.

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Qemu-devel] [RFC PATCH V1 12/14] microblaze: Make the MSR PVR bit non writable
  2011-08-25 10:17     ` Peter Crosthwaite
@ 2011-08-25 18:28       ` Edgar E. Iglesias
  2011-08-25 21:04       ` Edgar E. Iglesias
  1 sibling, 0 replies; 29+ messages in thread
From: Edgar E. Iglesias @ 2011-08-25 18:28 UTC (permalink / raw)
  To: Peter Crosthwaite
  Cc: Peter Maydell, stefanha, qemu-devel, michal.simek,
	Edgar E. Iglesias, john.williams

On Thu, Aug 25, 2011 at 08:17:35PM +1000, Peter Crosthwaite wrote:
> Hi Peter , I included them as they are prerequisite for patch 14. Edgar, can we
> get a review / push of these two separate of this series so I can take them out
> next revision ?


Yes, my bad. I should have pushed this before.

Thanks

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees
  2011-08-25 16:04     ` Anthony Liguori
@ 2011-08-25 19:10       ` Edgar E. Iglesias
  2011-08-25 19:54         ` Anthony Liguori
  0 siblings, 1 reply; 29+ messages in thread
From: Edgar E. Iglesias @ 2011-08-25 19:10 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Grant Likely, stefanha, qemu-devel, Peter Crosthwaite,
	michal.simek, john.williams

On Thu, Aug 25, 2011 at 11:04:12AM -0500, Anthony Liguori wrote:
> On 08/25/2011 10:43 AM, Peter Crosthwaite wrote:
> >Hi Anthony,
> >
> >So the primary motivation for using this is in embedded systems design flows
> >where you are already working with DTS for software boot. For
> >microblaze-linux, xilinx-ppc and the xilinx-arm platforms which we are
> >working with, it even more makes sense as the hardware platform design tools
> >are capable of emitting platforms descriptions as DTS. With this framework,
> >there is no need to write another description of your system (i.e. a config
> >file, or a hardcoded machine model). DTSs are a standardised way of
> >describing machines in the embedded linux arena, and are our machine
> >description source, so in one way or another, we will continue need to
> >create QEMU machines that match a DTB.
> 
> Yes, but as is obvious in your series, the DTB used to create the
> guest is not necessarily what you expose to the guest.
> 
> So whether the config you use to create the guest is DTB or
> something else sort of doesn't matter.  It's an implementation
> detail and you should be able to easily use any number of formats.

No, the point *is* to use DTS. It's an existing format, widely used
and compatible with other tools.

The dtb is passed on by different layers of the boot and is edited for
various reasons, for example to pass on kernel cmd lines. Nothing strange
there.

The reason for removing devices from it, is simply due to lack of manpower,
QEMU doesnt emulate all the devices in the dtb description yet. So that
miss-"feature" will ideally go away with time.

An option is ofcourse to translate the dts to what ever bolibumpa format
qemu is using (with all the compat/versioning issues that brings). Still,
maybe that's something to consider. Peter?


> >So anyways, the framework does a little bit more than read-config as the
> >framework allows you to define a mapping between dts descriptions and qdev
> >device models,
> 
> Yes, this is the main problem.  You should be able to do this via a
> programmatic interface (via the monitor).  Really, you should be
> able to do this all via qdev.
> 
> >rather than your configuration source being straight up qdev
> >property values. There's also examples of more Ad-Hoc device models that are
> >not currently qdev models (e.g. pflash_cfi)
> 
> That's a bug.  We should convert those devices to qdev, not paper around it.
> 
>  where you are forced to take a
> >code driven approach rather than have to rely on QDev. It also allows you to
> >define machine creation behavior for device nodes that are not QDev devices
> >at all (e.g. simple busses or memories).
> 
> Another bug.  We should fix those bugs.
>
> 
> >The possibility would exist to take a DTS and to auto-translate it into a
> >config format, however the process for doing this would be near identical to
> >the code in this patch series, but rather than just straight up instantiate
> >the devices as you go, you would have to dump all the results to a single
> >data structure then read-config that result i.e:
> >
> >foo.dtb ->  foo.cfg ->  pass to qemu.
> >
> >But another important feature of this work that is perhaps glossed over in
> >the original description, is the ability to specify opaque interconnection
> >data for inter-communicating devices.
> 
> This is the goal of QOM except it does this by fixing the problems
> in qdev instead of adding another layer on top of things.


Then maybe the FDT machinery could be respinned to work on top of your QOM
objects?

Or are FDT's a complete no go? So external conversion is the only option?

Cheers

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees
  2011-08-25 19:10       ` Edgar E. Iglesias
@ 2011-08-25 19:54         ` Anthony Liguori
  2011-08-25 20:20           ` Edgar E. Iglesias
  0 siblings, 1 reply; 29+ messages in thread
From: Anthony Liguori @ 2011-08-25 19:54 UTC (permalink / raw)
  To: Edgar E. Iglesias
  Cc: Peter Crosthwaite, stefanha, qemu-devel, Grant Likely,
	michal.simek, john.williams

On 08/25/2011 02:10 PM, Edgar E. Iglesias wrote:
> On Thu, Aug 25, 2011 at 11:04:12AM -0500, Anthony Liguori wrote:
>> On 08/25/2011 10:43 AM, Peter Crosthwaite wrote:
>>> Hi Anthony,
>>>
>>> So the primary motivation for using this is in embedded systems design flows
>>> where you are already working with DTS for software boot. For
>>> microblaze-linux, xilinx-ppc and the xilinx-arm platforms which we are
>>> working with, it even more makes sense as the hardware platform design tools
>>> are capable of emitting platforms descriptions as DTS. With this framework,
>>> there is no need to write another description of your system (i.e. a config
>>> file, or a hardcoded machine model). DTSs are a standardised way of
>>> describing machines in the embedded linux arena, and are our machine
>>> description source, so in one way or another, we will continue need to
>>> create QEMU machines that match a DTB.
>>
>> Yes, but as is obvious in your series, the DTB used to create the
>> guest is not necessarily what you expose to the guest.
>>
>> So whether the config you use to create the guest is DTB or
>> something else sort of doesn't matter.  It's an implementation
>> detail and you should be able to easily use any number of formats.
>
> No, the point *is* to use DTS. It's an existing format, widely used
> and compatible with other tools.

Yes, I understand.  But DTS is just a data format.  What matters are the 
mechanisms of going from DTS -> object model.

If we do that right, you could use DTS, INI, XML, JSON, whatever.

> The dtb is passed on by different layers of the boot and is edited for
> various reasons, for example to pass on kernel cmd lines. Nothing strange
> there.
>
> The reason for removing devices from it, is simply due to lack of manpower,
> QEMU doesnt emulate all the devices in the dtb description yet. So that
> miss-"feature" will ideally go away with time.
>
> An option is ofcourse to translate the dts to what ever bolibumpa format
> qemu is using (with all the compat/versioning issues that brings). Still,
> maybe that's something to consider. Peter?

We shouldn't have an intermediate format.  We should have monitor 
commands to create the device tree and then a DTS interpreter that reads 
the DTS and executes the appropriate commands.

The problem with the current series is that it mixes up these two things.

>> This is the goal of QOM except it does this by fixing the problems
>> in qdev instead of adding another layer on top of things.
>
>
> Then maybe the FDT machinery could be respinned to work on top of your QOM
> objects?
>
> Or are FDT's a complete no go? So external conversion is the only option?

No, DTS is fine but not as proposed.  You shouldn't mix the logic of 
creating the nodes in the tree with the format of how you're describing 
what nodes to be there.

Another way to put it, limit the logic strictly to invoking qdev 
operations derived from the DTS.  You'll see that there are things you 
can't do but the point is that we need to fix qdev to make it possible 
to do those things.

Regards,

Anthony Liguori

>
> Cheers
>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees
  2011-08-25 19:54         ` Anthony Liguori
@ 2011-08-25 20:20           ` Edgar E. Iglesias
  2011-08-25 21:17             ` Anthony Liguori
  0 siblings, 1 reply; 29+ messages in thread
From: Edgar E. Iglesias @ 2011-08-25 20:20 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Peter Crosthwaite, stefanha, qemu-devel, Grant Likely,
	michal.simek, john.williams

On Thu, Aug 25, 2011 at 02:54:13PM -0500, Anthony Liguori wrote:
> On 08/25/2011 02:10 PM, Edgar E. Iglesias wrote:
> >On Thu, Aug 25, 2011 at 11:04:12AM -0500, Anthony Liguori wrote:
> >>On 08/25/2011 10:43 AM, Peter Crosthwaite wrote:
> >>>Hi Anthony,
> >>>
> >>>So the primary motivation for using this is in embedded systems design flows
> >>>where you are already working with DTS for software boot. For
> >>>microblaze-linux, xilinx-ppc and the xilinx-arm platforms which we are
> >>>working with, it even more makes sense as the hardware platform design tools
> >>>are capable of emitting platforms descriptions as DTS. With this framework,
> >>>there is no need to write another description of your system (i.e. a config
> >>>file, or a hardcoded machine model). DTSs are a standardised way of
> >>>describing machines in the embedded linux arena, and are our machine
> >>>description source, so in one way or another, we will continue need to
> >>>create QEMU machines that match a DTB.
> >>
> >>Yes, but as is obvious in your series, the DTB used to create the
> >>guest is not necessarily what you expose to the guest.
> >>
> >>So whether the config you use to create the guest is DTB or
> >>something else sort of doesn't matter.  It's an implementation
> >>detail and you should be able to easily use any number of formats.
> >
> >No, the point *is* to use DTS. It's an existing format, widely used
> >and compatible with other tools.
> 
> Yes, I understand.  But DTS is just a data format.  What matters are
> the mechanisms of going from DTS -> object model.
> 
> If we do that right, you could use DTS, INI, XML, JSON, whatever.

Yup, I see what you mean.


> >The dtb is passed on by different layers of the boot and is edited for
> >various reasons, for example to pass on kernel cmd lines. Nothing strange
> >there.
> >
> >The reason for removing devices from it, is simply due to lack of manpower,
> >QEMU doesnt emulate all the devices in the dtb description yet. So that
> >miss-"feature" will ideally go away with time.
> >
> >An option is ofcourse to translate the dts to what ever bolibumpa format
> >qemu is using (with all the compat/versioning issues that brings). Still,
> >maybe that's something to consider. Peter?
> 
> We shouldn't have an intermediate format.  We should have monitor
> commands to create the device tree and then a DTS interpreter that
> reads the DTS and executes the appropriate commands.
> 
> The problem with the current series is that it mixes up these two things.
> 
> >>This is the goal of QOM except it does this by fixing the problems
> >>in qdev instead of adding another layer on top of things.
> >
> >
> >Then maybe the FDT machinery could be respinned to work on top of your QOM
> >objects?
> >
> >Or are FDT's a complete no go? So external conversion is the only option?
> 
> No, DTS is fine but not as proposed.  You shouldn't mix the logic of
> creating the nodes in the tree with the format of how you're
> describing what nodes to be there.

Thanks. Would you mind spending a few lines on how far you've gotten with
QOM and if there is, where to find more info about it (sorry, I havent been
following it at all).

Cheers

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Qemu-devel] [RFC PATCH V1 12/14] microblaze: Make the MSR PVR bit non writable
  2011-08-25 10:17     ` Peter Crosthwaite
  2011-08-25 18:28       ` Edgar E. Iglesias
@ 2011-08-25 21:04       ` Edgar E. Iglesias
  1 sibling, 0 replies; 29+ messages in thread
From: Edgar E. Iglesias @ 2011-08-25 21:04 UTC (permalink / raw)
  To: Peter Crosthwaite
  Cc: Peter Maydell, stefanha, qemu-devel, michal.simek,
	Edgar E. Iglesias, john.williams

On Thu, Aug 25, 2011 at 08:17:35PM +1000, Peter Crosthwaite wrote:
> Hi Peter , I included them as they are prerequisite for patch 14. Edgar, can we
> get a review / push of these two separate of this series so I can take them out
> next revision ?

I've applied this now, thanks.

Cheers

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees
  2011-08-25 20:20           ` Edgar E. Iglesias
@ 2011-08-25 21:17             ` Anthony Liguori
  2011-09-02  2:45               ` John Williams
  0 siblings, 1 reply; 29+ messages in thread
From: Anthony Liguori @ 2011-08-25 21:17 UTC (permalink / raw)
  To: Edgar E. Iglesias
  Cc: Grant Likely, stefanha, qemu-devel, Peter Crosthwaite,
	michal.simek, john.williams

On 08/25/2011 03:20 PM, Edgar E. Iglesias wrote:
> On Thu, Aug 25, 2011 at 02:54:13PM -0500, Anthony Liguori wrote:
>> On 08/25/2011 02:10 PM, Edgar E. Iglesias wrote:
>>>> This is the goal of QOM except it does this by fixing the problems
>>>> in qdev instead of adding another layer on top of things.
>>>
>>>
>>> Then maybe the FDT machinery could be respinned to work on top of your QOM
>>> objects?
>>>
>>> Or are FDT's a complete no go? So external conversion is the only option?
>>
>> No, DTS is fine but not as proposed.  You shouldn't mix the logic of
>> creating the nodes in the tree with the format of how you're
>> describing what nodes to be there.
>
> Thanks. Would you mind spending a few lines on how far you've gotten with
> QOM and if there is, where to find more info about it (sorry, I havent been
> following it at all).

Stay tuned.  I'm going to spend the day tomorrow getting the next series 
ready and writing some stuff on the wiki.

Regards,

Anthony Liguori

>
> Cheers
>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees
  2011-08-25 21:17             ` Anthony Liguori
@ 2011-09-02  2:45               ` John Williams
  2011-09-08  0:29                 ` John Williams
  0 siblings, 1 reply; 29+ messages in thread
From: John Williams @ 2011-09-02  2:45 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Grant Likely, stefanha, qemu-devel, Peter Crosthwaite,
	michal.simek, Edgar E. Iglesias

[-- Attachment #1: Type: text/plain, Size: 2356 bytes --]

On Fri, Aug 26, 2011 at 7:17 AM, Anthony Liguori <anthony@codemonkey.ws>wrote:

> On 08/25/2011 03:20 PM, Edgar E. Iglesias wrote:
>
>> On Thu, Aug 25, 2011 at 02:54:13PM -0500, Anthony Liguori wrote:
>>
>>> On 08/25/2011 02:10 PM, Edgar E. Iglesias wrote:
>>>
>>>> This is the goal of QOM except it does this by fixing the problems
>>>>> in qdev instead of adding another layer on top of things.
>>>>>
>>>>
>>>>
>>>> Then maybe the FDT machinery could be respinned to work on top of your
>>>> QOM
>>>> objects?
>>>>
>>>> Or are FDT's a complete no go? So external conversion is the only
>>>> option?
>>>>
>>>
>>> No, DTS is fine but not as proposed.  You shouldn't mix the logic of
>>> creating the nodes in the tree with the format of how you're
>>> describing what nodes to be there.
>>>
>>
>> Thanks. Would you mind spending a few lines on how far you've gotten with
>> QOM and if there is, where to find more info about it (sorry, I havent
>> been
>> following it at all).
>>
>
> Stay tuned.  I'm going to spend the day tomorrow getting the next series
> ready and writing some stuff on the wiki.
>

It seems that the main issue raised is not about the quality of the work
being contributed, nor the overall intent, but rather an expression that it
might be better done building on a layer which itself is still a work in
progress, I'd like to propose a compromise.

This is a long term investment for us, we have two working architectures,
numerous users, and immediate plans to add support for a 3rd architecture.
 We are committed to doing it the right way, and letting people other than
our immediate customers benefit from our work. However, there is also a
significant cost to us maintaining this out-of-tree - something breaks every
time we pull from mainline.

So, may I ask that the code be reviewed on its technical merit as it stands
today, and if that is suitable then it be merged, with a commitment from us
that when there is suitable plumbing in place our work will be refactored
around that?  Indeed, the process of us doing so will probably provide
useful feedback in the design of these underlying layers.

Thanks in advance for your consideration and cooperation.

Regards,

John
-- 
John Williams, PhD, B. Eng, B. IT
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com  p: +61-7-30090663  f: +61-7-30090663

[-- Attachment #2: Type: text/html, Size: 3428 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees
  2011-09-02  2:45               ` John Williams
@ 2011-09-08  0:29                 ` John Williams
  0 siblings, 0 replies; 29+ messages in thread
From: John Williams @ 2011-09-08  0:29 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Grant Likely, stefanha, qemu-devel, Peter Crosthwaite,
	michal.simek, Edgar E. Iglesias

[-- Attachment #1: Type: text/plain, Size: 2330 bytes --]

On Fri, Sep 2, 2011 at 12:45 PM, John Williams
<john.williams@petalogix.com>wrote:

> On Fri, Aug 26, 2011 at 7:17 AM, Anthony Liguori <anthony@codemonkey.ws>wrote:
>
>> On 08/25/2011 03:20 PM, Edgar E. Iglesias wrote:
>>
>>> On Thu, Aug 25, 2011 at 02:54:13PM -0500, Anthony Liguori wrote:
>>>
>>>> On 08/25/2011 02:10 PM, Edgar E. Iglesias wrote:
>>>>
>>>>> This is the goal of QOM except it does this by fixing the problems
>>>>>> in qdev instead of adding another layer on top of things.
>>>>>>
>>>>>
>>>>>
>>>>> Then maybe the FDT machinery could be respinned to work on top of your
>>>>> QOM
>>>>> objects?
>>>>>
>>>>> Or are FDT's a complete no go? So external conversion is the only
>>>>> option?
>>>>>
>>>>
>>>> No, DTS is fine but not as proposed.  You shouldn't mix the logic of
>>>> creating the nodes in the tree with the format of how you're
>>>> describing what nodes to be there.
>>>>
>>>
>>> Thanks. Would you mind spending a few lines on how far you've gotten with
>>> QOM and if there is, where to find more info about it (sorry, I havent
>>> been
>>> following it at all).
>>>
>>
>> Stay tuned.  I'm going to spend the day tomorrow getting the next series
>> ready and writing some stuff on the wiki.
>>
>
> It seems that the main issue raised is not about the quality of the work
> being contributed, nor the overall intent, but rather an expression that it
> might be better done building on a layer which itself is still a work in
> progress, I'd like to propose a compromise.
>
> This is a long term investment for us, we have two working architectures,
> numerous users, and immediate plans to add support for a 3rd architecture.
>  We are committed to doing it the right way, and letting people other than
> our immediate customers benefit from our work. However, there is also a
> significant cost to us maintaining this out-of-tree - something breaks every
> time we pull from mainline.
>
> So, may I ask that the code be reviewed on its technical merit as it stands
> today, and if that is suitable then it be merged, with a commitment from us
> that when there is suitable plumbing in place our work will be refactored
> around that?  Indeed, the process of us doing so will probably provide
> useful feedback in the design of these underlying layers.
>

Any thoughts on our proposal?

Thanks,

John

[-- Attachment #2: Type: text/html, Size: 3491 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2011-09-08  0:29 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [Qemu-devel] [RFC PATCH V1 00/14] Dynamic machine model creation from device trees Anthony Liguori
2011-08-25 15:43   ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.