From patchwork Wed Dec 3 20:05:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 41866 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CECA325E88 for ; Wed, 3 Dec 2014 20:07:45 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id ge10sf6532058lab.4 for ; Wed, 03 Dec 2014 12:07:44 -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=lNLA414YxkASJ0eh0JLLy9UYOeesHh38YjFYmsCMJuk=; b=DCsC4ZRaYGwFwGTbFs+NLjm8UAKESE3HlKrVmhRDLn1+diP2FPJcE68JKDgGGaMamP Xdis66cGoqiyZ5v+5LvEcNFQnrE0zX6B5uHl4WMdr76D89BlpENuHzPGF0y9B99E7iLK QYo8aH9P+nyODt2hyKa4hJy9yXSMLRXkkjxhrtkQ4LUzGbWg22XtkluC9To/SUpJt2uK ZzbDKF88fhBCamcVuXFrmTMKtAATRKOm7aj119dAEVj3nUXk7tqS9wB5KwBRbCq6UeM8 iIfBI9wVGklbIiH25h/BR+up6zXRhFNY9yXOB4wwKdqX2v17al7MPe2VUM+2S7UsUJG0 za7w== X-Gm-Message-State: ALoCoQn9p+EDUQ/o/ioPNG8FiuY+MqslMDRf5CuuAOOusJ3oDi2+uBzX3HXbrIER2/P58r2NqkS0 X-Received: by 10.112.89.195 with SMTP id bq3mr1463637lbb.9.1417637264778; Wed, 03 Dec 2014 12:07:44 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.227 with SMTP id u3ls214944laa.109.gmail; Wed, 03 Dec 2014 12:07:44 -0800 (PST) X-Received: by 10.152.4.233 with SMTP id n9mr5932571lan.61.1417637264640; Wed, 03 Dec 2014 12:07:44 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id cy4si23994762lac.4.2014.12.03.12.07.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 12:07:44 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id b6so3378195lbj.22 for ; Wed, 03 Dec 2014 12:07:44 -0800 (PST) X-Received: by 10.152.43.103 with SMTP id v7mr5899581lal.29.1417637264562; Wed, 03 Dec 2014 12:07:44 -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 ew9csp730693lbc; Wed, 3 Dec 2014 12:07:44 -0800 (PST) X-Received: by 10.180.100.98 with SMTP id ex2mr34591098wib.58.1417637263852; Wed, 03 Dec 2014 12:07:43 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 10si17189795wjy.93.2014.12.03.12.07.43 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Dec 2014 12:07:43 -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]:43145 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwGD8-0007nG-Ec for patch@linaro.org; Wed, 03 Dec 2014 15:07:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwGBs-0006la-Vq 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-0003Ty-53 for qemu-devel@nongnu.org; Wed, 03 Dec 2014 15:06:24 -0500 Received: from mail-oi0-f50.google.com ([209.85.218.50]:53720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwGBm-0003Tr-0k for qemu-devel@nongnu.org; Wed, 03 Dec 2014 15:06:18 -0500 Received: by mail-oi0-f50.google.com with SMTP id a141so11300976oig.23 for ; Wed, 03 Dec 2014 12:06:17 -0800 (PST) X-Received: by 10.60.42.208 with SMTP id q16mr4493554oel.20.1417637177570; Wed, 03 Dec 2014 12:06:17 -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.16 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 12:06:17 -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:56 -0600 Message-Id: <1417637167-20640-3-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.218.50 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH 02/13] target-arm: Add vexpress a9 & a15 machine objects 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.217.177 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 Add Vexpress machine objects for the the Cortex A9 & A15 variants. The older style QEMUMachine types were replaced with dedicated TypeInfo objects. The new objects include dedicated class init functions that currently ustilze dedicated machine init methods. The previous qemu_register_machine calls were replaced with the newer type_register_status calls. Signed-off-by: Greg Bellows --- hw/arm/vexpress.c | 50 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 8bec04a..0433300 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -167,6 +167,8 @@ typedef struct { } VexpressMachineState; #define TYPE_VEXPRESS_MACHINE "vexpress" +#define TYPE_VEXPRESS_A9_MACHINE "vexpress-a9" +#define TYPE_VEXPRESS_A15_MACHINE "vexpress-a15" #define VEXPRESS_MACHINE(obj) \ OBJECT_CHECK(VexpressMachineState, (obj), TYPE_VEXPRESS_MACHINE) #define VEXPRESS_MACHINE_GET_CLASS(obj) \ @@ -726,6 +728,30 @@ static void vexpress_class_init(ObjectClass *oc, void *data) mc->max_cpus = 4; } +static void vexpress_a9_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + VexpressMachineClass *vmc = VEXPRESS_MACHINE_CLASS(oc); + + mc->name = TYPE_VEXPRESS_A9_MACHINE; + mc->desc = "ARM Versatile Express for Cortex-A9"; + mc->init = vexpress_a9_init; + + vmc->daughterboard = &a9_daughterboard;; +} + +static void vexpress_a15_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + VexpressMachineClass *vmc = VEXPRESS_MACHINE_CLASS(oc); + + mc->name = TYPE_VEXPRESS_A15_MACHINE; + mc->desc = "ARM Versatile Express for Cortex-A15"; + mc->init = vexpress_a15_init; + + vmc->daughterboard = &a15_daughterboard; +} + static const TypeInfo vexpress_info = { .name = TYPE_VEXPRESS_MACHINE, .parent = TYPE_MACHINE, @@ -734,27 +760,23 @@ static const TypeInfo vexpress_info = { .class_init = vexpress_class_init, }; -static QEMUMachine vexpress_a9_machine = { - .name = "vexpress-a9", - .desc = "ARM Versatile Express for Cortex-A9", - .init = vexpress_a9_init, - .block_default_type = IF_SCSI, - .max_cpus = 4, +static const TypeInfo vexpress_a9_info = { + .name = TYPE_VEXPRESS_A9_MACHINE, + .parent = TYPE_VEXPRESS_MACHINE, + .class_init = vexpress_a9_class_init, }; -static QEMUMachine vexpress_a15_machine = { - .name = "vexpress-a15", - .desc = "ARM Versatile Express for Cortex-A15", - .init = vexpress_a15_init, - .block_default_type = IF_SCSI, - .max_cpus = 4, +static const TypeInfo vexpress_a15_info = { + .name = TYPE_VEXPRESS_A15_MACHINE, + .parent = TYPE_VEXPRESS_MACHINE, + .class_init = vexpress_a15_class_init, }; static void vexpress_machine_init(void) { type_register_static(&vexpress_info); - qemu_register_machine(&vexpress_a9_machine); - qemu_register_machine(&vexpress_a15_machine); + type_register_static(&vexpress_a9_info); + type_register_static(&vexpress_a15_info); } machine_init(vexpress_machine_init);