From patchwork Mon Dec 15 18:51:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 42276 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 148F82456A for ; Mon, 15 Dec 2014 18:53:44 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id w7sf4087901lbi.0 for ; Mon, 15 Dec 2014 10:53:43 -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=n49LoaiZF15smIDNEJmw2Y57WOjsT78w9ViQZnbND1E=; b=EOWSoBU7vSgOIsvxAZyxTl2x0PJKzeji2+rIIi3JJ3z0btyJHvcWFzq0pmwOgKUOWV 7hA5HLFKaSNkE5ecawaJvvxa91ucIl4fO+dduRcOvVLAlA2vV2Yo7+qy8UNQuikSTyvs HplzplGanzpHlLZTIzLtKVps9uy/CqMQG/zgYa43FSRRaEMVpcLRIGWtInB3Z7GyMKAh MHR4z7ZZCvzw4ZofR06tk4WeFGB28kA6KGwGGo8H7XBMCijuLGCQ+j0a4/L+5to3hcM/ LPo8qupVCp/5s1CH4JsBG9qc/vovA7OmMIVyuC/cslvpXIHOh/k7qJOpWuXoLHRFMKJN tV+g== X-Gm-Message-State: ALoCoQmj/0DctX6FGV8xXaqUH8SfE4QrgmdT+YineqFOh61XQ4OcXUY5E81rowGh0uMmuJcLzsKL X-Received: by 10.112.40.71 with SMTP id v7mr278332lbk.20.1418669622956; Mon, 15 Dec 2014 10:53:42 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.226 with SMTP id kt2ls770157lac.52.gmail; Mon, 15 Dec 2014 10:53:42 -0800 (PST) X-Received: by 10.152.178.129 with SMTP id cy1mr14611633lac.53.1418669622725; Mon, 15 Dec 2014 10:53:42 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id s8si11252823lae.135.2014.12.15.10.53.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 10:53:42 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id 10so9754137lbg.15 for ; Mon, 15 Dec 2014 10:53:42 -0800 (PST) X-Received: by 10.152.37.7 with SMTP id u7mr7964700laj.74.1418669622588; Mon, 15 Dec 2014 10:53:42 -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 ru5csp808984lbb; Mon, 15 Dec 2014 10:53:41 -0800 (PST) X-Received: by 10.224.45.69 with SMTP id d5mr14485529qaf.56.1418669620917; Mon, 15 Dec 2014 10:53:40 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i5si7129540qab.44.2014.12.15.10.53.40 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 15 Dec 2014 10:53:40 -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]:41459 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0am4-00032O-0O for patch@linaro.org; Mon, 15 Dec 2014 13:53:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0ak5-0000J3-R6 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 1Y0ajy-0005rV-QI for qemu-devel@nongnu.org; Mon, 15 Dec 2014 13:51:37 -0500 Received: from mail-pd0-f177.google.com ([209.85.192.177]:59228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0ajy-0005rJ-LY for qemu-devel@nongnu.org; Mon, 15 Dec 2014 13:51:30 -0500 Received: by mail-pd0-f177.google.com with SMTP id ft15so12012950pdb.8 for ; Mon, 15 Dec 2014 10:51:29 -0800 (PST) X-Received: by 10.70.140.130 with SMTP id rg2mr51787123pdb.49.1418669489725; Mon, 15 Dec 2014 10:51:29 -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.28 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 10:51:28 -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:05 -0600 Message-Id: <1418669479-23908-2-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.177 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH v3 01/15] target-arm: Add vexpress class and machine types 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.170 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 Adds base Vexpress class and machine objects and infrastructure. This is in preparation for switching to the full QEMU object model. The base vexpress infrastructure is intended to handle common vexpress details. Signed-off-by: Greg Bellows Reviewed-by: Peter Maydell --- v1 -> v2 - Made the vexpress class abstract --- hw/arm/vexpress.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 7cbd13f..01046c2 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -157,6 +157,23 @@ static hwaddr motherboard_aseries_map[] = { typedef struct VEDBoardInfo VEDBoardInfo; +typedef struct { + MachineClass parent; + VEDBoardInfo *daughterboard; +} VexpressMachineClass; + +typedef struct { + MachineState parent; +} VexpressMachineState; + +#define TYPE_VEXPRESS_MACHINE "vexpress" +#define VEXPRESS_MACHINE(obj) \ + OBJECT_CHECK(VexpressMachineState, (obj), TYPE_VEXPRESS_MACHINE) +#define VEXPRESS_MACHINE_GET_CLASS(obj) \ + OBJECT_GET_CLASS(VexpressMachineClass, obj, TYPE_VEXPRESS_MACHINE) +#define VEXPRESS_MACHINE_CLASS(klass) \ + OBJECT_CLASS_CHECK(VexpressMachineClass, klass, TYPE_VEXPRESS_MACHINE) + typedef void DBoardInitFn(const VEDBoardInfo *daughterboard, ram_addr_t ram_size, const char *cpu_model, @@ -681,6 +698,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); @@ -691,6 +715,26 @@ 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->block_default_type = IF_SCSI; + mc->max_cpus = 4; +} + +static const TypeInfo vexpress_info = { + .name = TYPE_VEXPRESS_MACHINE, + .parent = TYPE_MACHINE, + .abstract = true, + .instance_size = sizeof(VexpressMachineState), + .class_size = sizeof(VexpressMachineClass), + .class_init = vexpress_class_init, +}; + static QEMUMachine vexpress_a9_machine = { .name = "vexpress-a9", .desc = "ARM Versatile Express for Cortex-A9", @@ -709,6 +753,7 @@ static QEMUMachine vexpress_a15_machine = { static void vexpress_machine_init(void) { + type_register_static(&vexpress_info); qemu_register_machine(&vexpress_a9_machine); qemu_register_machine(&vexpress_a15_machine); }