From patchwork Mon Dec 15 23:09:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 42297 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 486F126C6C for ; Mon, 15 Dec 2014 23:13:48 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id p9sf7889083lbv.9 for ; Mon, 15 Dec 2014 15:13:47 -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=jqrKs4EH0Tk4yGImpPQn6+5CVxgZpQx4fHw41QcnUqdljmqjJNHDdsEIJW97yz4r1P gs/J1iJCbdtUIDc+oXxKuLO6NPvZnL/6UWI1bQl9K6V66lwK7hQ+OErtz+nioM/Br2iG Iq1NpJsgriyNJZKIEmsIkqZe8xo4JOWt/1NmSPF3dR03RZ2PFVOqt/CHdjhuTfCPZiYE OPwQ7CXgRId9gNOo4BLU3o2/1mJYEvCnrigKi3JVlkBnAr3gyfAU0H6mJQjF3j6vW7VG KrORIyg3Bts6ZlRyBkgBqPVfHx33Inx/a05GotlCTcy2wkKHlC0B1ivFTyUCsi7TiURB riMQ== X-Gm-Message-State: ALoCoQmm/sl/C7QNrQpBBs8OXQt8xNL5otcPu1kxrjlD0YuPEm48VUopo5J3XxxDxN0aMQrgZQTY X-Received: by 10.112.138.234 with SMTP id qt10mr5133247lbb.4.1418685227185; Mon, 15 Dec 2014 15:13:47 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.229 with SMTP id e5ls184902laa.105.gmail; Mon, 15 Dec 2014 15:13:46 -0800 (PST) X-Received: by 10.152.44.167 with SMTP id f7mr33175125lam.30.1418685226857; Mon, 15 Dec 2014 15:13:46 -0800 (PST) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id b9si11825958lah.61.2014.12.15.15.13.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 15:13:46 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id hs14so10190892lab.39 for ; Mon, 15 Dec 2014 15:13:46 -0800 (PST) X-Received: by 10.152.234.35 with SMTP id ub3mr33018807lac.70.1418685226762; Mon, 15 Dec 2014 15:13:46 -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 ru5csp866580lbb; Mon, 15 Dec 2014 15:13:45 -0800 (PST) X-Received: by 10.140.83.169 with SMTP id j38mr56652796qgd.99.1418685224993; Mon, 15 Dec 2014 15:13:44 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id q5si12348550qal.127.2014.12.15.15.13.44 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 15 Dec 2014 15:13:44 -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]:42321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0epj-000851-SG for patch@linaro.org; Mon, 15 Dec 2014 18:13:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0emK-0003Wu-2H for qemu-devel@nongnu.org; Mon, 15 Dec 2014 18:10:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0emE-0000Xt-58 for qemu-devel@nongnu.org; Mon, 15 Dec 2014 18:10:12 -0500 Received: from mail-pd0-f176.google.com ([209.85.192.176]:62390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0emD-0000X0-Vb for qemu-devel@nongnu.org; Mon, 15 Dec 2014 18:10:06 -0500 Received: by mail-pd0-f176.google.com with SMTP id r10so10583700pdi.7 for ; Mon, 15 Dec 2014 15:10:05 -0800 (PST) X-Received: by 10.67.3.165 with SMTP id bx5mr55488361pad.59.1418685005587; Mon, 15 Dec 2014 15:10:05 -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 uq15sm10402467pab.8.2014.12.15.15.10.04 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 15:10:04 -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 17:09:39 -0600 Message-Id: <1418684992-8996-3-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1418684992-8996-1-git-send-email-greg.bellows@linaro.org> References: <1418684992-8996-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.176 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH v4 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.52 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);