From patchwork Mon Jul 7 07:08:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 33133 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EEB1920C88 for ; Mon, 7 Jul 2014 07:12:06 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id b6sf17468420yha.8 for ; Mon, 07 Jul 2014 00:12:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=TEaHumLph2A4BObO8N8PpLEtP7MUjFtYSX2NFW5RTpQ=; b=je+iSbVEsoHyBsuL7Po8avDQoIsp6MDWqWaaenOB6sykU6wGLQ7yzU8ltaMafaysjf phH7w/txszV0H4BLmmDtQ0O+boCFoyXPZPEUkShRrG7JzssaNTDwnT5h8i3lUkcfhWuS 8MZTaMToUTwB6ET6bAUKLcfMoDmn55Ts8OypBoBsqokcrI8eFFcJxTfjBjMKXS/M9i4J NQi9gU8lPC36r2100xARBaWJPvZXx+PC1HfGMDUXGqRRRGatSHES870wMPxljuYb72iP O9PgRfklf9Nv/TZ6gYpPCZc4L1vgOz1/N74iMfZM2TT1rWGuwu4H+mz7c5n4nEpMv+d0 9KoA== X-Gm-Message-State: ALoCoQmy6eEzAKQm4k16z2VQ9gXB03tCwwUbUrvvH03C8ptTjJfN80ydJlOQztS3RXQ9sJqZ+hMA X-Received: by 10.58.15.136 with SMTP id x8mr12910755vec.1.1404717126769; Mon, 07 Jul 2014 00:12:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.114 with SMTP id b105ls1606009qgd.16.gmail; Mon, 07 Jul 2014 00:12:06 -0700 (PDT) X-Received: by 10.58.248.34 with SMTP id yj2mr2184458vec.43.1404717126702; Mon, 07 Jul 2014 00:12:06 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id t10si18416324vdf.82.2014.07.07.00.12.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Jul 2014 00:12:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.177 as permitted sender) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id i13so3590409veh.22 for ; Mon, 07 Jul 2014 00:12:06 -0700 (PDT) X-Received: by 10.52.144.235 with SMTP id sp11mr5599437vdb.25.1404717126646; Mon, 07 Jul 2014 00:12:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp644882vcb; Mon, 7 Jul 2014 00:12:06 -0700 (PDT) X-Received: by 10.194.222.5 with SMTP id qi5mr29447753wjc.62.1404717125619; Mon, 07 Jul 2014 00:12:05 -0700 (PDT) Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by mx.google.com with ESMTPS id e4si39823277wij.16.2014.07.07.00.12.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Jul 2014 00:12:05 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.180 as permitted sender) client-ip=209.85.212.180; Received: by mail-wi0-f180.google.com with SMTP id hi2so6273581wib.7 for ; Mon, 07 Jul 2014 00:12:05 -0700 (PDT) X-Received: by 10.194.90.51 with SMTP id bt19mr1771877wjb.105.1404717125220; Mon, 07 Jul 2014 00:12:05 -0700 (PDT) Received: from midway01-04-00.lavalab ([88.98.47.97]) by mx.google.com with ESMTPSA id fb15sm111830218wid.23.2014.07.07.00.12.04 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Jul 2014 00:12:04 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, christoffer.dall@linaro.org, qemu-devel@nongnu.org, kim.phillips@freescale.com, a.rigo@virtualopensystems.com Cc: eric.auger@linaro.org, kvmarm@lists.cs.columbia.edu, alex.williamson@redhat.com, agraf@suse.de, peter.maydell@linaro.org, stuart.yoder@freescale.com, a.motakis@virtualopensystems.com, patches@linaro.org Subject: [PATCH 5/7] hw/core/sysbus: add fdt_add_node method Date: Mon, 7 Jul 2014 08:08:10 +0100 Message-Id: <1404716892-15600-6-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1404716892-15600-1-git-send-email-eric.auger@linaro.org> References: <1404716892-15600-1-git-send-email-eric.auger@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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. */