From patchwork Wed Apr 8 21:20:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 46893 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1E77D20D10 for ; Wed, 8 Apr 2015 21:22:06 +0000 (UTC) Received: by layy10 with SMTP id y10sf22736184lay.0 for ; Wed, 08 Apr 2015 14:22:05 -0700 (PDT) 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=vQq0Q6aJZzSrhlN9GTq6zqQnvqwD+lM97YJ4/bChdjo=; b=RkYyg/qiBat2XEB4+8oUoZrRixExpLVAHsSzHq937VMghgvESsKCoPA9C3yj3L4DGD 7M9thgcJJn7j0iPKw+jy8Iv2VD7Np+f6KV3CeBPzgI0LV3D73zjFUVa4IBjQJHBDgSzP K3qqdIRnv1XQTBELV/B1G+oX1IKSBlxcymHcLc1NOzttxcMiaPcJMXwH75pMjiKeUOP1 ToLvjjSg0CS5tTnvsobVX7K79kxN0egAs9FoGizmOmAmSiBHQ1rFIhHmUf5JmmahGZ6W Q6xmPAydPpqwc9q1DL75NDYB3kkB3R9WBmDT16MYxrAWxGVqkxAo+9MNCCl9dJrgOBia cP5g== X-Gm-Message-State: ALoCoQkMBW7k1tRrEHjPto8R7YGtmPjAbx15LDa+41S4vFmZPHQVOyYo7dlogzKrxX7RWj0j8zMK X-Received: by 10.112.98.38 with SMTP id ef6mr5304142lbb.3.1428528124968; Wed, 08 Apr 2015 14:22:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.200 with SMTP id d8ls230376laa.34.gmail; Wed, 08 Apr 2015 14:22:04 -0700 (PDT) X-Received: by 10.112.8.101 with SMTP id q5mr25300247lba.19.1428528124828; Wed, 08 Apr 2015 14:22:04 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id ks12si9632805lac.38.2015.04.08.14.22.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Apr 2015 14:22:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by laat2 with SMTP id t2so68718725laa.1 for ; Wed, 08 Apr 2015 14:22:04 -0700 (PDT) X-Received: by 10.152.116.11 with SMTP id js11mr1480115lab.106.1428528124745; Wed, 08 Apr 2015 14:22:04 -0700 (PDT) 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.67.65 with SMTP id l1csp98265lbt; Wed, 8 Apr 2015 14:22:04 -0700 (PDT) X-Received: by 10.140.41.169 with SMTP id z38mr31895274qgz.56.1428528123475; Wed, 08 Apr 2015 14:22:03 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o8si12297556qcq.18.2015.04.08.14.22.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 08 Apr 2015 14:22:03 -0700 (PDT) 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]:54909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfxQA-00038t-Jz for patch@linaro.org; Wed, 08 Apr 2015 17:22:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfxPP-0002Jd-Ps for qemu-devel@nongnu.org; Wed, 08 Apr 2015 17:21:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YfxPJ-0005Db-0O for qemu-devel@nongnu.org; Wed, 08 Apr 2015 17:21:15 -0400 Received: from mail-la0-f50.google.com ([209.85.215.50]:33110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfxPI-0005DI-Lf for qemu-devel@nongnu.org; Wed, 08 Apr 2015 17:21:08 -0400 Received: by layy10 with SMTP id y10so75793523lay.0 for ; Wed, 08 Apr 2015 14:21:08 -0700 (PDT) X-Received: by 10.152.116.102 with SMTP id jv6mr1441568lab.50.1428528068061; Wed, 08 Apr 2015 14:21:08 -0700 (PDT) Received: from localhost.localdomain (188-178-240-98-static.dk.customer.tdc.net. [188.178.240.98]) by mx.google.com with ESMTPSA id ba4sm2709491lab.31.2015.04.08.14.21.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Apr 2015 14:21:07 -0700 (PDT) From: Christoffer Dall To: qemu-devel@nongnu.org Date: Wed, 8 Apr 2015 23:20:58 +0200 Message-Id: <1428528060-17896-2-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1428528060-17896-1-git-send-email-christoffer.dall@linaro.org> References: <1428528060-17896-1-git-send-email-christoffer.dall@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.50 Cc: Christoffer Dall , eric.auger@linaro.org Subject: [Qemu-devel] [PATCH 1/3] target-arm: Add GIC phandle to VirtBoardInfo 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: christoffer.dall@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.48 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 Instead of passing the GIC phandle around between functions, add it to the VirtBoardInfo just like we do for the clock_phandle. We are about to add the v2m phandle as well, and it's easier not having to pass around a bunch of phandles, return multiple values from functions, etc. Signed-off-by: Christoffer Dall Reviewed-by: Peter Maydell --- hw/arm/virt.c | 26 +++++++++++--------------- pixman | 2 +- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index febff22..e01676a 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -87,6 +87,7 @@ typedef struct VirtBoardInfo { void *fdt; int fdt_size; uint32_t clock_phandle; + uint32_t gic_phandle; } VirtBoardInfo; typedef struct { @@ -322,12 +323,11 @@ static void fdt_add_cpu_nodes(const VirtBoardInfo *vbi) } } -static uint32_t fdt_add_gic_node(const VirtBoardInfo *vbi) +static void fdt_add_gic_node(VirtBoardInfo *vbi) { - uint32_t gic_phandle; - gic_phandle = qemu_fdt_alloc_phandle(vbi->fdt); - qemu_fdt_setprop_cell(vbi->fdt, "/", "interrupt-parent", gic_phandle); + vbi->gic_phandle = qemu_fdt_alloc_phandle(vbi->fdt); + qemu_fdt_setprop_cell(vbi->fdt, "/", "interrupt-parent", vbi->gic_phandle); qemu_fdt_add_subnode(vbi->fdt, "/intc"); /* 'cortex-a15-gic' means 'GIC v2' */ @@ -340,12 +340,10 @@ static uint32_t fdt_add_gic_node(const VirtBoardInfo *vbi) 2, vbi->memmap[VIRT_GIC_DIST].size, 2, vbi->memmap[VIRT_GIC_CPU].base, 2, vbi->memmap[VIRT_GIC_CPU].size); - qemu_fdt_setprop_cell(vbi->fdt, "/intc", "phandle", gic_phandle); - - return gic_phandle; + qemu_fdt_setprop_cell(vbi->fdt, "/intc", "phandle", vbi->gic_phandle); } -static uint32_t create_gic(const VirtBoardInfo *vbi, qemu_irq *pic) +static void create_gic(VirtBoardInfo *vbi, qemu_irq *pic) { /* We create a standalone GIC v2 */ DeviceState *gicdev; @@ -392,7 +390,7 @@ static uint32_t create_gic(const VirtBoardInfo *vbi, qemu_irq *pic) pic[i] = qdev_get_gpio_in(gicdev, i); } - return fdt_add_gic_node(vbi); + fdt_add_gic_node(vbi); } static void create_uart(const VirtBoardInfo *vbi, qemu_irq *pic) @@ -639,8 +637,7 @@ static void create_pcie_irq_map(const VirtBoardInfo *vbi, uint32_t gic_phandle, 0x7 /* PCI irq */); } -static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic, - uint32_t gic_phandle) +static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic) { hwaddr base = vbi->memmap[VIRT_PCIE].base; hwaddr size = vbi->memmap[VIRT_PCIE].size; @@ -712,7 +709,7 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic, 2, base_mmio, 2, size_mmio); qemu_fdt_setprop_cell(vbi->fdt, nodename, "#interrupt-cells", 1); - create_pcie_irq_map(vbi, gic_phandle, irq, nodename); + create_pcie_irq_map(vbi, vbi->gic_phandle, irq, nodename); g_free(nodename); } @@ -734,7 +731,6 @@ static void machvirt_init(MachineState *machine) MemoryRegion *ram = g_new(MemoryRegion, 1); const char *cpu_model = machine->cpu_model; VirtBoardInfo *vbi; - uint32_t gic_phandle; char **cpustr; if (!cpu_model) { @@ -812,13 +808,13 @@ static void machvirt_init(MachineState *machine) create_flash(vbi); - gic_phandle = create_gic(vbi, pic); + create_gic(vbi, pic); create_uart(vbi, pic); create_rtc(vbi, pic); - create_pcie(vbi, pic, gic_phandle); + create_pcie(vbi, pic); /* Create mmio transports, so the user can create virtio backends * (which will be automatically plugged in to the transports). If diff --git a/pixman b/pixman index 87eea99..97336fa 160000 --- a/pixman +++ b/pixman @@ -1 +1 @@ -Subproject commit 87eea99e443b389c978cf37efc52788bf03a0ee0 +Subproject commit 97336fad32acf802003855cd8bd6477fa49a12e3