From patchwork Thu Dec 11 23:29:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 420301 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8E8CC14009B for ; Fri, 12 Dec 2014 10:36:24 +1100 (AEDT) Received: from localhost ([::1]:54690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzDHS-0006Jh-Ga for incoming@patchwork.ozlabs.org; Thu, 11 Dec 2014 18:36:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzDBD-0003tb-KG for qemu-devel@nongnu.org; Thu, 11 Dec 2014 18:30:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzDB5-0000iZ-H5 for qemu-devel@nongnu.org; Thu, 11 Dec 2014 18:29:55 -0500 Received: from mail-pd0-f172.google.com ([209.85.192.172]:35626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzDB5-0000iS-Bq for qemu-devel@nongnu.org; Thu, 11 Dec 2014 18:29:47 -0500 Received: by mail-pd0-f172.google.com with SMTP id y13so5915225pdi.31 for ; Thu, 11 Dec 2014 15:29:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=O4cNq4+IqD1yWDLZS/3acCc41UHrDWI9BCqcwbwZhWo=; b=O0Ln5YOOhAs89un+u56O43mwJ5qGf/+xzb4C4uB6dTYssDgx8KNsBuLux9Hsixr+Ec IDZwlVPmtef8iedE6vUt2LjVRsATwSedD0mZqySCSUmR97awhmNYj5BAcmCJ4X7v7D58 EqpvkccLNcEpqLjR5qY2cbXkUaMbbvL5RsJ5tP9BWjaRsef4IuOhM1m4zGC4aOOORud4 s87h/p7qEUf4bHZjIGZRMN0o0/DQM3zlflla5HaIkUCZ+nyetmmFXHccQLEQxDnQtlxC kOXZ7ufcpAPEq+w+9SK6WyTPraDE/xtBX3cOyYAgkkxgfLBjVokOSSzTWTq7q3M1y4li 6Nfw== X-Gm-Message-State: ALoCoQm4JQJmpSYmoQCgWA0T4Wgb2x/VFDeiW3s7FJGZrg4CfdcLr8U8JWmbDMWQ2zau0mEEILUk X-Received: by 10.66.182.130 with SMTP id ee2mr21733577pac.22.1418340585793; Thu, 11 Dec 2014 15:29:45 -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.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Dec 2014 15:29:45 -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:17 -0600 Message-Id: <1418340569-30519-4-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.192.172 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH v2 03/15] target-arm: Switch to common vexpress machine init 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Switched the Vexpress machine initialization to use the common function with the machine pointer to board info. Signed-off-by: Greg Bellows Reviewed-by: Peter Maydell --- hw/arm/vexpress.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 8f22696..a03cb52 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -532,9 +532,10 @@ static pflash_t *ve_pflash_cfi01_register(hwaddr base, const char *name, return OBJECT_CHECK(pflash_t, (dev), "cfi.pflash01"); } -static void vexpress_common_init(VEDBoardInfo *daughterboard, - MachineState *machine) +static void vexpress_common_init(MachineState *machine) { + VexpressMachineClass *vmc = VEXPRESS_MACHINE_GET_CLASS(machine); + VEDBoardInfo *daughterboard = vmc->daughterboard;; DeviceState *dev, *sysctl, *pl041; qemu_irq pic[64]; uint32_t sys_id; @@ -700,30 +701,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); -} - -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->init = vexpress_common_init; mc->block_default_type = IF_SCSI; mc->max_cpus = 4; } @@ -735,7 +719,6 @@ static void vexpress_a9_class_init(ObjectClass *oc, void *data) mc->name = TYPE_VEXPRESS_A9_MACHINE; mc->desc = "ARM Versatile Express for Cortex-A9"; - mc->init = vexpress_a9_init; vmc->daughterboard = &a9_daughterboard;; } @@ -747,7 +730,6 @@ static void vexpress_a15_class_init(ObjectClass *oc, void *data) mc->name = TYPE_VEXPRESS_A15_MACHINE; mc->desc = "ARM Versatile Express for Cortex-A15"; - mc->init = vexpress_a15_init; vmc->daughterboard = &a15_daughterboard; }