From patchwork Thu Dec 11 23:29:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 42163 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DB39E26666 for ; Thu, 11 Dec 2014 23:33:05 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id x12sf4166703wgg.4 for ; Thu, 11 Dec 2014 15:33:05 -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=f8Dkx4QX6HdF5B2fMS1sJnygHw8JewHf/r+pTRGU/JI=; b=YKyKoUMO/LcghXdg17s939x6+4JW8L1PzLtEHIfEJBHd+aBit055JvK8uftVyV5CO0 +Bb/uI85MVgAe3fW6Imic2In4xwdrLZKwfZ5SlyLKJ7vHd9cjFPlisL4BRJ1eQhQ54nx cMiBTxDRVGWItH+C3GIpdXdQQ45Vv2ssCVsnkdUzdqO4u7551oqzlsRcXVCwU4Y2Dnzr OkdNEuV4bCHqO2+gF0t7xCKylDKFkTzmeNMRECbJqvUXCNnb2iu3jWfQ2RQsXlKd33Pg t5H7daR6MIBRz2n1X18tk3ztoxx4Pv9p8RfXmQis3uzaoKpF8pAuNKbIgL4hdWCD4I7a dsww== X-Gm-Message-State: ALoCoQkM87sybV1A9c1qkjXWnPVspVRRj7rgEq3bd1TGjHlUm/UlzviwCRCC9VWah6iokhpVcXVT X-Received: by 10.180.101.40 with SMTP id fd8mr206643wib.5.1418340785167; Thu, 11 Dec 2014 15:33:05 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.130 with SMTP id z2ls385238laa.49.gmail; Thu, 11 Dec 2014 15:33:04 -0800 (PST) X-Received: by 10.112.43.66 with SMTP id u2mr6050394lbl.35.1418340784914; Thu, 11 Dec 2014 15:33:04 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id wo4si2783926lbb.17.2014.12.11.15.33.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Dec 2014 15:33:04 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id f15so5615594lbj.9 for ; Thu, 11 Dec 2014 15:33:04 -0800 (PST) X-Received: by 10.112.235.164 with SMTP id un4mr2889434lbc.56.1418340784798; Thu, 11 Dec 2014 15:33:04 -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.142.69 with SMTP id ru5csp686425lbb; Thu, 11 Dec 2014 15:33:04 -0800 (PST) X-Received: by 10.224.37.5 with SMTP id v5mr25268937qad.25.1418340783508; Thu, 11 Dec 2014 15:33:03 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e8si3251536qas.10.2014.12.11.15.33.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 11 Dec 2014 15:33:03 -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]:54658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzDEE-00008j-HC for patch@linaro.org; Thu, 11 Dec 2014 18:33:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzDB9-0003tX-El for qemu-devel@nongnu.org; Thu, 11 Dec 2014 18:29:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzDB3-0000hy-1Q for qemu-devel@nongnu.org; Thu, 11 Dec 2014 18:29:51 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:45455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzDB2-0000hp-Ri for qemu-devel@nongnu.org; Thu, 11 Dec 2014 18:29:44 -0500 Received: by mail-pa0-f46.google.com with SMTP id lf10so5354071pab.5 for ; Thu, 11 Dec 2014 15:29:44 -0800 (PST) X-Received: by 10.70.102.234 with SMTP id fr10mr21211589pdb.145.1418340584174; Thu, 11 Dec 2014 15:29:44 -0800 (PST) Received: from gbellows-linaro.qualcomm.com (rrcs-67-52-129-61.west.biz.rr.com. [67.52.129.61]) by mx.google.com with ESMTPSA id ip1sm2362908pbc.0.2014.12.11.15.29.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Dec 2014 15:29:43 -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: Thu, 11 Dec 2014 17:29:16 -0600 Message-Id: <1418340569-30519-3-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1418340569-30519-1-git-send-email-greg.bellows@linaro.org> References: <1418340569-30519-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.220.46 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH v2 02/15] 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.178 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 Reviewed-by: Peter Maydell --- 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 01046c2..8f22696 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, @@ -735,27 +761,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);