From patchwork Mon Dec 15 18:51:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 42275 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DB17E2456A for ; Mon, 15 Dec 2014 18:53:28 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id d49sf7949577eek.0 for ; Mon, 15 Dec 2014 10:53:28 -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=2mmctGSJ/kUcK8bR1l2U5X5bLuoqzFdoJu40P0xmD0s=; b=WlfVjxYq5b48ToT8yRprQylKeqFqy6FBt94ZZU7E4OaKR2l62Yz4bVCyREwu9L369r 7BNa4bIXE1n2WhHJVmj9/d2IjmXJcUbwaAdxdiq01myza0u+LJhw0XNPliGjnLy573jG vk4UwyGnWvEEy1sJ13cE9B5mUtSQpVnJiPf2Bx+0yW+oyja4wiRrTGDJx9SieUWOaDzH iGdyyk7q+rUJBVufwlJXmwArGRJQOEYdTZclLuatTUOb84z8E0Kt5O5sPYdGp/S70fv3 5EAoCUkw6+m/WA1wL4UpSaxj3mQieJIZRIK0xBTZm3uEVSIU42m/nLP0fv51bnFmEiyj V27A== X-Gm-Message-State: ALoCoQm+6vEAjGriuAlCUKIeVnX3ZzFOJSE4g0TyewvMA0d9FJ6a+P0NtD2FHLJ2iVbKLHCo8Nz0 X-Received: by 10.194.173.97 with SMTP id bj1mr4982782wjc.2.1418669608069; Mon, 15 Dec 2014 10:53:28 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.99 with SMTP id s3ls442426lag.79.gmail; Mon, 15 Dec 2014 10:53:27 -0800 (PST) X-Received: by 10.112.157.104 with SMTP id wl8mr18395363lbb.96.1418669607883; Mon, 15 Dec 2014 10:53:27 -0800 (PST) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id cy4si11354196lac.4.2014.12.15.10.53.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 10:53:27 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id pv20so9703622lab.41 for ; Mon, 15 Dec 2014 10:53:27 -0800 (PST) X-Received: by 10.112.14.6 with SMTP id l6mr9046071lbc.91.1418669607797; Mon, 15 Dec 2014 10:53:27 -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 ru5csp808925lbb; Mon, 15 Dec 2014 10:53:27 -0800 (PST) X-Received: by 10.140.88.48 with SMTP id s45mr5235858qgd.28.1418669606344; Mon, 15 Dec 2014 10:53:26 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id w81si11568415qge.81.2014.12.15.10.53.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 15 Dec 2014 10:53:26 -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]:41457 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0alp-0002e8-Fb for patch@linaro.org; Mon, 15 Dec 2014 13:53:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0ak6-0000JZ-1b for qemu-devel@nongnu.org; Mon, 15 Dec 2014 13:51:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0ak0-0005ro-05 for qemu-devel@nongnu.org; Mon, 15 Dec 2014 13:51:37 -0500 Received: from mail-pd0-f169.google.com ([209.85.192.169]:40302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0ajz-0005rc-RL for qemu-devel@nongnu.org; Mon, 15 Dec 2014 13:51:31 -0500 Received: by mail-pd0-f169.google.com with SMTP id z10so12288108pdj.0 for ; Mon, 15 Dec 2014 10:51:31 -0800 (PST) X-Received: by 10.70.50.41 with SMTP id z9mr53742429pdn.31.1418669491227; Mon, 15 Dec 2014 10:51:31 -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 bq7sm9972513pdb.50.2014.12.15.10.51.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 10:51:30 -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: Mon, 15 Dec 2014 12:51:06 -0600 Message-Id: <1418669479-23908-3-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1418669479-23908-1-git-send-email-greg.bellows@linaro.org> References: <1418669479-23908-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.192.169 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH v3 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.215.54 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);