From patchwork Fri May 29 11:01:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 49161 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1CC63218E7 for ; Fri, 29 May 2015 11:01:54 +0000 (UTC) Received: by laat2 with SMTP id t2sf19354005laa.2 for ; Fri, 29 May 2015 04:01:53 -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=MTLGGDS4oTO4qNYoDGoi389QuHZo+vVWadAEnaCReoA=; b=Rhyt4tDkZhT8JEhyAmYdw8yx4sukjT0YkoeSGhxkMvOdky4vNg7PF8+CLKxAac2x0L Kc2WPb9U/VR7AbjqWorqhoAAH+Au/gs6CGPIMN/VFPLPmTVO7SYs/zPtrBzrynFSRoXV 4ugy+iuVeNz2rCeTVG14k4QglM57pCEBuN45P7UGCaAky0+bTg1yKE2Nwia6BvOrDWuJ fBQS+K81OVYf+cxV5yvpaTUPifZ0C98DT5c5wLHO++dS9VMSjGsRO6n5EeE8TTTaxw7R LAFPWqalcZhnZOeYOsD/Mvg9X2f4gBLPERkhioF4wr6OgvD303mh+TKQFPDLPTkOkt2p OxiA== X-Gm-Message-State: ALoCoQm3VVDaHufR6EKrK/cisKVLDJvUbTI/y7ODEPOAuAIrF1H7s4Eod5YTXHIcFnXGqpvfrKQR X-Received: by 10.112.166.137 with SMTP id zg9mr6900445lbb.11.1432897312932; Fri, 29 May 2015 04:01:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.36 with SMTP id t4ls338800lal.99.gmail; Fri, 29 May 2015 04:01:52 -0700 (PDT) X-Received: by 10.112.25.69 with SMTP id a5mr7384080lbg.16.1432897312790; Fri, 29 May 2015 04:01:52 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id aa12si4418090lbd.30.2015.05.29.04.01.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 04:01:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by labko7 with SMTP id ko7so49281315lab.2 for ; Fri, 29 May 2015 04:01:52 -0700 (PDT) X-Received: by 10.152.29.34 with SMTP id g2mr7370836lah.73.1432897312336; Fri, 29 May 2015 04:01:52 -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.108.230 with SMTP id hn6csp220808lbb; Fri, 29 May 2015 04:01:51 -0700 (PDT) X-Received: by 10.229.30.8 with SMTP id s8mr9125116qcc.31.1432897310767; Fri, 29 May 2015 04:01:50 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id gu9si5249469qcb.24.2015.05.29.04.01.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 29 May 2015 04:01:50 -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]:35042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyI2v-00023s-SU for patch@linaro.org; Fri, 29 May 2015 07:01:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyI22-000155-Df for qemu-devel@nongnu.org; Fri, 29 May 2015 07:00:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyI1w-0001ZG-9K for qemu-devel@nongnu.org; Fri, 29 May 2015 07:00:54 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:33529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyI1v-0001Z1-NU for qemu-devel@nongnu.org; Fri, 29 May 2015 07:00:47 -0400 Received: by lbcue7 with SMTP id ue7so46016905lbc.0 for ; Fri, 29 May 2015 04:00:47 -0700 (PDT) X-Received: by 10.112.213.108 with SMTP id nr12mr7468766lbc.42.1432897247001; Fri, 29 May 2015 04:00:47 -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 zf3sm1319671lbb.2.2015.05.29.04.00.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 May 2015 04:00:46 -0700 (PDT) From: Christoffer Dall To: qemu-devel@nongnu.org Date: Fri, 29 May 2015 13:01:09 +0200 Message-Id: <1432897270-7780-4-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1432897270-7780-1-git-send-email-christoffer.dall@linaro.org> References: <1432897270-7780-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.217.179 Cc: Christoffer Dall , kvmarm@lists.cs.columbia.edu, shankerd@codeaurora.org, eric.auger@linaro.org Subject: [Qemu-devel] [PATCH v4 3/4] target-arm: Extend the gic node properties 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.53 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 In preparation for adding the GICv2m which requires address specifiers and is a subnode of the gic, we extend the gic DT definition to specify the #address-cells and #size-cells properties and add an empty ranges property properties of the DT node, since this is required to add the v2m node as a child of the gic node. Note that we must also expand the irq-map to reference the gic with the right address-cells as a consequence of this change. Reviewed-by: Eric Auger Suggested-by: Shanker Donthineni Signed-off-by: Christoffer Dall --- Changes since v3: - Rewrote patch and changed authorship and tags accordingly - Fixed spelling in commit message Changes since v2: - New separate patch factoring out changes to existing code for eased bisectability in case we broke something - The above fixes the issue with non-MSI compatible guests. hw/arm/virt.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index e5235ef..387dac8 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -317,6 +317,9 @@ static void fdt_add_gic_node(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", "#address-cells", 0x2); + qemu_fdt_setprop_cell(vbi->fdt, "/intc", "#size-cells", 0x2); + qemu_fdt_setprop(vbi->fdt, "/intc", "ranges", NULL, 0); qemu_fdt_setprop_cell(vbi->fdt, "/intc", "phandle", vbi->gic_phandle); } @@ -585,7 +588,7 @@ static void create_pcie_irq_map(const VirtBoardInfo *vbi, uint32_t gic_phandle, int first_irq, const char *nodename) { int devfn, pin; - uint32_t full_irq_map[4 * 4 * 8] = { 0 }; + uint32_t full_irq_map[4 * 4 * 10] = { 0 }; uint32_t *irq_map = full_irq_map; for (devfn = 0; devfn <= 0x18; devfn += 0x8) { @@ -598,13 +601,13 @@ static void create_pcie_irq_map(const VirtBoardInfo *vbi, uint32_t gic_phandle, uint32_t map[] = { devfn << 8, 0, 0, /* devfn */ pin + 1, /* PCI pin */ - gic_phandle, irq_type, irq_nr, irq_level }; /* GIC irq */ + gic_phandle, 0, 0, irq_type, irq_nr, irq_level }; /* GIC irq */ /* Convert map to big endian */ - for (i = 0; i < 8; i++) { + for (i = 0; i < 10; i++) { irq_map[i] = cpu_to_be32(map[i]); } - irq_map += 8; + irq_map += 10; } }