From patchwork Sat Aug 16 19:48:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Lackorzynski X-Patchwork-Id: 380502 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C4D121400A0 for ; Sun, 17 Aug 2014 05:49:10 +1000 (EST) Received: from localhost ([::1]:36502 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIjyP-000850-0E for incoming@patchwork.ozlabs.org; Sat, 16 Aug 2014 15:49:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIjxt-0007HP-FZ for qemu-devel@nongnu.org; Sat, 16 Aug 2014 15:48:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIjxh-00078g-3x for qemu-devel@nongnu.org; Sat, 16 Aug 2014 15:48:37 -0400 Received: from os.inf.tu-dresden.de ([2002:8d4c:3001:48::99]:37732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIjxg-000787-Ry for qemu-devel@nongnu.org; Sat, 16 Aug 2014 15:48:25 -0400 Received: from erwin.inf.tu-dresden.de ([141.76.48.80] helo=x) by os.inf.tu-dresden.de with esmtp (Exim 4.84) id 1XIjxf-0001zb-6T; Sat, 16 Aug 2014 21:48:23 +0200 From: Adam Lackorzynski To: qemu-devel@nongnu.org Date: Sat, 16 Aug 2014 21:48:20 +0200 Message-Id: <1408218501-22326-3-git-send-email-adam@os.inf.tu-dresden.de> X-Mailer: git-send-email 2.1.0.rc1 In-Reply-To: <1408218501-22326-1-git-send-email-adam@os.inf.tu-dresden.de> References: <1408218501-22326-1-git-send-email-adam@os.inf.tu-dresden.de> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2002:8d4c:3001:48::99 Cc: christoffer.dall@linaro.org Subject: [Qemu-devel] [PATCH 2/3] arm_gic: GICD_ICFGR: Write model only for pre v1 GICs 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 Setting the model is only available in pre-v1 GIC models. Acked-by: Christoffer Dall --- hw/intc/arm_gic.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index d2b1aaf..e546647 100644 --- a/hw/intc/arm_gic.c +++ b/hw/intc/arm_gic.c @@ -561,10 +561,12 @@ static void gic_dist_writeb(void *opaque, hwaddr offset, if (irq < GIC_INTERNAL) value |= 0xaa; for (i = 0; i < 4; i++) { - if (value & (1 << (i * 2))) { - GIC_SET_MODEL(irq + i); - } else { - GIC_CLEAR_MODEL(irq + i); + if (s->revision == REV_11MPCORE || s->revision == REV_NVIC) { + if (value & (1 << (i * 2))) { + GIC_SET_MODEL(irq + i); + } else { + GIC_CLEAR_MODEL(irq + i); + } } if (value & (2 << (i * 2))) { GIC_SET_EDGE_TRIGGER(irq + i);