From patchwork Mon Dec 15 23:09:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 42294 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CC2D126C6C for ; Mon, 15 Dec 2014 23:11:40 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id bs8sf4197365wib.2 for ; Mon, 15 Dec 2014 15:11:40 -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=SPejXGVYIAdCY03bpVEr1S33eEo2W6X8/3w6Y0RpsJGYVhCWotMs4G45wX4e5uQb0L SxctgycSyvlrl2mFpw0UenpbtjkIsZMiaINAveT57wes5lutud3IIpV245RxvOMh0u4m cofdcSf9iegmP0PJ/eJ1CwKTbh9MqV3ZDYj9INzK4ybk79H6YvjJBXD6mrhiujt5pNk8 be7tfUBEomZb3AGJcaYDYWzBGEUm/8ddujpJshcqqTmnKGGST13KY2HXNGUxbfylNDH/ i+A42n+scM4hcH/KQrnwqnZ57Ko5RwkbiXNHR7ZO0kznw7zEMbdP3YU+0d2el7THoA7M TrNw== X-Gm-Message-State: ALoCoQnH3CHnvlSbX2UqbpVbtwNJGl2hiJ9A8XBIqEGw1YRgpmpZXEJKeycZlnUvMsjSbzisCSG2 X-Received: by 10.112.55.10 with SMTP id n10mr8530lbp.14.1418685099880; Mon, 15 Dec 2014 15:11:39 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.98 with SMTP id lf2ls739350lac.16.gmail; Mon, 15 Dec 2014 15:11:39 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr32265675lbo.32.1418685099572; Mon, 15 Dec 2014 15:11:39 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id xc4si11807254lbb.82.2014.12.15.15.11.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 15:11:39 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id p9so10059338lbv.0 for ; Mon, 15 Dec 2014 15:11:39 -0800 (PST) X-Received: by 10.112.136.69 with SMTP id py5mr18909580lbb.56.1418685099129; Mon, 15 Dec 2014 15:11:39 -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 ru5csp866139lbb; Mon, 15 Dec 2014 15:11:38 -0800 (PST) X-Received: by 10.224.13.145 with SMTP id c17mr60852276qaa.96.1418685094578; Mon, 15 Dec 2014 15:11:34 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id w13si12430192qay.50.2014.12.15.15.11.33 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 15 Dec 2014 15:11:34 -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]:42304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0enc-0004WG-4I for patch@linaro.org; Mon, 15 Dec 2014 18:11:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0emI-0003Ws-Oh for qemu-devel@nongnu.org; Mon, 15 Dec 2014 18:10:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0emC-0000Tz-Nu for qemu-devel@nongnu.org; Mon, 15 Dec 2014 18:10:10 -0500 Received: from mail-pd0-f174.google.com ([209.85.192.174]:52164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0emC-0000T2-Hb for qemu-devel@nongnu.org; Mon, 15 Dec 2014 18:10:04 -0500 Received: by mail-pd0-f174.google.com with SMTP id fp1so12602124pdb.33 for ; Mon, 15 Dec 2014 15:10:04 -0800 (PST) X-Received: by 10.66.121.230 with SMTP id ln6mr758978pab.82.1418685004038; Mon, 15 Dec 2014 15:10:04 -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.02 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 15:10:03 -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:38 -0600 Message-Id: <1418684992-8996-2-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.174 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH v4 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.169 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); }