From patchwork Sun Nov 6 19:14:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jean-Christophe Dubois X-Patchwork-Id: 123958 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2F3A0B6F7B for ; Mon, 7 Nov 2011 06:14:31 +1100 (EST) Received: from localhost ([::1]:44587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RN8Aj-00018i-30 for incoming@patchwork.ozlabs.org; Sun, 06 Nov 2011 14:14:25 -0500 Received: from eggs.gnu.org ([140.186.70.92]:50073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RN8Ae-00018d-BZ for qemu-devel@nongnu.org; Sun, 06 Nov 2011 14:14:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RN8Ac-0007pA-Ne for qemu-devel@nongnu.org; Sun, 06 Nov 2011 14:14:20 -0500 Received: from smtp4-g21.free.fr ([212.27.42.4]:39542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RN8Ac-0007ov-2Q for qemu-devel@nongnu.org; Sun, 06 Nov 2011 14:14:18 -0500 Received: from localhost.localdomain (unknown [78.235.240.156]) by smtp4-g21.free.fr (Postfix) with ESMTP id C12864C8262; Sun, 6 Nov 2011 20:14:11 +0100 (CET) From: Jean-Christophe DUBOIS To: qemu-devel@nongnu.org Date: Sun, 6 Nov 2011 20:14:03 +0100 Message-Id: <1320606843-13329-1-git-send-email-jcd@tribudubois.net> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 212.27.42.4 Cc: peter.maydell@linaro.org, paul@codesourcery.com, Jean-Christophe DUBOIS Subject: [Qemu-devel] [PATCH v3] hw/arm_sysctl: Fix RESETCTL for realview-pb-a8 and -pbx-a9 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 Depending on the considered baseboard the bit used to reset the platform is different. Here is the list of considered Realview/Versatile platforms: Realview/Versatile AB for ARM926EJ-S: BOARD_ID = 0x100 = BOARD_ID_PB926 http://infocenter.arm.com/help/topic/com.arm.doc.dui0225d/CACCIFGI.html RealView Emulation Baseboard: BOARD_ID = 0x140 = BOARD_ID_EB No reset register RealView PB for Cortex-A8: BOARD_ID = 0x178 = BOARD_ID_PBA8 http://infocenter.arm.com/help/topic/com.arm.doc.dui0417d/BBACIGAD.html RealView PB for Cortex-A9: BOARD_ID = 0x182 = BOARD_ID_PBX http://infocenter.arm.com/help/topic/com.arm.doc.dui0440b/CACCHBFB.html Motherboard Express µATX: BOARD_ID = 0x190 = BOARD_ID_VEXPRESS No reset register Signed-off-by: Jean-Christophe DUBOIS Reviewed-by: Peter Maydell --- v3: - change patch name to something more meaningful - move version information after the commit message. - remove added BOARD_ID and code for unsuported board - remove code style fixing for unrelated code v2: - Add multiple boards support - fix coding style - Added a BOARD_ID descriptor for unsupported baseboards. hw/arm_sysctl.c | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c index 17cf6f7..477fc6f 100644 --- a/hw/arm_sysctl.c +++ b/hw/arm_sysctl.c @@ -231,15 +231,30 @@ static void arm_sysctl_write(void *opaque, target_phys_addr_t offset, s->nvflags &= ~val; break; case 0x40: /* RESETCTL */ - if (board_id(s) == BOARD_ID_VEXPRESS) { + switch (board_id(s)) { + case BOARD_ID_PB926: + if (s->lockval == LOCK_VALUE) { + s->resetlevel = val; + if (val & 0x100) { + qemu_system_reset_request(); + } + } + break; + case BOARD_ID_PBX: + case BOARD_ID_PBA8: + if (s->lockval == LOCK_VALUE) { + s->resetlevel = val; + if (val & 0x04) { + qemu_system_reset_request(); + } + } + break; + case BOARD_ID_VEXPRESS: + case BOARD_ID_EB: + default: /* reserved: RAZ/WI */ break; } - if (s->lockval == LOCK_VALUE) { - s->resetlevel = val; - if (val & 0x100) - qemu_system_reset_request (); - } break; case 0x44: /* PCICTL */ /* nothing to do. */