qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@linaro.org>
To: eric.auger@st.com, christoffer.dall@linaro.org,
	qemu-devel@nongnu.org, kim.phillips@freescale.com,
	a.rigo@virtualopensystems.com
Cc: peter.maydell@linaro.org, eric.auger@linaro.org,
	patches@linaro.org, agraf@suse.de, stuart.yoder@freescale.com,
	alex.williamson@redhat.com, a.motakis@virtualopensystems.com,
	kvmarm@lists.cs.columbia.edu
Subject: [Qemu-devel] [PATCH 5/7] hw/core/sysbus: add fdt_add_node method
Date: Mon,  7 Jul 2014 08:08:10 +0100	[thread overview]
Message-ID: <1404716892-15600-6-git-send-email-eric.auger@linaro.org> (raw)
In-Reply-To: <1404716892-15600-1-git-send-email-eric.auger@linaro.org>

This method is meant to be called on sysbus device dynamic
instantiation (-device option). Devices that support this
kind of instantiation must implement this method.

Signed-off-by: Eric Auger <eric.auger@linaro.org>
---
 hw/core/sysbus.c    | 12 ++++++++++++
 include/hw/sysbus.h |  2 ++
 2 files changed, 14 insertions(+)

diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index aacc446..c1c0009 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -289,11 +289,23 @@ MemoryRegion *sysbus_address_space(SysBusDevice *dev)
     return get_system_memory();
 }
 
+/*
+ * to be specialized in susbus devices that support dynamic instantiation
+ */
+void sysbus_fdt_add_node(SysBusDevice *dev, void *data)
+{
+    error_report("Dynamic instantiation of Device %s"
+                 " is not implemented",
+                 qdev_fw_name(DEVICE(dev)));
+}
+
 static void sysbus_device_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *k = DEVICE_CLASS(klass);
+    SysBusDeviceClass *sbdevk = SYS_BUS_DEVICE_CLASS(klass);
     k->init = sysbus_device_init;
     k->bus_type = TYPE_SYSTEM_BUS;
+    sbdevk->fdt_add_node = sysbus_fdt_add_node;
 }
 
 static const TypeInfo sysbus_device_type_info = {
diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h
index 533184a..df514f9 100644
--- a/include/hw/sysbus.h
+++ b/include/hw/sysbus.h
@@ -40,6 +40,7 @@ typedef struct SysBusDeviceClass {
     /*< public >*/
 
     int (*init)(SysBusDevice *dev);
+    void (*fdt_add_node)(SysBusDevice *dev, void *data);
 } SysBusDeviceClass;
 
 struct SysBusDevice {
@@ -73,6 +74,7 @@ void sysbus_mmio_map_overlap(SysBusDevice *dev, int n, hwaddr addr,
 void sysbus_add_io(SysBusDevice *dev, hwaddr addr,
                    MemoryRegion *mem);
 void sysbus_del_io(SysBusDevice *dev, MemoryRegion *mem);
+void sysbus_fdt_add_node(SysBusDevice *dev, void *mem);
 MemoryRegion *sysbus_address_space(SysBusDevice *dev);
 
 /* Legacy helper function for creating devices.  */
-- 
1.8.3.2

  parent reply	other threads:[~2014-07-07  7:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07  7:08 [Qemu-devel] [PATCH 0/7] machvirt dynamic sysbus device instantiation Eric Auger
2014-07-07  7:08 ` [Qemu-devel] [PATCH 1/7] hw/misc/platform_devices: helpers for dynamic instantiation of platform devices Eric Auger
2014-07-08 13:43   ` Alexander Graf
2014-07-23 14:58     ` Eric Auger
2014-07-23 23:07       ` Alexander Graf
2014-07-24  8:01         ` Eric Auger
2014-07-07  7:08 ` [Qemu-devel] [PATCH 2/7] hw/arm/boot: load_dtb becomes non static Eric Auger
2014-07-07  7:08 ` [Qemu-devel] [PATCH 3/7] hw/arm/virt: add new add_fdt_xxx_node functions Eric Auger
2014-07-07  7:08 ` [Qemu-devel] [PATCH 4/7] hw/arm/virt: Support dynamically spawned sysbus devices Eric Auger
2014-07-08 13:51   ` Alexander Graf
2014-07-08 13:55     ` Peter Maydell
2014-07-23 15:01     ` Eric Auger
2014-07-07  7:08 ` Eric Auger [this message]
2014-07-08 13:52   ` [Qemu-devel] [PATCH 5/7] hw/core/sysbus: add fdt_add_node method Alexander Graf
2014-07-23 15:33     ` Eric Auger
2014-07-23 23:02       ` Alexander Graf
2014-07-24  7:36         ` Eric Auger
2014-07-24 11:25           ` Alexander Graf
2014-07-24 12:42             ` Rob Herring
2014-07-07  7:08 ` [Qemu-devel] [PATCH 6/7] hw/misc/platform_devices: add call to sysbus fdt_add_node Eric Auger
2014-07-07  7:08 ` [Qemu-devel] [PATCH 7/7] hw/misc/platform_devices: Add platform_bus_base to PlatformDevtreeData Eric Auger
2014-07-08 13:53   ` Alexander Graf
2014-07-23 15:39     ` Eric Auger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1404716892-15600-6-git-send-email-eric.auger@linaro.org \
    --to=eric.auger@linaro.org \
    --cc=a.motakis@virtualopensystems.com \
    --cc=a.rigo@virtualopensystems.com \
    --cc=agraf@suse.de \
    --cc=alex.williamson@redhat.com \
    --cc=christoffer.dall@linaro.org \
    --cc=eric.auger@st.com \
    --cc=kim.phillips@freescale.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stuart.yoder@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).