From patchwork Wed Dec 3 20:05:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 41869 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D165425E88 for ; Wed, 3 Dec 2014 20:09:49 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id e53sf10188717eek.3 for ; Wed, 03 Dec 2014 12:09:49 -0800 (PST) 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:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=SygSJGLUc0v3BXbEd3SC9stX4d3SgCDF9bRKeYb4K0o=; b=Huz/5ImfGsX8WDg3h/vMevbFh8+qIeBAJjGjesO7SWnITWEjGxuyXH+2pFCItc99Z+ Bias3VrtETE3Wg/8EyXNb0YZxLzxejYoBGvVfKSEEGqQ9GfOC1nRyLboALhk8lWwY90T 2CcswcWQ3JhuNsyaNxDmC7iXv7r+OBTuPBn33doBuvCpBFZpUNfhfSxS44DZ8RLWBUXw 3348IYJX0UY272zDn3GjXjRYdPPvld4V3iD/+CvUnlqb0LuCbfIbzwM6YYKd6LR/KkKi ddKmjLGYoMXxgBD6PVCsaFFO3bVHnPj+TB5sESfTyAVkpTAEpqgKjC1DKu9ha+ns+XgN WMAA== X-Gm-Message-State: ALoCoQltrTYsKteABsToM61nEQ6QHHW8/yr/L/LItz6vMPxC2k+QgvpHyVMWmiqOnPYzLHIxc5rN X-Received: by 10.194.92.34 with SMTP id cj2mr740220wjb.5.1417637389062; Wed, 03 Dec 2014 12:09:49 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.136 with SMTP id kq8ls196219lac.84.gmail; Wed, 03 Dec 2014 12:09:48 -0800 (PST) X-Received: by 10.152.120.42 with SMTP id kz10mr3310716lab.92.1417637388784; Wed, 03 Dec 2014 12:09:48 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id y9si23913920lbw.115.2014.12.03.12.09.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 12:09:48 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id hz20so12949990lab.6 for ; Wed, 03 Dec 2014 12:09:48 -0800 (PST) X-Received: by 10.112.14.69 with SMTP id n5mr5996644lbc.34.1417637388666; Wed, 03 Dec 2014 12:09:48 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp730989lbc; Wed, 3 Dec 2014 12:09:48 -0800 (PST) X-Received: by 10.180.7.201 with SMTP id l9mr40463290wia.80.1417637387868; Wed, 03 Dec 2014 12:09:47 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id vf7si41506579wjc.81.2014.12.03.12.09.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Dec 2014 12:09:47 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:43162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwGF8-0002y7-Jt for patch@linaro.org; Wed, 03 Dec 2014 15:09:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwGBt-0006lb-5f for qemu-devel@nongnu.org; Wed, 03 Dec 2014 15:06:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwGBm-0003U4-Ad for qemu-devel@nongnu.org; Wed, 03 Dec 2014 15:06:25 -0500 Received: from mail-ob0-f176.google.com ([209.85.214.176]:35173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwGBm-0003TN-5I for qemu-devel@nongnu.org; Wed, 03 Dec 2014 15:06:18 -0500 Received: by mail-ob0-f176.google.com with SMTP id vb8so1662027obc.35 for ; Wed, 03 Dec 2014 12:06:16 -0800 (PST) X-Received: by 10.202.59.137 with SMTP id i131mr4035092oia.114.1417637176493; Wed, 03 Dec 2014 12:06:16 -0800 (PST) Received: from gbellows-linaro.bellowshome.net (99-179-1-128.lightspeed.austtx.sbcglobal.net. [99.179.1.128]) by mx.google.com with ESMTPSA id mq4sm11787321obb.22.2014.12.03.12.06.15 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 12:06:16 -0800 (PST) From: Greg Bellows To: qemu-devel@nongnu.org, serge.fdrv@gmail.com, edgar.iglesias@gmail.com, aggelerf@ethz.ch, peter.maydell@linaro.org Date: Wed, 3 Dec 2014 14:05:55 -0600 Message-Id: <1417637167-20640-2-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1417637167-20640-1-git-send-email-greg.bellows@linaro.org> References: <1417637167-20640-1-git-send-email-greg.bellows@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.214.176 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH 01/13] target-arm: Add vexpress class and machine types X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: greg.bellows@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.215.47 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Adds base Vexpress class and machine objects and infrastructure. This is in preparation for switching to the full QEMU object model. The base vexpress infrastructure is intended to handle common vexpress details. Signed-off-by: Greg Bellows --- hw/arm/vexpress.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 7cbd13f..8bec04a 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -157,6 +157,23 @@ static hwaddr motherboard_aseries_map[] = { typedef struct VEDBoardInfo VEDBoardInfo; +typedef struct { + MachineClass parent; + VEDBoardInfo *daughterboard; +} VexpressMachineClass; + +typedef struct { + MachineState parent; +} VexpressMachineState; + +#define TYPE_VEXPRESS_MACHINE "vexpress" +#define VEXPRESS_MACHINE(obj) \ + OBJECT_CHECK(VexpressMachineState, (obj), TYPE_VEXPRESS_MACHINE) +#define VEXPRESS_MACHINE_GET_CLASS(obj) \ + OBJECT_GET_CLASS(VexpressMachineClass, obj, TYPE_VEXPRESS_MACHINE) +#define VEXPRESS_MACHINE_CLASS(klass) \ + OBJECT_CLASS_CHECK(VexpressMachineClass, klass, TYPE_VEXPRESS_MACHINE) + typedef void DBoardInitFn(const VEDBoardInfo *daughterboard, ram_addr_t ram_size, const char *cpu_model, @@ -681,6 +698,13 @@ static void vexpress_common_init(VEDBoardInfo *daughterboard, arm_load_kernel(ARM_CPU(first_cpu), &daughterboard->bootinfo); } +static void vexpress_init(MachineState *machine) +{ + VexpressMachineClass *vmc = VEXPRESS_MACHINE_GET_CLASS(machine); + + vexpress_common_init(vmc->daughterboard, machine); +} + static void vexpress_a9_init(MachineState *machine) { vexpress_common_init(&a9_daughterboard, machine); @@ -691,6 +715,25 @@ static void vexpress_a15_init(MachineState *machine) vexpress_common_init(&a15_daughterboard, machine); } +static void vexpress_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->name = TYPE_VEXPRESS_MACHINE; + mc->desc = "ARM Versatile Express"; + mc->init = vexpress_init; + mc->block_default_type = IF_SCSI; + mc->max_cpus = 4; +} + +static const TypeInfo vexpress_info = { + .name = TYPE_VEXPRESS_MACHINE, + .parent = TYPE_MACHINE, + .instance_size = sizeof(VexpressMachineState), + .class_size = sizeof(VexpressMachineClass), + .class_init = vexpress_class_init, +}; + static QEMUMachine vexpress_a9_machine = { .name = "vexpress-a9", .desc = "ARM Versatile Express for Cortex-A9", @@ -709,6 +752,7 @@ static QEMUMachine vexpress_a15_machine = { static void vexpress_machine_init(void) { + type_register_static(&vexpress_info); qemu_register_machine(&vexpress_a9_machine); qemu_register_machine(&vexpress_a15_machine); }