From patchwork Thu Apr 12 08:13:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Voevodin X-Patchwork-Id: 151997 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7D897B7069 for ; Thu, 12 Apr 2012 18:13:45 +1000 (EST) Received: from localhost ([::1]:38602 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIF9z-0004yE-6x for incoming@patchwork.ozlabs.org; Thu, 12 Apr 2012 04:13:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIF9l-0004x4-BG for qemu-devel@nongnu.org; Thu, 12 Apr 2012 04:13:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SIF9a-00007s-DG for qemu-devel@nongnu.org; Thu, 12 Apr 2012 04:13:28 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:53740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIF9a-00007D-7d for qemu-devel@nongnu.org; Thu, 12 Apr 2012 04:13:18 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: TEXT/PLAIN Received: from euspt1 ([210.118.77.13]) by mailout3.w1.samsung.com (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0M2C0019ZXHGQN60@mailout3.w1.samsung.com> for qemu-devel@nongnu.org; Thu, 12 Apr 2012 09:12:52 +0100 (BST) Received: from evvoevodinPC.rnd.samsung.ru ([106.109.9.191]) by spt1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M2C001BZXHW60@spt1.w1.samsung.com> for qemu-devel@nongnu.org; Thu, 12 Apr 2012 09:13:14 +0100 (BST) Date: Thu, 12 Apr 2012 12:13:00 +0400 From: Evgeny Voevodin In-reply-to: <1334218381-4208-1-git-send-email-e.voevodin@samsung.com> To: qemu-devel@nongnu.org Message-id: <1334218381-4208-2-git-send-email-e.voevodin@samsung.com> X-Mailer: git-send-email 1.7.5.4 References: <1334218381-4208-1-git-send-email-e.voevodin@samsung.com> X-detected-operating-system: by eggs.gnu.org: Solaris 9.1 X-Received-From: 210.118.77.13 Cc: peter.maydell@linaro.org, i.mitsyanko@samsung.com, Evgeny Voevodin , kyungmin.park@samsung.com, d.solodkiy@samsung.com, m.kozlov@samsung.com Subject: [Qemu-devel] [PATCH v2 1/2] hw/exynos4210.c: Access gate_irq by using group size. 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 New EXYNOS4210_IRQ_GATE_GROUP_SIZE introduced and EXYNOS4210_IRQ_GATE_NINPUTS changed from 8 to 4, because having 8 inputs makes an input group of size 4 and access to second's group first input leads to pass it into third instead of second output of gate. Signed-off-by: Evgeny Voevodin --- hw/exynos4210.c | 6 ++++-- hw/exynos4210.h | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/exynos4210.c b/hw/exynos4210.c index f904370..5e30387 100644 --- a/hw/exynos4210.c +++ b/hw/exynos4210.c @@ -116,7 +116,8 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem, busdev = sysbus_from_qdev(dev); sysbus_mmio_map(busdev, 0, EXYNOS4210_SMP_PRIVATE_BASE_ADDR); for (n = 0; n < EXYNOS4210_NCPUS; n++) { - sysbus_connect_irq(busdev, n, gate_irq[n * 2]); + sysbus_connect_irq(busdev, n, gate_irq[n * + EXYNOS4210_IRQ_GATE_GROUP_SIZE]); } for (n = 0; n < EXYNOS4210_INT_GIC_NIRQ; n++) { s->irqs.int_gic_irq[n] = qdev_get_gpio_in(dev, n); @@ -135,7 +136,8 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem, /* Map Distributer interface */ sysbus_mmio_map(busdev, 1, EXYNOS4210_EXT_GIC_DIST_BASE_ADDR); for (n = 0; n < EXYNOS4210_NCPUS; n++) { - sysbus_connect_irq(busdev, n, gate_irq[n * 2 + 1]); + sysbus_connect_irq(busdev, n, gate_irq[n * + EXYNOS4210_IRQ_GATE_GROUP_SIZE + 1]); } for (n = 0; n < EXYNOS4210_EXT_GIC_NIRQ; n++) { s->irqs.ext_gic_irq[n] = qdev_get_gpio_in(dev, n); diff --git a/hw/exynos4210.h b/hw/exynos4210.h index c112e03..cb5aafb 100644 --- a/hw/exynos4210.h +++ b/hw/exynos4210.h @@ -56,7 +56,9 @@ /* * exynos4210 IRQ subsystem stub definitions. */ -#define EXYNOS4210_IRQ_GATE_NINPUTS 8 +#define EXYNOS4210_IRQ_GATE_NINPUTS 4 +#define EXYNOS4210_IRQ_GATE_GROUP_SIZE (EXYNOS4210_IRQ_GATE_NINPUTS / \ + EXYNOS4210_NCPUS) #define EXYNOS4210_MAX_INT_COMBINER_OUT_IRQ 64 #define EXYNOS4210_MAX_EXT_COMBINER_OUT_IRQ 16